cv2.findContours(img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
时间: 2023-08-19 17:11:01 浏览: 147
cv2.findContours(img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)是一个OpenCV-Python接口中的函数,用于查找图像中物体的轮廓。该函数的参数包括输入图像img、轮廓检索模式cv2.RETR_EXTERNAL和轮廓逼近方法cv2.CHAIN_APPROX_SIMPLE。其中,cv2.RETR_EXTERNAL表示只检测最外层的轮廓,cv2.CHAIN_APPROX_SIMPLE表示使用简单的轮廓逼近方法。该函数的返回值包括处理后的图像、检测到的轮廓以及轮廓的层级信息。通过调用该函数,可以获取到图像中物体的轮廓信息。
#### 引用[.reference_title]
- *1* [基于Python_Opencv识别图像轮廓](https://blog.csdn.net/qq_38967295/article/details/81572057)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [cv2.threshold()、cv2.findContours(),cv2.findContours图片轮廓处理](https://blog.csdn.net/weixin_43794311/article/details/125705348)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [opencv:图像轮廓检测 cv2.findContours() 与 cv2.drawContours()](https://blog.csdn.net/weixin_40522801/article/details/106496507)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文