Is it possible to implement principle component analysis on the function imageDatastore?

Hi everyone.
I am new user of MATLAB. I am implementing CNN on the data set that I have and I use the bulid function
imds = imageDatastore(fullfile(pwd,'data'),...
'IncludeSubfolders',true,'FileExtensions','.dcm',...
'LabelSource','foldernames');
and I am trying to apply PCA on imds ( dimentinalty reduction ). I notice that there is a function that preformed pca called coeff = pca(imds). However, I recive the following error
Error using pca (line 168)
The value of X must be a numeric array.
Error in cnn (line 34)
coeff = pca(imds)
which means that imds must be numeric array. Please, If someone can help me to solve this problem??.
Many thanks

답변 (1개)

Walter Roberson
Walter Roberson 2019년 10월 4일
No, you can only apply pca to an image that you have read in from the datastore, not to the whole datastore. You will need a loop.

카테고리

도움말 센터File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

태그

질문:

2019년 10월 4일

댓글:

2020년 5월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by