Library for calculating Eigenfaces and Fisherfaces in C++
Switch branches/tags
Nothing to show
Clone or download
Latest commit e4f211b Jul 10, 2017
Permalink
Failed to load latest commit information.
RedSVD @ 81a2da8 Initial commit Oct 15, 2016
docs Added documentation Dec 13, 2016
img Calculate distance to face space Nov 21, 2016
.gitattributes Calculate K based on cumulative energy instead of using hardcoded value Oct 18, 2016
.gitignore Implemented Fisherfaces Nov 14, 2016
.gitmodules Initial commit Oct 15, 2016
Doxyfile Added files used for Doxygen Dec 13, 2016
Eigenfaces.cpp Calculate distance to face space Nov 21, 2016
Eigenfaces.h Calculate distance to face space Nov 21, 2016
Eigenfaces.m Calculate distance to face space Nov 21, 2016
Eigenfaces_Report.pdf Added files used for Doxygen Dec 13, 2016
Facebase.cpp Calculate distance to face space Nov 21, 2016
Facebase.h Calculate distance to face space Nov 21, 2016
Final_Project_Report.pdf Uploaded final project report Dec 26, 2016
Fisherfaces.cpp Calculate distance to face space Nov 21, 2016
Fisherfaces.h Calculate distance to face space Nov 21, 2016
LDA.cpp Prevent crash when number of components in LDA is 0 Nov 21, 2016
LDA.h Implemented Fisherfaces Nov 14, 2016
LICENSE Initial commit Oct 15, 2016
Makefile Implemented Fisherfaces Nov 14, 2016
PCA.cpp Calculate distance to face space Nov 21, 2016
PCA.h Calculate distance to face space Nov 21, 2016
README.md Added link to blog post Jul 10, 2017
Tools.h Implemented Fisherfaces Nov 14, 2016
convert_pgm.sh Tested the code with the Yale Face Database Nov 15, 2016
convert_yalefaces.sh Tested the code with the Yale Face Database Nov 15, 2016
main.cpp Calculate distance to face space Nov 21, 2016
pgm.c Initial commit Oct 15, 2016
pgm.h Initial commit Oct 15, 2016

README.md

Face Recognition Library

Developed by Kristian Lauszus, 2016

The code is released under the GNU General Public License.


This library can be used in order to calculate Eigenfaces and Fisherfaces in C++.

This Eigenfaces are calculated efficiently as described in the paper by M. Turk and A. Pentland.

The Eigenfaces.m Matlab script was used for development and was then ported to C++.

If you want to convert the PGM image run the convert_pgm.sh script.

Documentation

Some information can be found in the Eigenfaces_Report.pdf.

The final project report describing Fisherfaces and the Android application is available as well.

A short blog post can be found at the following link: http://blog.tkjelectronics.dk/2017/07/face-recognition-using-eigenfaces-and-fisherfaces.

The source is documentated using Doxygen. The documentation can be found at the following link: http://lauszus.github.io/FaceRecognitionLib.

AT&T Facedatabase

When using the code with the AT&T Facedatabase the output looks like this:

Eigenfaces:

Fisherfaces:

Notice how the Eigenfaces is only slightly worse compared to Fisherfaces.

Yale Face Database

However when using the Yale Face Database the difference is significant:

Eigenfaces:

Fisherfaces:

This clearly shows the weakness of Eigenfaces, as it only maximizes the scatter between classes and thus end up matching all images with light coming from the left side.

Note you need to prepare the Yale Face Database by running the convert_yalefaces.sh script first.

Android application

This library was used for an Android application. Some screenshots can be seen below:

Build instructions

In order to build the C++ code and run the script you need to install Eigen3 and ImageMagick:

Mac:

brew install eigen imagemagick

Ubuntu:

sudo apt-get install libeigen3-dev imagemagick

The RedSVD library is included as a submodule.

For more information send me an email at lauszus@gmail.com.