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. ASSERT
s 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.
Is this an expected behavior, or am I doing something wrong here?