4.78947

4.8 | 19 ratings Rate this file 74 Downloads (last 30 days) File Size: 1.52 KB File ID: #6995
image thumbnail

Karhunen-Loeve Decomposition for Statistical Recognition and Detection

by Alex Chirokov

 

24 Feb 2005 (Updated 07 Nov 2005)

Karhunen-Loeve Decomposition for Face Recognition

| Watch this File

File Information
Description

This MATLAB script implements Karhunen-Loeve decomposition which is classical algorithm for face recognition and detection. Script uses ATT faces database http://www.uk.research.att.com/facesataglance.html
which can be downloaded from
http://www.uk.research.att.com/facedatabase.html

Computing Eigenvalues and Eigenvectors of images set
Encoding Face Images with a Linear Combination Key (KL decomposition)
Decoding a Key into an Image (reconstruction)
Comparing images using key, searching for similar images.

Required Products Image Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
face(6), image analysis(2), karhunen(4), kl transform(2), loeve(2), pca, recognition
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (22)
30 Mar 2012 mahendra kumar  
11 Dec 2008 sara  
30 Aug 2008 Ivelina Stefanova

Easy to grasp, straightforward, with nice visualization.

24 Aug 2008 troy rainmaker

Works fine. Short and efficient.

20 May 2008 Anton Kylling

Just what i needed to debug my own code

22 Dec 2007 mahmoud sayed  
08 Nov 2007 ma ng

it's ok

29 Sep 2007 christian cabrera

Ithink it would work i just have found it and i think i need the database you have in the link but ist is broken i Would like to know if you can send me the files or xplain somewhere hhow do we have to choose the data base... Thanks ...

02 Aug 2007 swathi reddy

The MATLAB script is excellent. It helped me a lot for my class project. ThankYou so much Alex chirokov. nice job :)

22 Feb 2007 chat sang

it ok

26 Dec 2006 venki raj

nice to work with

16 Jun 2006 wei zhang

The codes are effective in detecting human
faces

18 Apr 2006 l l

Error in ==>\KarhunenLoeve.m
On line 19 ==> x = double(x)/255;
%convert to double and normalize
can not work! anyone help me?

21 Mar 2006 K GOPAL

Quite Appreciable Work.....

13 Mar 2006 Jerome Bahans

Very clear, interesting, perfect !

06 Jan 2006 Agu Osoka

Just skimmed through and it works fine. Good stuff!!!

31 Oct 2005 Mutaz Shukair

Really very great function, I liked it specially it is easy to follow up and to understand.

07 Apr 2005 Alexandre Chirokov

Dear Paul Silvanovich

this line needed to normalize vectors
V = x*V*(abs(D))^-0.5;

[V,D] = eig(cov_mat);
returns unit eigen vectors.

V = x*V; !this line will produce non-unit vectors

one way to normalize them is to do this
V = x*V*(abs(D))^-0.5;
(but this is not the only way)

check it with: norm(V);

06 Apr 2005 Alex Chirokov

Dear Paul Silvanovich

The algorithm to transform images into eigenfaces is described well in Turk and Pentland [1], but I will describe it briefly here. Each image could be represented as a matrix of MxN pixels, with each element an 8-bit grayscale value. If all images are represented as such, they can each be turned into a vector of length MN. Next, the average face can be found, and each image can then be represented as a difference from the average. The difference vectors can then all be used as columns in a matrix A (matrix x in the code). The eigenfaces are then the eigenvectors of the covariance matrix C = A*A' (A' - is the transpose of A). However, since images are very high dimensional, the covariance matrix is likely quite large (if images are 92x112, C will be huge 10304x10304 ), thus a straightforward eigenvector computation is prohibitively expensive.
This problem can be solved by noticing that in the equation
A*A'*A*vi = u*A*vi,
the eigenvectors of C are A*vi, where vi are the eigenvectors of A'*A, which is a square matrix with dimension equal to the number of images in the data set. Since the number of images in the data set is usually much less than the size of an image, this computation is likely to be tractable.

[1] M. Turk, and A. Pentland, ?Eigenfaces for Recognition,? Journal of Cognitive
Neuroscience, vol. 3, no. 1, pp. 71-86, 1991.

31 Mar 2005 Paul Silvanovich

What for in KarhunenLoeve.m
V = x*V*(abs(D))^-0.5; ?

29 Mar 2005 low weiwei

i like it!

27 Feb 2005 Anas Qutieshat

very intersting :)
but found it hard to go through the code

Updates
07 Nov 2005

Code was updated to find the most similar and the most different faces. Also distance map of face database is now computed and shown.

Contact us