网站开发岗位群,温州网站定制公司哪家好,手机在线做ppt的网站有哪些问题,外贸营销渠道c语言通过opencv实现轮廓处理与切割发布时间#xff1a;2020-10-14 11:00:33来源#xff1a;脚本之家阅读#xff1a;89作者#xff1a;Farmwang注意在寻找轮廓时要选择中寻找外层轮廓RETR_EXTERNAL#include opencv/cv.h#include opencv/highgui.h…c语言通过opencv实现轮廓处理与切割发布时间2020-10-14 11:00:33来源脚本之家阅读89作者Farmwang注意在寻找轮廓时要选择中寻找外层轮廓RETR_EXTERNAL#include opencv/cv.h#include opencv/highgui.husing namespace std;using namespace cv;int main(){Mat srcimgimread(./22.jpg);Mat dst;cvtColor(srcimg,dst,CV_BGR2GRAY);threshold(dst,dst,120,255,1);vector edgepoint;vector lclass;findContours(dst,edgepoint,lclass,RETR_EXTERNAL,CHAIN_APPROX_NONE,Point());Mat mat[edgepoint.size()];for(int i0;i{Rect recboundingRect(Mat(edgepoint[i]));mat[i]dst(rec);rectangle(dst,rec,Scalar(100,80,90),1,1,0);drawContours(dst,edgepoint,i,Scalar(200),1,8,lclass);string strto_string(i);imshow(str,mat[i]);}imshow(tt,dst);coutwaitKey(0);}结果如下总结以上就是本文关于c语言通过opencv实现轮廓处理与切割的全部内容希望对大家有所帮助。感兴趣的朋友可以继续参阅本站其他相关专题如有不足之处欢迎留言指出。感谢朋友们对本站的支持