有谁可以帮我?我想要得到特征匹配器在提供的代码中选择的最佳像素的x和y坐标,使用c++和opencv。
http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html#feature-flann-matcher
我到处看了看,但什么都不能用。
任何帮助都是非常感谢的!
发布于 2011-12-09 03:57:36
DMatch类提供两个匹配的KeyPoints (训练和查询)之间的距离。因此,检测到的最佳对应该具有最小的距离。本教程将获取小于2*(最小配对距离)的所有匹配,并将其视为最佳匹配。
因此,要获得最佳匹配的(x,y)坐标。您应该使用good_matches ( DMatch对象的列表)从两个不同的KeyPoint向量(keypoints_1和keypoints_2)中查找相应的索引。类似于:
for(size_t i = 0; i < good_matches.size(); i++)
{
Point2f point1 = keypoints_1[good_matches[i].queryIdx].pt;
Point2f point2 = keypoints_2[good_matches[i].trainIdx].pt;
// do something with the best points...
}https://stackoverflow.com/questions/8436647
复制相似问题