knnMatch gives different results between debug and release Mode

asked 2017-11-28 21:13:47 -0600

charles1208 gravatar image

updated 2017-11-29 00:13:24 -0600

I am trying to use the BFMatcher class for Akaze

auto bf = cv::BFMatcher(cv::NORM_HAMMING);
bf.knnMatch(featuresA, featuresB, rawMatches, 2);

In Release mode, it works okay; however in Debug, the assertion:

CV_Assert( masks.size() == imageCount );

in line 617 of matchers.cpp under the DescriptorMatcher::checkMasks() function fails.

If it helps, I noticed that in line 616:

size_t imageCount = std::max(trainDescCollection.size(), utrainDescCollection.size() );

both trainDescCollection and utrainDescCollection has a ridiciously large count.

The input parameters are unchanged, and I am using version 3.3.1.

edit retag flag offensive close merge delete

Comments

you don't mention it, but is there any chance, you're using windows / VS, and link to the wrong opencv libs (debug/release) ?

berak gravatar imageberak ( 2017-11-28 22:03:44 -0600 )edit
1

Yes I am using windows/VS, but i checked that the debug are linked to the *d.lib files while the release are linked to the *.lib files.

charles1208 gravatar imagecharles1208 ( 2017-11-28 22:24:13 -0600 )edit
1

Can you reproduce issue using this source code?

LBerger gravatar imageLBerger ( 2017-11-29 03:22:45 -0600 )edit

Not really. For this it ran okay under release, but under debug, the following error appears: Assertion failed in cv::TlsStorage::getData, line 1425 under system.cpp

charles1208 gravatar imagecharles1208 ( 2017-11-30 22:51:26 -0600 )edit