hyperpca applied to a set of several hyperspectral images
5 ビュー (過去 30 日間)
古いコメントを表示
I am trying to perform the PCA of several hyperspectral images.
I want to make one PCA with the entire set of images, not one PCA per image. To do this I run into several problems.
- The first problem is that the data takes up a large amount of memory and the hyperpca function does not accept using tall arrays. Matlab's PCA function does allow me to work with tall arrays but I don't know how to perform a PCA for a three-dimensional array.
- The second is that if I have to carry out the PCA of each of the images individually, how can I combine the PCAs?
If anyone can give me a hand I would appreciate it.
0 件のコメント
回答 (1 件)
John D'Errico
2024 年 5 月 30 日
編集済み: John D'Errico
2024 年 5 月 30 日
You cannot combine multiple PCA analyses. Since each one requires the computation of the eigenvalues and eigenvectors of a matrix, that is a highly nonlinear operation. There would be no simple magic to combine the multiple solutions into one, done after the fact.
Instead, you would need to concatenate the images into one tall array, since PCA can handle tall arrays. And that is eminently doable.
Ta = tall(rand(100,3));
Tb = tall(rand(100,3));
Tab = [Ta;Tb];
whos Tab
So tall arrays can be vertically concatenated. And that means I can perform a PCA on Tab.
pca(Tab)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!