# Dimensionality reduction for classifying textures with MATLAB

I am trying to apply dimensionality reduction on an a set of images (~3000 pixels) using Matlab's Dimensionality Reduction toolbox. However, I know very little about dimension reduction. So I tried several functions by trial and error. PCA returned a matrix with complex numbers, and the others froze MATLAB. Can I get some advice as to which method works good on images? Here are some of the images:

-
PCA is one of the mainstream methods for dimensionality reduction. However, I don't know if you understand what PCA actually does, can you provide your background? I'm not familiar with the Matlab Toolbox for Dimensionality Reduction, but I find it strange that it returns complex numbers... –  Néstor May 7 '12 at 17:04
Now that I recall, it isn't THAT strange to obtain complex values, but as far as I know they usually arise from numerical errors in the calculation of the eigenvalues. Is this the case? If it is, then you can just ignore the imaginary part (they have to be real because the covariance matrix is symmetric). –  Néstor May 7 '12 at 17:30
If the algorithm works properly (which I expect from a Matlab Toolbox), you can "strip" the imaginary components and leave only the real values. However, I strongly suggest you to learn what PCA actually does before claiming that your results are ok! There are plenty of ways to check that your results are coherent with what you wanted to do if you understand what PCA does. –  Néstor May 7 '12 at 18:02
From a mathematical perspective, the book "Principal Component Analysis" of I.T. Jolliffe, is excellent and I think the standard book on the subject. –  Néstor May 7 '12 at 18:29
Learn about PCA here –  whuber May 7 '12 at 18:59

In the narrower context of facial analysis, your problem is called eigenface analysis. Since PCA works with vectors, you have to vectorize each image matrix by concatenating all the rows or columns before proceeding. (Tensor decomposition has been tried too, but don't worry about that since you're new to PCA.)

The important thing to note is that the images must be standardized---much like a passport photo. If you're trying to compare wildly different images, you'll find that you need a large number of eigenvectors, indicating that dimension reduction is not feasible.

-
It's not facial analysis... It's patterns on clothes. Whould PCA work? –  cubearth May 7 '12 at 19:10
As I think about it, There is quite wide variety. Is there any other recommended methods? –  cubearth May 7 '12 at 19:25
Please characterize the images in more detail. Can we see them? How many are there? –  Emre May 7 '12 at 19:30
I have about 2000 images, and each image is 25 * 125 pixels. And I can't place images (too low rep :( ) but it as varies as much as patterns on clothes/ ties –  cubearth May 7 '12 at 19:37
Please upload a contact sheet of a representative sample to imgur.com. We can embed it for you. If you are a Windows user you can can use this. –  Emre May 7 '12 at 19:41