Hello, I am a novice user in MATLAB. So,I have a question. I have 8760 of images in one folder and I want to read it one-by-one and take every time 336 image from first.how can i do this? As for example, At first,(1-3​36),(2-337​),(3-338), (4-339), (5-

1 view (last 30 days)
Hello, I am a novice user in MATLAB. So,I have a question. I have 8760 of images in one folder and I want to read 336 number of images sequentially and consider every time 336 set of images from first.How can i do this? As for example, I want to take (1-336),(2-337),(3-338), (4-339), (5-340),...., (8425-8760) from images folder. Is it possible?

Accepted Answer

KSSV
KSSV on 26 Aug 2016
imgfiles = dir('*.jpg'); % You are in the folder of jpg files/ change extension accordingly
Nfiles = length(imgfiles) ; % number of image files
% loop for each file
for i = 1:Nfiles
fname = imgfiles(i).name ; % file name
data = imread(fname) ; % read the image
%%do what you want %%%
end
  4 Comments
Dipankar Kumar
Dipankar Kumar on 26 Aug 2016
Thank you for your reply. I want to consider 336 sets of images. But, At first I want to take 336 only, image number-1 to image number-336, After, image number-2 to image number-337, image number-3 to image number-338 continue...
KSSV
KSSV on 26 Aug 2016
It is pretty simple....run a loop from 1 to 336 for the first 336 images...you fix the loop as you want...

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!