Giter VIP home page Giter VIP logo

silentmoire's Introduction

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

silentmoire's People

Contributors

gmelodie avatar rafarolfsen avatar murgalha avatar mohtashim-nawaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.