Ask Your Question
1

FREAK or BRISK neither good nor faster than SIFT/SURF when using BruteForceMatcher

asked 2013-08-08 02:14:52 -0600

volvic gravatar image

updated 2015-09-05 08:24:04 -0600

I try to match images against a database (100 images) to find the best matched image.

With OpenCV, I first tried SIFT feature with FlannBasedMatcher and found it worked well. But, because SIFT is patented, I turned to BRISK and FREAK. For both, I used BRISK detector (i.e. AGAST) and BruteForceMachter as they are binary descriptors. As claimed in the original BRISK and FREAK papers, they should have comparable accuracy and be faster than SIFT.

But unfortunately the result was really bad. My code of matching part looks like

BruteForceMatcher<Hamming> matcher;

//before matching, first add all descriptors of 100 images into matcher
...(get train_descriptors out of each image)
matcher.add(vector<Mat>(1, train_descriptors));
...(done.)

vector<KeyPoint> key_points;
Mat descriptors;
BRISK detector(30, 3, 1.0f);
detector.detect(test_image, keypoints);
FREAK extractor; //or BRISK extractor(30, 3, 1.0f);
extractor.compute(test_image, keypoints, descriptors);

vector<DMatch> matches;
matcher.match(descriptors, matches);
//choose good matches
vector<DMatch> good_matches;
for(size_t i=0;i<matches.size();i++) {
    if(matches[i].distance < 90) {
         good_matches.push_back(matches[i]);
    }
}

I used a matching Hamming distance threshold of 90 as suggested in the BRISK paper. However, the good_matches contains not so many matches (usually 20 matches or so), out of which only about 25% (or even worse) belong to the correct matched image. This result is much much worse than SIFT where this proportion is commonly over 90%.

In addition, they were not faster either. After the train set (100 images) is trained and indexed using FlannBasedMatcher, the matching of SIFT is actually much faster than BRISK/FREAK with BruteForceMatcher. Therefore, I also tried to use FlannBasedMatcher with LshIndexParams for BRISK/FREAK like

FlannBasedMatcher matcher(new flann::LshIndexParams(20,10,2));

But the results were still bad and not faster either.

So I have two questions here:

  1. How to determine a good match (to exclude outliers) for binary descriptors?

  2. Which matcher should be used for FREAK/BRISK to speed up the matching? (comparable to SIFT with FlannBasedMatcher).

Thank you in advance for any hints.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
5

answered 2013-08-08 05:50:11 -0600

Guanta gravatar image

If you still want to follow your (absolutely valid but woudln't be my first choice) approach, you can prune your matches with cross-check, ratio-test, or by geometry, all are explained here: http://answers.opencv.org/question/11840/false-positive-in-object-detection/

edit flag offensive delete link more

Comments

Thanks a lot! These really clear up my doubts.

volvic gravatar imagevolvic ( 2013-08-08 14:09:01 -0600 )edit

@Guanta, what's the basis behind the comment "BRISK / FREAK / ORB were all intended for a fast matching for tracking and not for an image classification problem."?

Poyan gravatar imagePoyan ( 2015-03-23 09:22:12 -0600 )edit

Well, afaik all the associated papers have a tracking background. However, you can use them also for image classification, see https://github.com/gantzer89/VLRPipeline . But it hasn't been very common so far.

Guanta gravatar imageGuanta ( 2015-03-23 10:15:22 -0600 )edit

Interesting find Guanta, I was not aware an implementation for k-majority for binary data existed, I actually implemented it myself last week. Perhaps it isn't common yet because it hasn't been readily available to do the clustering.

I'm currently looking into if it's feasible to do image recognition with binary feature descriptors, I will report back with my results.

Poyan gravatar imagePoyan ( 2015-03-24 04:08:36 -0600 )edit

By the way, perhaps you have some insight on a related question? http://answers.opencv.org/question/58...

Poyan gravatar imagePoyan ( 2015-03-24 04:10:30 -0600 )edit

@volvic, how did you finally manage this problem?

EdwinS gravatar imageEdwinS ( 2016-03-27 19:27:05 -0600 )edit

Question Tools

5 followers

Stats

Asked: 2013-08-08 02:14:52 -0600

Seen: 34,781 times

Last updated: Aug 08 '13