cv2.drawContours用法
时间: 2023-10-14 18:03:24 浏览: 115
cv2.drawContours是OpenCV的一个函数,用于绘制图像的轮廓。它的用法如下所示:
re = cv2.drawContours(image.copy(), [box], 0, (0, 255, 0), -1)
其中,image是原始图像,box是一个轮廓的列表,0表示要绘制的轮廓的索引,(0, 255, 0)表示轮廓的颜色,-1表示将轮廓填充为绿色。
这个函数的作用是在图像上绘制特定的轮廓。通过指定要绘制的轮廓以及相关的参数,可以将轮廓可视化出来。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [cv2.drawContours()讲解](https://blog.csdn.net/weixin_48262500/article/details/122786826)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [opencv 图像轮廓的实现示例](https://download.csdn.net/download/weixin_38743235/14908709)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [cv2.drawContours](https://blog.csdn.net/weixin_36670529/article/details/113927254)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文