I hope someone can help. I have been trying to work with SIFT and even the simplest program like this will cause a debug assertion failed.
int DoSift()
{
string image2 ="G:/SIFT Test/Foods/f1.jpg";
string image1 ="G:/SIFT Test/Foods/f2.jpg";
Mat input = imread(image1, IMREAD_GRAYSCALE );
Mat img_2 = imread( image2, IMREAD_GRAYSCALE );
cv::SiftFeatureDetector detector;
std::vector<cv::keypoint> keypoints;
detector.detect(input, keypoints);
cv::Mat output;
cv::drawKeypoints(input, keypoints, output);`enter code here`
cv::imwrite("sift_result.jpg", output);
return Exit_Success(); }
I think it's in the cleanup somewhere here:
void _Tidy()
{ if (this->_Myfirst != pointer())
{ this->_Orphan_all();
_Destroy(this->_Myfirst, this->_Mylast);
this->_Getal().deallocate(this->_Myfirst,
this->_Myend - this->_Myfirst);** this->_Myfirst = pointer();
this->_Mylast = pointer();
this->_Myend = pointer();
}
}
The exception details says:
**Debug assertion failed.
Program:...
File: f:\dd\vctools\ctr_bld\self_x86\crt\src\dbgheap.c
Line: 1322
Expression: _CrtIsValidHeapPointers(pUserData)**</cv::keypoint>