今天用了一下SURF角点检测的程序,结果在调试过程中总出现错误:SURF.exe 中的 0x756ad36f 处未处理的异常: Microsoft C++ 异常: 内存位置 0x003fcaf0 处的 cv::Exception。
代码:
int main()
{
Mat image, image1= imread ( "test.jpg");
cvtColor ( image1, image, CV_BGR2GRAY);
vector<KeyPoint> keypoints;
SurfFeatureDetector surf(2500);
surf.detect (image, keypoints);
drawKeypoints( image, keypoints, image, Scalar::all(255), DrawMatchesFlags::DEFAULT);
namedWindow("surf", CV_WINDOW_AUTOSIZE);
imshow("surf", image);