Ask Your Question
0

BOWImgDescriptorExtractor::compute fail on BRIEF + BruteForce-Hamming(2)

asked 2014-07-04 03:33:17 -0500

thdrksdfthmn gravatar image

I have tried to train a classifier based on the BOW, but BOWImgDescriptorExtractor::compute fail on descriptors extractor of type BRIEF and matcher of type BruteForce-Hamming(2). It says:

OpenCV Error: Assertion failed (type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U)) in batchDistance, file /home/me/opencv/modules/core/src/stat.cpp, line 2473
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/me/opencv/modules/core/src/stat.cpp:2473: error: (-215) type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U) in function batchDistance

In fact what are the compatibilities between the extractor types and matcher types? (I know that flann works just with SIFT and SURF)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2014-07-05 05:15:00 -0500

The problem is that the BRIEF descriptor returns descriptors in CV_8U and the matcher expects float. You could convert the descriptors from CV_8U to CV_32F with convertTo method from Mat.

FYI, SIFT and SURF return float descriptors, therefore they are "directly" compatible with matchers.

edit flag offensive delete link more

Comments

FYI is new to me, where is the info about it?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-07-07 02:26:59 -0500 )edit

Sorry, it means: For your information (ie. interesting to know… ;-)) my apologies about that…

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2014-07-07 02:59:35 -0500 )edit

=)) ok, sorry

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-07-07 03:16:08 -0500 )edit

Question Tools

Stats

Asked: 2014-07-04 03:33:17 -0500

Seen: 668 times

Last updated: Jul 05 '14