1 | initial version |
Hi,
In your case, you have two images and you want to find the similar features between them. In my opinion you can use for the query descriptor one of the two and for the train descriptor the other, or try the two combinations.
If you deal with a reference or a train image (for example a box) and you want to find it in a query image, you have to supply the correct query (descriptors computed from the query image) and train (descriptors computed from the train image where there is only the object we want to detect) descriptors.
For example (from this tutorial ):
I use this approach because as you can see on the picture, you will match keypoints detected on the box with keypoints detected in the whole query image. If you do the reverse, you will match keypoints detected on the whole query image with keypoints detected on the box. This will lead theoritecally to more false matches in the second case compared to the first case.
Remember that a match for a query keypoint is the keypoint from the train keypoints set which is the closest in term of descriptor distance. Also, OpenCV match function matches each query descriptors with the train descriptors and for the example with the box, the query descriptor argument would be the train descriptor and the train descriptor argument would be the query descriptor...
But it exists different strategies to eliminate false matches in the litterature:
And you should have approximatively the same result.
This could be different if you have multiple train images of your object and one query images. In this case, I will use as the query descriptor the one computed from the query image and as the train descriptor those computed from the train images.