Giter VIP home page Giter VIP logo

blur_detection's Introduction

Blur Detection

There are many methods to identify blurred images. Some of these are:

  1. Compute Fast Fourier Transform (FFT) of the image and then examine the distribution of low and high frequencies. If there are low amount of high frequencies, then the image can be considered blurry. The challenge is determining the threshold for the number of high frequencies.
  2. Variation of Laplacian: Convolve a single channel image with 3*3 Laplacian kernel and find the variance of the output. If the variance is below a threshold, then the image is considered blurry. Again, the threshold needs to be manually determined by examining the variance of the blurred images
  3. Deep Learning: Train a convolutional neural network (CNN) on images dataset to classify images as blurred/non-blurred. The CNN can be trained on any unlabelled dataset similar to the images present in testset. If the testset images are of human faces, then the CNN can be trained on Flickr-Faces-HQ (FFHQ) dataset (https://github.com/NVlabs/ffhq-dataset).

In this code, I implement the last two approaches. The CNN is trained on 3000 images from FFHQ dataset where half the images are blurred with Gaussian/Box blur having radius between 3 and 6. The network is trained to perform binary classification. The trained network is tested on the custom dataset of human faces. After evaluation, the blurred and clean images are stored in different folders

Improvements

  • The deep learining model can be improved by employing datasets that provide face location and blurring only the face and not the background. Currently, many of the images that are classified as blurred have sharp face but blurry background due to out of focus.
  • Model can be improved by choosing a deeper VGG or ResNet architecture.
  • The deep learning model can be trained on the entire FFHQ dataset or other datasets like CelebA-HQ

blur_detection's People

Contributors

nitin-rathi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fruitkwan

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.