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 件のコメント
Prakash Shyam Karuppiah
2020 年 5 月 29 日
Had you solved the problem, I am also struck with the same
回答 (1 件)
Walter Roberson
2019 年 10 月 4 日
0 投票
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.
2 件のコメント
Prakash Shyam Karuppiah
2020 年 5 月 29 日
Can you please elaborate, I am new user to Matlab ans I need a work around here
Walter Roberson
2020 年 5 月 29 日
https://www.mathworks.com/help/matlab/import_export/read-and-analyze-image-files.html shows an example. Notice in particular the loop, and the readimage() call.
カテゴリ
ヘルプ センター および File 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!