RoyG, The timing of your question couldn't be better, I just did an blog post on this (I also plugged scipy and the EPD): http://www.datawrangling.com/python-montage-code-for-displaying-arrays.html The code basically replicates the matlab montage() function and approach to handling grayscale images using matplotlib. -Pete On Fri, Feb 29, 2008 at 2:15 PM, devnew@gmail.com <devnew@gmail.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 step2 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 columns=numpixels
cavariancematrix =A *A_transpose will create a square matrix of shape(numimages,numimages) 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
RoyG _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- Peter N. Skomoroch peter.skomoroch@gmail.com http://www.datawrangling.com