Giter Site home page Giter Site logo

utkarshtambe10 / face-recognition-using-blurry-images Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.99 MB

The face-recognition of stored image is achieved even when the input image is blurry. Once can now recognize face, even if image is blurry.

License: MIT License

Python 100.00%
blurry-images face-recognition haar-cascade-classifier lbph-face-recognizer python viola-jonas

face-recognition-using-blurry-images's Introduction

Face-Recognition-using-Blurry-Images ๐Ÿ’ป๐Ÿ‘ง๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ’ป

Local Binary Pattern Histograms:
Suppose we have a facial image in grayscale. We can get part of this image as a window of 3x3 pixels. It can also be represented as a 3x3 matrix containing the intensity of each pixel (0-255). Then, we need to take the central value of the matrix to be used as the threshold. This value will be used to define the new values from the 8 neighbors. For each neighbor of the central value (threshold), we set a new binary value. We set 1 for values equal or higher than the threshold and 0 for values lower than the threshold. Now, the matrix will contain only binary values (ignoring the central value). We need to concatenate each binary value from each position from the matrix line by line into a new binary value (e.g. 10001101).
Note: There are various approaches to concatenate the binary values (e.g. clockwise direction), but the final result will be the same. Then, we convert this binary value to a decimal value and set it to the central value of the matrix, which is actually a pixel from the original image. At the end of this procedure (LBP procedure), we have a new image which represents better the characteristics of the original image. Now, using the image generated in the last step, we can divide the image into multiple grids.
Based on the image above, we can extract the histogram of each region as follows: As we have an image in grayscale, each histogram (from each grid) will contain only 256 positions (0-255) representing the occurrences of each pixel intensity. Then, we need to concatenate each histogram to create a new and bigger histogram. Supposing we have 8x8 grids, we will have 8x8x256=16.384 positions in the final histogram. The final histogram represents the characteristics of the image original image.


Workflow of the Project:
Face Recognition is performed using Local Binary Pattern Histograms(LBPH) and Face Detection has been done using Viola Jones Haar-Cascade Classifier. The user has to first run facerecognition.py to register his face by selecting 1 to train the algorithm followed by entering Password and his Name which also is the directory name. The algorithm takes 64 images of the user and stores in a folder called database. The algorithm then runs LBPH on the images and stores the trained classifier in trainedRec.py. The user can then select recognize to test whether he is an authorized person or not. The threshold posed by the condition if (prediction[1]) < 100 should be adjusted to adjust the sensitivity of face recognition.

face-recognition-using-blurry-images's People

Contributors

utkarshtambe10 avatar

Stargazers

 avatar

Watchers

 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.