reading trivially sorted images 1 by 1 in loop
1 次查看(过去 30 天)
显示 更早的评论
Hii, i have sorted the images in the form
Image_0001
Image_0002
..........
........... up to n
i am trying to read images one by one in a loop as follows but i am getting error because of not able to fix 0001, 0002 formate of sorting
for i=1:N % reading frames
im=imread(['C:\Users\Nikhil\Desktop\Manu Gowda\images\1mm ' num2str(i) '.jpg']);% reading images from folder
[x,g]=size(im) % x is no of rows y is no coloums
how to resolve it.
0 个评论
采纳的回答
Walter Roberson
2022-1-26
imgdir = 'C:\Users\Nikhil\Desktop\Manu Gowda\images';
Then in the loop,
basename = sprintf('1mm%04d.jpg', i);
im = imread(fullfile(imgdir, basename));% reading images from folder
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!