Face Recognition using OpenCV
Face Recognition is a very active research area specialising on how to recognize faces within images or videos. Face recognition compliments Face Detection. Face Detection is the process of finding a 'face' within images or videos and Face Recognition is the process of matching the detected 'face' to one of many the faces known to the filesystem.
A great resource understand more about the theory and aplications of Face Recognition is the Face Recognition Homepage. It is a source of journals, papers and resources about face recognition.
There are many algorithms to perform face recognition including:
Eigenfaces or Principal Component Analysis method (PCA)
Fisherfaces or Linear Discriminant Analysis method
Kernel Methods
3D face recognition methods
Gabor Wavelets method
Hidden Markov Models
OpenCV Supports Principal Component Analysis
The simplest and easiest method is to use the PCA support within OpenCV. However it does have its weaknesses. PCA is translation variant - Even if the images are shifted it wont recognize the face. It is Scale variant - Even if the images are scaled it will be difficult to recognize. PCA is background variant- If you want to recognize face in an image with different background, it will be difficult to recognize. Above all, it is lighting variant- if the light intensity changes, the face wont be recognized that accurate.
But what are the advantages of PCA?
It is fast, and it only needs lesser amount of memory. PCA basically performs dimensionality reduction.
So we have to perform various pre-processing steps in order to utilize the PCA method for recognition. Some may be:
Face detection and extraction: Detect the face using the OpenCV face detector, and then recognize the face.
Illumination Normalization:
Scaling
What do we basically need for face recognition? A Face Database. It is nothing but a collection of images or to be more precise, faces.
For testing purposes, there are many face databases available, of which some of them are:
You can find more databases at the Face Recognition Homepage.
First, how do we perform Face Detection?
Visit the wiki page FaceDetection . We are going to modify the facedetect.c to suit our needs.
Illumination normalization can be as simple as histogram equalization, to complex algorithms.
Scaling can be done using cvConvertScale or cvResize functions in OpenCV. Scaling can be done into a 100 by 100 size because it is optimal in recognizing the faces, and also has lesser calculations to perform.
After these pre-processing steps, comes the recognition step, which can be done by using a variety of algorithms.
Principal Component Analysis
Principal component analysis (PCA), based on information theory concepts, seeks a computational model that best describes a face by extracting the most relevant information contained in that face. The Eigenfaces approach is a PCA method, in which a small set of characteristic pictures are used to describe the variation between face images. The goal is to find the eigenvectors (eigenfaces) of the covariance matrix of the distribution, spanned by training a set of face images. Later, every face image is represented by a linear combination of these eigenvectors. Recognition is performed by projecting a new image onto the subspace spanned by the eigenfaces and then classifying the face by comparing its position in the face space with the positions of known individuals.
MORE TODO..
