Effective way to match SIFT descriptor

There are 2 images A and B. I extract key points from them (a [i] and b [i]).
I wonder how to effectively determine the correspondence between [i] and b [j]?

The obvious method is to compare each point in with each point in B. But it takes a long time for large image databases. How can I just compare point a [i] only with b [k], where k has a small range?

I heard that kd-tree might be a good choice, right? Are there any good examples about kd-tree?

Any other suggestions?

+6
source share
3 answers

The KD tree stores the processed descriptors in such a way that it is actually faster to find the most similar descriptor when doing a match.

It is very easy to use kd-tree in OpenCV, I will give you an example for a flaneograph:

flann::GenericIndex< cvflann::L2<int> > *tree; // the flann searching tree tree = new flann::GenericIndex< cvflann::L2<int> >(descriptors, cvflann::KDTreeIndexParams(4)); // a 4 kd tree 

Then, when you do the mapping:

 const cvflann::SearchParams params(32); tree.knnSearch(queryDescriptors, indices, dists, 2, cvflann::SearchParams(8)); 
+11
source

The question is, do you really want to define a keyword between two images or calculate a similarity score .

If you want to determine the match, then I'm afraid you will have to look for brute force through all possible pairs of descriptors between the two images (there are several more advanced methods, such as FLANN - quick approximate nearest neighbor search, but acceleration is not significant if you have less or less than 2000 key points per image - at least in my experience). To get a more accurate match (not faster, just a better match), I can suggest you take a look at:

If, on the other hand, you only need a measure of similarity in a large database, then a suitable place to start is:

+8
source

OpenCV implements several strategies for mapping sets of key points. See the documentation for General descriptor interfaces>.

+4
source

Source: https://habr.com/ru/post/927324/


All Articles