6

I am trying to scale the "matching_to_many_images.cpp" for large set of images. (20K+ images) https://github.com/kipr/opencv/blob/master/samples/cpp/matching_to_many_images.cpp

I use FLANN based matcher to match the images(with SURF keypoint and descriptor extractors).I try follow the method described in this paper (section "Searching on a Compute Cluster") http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann_pami2014.pdf ,

I have a training image set C with total n number of images.

C={B(1)...B(n)}.

I divide the set C into N number of "buckets" where each bucket contains (n/N) number of images. For each bucket I perform "detectKeyPoints" , "computeDescriptors" and "trainMatcher" separately. This means I have a separate "DescriptorMatcher" for each image-bucket.Total N number of DescriptorMatchers.

Then for the query image, I perform "detectKeyPoints","computeDescriptors" and then perform "match" against each of the N DescriptorMatchers.

Finally receive DMatch list from each DescriptorMatcher, map local-image-bucket-indices to the global-image-index and calculated the number of matching-descriptors per image.Larger this number the closest to the query image.

I ran this with N=1 which gives the correct result. But when I increase the N (>1) I noticed that I didnt get the correct matching result.

My questions are:

1) Am I doing the correct steps according to the paper? I am trying to understand how the "reduce" step is done as described in the paper.

2) There are two factors I can extract from the DMatch object ; "distance" and "number of total matches per image". How can I use these two factors to find the closest matching image?

Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
  • 1
    A small question:- To find best K matches, are you searching for K best matched images in each clusters first? Then collating K* (n/N) images and selecting the best K images. Also, does the wrong match happened once or often compared to when N = 1. – saurabheights Oct 27 '16 at 18:49
  • @saurabheights yes. thats what I do. But I dont directly use Flan library , I use the FlanBasedMatcher in OpenCV – Ashika Umanga Umagiliya Nov 02 '16 at 01:23
  • 1
    It has been long, my apologies. Using Flan or FlanBasedMatcher shouldn't be the issue. Your description of study in the paper is right on spot. In my analogy, lets say you have 10 dictionaries of English words, but words in each dictionary is mutually exclusive. No 2 dictionary has same word. Instead of surf/sift, here we use hamming distance to find closest word. To search for a word in dictionaries, we have to find the word in each dictionary. Now, from the result of search of each dictionary, choose the word with best hamming distance. – saurabheights Nov 10 '16 at 16:39
  • 1
    The issue of using N>1 is also simple to debug. Let's use 2 test sample images, Image A has its counterpart image B in bucket i. Check if search of Image A in Bucket i, returns image B. If not, the problem is search in Bucket i itself, else see why image from other bucket/s attenuated the image B. – saurabheights Nov 10 '16 at 16:49
  • 1
    My last thought: Now, the bigger question will arise? Are the features being used are able to generate a unique finger-print against other images. Not sure if this is correct:- A very large corpus of face images(large as 10000 images of people from same region, ethnicity) will produce alike features for many images and if we use SIFT, relative-distance(and angle) between features is not taken into account, thus SIFT won't work accurately. – saurabheights Nov 10 '16 at 16:53
  • Did you ever solve this? – Pibben Oct 18 '19 at 11:48
  • @Pibben First, I used Brute Force matching instead of FLAN and used 10 node cluster(EC2 instances) . Later I moved to GPU (one EC2 GPU instance) based solution which is much faster and cheaper than using 10 nodes cluster. – Ashika Umanga Umagiliya Oct 19 '19 at 05:36

0 Answers0