Face recognition
Data
The data consists of 10 snapshots of 40 different people.Each image is stored in a grayscale PNG file (110 rows by 92 columns) and we'll start by reading the data and making an array of targets that specifies which person each image corresponds to.
The images are stored in a directories named as, for example, 'orl/s15/3.png' which is the 3rd image for the 15th person.
Now we'll read all the images into a single array, X, so that each image is a row of X. The array t
will contain the number specifying the individual person.
PCA
Here we perform PCA on the data. Since there are only 400 face vectors there can be at most 400 dimensions. After reshaping this results in an array of 'eigenfaces', which are the principal component shaped to form images.