编译时报错:
error: ‘CV_RETR_EXTERNAL’ was not declared in this scope; did you mean ‘CV_DEPRECATED_EXTERNAL’?
cv::findContours(mid, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
在对应cpp里添加头文件即可:
#include <opencv2/imgproc/types_c.h>
参考:
https://blog.csdn.net/weixin_43738246/article/details/116521150