vector<Point> hull;
vector<Point> defects;
convexHull(Mat(largest),hull,false);
convexityDefects(largest,hull,defects);
*最大は画像内の私の最大の輪郭です
しかし、convexityDefectsは、「アサーションに失敗しました(hull.checkVector(1、CV_32S)> 2)」というエラーを表示します。誰かが私を助けてください、私はCソリューションの使用に頼りたくありません。
編集済み
vector<int> hull;
vector<Point> defects;
convexHull(Mat(largest),hull,false);
vector<vector<int>> testhull;
testhull.push_back(hull);
convexityDefects(largest,testhull,defects);
それをconvexityDefectsに渡す前にタイプで作成しようとしましたvector<vector<int>>
が、convexityDefectsで「アサーションに失敗しました(ptnum> 3)..」というエラーが発生します。