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-336),(2-337),(3-338), (4-339), (5-
1 view (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
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
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...
More Answers (0)
See Also
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!