【发布时间】:2012-08-04 03:50:43
【问题描述】:
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);
我尝试使用 vector<vector<int>> 类型将其传递给 convexityDefects 但convexityDefects 仍然给我错误“断言失败(ptnum > 3)..”。
【问题讨论】:
标签: c++ opencv convex-hull