cantarinigiorgio/Image-Inpainting

Code migration

Closed this issue · 2 comments

Hi, I am a beginner in the field of image processing. I found that if I want to use the algorithm to process the images in the "images" folder, I only need to modify "imagefilename" and "mask filename" in the main function, but how to process a new image? I add the image I want to process in the "image" folder, and use matlab to generate a white block in one area, and change the rest of the area to black. However, when doing so, the checkerr function will report an error of "invalid mask" when running.

Hi,
the checkErr function check if the mask passed is a matrix (a two-dimensional array that has a size of m-by-n, where m and n are non-negative integers) and if the values are in the range [0, 1]: if your generated mask does not satisfy these conditions, the checkErr function throws an error.
You can normalize your mask with double(generated_mask/255) if, for example, it has values in [0, 255].

Let me know if it works! :)

yep,I made a foul mistake hahaha . Although I turned the mask into black and white,I forgot rgb2gray,the mask was still rgb , not gray scale,so the mask was a 3-D matrix, not a 2-D one.
Thank you very much!!