Skip to content

gmelodie/silentMoire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

silentMoire

Moiré pattern denoiser for scanned photos

The problem (or Abstract)

Whenever you try to take a picture of a screen or monitor they always end up with some weird patterns. These patterns, the Moiré patterns, can be removed by using image restoration techniques. The aim of this project is to create an application that allows you to easily denoise your scanned pictures in order to remove this types of patterns.

In other words...

You are too lazy to take a proper screenshot of your screen. You see your phone nearby and decide to do the most stupid thing ever: take a pic of your screen with your phone. You end up with this:

Noisy photo

We've all been there, enter silentMoire: using silentMoire you should be able to restore the image back to something more like the original picture:

Restored photo

(Example images are inside the images folder)

Moiré Patterns

A moiré pattern is an interference pattern created when an observer observes through two overlapping periodic structures, in our case it ocours when someone tries to take a picture of a screen or monitor. For this project we have decided to remove horizontal and vertical Moiré patterns.

Techniques

Noising

Taking pictures containing Moiré patterns can be quite difficult, as it depends a lot on your camera and the refresh rate of your monitor. Because of that, the patterns will be artificially generated, adding black vertical, horizontal and/or diagonal lines in the image. It is important to notice that the images used will be in grayscale.

Denoising (with example)

Removing the Moiré pattern from the image is based on changing the domain of the image using the Fast Fourier Transform.

Example image Example fourier

Then, three options of filters can be chosen to denoise: a low-pass filter (used in the example), a bandstop filter using threshold and a simple cut on the noise spectre. One or more filters are applied on the shifted Fourier of the noisy image, removing noises, verified to appear on the edges of the shifted Fourier image. The filter and filtered image can be seen below.

Low-pass filter Filtered fourier

The original image essential frequencies are kept, denoising it back to the original (almost).

Denoised

Code

There is a step-by-step example on a Jupyter Notebook inside this repo. You can also run the all.py document to see some images and results.

Run yourself

If you want to run the script yourself, simply execute python silent.py <INPUT IMAGE> on the project root folder e follow the steps to apply some noise and denoise the image. Images are shown to accompany you through the process.

Images source

All the images used in this project were taken from Pexels and Unsplash.

Authors

  • Gabriel de Melo Cruz
  • Murilo Baldi
  • Rafael Amaro Rolfsen