Using FlannBasedMatcher. Exception.
Hello. i'm using opencv 2.4.4 on windows 7, vs 2010, c++. I implement features find task in mfc application. Here i have some code:
void CWorkClass::PrepareGoodMatches(cv::Mat mat1, cv::Mat mat2, vector<cv::DMatch>& out)
{
cv::FlannBasedMatcher matcher;
vector<cv::DMatch> matchVec;//leftCenterMatchVec, centerRightMatchVec;
matcher.match(mat1, mat2, matchVec);
double maxDist = 0;
double minDist = 100000;
for (unsigned int i = 0;i<matchVec.size();i++){
double curDist = matchVec.at(i).distance;
if (curDist < minDist) minDist = curDist;
if (curDist > maxDist) maxDist = curDist;
}
for (unsigned int i = 0;i<matchVec.size();i++){
if (matchVec.at(i).distance < (3 * minDist))
out.push_back(matchVec.at(i));
}
matchVec.clear();
}
After exit of this function i have different kinds of exceptions: 1) In OnCmdMSg(...) on return _AfxDispatchCmdMsg(this, nID, nCode, lpEntry->pfn, pExtra, lpEntry->nSig, pHandlerInfo); 2) _CrtIsValidHeapPointer(pUserData) (if i hit continue) 3) exception in ~DescriptorMatcher.
if therese no implemention of cv::FlannBasedMatcher matcher, this function return good. Please give me advice to solve this problem.
.... UPDATE .... My problem solved after i replace all opencv dll's i used in my project from origin package... i waste about 3 days (
...UPADTE 2... Really problem was that i used MFC as static lib, after i change to DLL, problem solved
Wow thanks man, you saved me some precious time!