PCA or clustering of an image

10 views (last 30 days)
I have an image which is a concentration profile of ftir mapped spectra. This said image clearly has certain unique patterns and regions.
My question is how do I use matlab to perform principal component analysis (PCA) on this image to obtain the unique images or regions that make up the full image. Any matlab code on performing PCA or clustering Analysis on the image? Thank you.
  1 Comment
David Fletcher
David Fletcher on 4 Mar 2018
It's a big topic area for a forum question. There are many forms of dimensionality reduction and clustering methods. Even within a single technique, there is still quite a lot of tinkering that needs to be done with such things as different distance metrics. The self-paced Machine Learning course does a good job of going through different methods, though I suspect it's not free to access. At the very least it's worth looking through the documentation for kmeans and pca, and they may lead on to other avenues of investigation. Actually running pca or kmeans on your data is fairly trivial, but to get the most from it you need to have some background knowledge of the process and how to adjust the parameters to optimize it for the data you have.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 4 Mar 2018
I agree with David's comment. An understanding of all the techniques is good before committing to one. You can try several with the Classification Learner app on the Apps tab of the tool ribbon. Attached is my demo of PCA with an image.
Recently (this year I think), I did a program for somebody who had hyperspectral images. Search the Answers forum for it. But it's a straightforward adaptation of the attached demo that does it in RGB space.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!