

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Homework # EECS- Due: Monday, Oct 6 (midnight) Total Points: 8 Celebrity Look-Alikes Although the technology for facial recognition is still a quickly evolving work in progress, even simple facial recognition approaches are sufficiently powerful for another application: identifying which celebrity looks most like you. In this assignment, we will use the eigenfaces technique discussed in class to write a matlab program that identifies which celebrity you most resemble.
1. Offline Processing: Computing the Eigenfaces (3 pts) Write a matlab routine function [mean_face, eigenfaces, singularvalues, celebrity_PCA_coefs] = ComputeEigenfaces(celebrity_directory, binary_mask) where celebrity_directory is a directory containing the celebrity photo database available from the class website. Each of these images is a 330x280x3 color image, and the scale, rotation, and offset of each image has been normalized so that the eyes of each celebrity are in the same location. Use dir([celebrity_directory, '*.jpg']) to get a list of files in the celebrity directory. binary_mask is the boolean 330x280x3 array that is found at the class website. This boolean mask zeros-out parts of the images that typically lie outside of faces, so that the image background does not affect the results. ComputeEigenfaces first computes the mean celebrity face, and then "centers" the celebrity images by subtracting out this mean face. mean_face should be a 330x280x3 array. Next, ComputeEigenfaces should apply the binary mask to each image, to zero-out the background. Next, compute the eigenfaces. To do this, you will first want to construct an array that contains each celebrity image. It is convenient here to keep only those pixels that are not masked out. You can do this by: unmasked_pixels = find(binary_mask); im_vector = im(unmasked_pixels); Later, when you need obtain the masked image from im_vector, use: full_im = zeros(size(binary_mask)); full_im(unmasked_pixels) = im_vector;
Once you have an array that contains each image vector, compute the eigenfaces using the Matlab function svd. Note that you have far more unmasked pixels (51951) than celebrity images (147), so most of the 51951 eigenfaces will be degenerate. Thereʼs no need to compute them all. Use: [U, S, V] = svd(X, 0); to compute the eigenvectors and singular values. To compute similar faces, there is no need to use all 147 eigenfaces. In this assignment, we will use only