- Call the images one by one
- Save images in Cell Array
Making a vector of images
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MOLE
am 21 Okt. 2019
Beantwortet: KALYAN ACHARJYA
am 21 Okt. 2019
I have a directory with several images like image_1.png, image_2.png... and I need to get these into a vector of image matrices (after using imread) so I can index and access the matrix corresponding to that image. Is this possible? How to do it?
0 Kommentare
Akzeptierte Antwort
KALYAN ACHARJYA
am 21 Okt. 2019
Set the current directory on the respective folder (Image Folder)
Steps:
list=dir('*.jpg');
image_data=cell(1,length(list));
%.............^ Note on format
for j=1:length(list)
image_file=imread(list(j).name);
image_data{j}=image_file;
end
Now you can acess any images by calling cell array image_data{1}, image_data{2},....so on
Hope it Helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!