次のコードから Convexity Defects を取得しようとしていますが、未処理の例外が引き続き発生します。私は何を間違っていますか?
vector<Vec4i> defects;
ContourPoly = vector<Point>(contour.size());
approxPolyDP( Mat(contour), ContourPoly,20, false );
convexHull(Mat(ContourPoly), HullPoints, false, true);
// The following line wont work
convexityDefects(Mat(ContourPoly),HullPoints,defects);
HullPoints は型ですが、vector<Point>
例外は次のとおりです。
OpenCV Error: Assertion Failed (ptnum >3) is unknown function, file ..\..\..\src\opencv\modules\imgproc\src\contours.cpp, line 1969
しかし、 vector<Point> defects;
またはvector<Vec4i> defects
次の例外が発生します
OpenCV Error: Assertion Failed (hull.checkVector(1,CV_32S) is unknown function, file ..\..\..\src\opencv\modules\imgproc\src\contours.cpp, line 1971