python 下面的轮廓填充
来源:互联网 发布:网络在线棋牌 编辑:程序博客网 时间:2024/06/04 21:53
今天项目里面有个地方用到了轮廓填充,用python下面调用opencv 做轮廓填充要比直接用python自带的IPL图像处理插件要简单一些
程序如下
import cv2import cv2.cv as cvfor c in contours: plength=cv2.arcLength(c,True) parea=cv2.contourArea(c) (x,y,w,h)=cv2.boundingRect(c) pointx=x+w/2 pointy=y+h/2 seed_point=pointx,pointy mask = np.zeros((200+2, 200+2), np.uint8) if ((plength/5)*(plength/5))>parea: cv2.floodFill(edgeimage,mask,seed_point,(0,0,0)) cv2.drawContours(edgeimage,c,-1,(0,0,0)) elif 100<parea<243: cv2.floodFill(edgeimage,mask,seed_point,(255,255,255)) cv2.drawContours(edgeimage,c,-1,(255,255,255)) elif parea<400: cv2.floodFill(edgeimage,mask,seed_point,(180,180,180)) cv2.drawContours(edgeimage,c,-1,(180,180,180)) elif parea<2000: cv2.floodFill(edgeimage,mask,seed_point,(100,100,100)) cv2.drawContours(edgeimage,c,-1,(100,100,100))edgeimage=cv2.medianBlur(edgeimage,3)cv2.imshow("filled window",edgeimage)
0 0
- python 下面的轮廓填充
- OpenCV的轮廓查找和填充
- python下使用cv2.drawContours填充轮廓颜色
- 图像内轮廓填充
- 图像内轮廓填充
- cvFindContours && cvDrawContours 的应用2-----图像内轮廓填充
- cvFindContours && cvDrawContours 的应用2-----图像内轮廓填充
- Opencv(Python) 教程-轮廓(3)轮廓的性质
- 二值图像轮廓填充
- [OpenCV]绘制填充轮廓drawContours
- javafx中vbox控件最下面的控件自动填充
- python 分割 画图像的轮廓
- 【转】python-skimage的边缘与轮廓
- Opencv-用轮廓查找快速解决秘密花园的填充问题
- opencv在图片指定区域内填充矩形,并在图片中显示矩形的轮廓
- 边缘检测、Hough变换、轮廓提取、种子填充、轮廓跟踪
- 图像外轮廓跟踪,特征轮廓提取,轮廓内部填充
- OpenCV图象孔洞内轮廓填充
- android launcher 全面解析
- Spring AOP中pointcut expression表达式解析
- Unity手游之路<十一>资源打包Assetbundle
- 影像质量评价指标汇总
- js 与或运算符 || && 妙用
- python 下面的轮廓填充
- springMVC将txt文件或Excel文件中的内容上传并导入数据库
- UITableView 详解
- Linux系统下/proc/meminfo详解
- 【指针常量】const int* p
- 中文分词技术
- unity NGUI(UIButton) 监听
- (3) cocos2d-x Tile Map 教程(一)
- Bugzilla附件设置相关参数说明