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,