其他分享
首页 > 其他分享> > 遮挡mask

遮挡mask

作者:互联网

image = imread('test.jpg')
show(image)
image.shape
# 创建遮挡
mask = np.zeros(image.shape,dtype='uint8')
white = (255,255,255)
cv2.rectangle(mask, (50,50), (250,350), white, -1)
show(mask)
# 对图像遮挡
masked = cv2.bitwise_and(image, mask)
show(masked)

# 创建遮挡
mask = np.zeros(image.shape,dtype='uint8')
white = (255,255,255)
cv2.circle(mask, (150,100), 80, white, -1)
show(mask)

# 对图像遮挡
masked = cv2.bitwise_and(image, mask)
show(masked)

 

标签:show,遮挡,image,cv2,mask,masked,255
来源: https://www.cnblogs.com/yunshangyue71/p/13584486.html