请看下面的代码
宣言
vector<vector<Point>> *contours;
vector<vector<Point>> *contoursPoly;
contours = new vector<vector<Point>>();
contoursPoly = new vector<vector<Point>>();
执行
//Find contours
findContours(*canny,*contours,*heirarchy,CV_RETR_TREE,CV_CHAIN_APPROX_SIMPLE,Point(0,0));
//Draw contours
//drawContours(*current,*contours,-1,Scalar(0,0,255),2);
for(int i=0;i<contours->size();i++)
{
cv::approxPolyDP(Mat(contours[i]),contoursPoly[i], 3, true);
}
一旦我运行此代码,我就会收到错误
A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Automated System.exe
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in Automated System.exe
此错误来自代码的此代码部分
cv::approxPolyDP(Mat(contours[i]),contoursPoly[i], 3, true);
为什么我会得到这个?