opencv轮廓检测小程序调试出现的一点问题 20
vector<vector<Point>>contours;findContours(img_threshold,contours,CV_RETR_EXTERNAL,CV...
vector<vector<Point> > contours;
findContours(img_threshold,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);//It had changed the img.
vector<vector<Point> >::iterator buff;
buff=contours.begin();
vector<RotatedRect> rect;
while(buff!=contours.end())
{
RotatedRect mr=minAreaRect(Mat(*buff));
if(!verifySizes(mr))
{
buff=contours.erase(buff);
}
else
{
++buff;
rect.push_back(mr);
}
}
当单步调试出现在buff=contours.erase(buff);的时候,就弹出对话框,程序触发断点,停止运行,寻求帮助,谢谢。 展开
findContours(img_threshold,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);//It had changed the img.
vector<vector<Point> >::iterator buff;
buff=contours.begin();
vector<RotatedRect> rect;
while(buff!=contours.end())
{
RotatedRect mr=minAreaRect(Mat(*buff));
if(!verifySizes(mr))
{
buff=contours.erase(buff);
}
else
{
++buff;
rect.push_back(mr);
}
}
当单步调试出现在buff=contours.erase(buff);的时候,就弹出对话框,程序触发断点,停止运行,寻求帮助,谢谢。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询