%function [w,eigapprox]=classifyim(fn)% script for classifying faces
%load eig.mat % input eigenvectors and mean
cd yalefaces;
% read in a test image
x = double(imread(fn,'gif'));
cd ..
figure,imagesc(x);colormap(gray);
new_data = x-facemean;
new_data = reshape(new_data,1,size(x,1)*size(x,2));
w = ef*new_data';
w,
efproj = w' * ef;

figure,imagesc(reshape(efproj,size(x,1),size(x,2)));colormap(gray);
save results w efproj
