can I take pca analysis of columns extracted from pixel values of a converted to gray image?

3 ビュー (過去 30 日間)
Neo
Neo 2023 年 1 月 19 日
コメント済み: Image Analyst 2023 年 1 月 21 日
starting columns and ending columns
I made a code that outputs the pixel values of the columns from an image.
meanpixelvalues(i) = meanpixelvalues(binaryImage(masks));
I then applied pca analysis to the pixel values and the pca code output 1:
coeff = pca(meanpixelvalues(i))
Results:
coeff =
1
but I don't think that's physically possible and i'm wondering what did i do wrong to get a value of 1 and what does the columns of an image mean?
Thank you.
  4 件のコメント
Neo
Neo 2023 年 1 月 20 日
StartingColumns =
Columns 1 through 7
1 435 869 1303 1737 2171 2605
Columns 8 through 13
3039 3473 3907 4341 4775 5209
endingColumns =
Columns 1 through 7
434 868 1302 1736 2170 2604 3038
Columns 8 through 12
3472 3906 4340 4774 5208
Neo
Neo 2023 年 1 月 20 日
rows =
1452
columns =
5208

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2023 年 1 月 20 日
You can do it. I attach an example where I did it for an RGB image where each column was one of the color channels converted into a column vector. But if your variables (features) are individual channels of a gray scale image, like you said, it's difficult to interpret. Why do you want to do it if you don't know what the PCs would represent?
  7 件のコメント
Neo
Neo 2023 年 1 月 20 日
sorry I attached the wrong image. But I think my main question is how to extract pc from an image that can be plotted on a graph not from color channels.
Image Analyst
Image Analyst 2023 年 1 月 21 日
You have to have 2 or more features. What are your features?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by