I have a follow-up question regarding this previously asked question:
How to use flann based matcher, or generally flann in opencv?
specifically regarding this portion of the answer:
/* for kk=1 to matches.size()
the best match for queryKeypoints[matches[kk].queryIdx].pt
is dbKeypoints[matches[kk].imgIdx][matches[kk].trainIdx].pt
*/
My question is the following: is it possible to access the image from which the best matching keypoint (shortest distance) has been found using opencv's flannbasedmatcher match() function and dmatch structure, and if so, how might one go about doing this?
Specifically, how does one do this when comparing a query image to a set of images? In this case, is the flann k-d tree built with all keypoints mixed together (then the corresponding image label is not attached with the keypoint in the tree)? Or is there a way to access the image to which a given keypoint belongs?
Any other pointers as to how the flannbasedmatcher match() and train() functions work would also be great, as I have scoured the source code and still am somewhat mystified -- thank you.
Any guidance is much appreciated -- thank you!