You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
660 B

import matplotlib.pyplot as plt
import numpy as np
from function import *
plt.ion()
plt.axis("off")
img = read("./dog/cow_img.bmp")
maskImg = read("./dog/cow_mask.bmp")
img = img.copy()
height, width = img.shape[:2]
mask = np.zeros((height,width),dtype=bool)
for y in range(height):
for x in range(width):
mask[y,x] = maskImg[y,x] == 255
for y in range(height):
for x in range(width):
if mask[y,x]:
img[y,x] = (255,0,0)
plt.imshow(mask)
plt.show()
plt.title("mask de l'image")
plt.pause(1)
plt.title("génération de l'image")
img = doTheInpainting(img,mask,2)
plt.imshow(img)
plt.title("image final")
plt.pause(20)