I am trying to scale "matching_to_many_images.cpp" to a large set of images. (20K + images) https://github.com/kipr/opencv/blob/master/samples/cpp/matching_to_many_images.cpp
I am using FLANN-based matching to match images (using SURF keypoint and descriptors). I am trying to execute the method described in this article (section "Searching on a Computing Cluster") http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann_pami2014.pdf ,
I have a set of C training images with a full number of n images.
C = {B (1) ... B (n)}.
I divide the set C by N the number of "buckets" where each bucket contains (n ββ/ N) the number of images. For each bucket, I run "detectKeyPoints", "computeDescriptors" and "trainMatcher" separately. This means that I have a separate "DescriptorMatcher" for each snapshot. The total number N of descriptors.
Then, for the request image, I run "detectKeyPoints", "computeDescriptors", and then I "match" each of the N descriptors.
Finally, get a DMatch list from each DescriptorMatcher, map the indices of the local image to the index of the global image, and calculate the number of matching descriptors for each image. Increase this number closest to the sample request.
I ran this with N = 1, which gives the correct result. But when I increment N (> 1), I noticed that I did not get the correct match result.
My questions:
1) Am I taking the right steps in accordance with the paper? I am trying to understand how the βreduceβ step is done, as described in the document.
2) There are two factors that I can extract from a DMatch object; "distance" and "number of matches per image". How can I use these two factors to find the closest matching image?