我的是vs2010+opencv2.4.9 在调试运行时有时会出现这个问题:Unhandled exception at 0x75af812f in Contours.exe: Microsoft C++ exception: cv::Exception at memory location 0x0014eac8..
比如一个寻找二值图像轮廓并绘制的程序,源程序为:
#include "stdio.h"
#include "iostream"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
int main()
{
Mat image=imread("C:\Users\Administrator\Desktop\images\binary.bmp");
vector>contours;
findContours(image,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);
Mat result(image.size(),CV_8U,Scalar(255));
drawContours(result,contours,-1,Scalar(0,0,255),1);
namedWindow("show");
imshow("show",result);
waitKey();
}
这个问题困扰了我很久,求大神解救