1

i want to perform facial recognition by using the Principal Component Analysis algorithm. I want to implement the algorithm in python or java myself however i am unsure where to start. Would appreciate some code samples/tutorials/references to get me started.

1

3 Answers 3

4

you can start by reading the original paper about the EigenFaces method (PCA-based face recognition):

"Eigenfaces for Recognition": http://www.cs.ucsb.edu/~mturk/Papers/jcn.pdf

Also, if you want to find some code samples, OpenCV implemented in of the latest versions, a face recognizer that is also based on EigenFaces:

http://opencv.itseez.com/modules/contrib/doc/facerec/facerec_api.html?highlight=face%20recognition#createeigenfacerecognizer

Please notice that are python bindings for the OpenCV and that also a Java version of OpenCV called JavaCV.

2

if you would like to write your own PCA code, I suggest you look at the Wikipedia Article for a starting point.

If you are looking for PCA code, try using the one on Numpy.

For general PCA advice: typically, one would turn the 2D image-array into a 1-D byte array (by stacking). If you do this for each of your n training images and assuming each one is p pixels when flattened, then you have your n x p training set for PCA! (Note: there are a number of tricks with PCA, such as taking zero-meaning the data etc ...)

Also, there is an extensive literature that suggests Non-negative Matrix Factorization is better for facial recognition

0

here is a simple tutorial using python: http://www.janeriksolem.net/2009/01/pca-for-images-using-python.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.