knnMatch gives different results between debug and release Mode
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.
you don't mention it, but is there any chance, you're using windows / VS, and link to the wrong opencv libs (debug/release) ?
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.
Can you reproduce issue using this source code?
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