I have read many questions about matching one image with a number of images using SIFT and Brute-Force matching like this and this. Is it possible to do many-with-one kind of matching? What I would like to do is the following.
- loop through query images in a directory
- for every image extract SIFT key-points and descriptors
- do a matching with every train/template image (again with SIFT)
- get the template image which has the best match (wrt minimum Euclidean distance for example?)
- use this best template image and compute the affine transformation between this template image and current query image.
Till now I am successful till step 3 and stuck at that point.
I am using Opencv 2.7.12 and python 2.7. Since there is no drawMatches
in this version and hence I am using this implementation.
https://stackoverflow.com/a/26227854/6677891