这是 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]]
请注意,matches它的类型是vector<DMatch>。这是DMatch构造函数:
DMatch(int queryIdx, int trainIdx, float distance)
据推测,queryIdx是一组关键点trainIdx的索引,并且是另一组关键点的索引。
问题:索引到和索引到是真的吗?或者是周围的其他方式?queryIdxkeypoints1trainIdxkeypoints2