def text_mask_img(self):
img = self.img_grey.copy()
mask = np.ones(img.shape[:2], dtype="uint8") * 255
for contour_node in self.contour_nodes:
cv2.drawContours(mask, contour_node.contour, -1, 0, -1)
image = cv2.bitwise_and(img, img, mask=mask)
return img
评论列表
文章目录