提取二值图像中的最大轮廓OpenCV.docx

上传人:牧羊曲112 文档编号:3548099 上传时间:2023-03-13 格式:DOCX 页数:1 大小:36.27KB
返回 下载 相关 举报
提取二值图像中的最大轮廓OpenCV.docx_第1页
第1页 / 共1页
亲,该文档总共1页,全部预览完了,如果喜欢就下载吧!
资源描述

《提取二值图像中的最大轮廓OpenCV.docx》由会员分享,可在线阅读,更多相关《提取二值图像中的最大轮廓OpenCV.docx(1页珍藏版)》请在三一办公上搜索。

提取二值图像中的最大轮廓OpenCVCvPoint* points = NULL; CvMemStorage* storage = cvCreateMemStorage(0); int method = CV_CHAIN_APPROX_SIMPLE; int mode = CV_RETR_EXTERNAL; CvSeq* contours = NULL; int Nc = 0; int n_mMax = -1; Nc = cvFindContours( pImg, storage, &contours, sizeof(CvContour),mode, method); for(; contours; contours=contours-h_next) if(contours-total n_mMax) free(points); points = NULL; n_mMax = contours-total; points = (CvPoint*)malloc(contours-total * sizeof(CvPoint); for(i=0; itotal; i+) CvPoint* pt = (CvPoint*)cvGetSeqElem(contours,i); pointsi.x = pt-x; pointsi.y = pt-y; else continue;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号