DmitryUlyanov / deep-image-prior

Image restoration with neural networks but without learning.
https://dmitryulyanov.github.io/deep_image_prior
Other
7.88k stars 1.43k forks source link

inpainting must need mask? #72

Open mumuyanyan opened 4 years ago

mumuyanyan commented 4 years ago

I only have the corrupted image, as follows: xf_3 but I don't have the mask of the image. should I have to get the mask of the image? In other words, I must acquire the mask of the corrupted before using the inpainting algorithm.

abhishekaich27 commented 4 years ago

You need a mask to indicate which pixels are missing. This is not blind inpainting (much difficult problem).

AnirudhMaiya commented 4 years ago

What you could do is, if the corrupted pixels are of value 255(near that range 250-255) and no other pixel in the image is as white as the corrupted pixel. Now convert the image to grayscale, obviously your corrupted pixels will be bright in grayscale. Threshold your grayscale image based on your corrupted pixel values and get the mask. I've tested inpainting using the above logic and it has worked. For your Image it will work since there are no white pixels like your corrupted pixel. send

AhmadManzoor commented 3 years ago

should we use any other color for mask image if white is already in image? and which function should we use in the colab file provided in readme. as there are 3 fucntions based on if-else. and where to set the value of our mask color?