OpenCV 冲浪和异常值检测
我知道这里已经有几个相同主题的问题,但我找不到任何帮助。
因此,我想比较 2 个图像,看看它们有多相似,我使用众所周知的 find_obj.cpp 演示来提取 surf 描述符,然后使用 flannFindPairs 进行匹配。
但正如您所知,这种方法不会丢弃异常值,我想知道真正匹配的数量,以便我可以计算出这两个图像的相似程度。
我已经看到这个问题:Detecting outliers in SURF or SIFT algorithm使用OpenCV,那里的人建议使用findFundamentalMat,但是一旦你得到了基本矩阵,我怎样才能从该矩阵中得到离群值/真阳性的数量?谢谢。
I know there are already several questions with the same subject asked here, but I couldn't find any help.
So I want to compare 2 images in order to see how similar they are and I'm using the well known find_obj.cpp demo to extract surf descriptors and then for the matching I use the flannFindPairs.
But as you know this method doesn't discard the outliers and I'd like to know the number of true positive matches so I can figure how similar those two images are.
I have already seen this question: Detecting outliers in SURF or SIFT algorithm with OpenCV and the guy there suggests to use the findFundamentalMat but once you get the fundamental matrix how can I get the number of outliers/true positive from that matrix? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是 descriptor_extractor_matcher.cpp 的片段OpenCV 提供的示例:
过滤的关键行在此处执行:
测量点之间的 L2 范数距离(如果未指定,则为 3 个像素,或用户定义的像素数重投影误差)。
希望有帮助!
Here is a snippet from the descriptor_extractor_matcher.cpp sample available from OpenCV:
The key lines for the filtering are performed here:
Which is measuring the L2-norm distance between the points (either 3 pixels if nothing was specified, or user-defined number of pixels reprojection error).
Hope that helps!
您可以使用名为“ptpairs”的向量的大小来确定图片的相似程度。
这个向量包含匹配的关键点,所以他的大小/2是匹配的数量。
我认为您可以使用 ptpairs 的大小除以关键点总数来设置适当的阈值。
这可能会让您估计它们之间的相似性。
you can use the size of the vector named "ptpairs" in order to decide how similiar the pictures are.
this vector contains the matching keypoints, so his size/2 is the number of matches.
i think you can use the size of ptpairs divided by the total number of keypoints in order to set an appropriate threshold.
this will probably give you an estimation to the similiarty between them.