cv2.drawContours()讲解

cv2.drawContours()讲解,第1张

cv2.drawContours()讲解
cv2.drawContours(image, contours, contourIdx, color, thickness=None, lineType=None, hierarchy=None, maxLevel=None, offset=None)
第一个参数是指明在哪幅图像上绘制轮廓;image为三通道才能显示轮廓

第二个参数是轮廓本身,在Python中是一个list;

thickness参数指定绘制轮廓list中的哪条轮廓,如果是-1,则绘制其中的所有轮廓。其中thickness表明轮廓线的宽度,如果是-1(cv2.FILLED),则为填充模式。
re = cv2.drawContours(img_ori.copy(), [box], 0, (0, 255, 0), 3)

re = cv2.drawContours(image.copy(), [box], 0, (0, 255, 0), -1)

 

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5720907.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存