pip install opencv-python
main.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import numpy as np import cv2 # Open the image. img = cv2.imread('cat_damaged.png') # Load the mask. mask = cv2.imread('cat_mask.png', 0) # Inpaint. dst = cv2.inpaint(img, mask, 3, cv2.INPAINT_NS) # Write the output. cv2.imwrite('cat_inpainted.png', dst) |