What are some methods used to restore an old image with patches in python image processing

Viewed 243

I have an old image with patches that I want to enhance. What I've tried is cv2's inpainting function. But it does not remove the yellow patches completely like I expected. First I created a mask by converting the image to YUV, then I extracted the U channel of the image because it shows the patches more obviously. After that I convert it to black and white.

thresh = 105
im_bw = cv2.threshold(u, thresh, 255, cv2.THRESH_BINARY)[1]

mask

original

Then I apply the inpainting function which results in this: result

It seems like it is not removing properly. I tried this exact same way with another picture that I use the spray brush in paint to draw a border on the picture and it removes just fine. Is there another method to this? Thanks!

0 Answers
Related