【发布时间】:2015-02-20 03:53:11
【问题描述】:
有人能描述一个忽略 BFMatcher 误报的好过程吗?
我定义了要在场景中查找的图像,使用 SiftFeatureDetector、SiftDescriptorExtractor,然后使用 BFMatcher。在搜索正确的标记时,我发现匹配没有问题,但我想让我的代码对误报更加健壮。
//Detect keypoints using ORB Detector
SiftFeatureDetector detector;
vector<KeyPoint> keypoints1, keypoints2;
detector.detect(im1, keypoints1);
detector.detect(im2, keypoints2);
//Draw keypoints on images
Mat display1, display2;
drawKeypoints(im1, keypoints1, display1, Scalar(0,0,255));
drawKeypoints(im2, keypoints2, display2, Scalar(0,0,255));
//Extract descriptors
SiftDescriptorExtractor extractor;
Mat descriptors1, descriptors2;
extractor.compute( im1, keypoints1, descriptors1 );
extractor.compute( im2, keypoints2, descriptors2 );
BFMatcher matcher(NORM_L1, true);
vector<DMatch> matches;
matcher.match(descriptors1, descriptors2, matches);
我尝试通过跳过过滤掉误报:
if (matches.size() < 50) {
//false positive - skip
} else {
//perform actions
}
但这一点都不可靠。我想我看到了一些关于人们使用半径匹配器的文章,但我找不到一个很好的描述来使用蛮力的半径匹配。我查看了文档:http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_matchers.html,但我非常清楚我如何决定这个应用程序的最佳 min_dist/max_dist 是什么?
我相信这对你们中的一些人来说是一个非常简单的答案 - 非常感谢您的帮助!
【问题讨论】:
标签: opencv computer-vision sift brute-force