Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

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:

enter image description here

share|improve this question
1  
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
1  
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
2  
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
1  
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
2  
Learn about PCA here – whuber May 7 '12 at 18:59
show 5 more comments

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
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
show 6 more comments

I worked on a 2011 webinar titled "Computer Vision with MATLAB".

The webinar includes a texture classification example that would seem applicable to recognizing patterns in clothing.

You can download all of the code from MATLAB Central

http://www.mathworks.com/matlabcentral/fileexchange/31152-demos-from-computer-vision-with-matlab-webinar

The example uses a grayscale co-occurence matrix to extract features and then bagged decision trees for a classifier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.