Error using imread>get_full_filename
Mostra commenti meno recenti
I'm running the below code for my algorithm. Everything is working fine but imread() is giving an error in a loop. If I run the command separately it gives the output but in the loop it's showing an error. Could you please help me out?
Trainingpath = 'Destination Foler path';
imagesets = imageDatastore(Trainingpath,'IncludeSubfolders',true,'LabelSource',...
'foldernames');
[traindata,validation] = splitEachLabel(imagesets,0.50,'randomize');
extracted_features = bagOfFeatures(traindata);
Sclassifier = trainImageCategoryClassifier(traindata,extracted_features);
ConfusMatrix = evaluate(Sclassifier,validation);
mean(diag(ConfusMatrix));
imagename = uigetfile({'*.jpg;*.tif;*.png;*.gif','All Image Files';...
'*.*','All Files' });
image = imread(imagename); %?????????????????????
[Label, score] = predict(Sclassifier,image);
prediction = Sclassifier.Labels(Label);
%fprintf(imagename, prediction);
imagename, prediction
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Communications Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!