Programming Assignment 2
Due before class on Thursday, October 22


Write a matlab program that uses eigenfaces to detect faces in grayscale images. The output of your program should be the input grayscale image with a box drawn around the located face.

For the sake of this assignment, you may assume:

  1. faces appear approximately in frontal view
  2. faces are not "tilted" or rotated in the image
  3. there is only one face present in each image
  4. faces appear at various scales
To detect faces at various scales, utilize image pyramids as discussed in class.

Pyramids

Matlab code for image pyramids is available on the CAS cluster in the directory /usr2/cs585/courseware/matlabPyrTools.

So that matlab can find the pyramid tools, type in matlab:

path('/usr2/cs585/courseware/matlabPyrTools', path);

To read about the pyramid tools, type in matlab:

help matlabPyrTools

To build and display an example Gaussian pyramid, type in matlab:

im = pgmRead('einstein.pgm');
[pyr,pind] = buildGpyr(im);
showLpyr(pyr,pind);

If you want to download the source code for the pyramid tools, please download matlabPyrTools.tar.gz directly from the source.

Eigenfaces

A basis set of eigenfaces, corresponding eigenvalues, and the average face are provided on the CAS cluster in the directory /usr2/cs585/courseware/eigenfaces.

There are three data files in this directory: eigenvalues.mat, eigenfaces.mat, and average_face.mat. So that matlab can find these, type in matlab:

path('/usr2/cs585/courseware/eigenfaces', path);

There is a brief example program that displays the basis set of eigenfaces, corresponding eigenvalues, and the average face. To run it, type in matlab: showme.

What to Submit

Create an HTML document named "p2.html" that gives links to your matlab program source and your program's output images for at least three test cases. Be sure to include a one page description of how your program works. Be sure to discuss the assumptions and weaknesses of the particular technique employed. How does your program fail and why? How would you extend the program to make it more general?

Submit your complete HTML document, matlab source, and output images using the submit program on the CAS cluster.