Dose anyone can help with PCA technique

How can PCA code reduce the dimension of image, if I have image with 128*128, after used PCA to compress image?

3 Comments

PCA mainly relies on a singular value decomposition of your data, what is it exactly you want to achieve ?
Thanks for your answer M and KSSV

Sign in to comment.

Answers (1)

Attached is a demo where I use it.

10 Comments

many thanks Image Analst for your consideration, my question is if I have image with dimension 128*128, how PCA code reduction the dimension???
Get the PCs - 128 of them - and throw away the ones you don't want. Keep just 3 or 4 of them.
thanks Image Analyst for your reply, could you please explain more, don't understand
Let's say you had an array where you had one row for each person, and each column was a measurement. The measurements were height (in col1), weight (in col 2), cholesterol, A1C, blood pressure, age (in days), social security number, street address, credit card number, and number of followers on Facebook. Now you do PCA on those and get 10 PCs. Now, might find good correlation between the first 6, but the last 4 don't show any trend or correlation at all - essentially they're random with respect to the first 6 biometric measurements. So you could just use the first 6 PCs and ignore the last 4, thus achieving data reduction.
Many thanks for your consideration Image Analyst. I understand this example. what about image? for example if I have image with 256*256,and used the PCA. is the PCA will reduction the dimension of image? and what will happened with 256*256?
You have to have more than 1 feature. Like for the color image demo I gave you the features were the rad value, green value, and blue value at each pixel. For your image, is it grayscale? Or color? What are the features?
its a grayscale image
OK . . . but what about the last, and most important, question that I asked. What are your features?
what do you mean about features?
Like what are your distinguishing attributes? You can't have just one - the gray level - you need more than 1. Like when I did it in the demo for a color image we had 3 - the red value,the green value, and the blue value. You can't just take one measurement and do PCA. Like if you had the heights of your classmates, you can't just say "I want to do PCA on the list of heights" - it doesn't make sense. Just like you can't say "I want to do PCA on the gray levels". If you don't even know what your features are, then why do you think that PCA is the approach you want to use??? Are you just wanting to write a compressed image, like in JPG or PNG format or something?

Sign in to comment.

Categories

Asked:

on 22 Nov 2017

Commented:

on 27 Nov 2017

Community Treasure Hunt

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

Start Hunting!