The various steps to calculate Eigen faces are
i) Prepare the data: A 2-D facial image can be represented as 1-D vector by concatenating each row (or column) into a long thin vector.
Let’s suppose we have M vectors of size N (= rows x columns of image) representing a set of sampled images .Then the training set becomes: �1, �2, �3.....�M
ii) Subtract the mean: The average matrix � has to be calculated, then subtracted from the original faces (�i ) and the result stored in the variable �i
Eq…3.1
Eq….3.2
iii) Calculate the co-variance matrix In the next step the covariance matrix A is calculated according to:
Eq…3.3
iv) Calculate the Eigenvectors and Eigen values of the covariance matrix. In this step, the Eigen vectors (Eigen vectors) Xi and the corresponding Eigen values �i should be calculated.
v) Calculate Eigen faces
Eq…3.4
Where, Xi are eigenvectors and fi are Eigen faces.
Fig. 3.1 Sample Eigen face images of normal face images
vi) Classifying the faces: The new image is transformed into its Eigen face components. The resulting weights form the weight vector �T : k
Eq…3.5
Where,
k = 1,2,3,4
�T = [�1�2....�M ] k
3.2.2 Euclidean Distance
The Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula. By using this formula as distance, Euclidean space (or even any inner product space) becomes a metric space. The associated norm is called the Euclidean norm.
The Euclidean distance between two weight vectors d(�i, �j) provides a measure of similarity between the corresponding images i & j. It also known as the L2-norm, it is defined as follows:
Eq…3.6
The Euclidean distance between points p and q is the length of the line segment connecting them ( ). In Cartesian coordinates, if p = (p1, p2,..., pn) and q = (q1, q2,..., qn) are two points in Euclidean n-space, then the distance from p to q, or from q to p is given by,