How we can read specific image from all directories in MATLAB?

2 vues (au cours des 30 derniers jours)
Javaid Iqbal
Javaid Iqbal le 7 Avr 2018
Réponse apportée : KSSV le 7 Avr 2018
images_path = ['J:\Education\MSCS\4th_Semester\Thesis\Implementation\source_code\MRI_Brain_Dataset'];
%images_path = '';
addpath(images_path);
fnames = dir([images_path]); %folder names e.g. here is 5 folders for sequences
numfids = length(fnames);
vals = cell(1,numfids);
for K = 1:numfids
fnames2 = dir([images_path '\' fnames(K).name]);
numfids2 = length(fnames2);
for L = 1:numfids2
if(L==1)
im = imread([images_path '\' fnames(K).name '\' fnames2(K).name '\Slice#89.jpg']);
figure, imshow(im);
% extract features of image
end
end
close all
end
close all
%%this code work for only on the current folder but I required to retrieve images from more directories mean in this current location have 84 more folders and each folder have 5 folders. and I want to read images from these 5 folders last location.

Réponses (1)

KSSV
KSSV le 7 Avr 2018

Catégories

En savoir plus sur Images 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!

Translated by