sol*_*les 11 c++ opencv image-processing computer-vision
这是OpenCV的drawMatches()功能:
void drawMatches(Mat img1, vector<KeyPoint> keypoints1,
Mat img2, vector<KeyPoint> keypoints2,
vector<DMatch> matches,
Mat outImg) //want keypoints1[i] = keypoints2[matches[i]]
Run Code Online (Sandbox Code Playgroud)
注意matches是类型的vector<DMatch>.这是DMatch构造函数:
DMatch(int queryIdx, int trainIdx, float distance)
Run Code Online (Sandbox Code Playgroud)
据推测,它queryIdx是一组关键点trainIdx的索引,并且是另一组关键点的索引.
问题:索引和索引是否正确?或者是周围的其他方式?queryIdxkeypoints1trainIdxkeypoints2
小智 25
这取决于你如何得到matches.
如果您按顺序调用match函数:
match(descriptor_for_keypoints1, descriptor_for_keypoints2, matches)
Run Code Online (Sandbox Code Playgroud)
然后queryIdx指keypoints1和trainIdx指keypoints2,反之亦然.
变量" matches "是DMatch对象的列表 .
如果我们迭代这个DMatch对象列表,那么每个项目将具有以下属性:
| 归档时间: |
|
| 查看次数: |
16246 次 |
| 最近记录: |