- python 2.7
- cv2
- os
- numpy
-
put
main.py
,extension.py
,haarcascade_frontalface.xml
, and a folder namedimages
containing the dataset all in one folder. -
the first line in the
main
function in themain.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 keyp
is pressed, the detected face (i.e. the image inside the green box) will be saved to theimages
folder.
- if set to
-
Run the
main.py
file -
press
q
to quit
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
This work wouldn't have been possible without the valuable information I got from:
- Eigenfaces and Forms
- Geometric explanation of PCA
- kagan94 repository (important)
- learn OpenCV (important)
- wellecs repository this
- Dimensionality Reduction with SVD | Stanford University
- PCA, SVD
- singular value decomposition SVD (very important)
- principle component analysis PCA (very important)
- PCA for face recognition using MATLAB (very important)
- Prof. J. Nathan Kutz book (very important)