Can PCA be applied directly on an image?

4 次查看(过去 30 天)
Can PCA be applied directly on an image, in contrast to a matrix(in which rows correspond to observations & columns to variables)?
When i try to apply PCA using SVD/Covariance directly on an image i get the following error:
"Error using minus
Integers can only be combined with integers of same class or scalar doubles.
Error in pca2 at 14
data=data-repmat(mn,1,N);"
Thanking you in advance

采纳的回答

Walter Roberson
Walter Roberson 2013-11-14
Apply it to im2double() of the image.

更多回答(1 个)

sidra
sidra 2013-11-18
Walter, it works fine for a single image but when i try the same on array of images i get the error :
"Array dimensions must match for binary array op.
error in pca2 at 14
data=data-repmat(mn,1,N);
error in db.pca at 18
pc=pca2(imagearray);"

类别

Help CenterFile Exchange 中查找有关 Dimensionality 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