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.