Read Image sequences in order
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nataliya
am 18 Okt. 2015
Beantwortet: Image Analyst
am 19 Okt. 2015
Hello everyone, I am trying to read the image sequences. Images are named as Img_1, Img_2,....,Img_10. I am reading the images one by one as follows:
m=1;
while(m <= length(Images))
Frame1 = [Imgdir '/' Images(m).name];
curr_frame1=imread(Frame1);
m=m+1;
end
But It reads Img_10 first and then Img_1. Why? I want to read the image in sequence.Please help.
0 Kommentare
Akzeptierte Antwort
Martin Schätz
am 18 Okt. 2015
Hi, there is no need to use while (however your code should work), for is more appropriate in this case.
for m=1:length(Images)
Frame1 = [Imgdir '/' Images(m).name];
curr_frame1=imread(Frame1);
end
It depends how your structure Images is designed. Under Images(1).name could be Img_10 and not Img_1. So to be absolutely shure, try this:
for m=1:length(Images)
Frame1 = [Imgdir '/' 'Img_' num2str(m)];
curr_frame1=imread(Frame1);
end
0 Kommentare
Weitere Antworten (1)
Image Analyst
am 19 Okt. 2015
Code samples for this frequently asked question are in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
0 Kommentare
Siehe auch
Kategorien
Mehr zu Biotech and Pharmaceutical 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!