小编Bil*_*ill的帖子

填充OpenCV轮廓的外部

我试图用openCV和python语言在轮廓的外部区域用黑色着色.这是我的代码:

contours, hierarchy = cv2.findContours(copy.deepcopy(img_copy),cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
areas = [cv2.contourArea(c) for c in contours]
max_index = np.argmax(areas)
cnt=contours[max_index]
# how to fill of black the outside of the contours cnt please? `
Run Code Online (Sandbox Code Playgroud)

python opencv image python-2.7 opencv-contour

6
推荐指数
1
解决办法
5909
查看次数

标签 统计

image ×1

opencv ×1

opencv-contour ×1

python ×1

python-2.7 ×1