次のコードを見てください
宣言
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);
なぜ私はこれを手に入れたのですか?