Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove paper texture pattern from a photograph

I've scanned an old photo with paper texture pattern and I would like to remove the texture as much as possible without lowering the image quality. Is there a way, probably using Image Processing toolbox in MATLAB?

I've tried to apply FFT transformation (using Photoshop plugin), but I couldn't find any clear white spots to be paint over. Probably the pattern is not so regular for this method?

You can see the sample below. If you need the full image I can upload it somewhere. photograph sample

like image 284
yuk Avatar asked Mar 27 '11 15:03

yuk


People also ask

How do I remove a pattern from a picture in Photoshop?

Conclusion: There are several ways that you can remove patterns from an image in Photoshop. You can use the clone stamp tool, healing brush tool, or eraser tool. You can also use layer masks to selectively remove patterns from an image.


1 Answers

Unfortunately, you're pretty much stuck in the spatial domain, as the pattern isn't really repetitive enough for Fourier analysis to be of use.

As @Jonas and @michid have pointed out, filtering will help you with a problem like this. With filtering, you face a trade-off between the amount of detail you want to keep and the amount of noise (or unwanted image components) you want to remove. For example, the median filter used by @Jonas removes the paper texture completely (even the round scratch near the bottom edge of the image) but it also removes all texture within the eyes, hair, face and background (although we don't really care about the background so much, it's the foreground that matters). You'll also see a slight decrease in image contrast, which is usually undesirable. This gives the image an artificial look.

Here's how I would handle this problem:

  • Detect the paper texture pattern:
    • Apply Gaussian blur to the image (use a large kernel to make sure that all the paper texture information is destroyed
    • Calculate the image difference between the blurred and original images
    • EDIT 2 Apply Gaussian blur to the difference image (use a small 3x3 kernel)
  • Threshold the above pattern using an empirically-determined threshold. This yields a binary image that can be used as a mask.
  • Use median filtering (as mentioned by @Jonas) to replace only the parts of the image that correspond to the paper pattern.

Paper texture pattern (before thresholding):

enter image description here

You want as little actual image information to be present in the above image. You'll see that you can very faintly make out the edge of the face (this isn't good, but it's the best I have time for). You also want this paper texture image to be as even as possible (so that thresholding gives equal results across the image). Again, the right hand side of the image above is slightly darker, meaning that thresholding it well will be difficult.

Final image:

enter image description here

The result isn't perfect, but it has completely removed the highly-visible paper texture pattern while preserving more high-frequency content than the simpler filtering approaches.

EDIT

The filled-in areas are typically plain-colored and thus stand out a bit if you look at the image very closely. You could also try adding some low-strength zero-mean Gaussian noise to the filled-in areas to make them look more realistic. You'd have to pick the noise variance to match the background. Determining it empirically may be good enough.

Here's the processed image with the noise added:

enter image description here

Note that the parts where the paper pattern was removed are more difficult to see because the added Gaussian noise is masking them. I used the same Gaussian distribution for the entire image but if you want to be more sophisticated you can use different distributions for the face, background, etc.

like image 146
mpenkov Avatar answered Oct 05 '22 15:10

mpenkov