how i can import imagedatstore contains subfolder of image?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
youb mr
le 12 Avr 2020
Réponse apportée : Image Analyst
le 12 Avr 2020
hello every one
i want to load an imagedatastore that contains subfolder of image. I have used this programme but it doesn't work, where the database is the folder and it contains 5 subfolders
%% Load the dataset
rootFolder = 'database.mp;
imds = imageDatastore('database', 'IncludeSubfolders',1 ,'LabelSource', 'foldernames');
% after that i want to read the first 10 image of each subfolder i haev use this programme
for i=1:10
img = readimage(rootFolder, i);
end
also this code dosn't work how can i do that
0 commentaires
Réponse acceptée
Image Analyst
le 12 Avr 2020
Try this:
%% Load the dataset
% rootFolder = 'database.mp';
rootFolder = 'D:\OneDrive\Not Shared\Matlab\work\Tests'; % Wherever. Change to your computer...
imds = imageDatastore(rootFolder, 'IncludeSubfolders',1 ,'LabelSource', 'foldernames');
% after that i want to read the first 10 image of each subfolder i haev use this programme
for k = 1 : 10
thisFullFileName = imds.Files{k};
fprintf('Reading in %s.\n', thisFullFileName);
thisImage = readimage(imds, k);
imshow(thisImage);
drawnow;
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur GigE Vision Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!