hyperpca applied to a set of several hyperspectral images
7 次查看(过去 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!