如何使用蛮力匹配/SIFT描述符获取匹配点的位置 [英] How to get the positions of the matched points with Brute-Force Matching / SIFT Descriptors

查看:208
本文介绍了如何使用蛮力匹配/SIFT描述符获取匹配点的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将我的SIFT-Keypoints与BF-matcher匹配.我曾经像本教程那样做 https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html

I tried matching my SIFT-Keypoints with BF-matcher. I used to do it like this tutorial https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html

但是,如果我想通过print(good)获得x,y位置,它只会给我类似的东西 DMatch 000001DD9C4E0EB0

But if i want to get the x,y-positions with print(good) it gives me only something like DMatch 000001DD9C4E0EB0

如何将其转换为职位?

How can I convert this into positions?

推荐答案

由于您未提供任何代码,因此我将根据教程中的代码回答您的问题. 基本上,关键点是由SIFT算法检测到的具有旋转,缩放和x,y位置的点,而描述符只是用于匹配它们的特征向量. 在matchs变量中,描述符之间有一组匹配项(DMatch).关键点位于kp1和kp2中. 要找到匹配的两个点(p1,p2),请使用如下代码:

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

这篇关于如何使用蛮力匹配/SIFT描述符获取匹配点的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆