【发布时间】:2018-10-15 19:10:23
【问题描述】:
我想使用 findContours 处理黑白图像。
Mat frame= imread(argv[1]);
cvtColor(frame, frame, CV_BGR2GRAY);
threshold(frame,frame, 150, 255, THRESH_BINARY);
vector<vector<Point2f>> contours;
findContours(frame.clone(), contours, noArray(), CV_RETR_EXTERNAL,
CV_CHAIN_APPROX_SIMPLE , Point(0, 0));
但我得到以下异常:
OpenCV 错误:断言失败 (mtype == type0 || (((((mtype) & ((512 - 1) > 3) + 1) == ((((type0) & ((512 - 1) > 3) + 1) && ((1 > 3) + 1) == ((((type0) & ((512 - 1) > 3) + 1) && ((1
用于查找轮廓的图像:
.任何有关如何解决此问题的指针将不胜感激。 谢谢。
【问题讨论】:
标签: c++ opencv mat opencv-contour