[Numpy-discussion] PCA on set of face images
Fri Feb 29 13:50:14 CST 2008
The timing of your question couldn't be better, I just did an blog post on
this (I also plugged scipy and the EPD):
The code basically replicates the matlab montage() function and approach to
handling grayscale images using matplotlib.
On Fri, Feb 29, 2008 at 2:15 PM, firstname.lastname@example.org <email@example.com> wrote:
> hi guys
> I have a set of face images with which i want to do face recognition
> using Petland's PCA method.I gathered these steps from their docs
> 1.represent matrix of face images data
> 2.find the adjusted matrix by substracting the mean face
> 3.calculate covariance matrix (cov=A* A_transpose) where A is from
> 4.find eigenvectors and select those with highest eigenvalues
> 5.calculate facespace=eigenvectors*A
> when it comes to implementation i have doubts as to how i should
> represent the matrix of face images?
> using PIL image.getdata() i can make an array of each greyscale image.
> Should the matrix be like each row contains an array representing an
> image? That will make a matrix with rows=numimages and
> cavariancematrix =A *A_transpose will create a square matrix of
> Using numpy.linalg.eigh(covariancematrix) will give eigenvectors of
> same shape as the covariance matrix.
> I would like to know if this is the correct way to do this..I have no
> big expertise in linear algebra so i would be grateful if someone can
> confirm the right way of doing this
> Numpy-discussion mailing list
Peter N. Skomoroch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion