This is OpenCV's drawMatches()
function:
void drawMatches(Mat img1, vector<KeyPoint> keypoints1,
Mat img2, vector<KeyPoint> keypoints2,
vector<DMatch> matches,
Mat outImg) //want keypoints1[i] = keypoints2[matches[i]]
Notice that matches
is of type vector<DMatch>
. Here is the DMatch
constructor:
DMatch(int queryIdx, int trainIdx, float distance)
Presumably, queryIdx
is an index into one set of keypoints, and trainIdx
is an index into the other set of keypoints.
The question: Is it true that queryIdx
indexes into keypoints1
, and trainIdx
indexes into keypoints2
? Or, is it the other way around?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…