Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BRIEF descriptors in OpenCV 3

I'm having trouble migrating BRIEF feature extraction to OpenCV 3. I have followed the transition guide from http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html#gsc.tab=0 to compile the contrib module and load it into opencv-master. I am including the <xfeatures2d.hpp> file and trying to get descriptors with the following code (which worked fine with OpenCV2):

cv::xfeatures2d::BriefDescriptorExtractor extractor;
extractor.create(64);

cv::KeyPoint kp = cv::KeyPoint(x, y, size);
std::vector<cv::KeyPoint> kp_vec();
kp_vec.push_back(kp);
cv::Mat descriptors;

extractor.compute(image, kp_vec, descriptors);

The program crashes on the last line inside features2d.h, with the error CV_Error(Error::StsNotImplemented, "");. Am I doing something wrong? Is the BRIEF detector missing? I could not find any examples in the openCV docs, apart from some python code that looks like the one I posted above.