Ask Your Question

Emre's profile - activity

2012-09-20 01:10:44 -0600 received badge  Good Question (source)
2012-08-27 04:13:01 -0600 received badge  Nice Question (source)
2012-07-28 11:24:26 -0600 received badge  Editor (source)
2012-07-28 09:24:40 -0600 received badge  Student (source)
2012-07-28 08:58:15 -0600 asked a question Does FREAK eat keypoints when it can't find any descriptors?

I'm using OpenCV 2.4.2 with gcc 4.4.5 on a Debian testing box.

Basically I'm following FREAK sample in freak_demo.cpp with the following snippet:

    detector_.detect(img_, keypoints_);
    ASSERT(keypoints_.size() > 0);  // PASS
    FREAK* freak = new FREAK();
    freak->compute(img_, keypoints_, descriptors_);
    ASSERT(keypoints_.size() > 0); // FAIL
    ASSERT(descriptors_.rows > 0); // FAIL

detector_ is a FeatureDetector and instantiated with a SurfFeatureDetector here. ASSERTs are BOOST_ASSERT macros. I'm testing this with mainly binary images.

The first assertion passes, hence SURF detects some keypoints, but the second assertion fails and in between the only suspect is freak->compute. If I remove the second assertion, the third one also fails. So FREAK does not produce any descriptors_.

It may be related with the type of images I'm using, they are binary word or text line images. I changed the octave size to 2 (from the default 4) and will continue to test with different parameters.

Edit

The problem seems to be related with the parameters of SurfFeatureDescriptor which I set identical with the values in freak_demo.cpp. With default values (i.e. no explicit values in the constructor), FREAK retains some of the keypoints.

I also tested this with varying values for patternScale parameter of FREAK. The initial value is the default.

patternScale: 22 
keypoints.size() before: 118
keypoints.size() after: 5
...
patternScale: 18
keypoints.size() before: 118
keypoints.size() after: 15
...
patternScale: 14
keypoints.size() before: 118
keypoints.size() after: 33
...
patternScale: 8
keypoints.size() before: 118
keypoints.size() after: 82
...

So I think patternScale size should be set according to the image size.

Anyhow I'd not expect keypoints to be zeroed. Is this an expected behavior?