Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
802 B
2
Indexable
Never
    path = "C:\\Users\\Aenthran\\Desktop\\pyheal-master\\samples\\"
    imgpath =  path + "ship_in.png"
    maskpath = path + "ship_mask.png"
    img_original = cv2.imread(imgpath, 1)
    img_original = cv2.cvtColor(img_original, cv2.COLOR_BGR2RGB)

    img_telea = cv2.imread(imgpath, 1)
    img_telea = cv2.cvtColor(img_telea, cv2.COLOR_BGR2RGB)
    mask = cv2.imread(maskpath, 0)
    output1 = cv2.inpaint(img_telea, mask, 5, cv2.INPAINT_TELEA)

    img_pyheal = cv2.imread(imgpath, 1)
    img_pyheal = cv2.cvtColor(img_pyheal, cv2.COLOR_BGR2RGB)
    mask_img = cv2.imread(maskpath)
    mask2 = mask_img[:, :, 0].astype(bool, copy=False)
    output2 = pyheal.inpaint(img_pyheal, mask2, 5)

    output = [img_original, mask, output1, output2]
    titles = ['Damaged Image', 'Mask', 'TELEA', 'Pyheal']