我正在尝试注册两个二进制图像。我使用 opencv orb detector 和 matcher 来生成和匹配特征点。但是,匹配结果看起来很糟糕。谁能告诉我为什么以及如何改进?谢谢。 这是图像和匹配结果。
这是代码
OrbFeatureDetector detector; //OrbFeatureDetector detector;SurfFeatureDetector
vector<KeyPoint> keypoints1;
detector.detect(im_edge1, keypoints1);
vector<KeyPoint> keypoints2;
detector.detect(im_edge2, keypoints2);
OrbDescriptorExtractor extractor; //OrbDescriptorExtractor extractor; SurfDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.compute( im_edge1, keypoints1, descriptors_1 );
extractor.compute( im_edge2, keypoints2, descriptors_2 );
//-- Step 3: Matching descriptor vectors with a brute force matcher
BFMatcher matcher(NORM_L2, true); //BFMatcher matcher(NORM_L2);
vector< DMatch> matches;
matcher.match(descriptors_1, descriptors_2, matches);
vector< DMatch > good_matches;
vector<Point2f> featurePoints1;
vector<Point2f> featurePoints2;
for(int i=0; i<int(matches.size()); i++){
good_matches.push_back(matches[i]);
}
//-- Draw only "good" matches
Mat img_matches;
imwrite("img_matches_orb.bmp", img_matches);
最佳答案
与 SURF
不同,
ORB
描述符是二进制描述符。 HAMMING
距离适用于二进制描述符比较。在初始化 BFMatcher
时使用 NORM_HAMMING
。
关于c++ - 如何改进 orb 特征匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36701282/