user1393500
user1393500

Reputation: 199

Best way of matching FREAK descriptors?

So I'm making an application with the use of FAST detectors and FREAK descriptors. When it comes to the matching I wanted to use the BRUTEFORCE_HAMMING matching, but I don't get the expected results (gives more matches with images that have nothing to do with the original, then images that look alike)

I tried the following code

 MatOfDMatch matches = new MatOfDMatch();

        matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
        matcher.match(descriptors,descriptors1,matches);
        MatOfDMatch goedematches = new MatOfDMatch();

        double max_dist = 0;
        double min_dist = 100;
        //if (descriptors.cols() == descriptors1.cols())
        //{
        for( int i = 0; i < descriptors.rows(); i++ )
        { double dist = matches.toArray()[i].distance;
          if( dist < min_dist ) min_dist = dist;
          if( dist > max_dist ) max_dist = dist;
        }
        // should only draw good matches
       for( int i = 0; i < descriptors.rows(); i++ )
        {  MatOfDMatch temp = new MatOfDMatch();
           if( matches.toArray()[i].distance <= 2*min_dist )
           {   temp.fromArray(matches.toArray()[i]);
               goedematches.push_back(temp); 
               }        
       // }
        }

       Log.d("LOG!", "Number of good matches= " + goedematches.size());

But it gives back "bad" results. So my question is, are there other methods of doing this matching with FREAK descriptors? (I use the OpenCV Library 2.4.4 and the Java wrapper, so no C-code)

Upvotes: 0

Views: 2240

Answers (3)

aishwarya natesh
aishwarya natesh

Reputation: 1

You might be getting bad results because FREAK is not rotation and scale invariant on its own. Try using the BRISK keypoint detection and FREAK descriptors around those keypoints.

JavaCV allows you to use the BRISK keypoint detection if you set the descriptor mat to null.

Upvotes: 0

Karthik Balakrishnan
Karthik Balakrishnan

Reputation: 4383

If it's duplicity of images that you're checking for I'd suggest you use BRISK algorithm with a hamming distance of 10. I use this in my application and I've developed a tool which will help you find the best algorithm required. Perhaps you can upgrade the tool I've designed with matching types too.

Upvotes: 0

JonasVautherin
JonasVautherin

Reputation: 8033

Once you have your descriptors, the brute force approach will give you the closest correspondences you can possibly find since it tries to match a descriptor on the first image against all the descriptors of the second image.

So the answer is no: with FREAK descriptors, the best results you can get (w.r.t the Hamming distance) are those you get with the brute force matching.

(This said, you should get a lot of good and bad matches when the images are similar. Have you tried to draw the matches? Try to draw lines between the matches without using the filtering step.)

Upvotes: 1

Related Questions