hajo
hajo

Reputation: 344

How to get the positions of the matched points with Brute-Force Matching / SIFT Descriptors

I tried matching my SIFT-Keypoints with BF-matcher. I used to do it like this.

But if I want to get the x,y-positions with print(good) it only gives me something like this:

DMatch 000001DD9C4E0EB0

How can I convert this into positions?

Upvotes: 4

Views: 10659

Answers (1)

Piotr Siekański
Piotr Siekański

Reputation: 1715

As you provided no code, I answer your question based on the code in the tutorial. Basically, keypoints are the points detected by the SIFT algorithm with the rotation, scale and x,y position, and descriptors are just the vectors of features used to match them. In the matches variable you have a set of matches between descriptors (DMatch). Keypoints are located in kp1 and kp2. To find two points (p1,p2) that are matched use the code like this:

for match in matches:
  p1 = kp1[match.queryIdx].pt
  p2 = kp2[match.trainIdx].pt

Upvotes: 14

Related Questions