'How to repair the corrupted image below using opencv, python, numpy and necessary libraries
import cv2
damaged_image = cv2.imread("Corrupted.png")
mask = cv2.imread("mask.png", 0)
output = cv2.inpaint(damaged_image, mask, 1, cv2.INPAINT_TELEA)
cv2.imshow('test', output)
cv2.waitKey(0)
cv2.destroyAllWindows()
I couldn't generate mask with python, i have drawn the mask by using Paint as you can see it is not perfect.
After this code i get this output:
the repaired image should look similar to this picture:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|