How to read & display multiple images from multiple folder using for loop ?

4 vues (au cours des 30 derniers jours)
I have three folders with 12 image in each folder. to comapre them i need to dispaly all the images across their coresponding predicted and ground truth image. Row 1 consists of 12 original images, Row 2 consists of 12 groung truth iamges and Row 3 consists 12 predicted images.
images = imageDatastore('D:\original images');
GroundT = imageDatastore('D:\ground truth');
Predict = imageDatastore('D:\ predicted');
for i = 1:12
subplot(3,12,i)
imshow(images.Files{i})
hold on
for j=13:24
subplot(3,12,j)
imshow(GroundT.Files{i})
hold on
for k=25:36
subplot(3,12,k)
imshow(Predict.Files{i})
end
end
end

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Juin 2021
images = imageDatastore('D:\original images');
GroundT = imageDatastore('D:\ground truth');
Predict = imageDatastore('D:\ predicted');
for i = 1:12
subplot(3,12,i*3-2)
imshow(images.Files{i})
subplot(3,12,i*3-1)
imshow(GroundT.Files{i})
subplot(3,12,i*3)
imshow(Predict.Files{i})
end
  2 commentaires
Raza Ali
Raza Ali le 28 Juin 2021
Thank you for your answer but I need all the images in Row 1, all the groundtruth images in Row 2 and all the coresponding predicted images in Row 3.
Walter Roberson
Walter Roberson le 29 Juin 2021
images = imageDatastore('D:\original images');
GroundT = imageDatastore('D:\ground truth');
Predict = imageDatastore('D:\ predicted');
for i = 1:12
subplot(3,12,i)
imshow(images.Files{i})
subplot(3,12,i+12)
imshow(GroundT.Files{i})
subplot(3,12,i+24)
imshow(Predict.Files{i})
end

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by