/Face-recognition-using-PCA-and-SVD

In this project, facial recognition algorithm is implemented with python using PCA and SVD dimensionality reduction tools.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Face-recognition-using-PCA-and-SVD

requirements

  • python 2.7
  • cv2
  • os
  • numpy

process

  1. put main.py, extension.py, haarcascade_frontalface.xml, and a folder named images containing the dataset all in one folder.

  2. the first line in the main function in the main.py file is:python mode= True

    there are two modes of operation determined by that mode variable:

    • if set to True: the program will detect the face in front of the camera and, automatically, open another window containing the image in the dataset of the face closest to the face in front of the camera.
    • if set to False: the program will detect the face in front of the camera and whenever the key p is pressed, the detected face (i.e. the image inside the green box) will be saved to the images folder.
  3. Run the main.py file

  4. press q to quit

Additional files

Since this is a course project, along with the actual implementation of the tool there're lots of theoretical work that I've attached in the additional-files folder in this repository. In these files PCA is thoroughly explained as well as the methodology adopted from collecting the dataset to explaining the final results.

Also, an image compression method based on PCA is presented, but the code isn't attached here since it's quiet messy.

The additional-files folder includes: * the project report * 2-pages summary * scientific poster * the slides used in a video where I'm demonstrating what I've done in this project. video link

References

This work wouldn't have been possible without the valuable information I got from: