Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 833
hajo Avatar asked Oct 20 '25 07:10

hajo


1 Answers

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
like image 125
Piotr Siekański Avatar answered Oct 22 '25 22:10

Piotr Siekański



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!