2024-09-28 19:33:39 发布
网友
我的问题与以下问题相反: Blackout image except for polygons provided as coordinates in OpenCV (Python)
我只希望我的图像的某一部分被遮住
感谢@stateMachine提到了掩码的反转
除此之外,cv2.fillPoly函数应将颜色设置为[0,0,0]
这些是我换的部分
mask = np.zeros(image.shape, dtype=np.uint8) mask = 255 - mask cv2.fillPoly(mask, pts=[contours], color=(0,0,0))
感谢@stateMachine提到了掩码的反转
除此之外,cv2.fillPoly函数应将颜色设置为[0,0,0]
这些是我换的部分
相关问题 更多 >
编程相关推荐