python opencv3 —— findContours
findContours 是 opencv 下的轮廓提取函数。
1. api 分析
findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
- image,一般为单通道图像;
- mode:轮廓检索模式(retrieve)
- cv2.RETR_EXTERNAL,只检测外部轮廓,也即对所有轮廓
hierarchy[i][2] == hierarchy[i][3] == -1- hierarchy[i],一级索引指的是全部检索到的轮廓,轮廓由四个元素构成的元组组成,
- cv2.RETR_LIST:提取所有轮廓,并放置在 list 中,对检测到的轮廓不建立等级关系;
- cv2.RETR_TREE:提取所有轮廓,建立网状的轮廓结构;
- cv2.RETR_EXTERNAL,只检测外部轮廓,也即对所有轮廓
- method:轮廓的近似方法,是提取轮廓上所有的像素点,还是一些关键点。
- 如对于一条线段是提取所有点,还是仅提取两个端点;
- contours:检索到的轮廓,为构成轮廓的点集;
2. 轮廓的层次结构
python opencv3 —— findContours的更多相关文章
- python opencv3添加opencv-contrib
不需要编译或其他操作,只需一句话安装第三方库利用sift等特征提取算法: sudo pip3 install opencv-contrib-python 附网站:https://pypi.python ...
- python opencv3 给图片加中文
转自:https://www.cnblogs.com/arkenstone/p/6961453.html opencv3.2将中文输出到图片上 opencv自带的putText函数无法输出utf8类型 ...
- python opencv3 背景分割 mog2 knn
git:https://github.com/linyi0604/Computer-Vision 使用mog2算法进行背景分割 # coding:utf-8 import cv2 # 获取摄像头对象 ...
- python opencv3 运动检测
git:https://github.com/linyi0604/Computer-Vision 思路: 开启摄像头后 设置一个当前帧为背景, 在之后检测到的帧都与背景对比不同,对不同的地方进行检测 ...
- python opencv3 矩形 圆形边框
git:https://github.com/linyi0604/Computer-Vision # coding:utf8 import cv2 import numpy as np # 读入图像 ...
- python opencv3 轮廓检测
git:https://github.com/linyi0604/Computer-Vision # coding:utf8 import cv2 import numpy as np # 创建一个2 ...
- python opencv3 写字画圈画矩形
python opencv练习 自定义一张[512, 512, 3]的图像 在上面写写字,画画圈和矩形 显示 代码为: import cv2 import numpy as np img = np.z ...
- python opencv3 检测人
git:https://github.com/linyi0604/Computer-Vision # coding:utf-8 import cv2 # 检测i方框 包含o方框 def is_insi ...
- python opencv3 FLANN单应性匹配
git:https://github.com/linyi0604/Computer-Vision 匹配准确率非常高. 单应性指的是图像在投影发生了 畸变后仍然能够有较高的检测和匹配准确率 # codi ...
随机推荐
- 简单的横向ListView实现(version 3.0)
版本号2仅仅是简单的实现了当手指按下的时候listView的Item向左移动一定的距离,并没有随着手指的左右移动而左右滚动.在这个版本号3.0中将会实现随着手指的移动而滚动的目标:当手指向左移动的时候 ...
- thinkphp缓存使用
thinkphp缓存使用 一.总结 1.这里的缓存不是指的缓存的页面,而是cache,如果你缓存了一个数组,那么你就可以取出这个数组里面的数据进行使用,用法性质和cookie和session有点像 2 ...
- 【单词】常见单词含义的辨异(emulator/simulator、hardware/firmware)
1. emulator 与 simulator The Simulator tries to duplicate the behavior of the device.(仿真的是行为): The Em ...
- httpurlconnection发送文件到服务端并接收
httpurlconnection发送文件到服务端并接收 客户端 import java.io.DataInputStream; import java.io.File; import java.io ...
- Spring学习总结(10)——Spring JMS---三种消息监听器
消息监听器MessageListener 在spring整合JMS的应用中我们在定义消息监听器的时候一共可以定义三种类型的消息监听器,分别是MessageListener.SessionAwareMe ...
- POJ——T2271 Guardian of Decency
http://poj.org/problem?id=2771 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 5932 A ...
- [React] Remove React PropTypes by using Flow Annotations (in CRA)
Starting from v15.5 if we wanted to use React's PropTypes we had to change our code to use a separat ...
- winedt (latex 编译器)解决中文的问题(CJK & CTEX)
主要是导入相关的库支持: 1. CJK \usepackage{CJK}:CJK,是中日韩的英文首字母的组合,处理中文需要先导入这个包: \begin{CJK*}{GBK}{song}:默认句式,表示 ...
- 使用ajax发送图片等文件
1.使用H5的FormData()对象,append()添加文件 2.processData: false, // 告诉jQuery不要去处理发送的数据 contentType: false, ...
- 苹果手机wifi代理设置方法--用于抓包
杯具了!@@@@@@@变态的公司不能直接上网了,但是经过我的研究.可以用代理上网,电脑是可以了,但是的iphone肿么办,哇咔咔,不要捉急,我来告诉你怎么让你的iphone通过代理上网.动起来吧. 请 ...