Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BFmatcher types error

Hi everyone.

I have some trouble with the BFmatcher. I make a matrix with some descriptors but when I try knnmatch() Doesn't work due a types error. I have a set of descriptor in mainDesc I pick some of them

Mat kdesc();
kdesc.push_back(mainDesc.row(i));

The matcher is a member of a function. Does need some inizialization? Then I call knnMatch and the ouput is:

OpenCV Error: Assertion failed (queryDescriptors.type() == trainDescCollection[0].type()) in knnMatchImpl, file /home/maxpower/opencv-2.4.6.1/modules/features2d/src/matchers.cpp, line 351 terminate called after throwing an instance of 'cv::Exception' what(): /home/maxpower/opencv-2.4.6.1/modules/features2d/src/matchers.cpp:351: error: (-215) queryDescriptors.type() == trainDescCollection[0].type() in function knnMatchImpl

Regards