How to read the specific numbered image from a serially numbered image

1 次查看(过去 30 天)
Hi everyone, I would folder of 1000 image with the number from "IM_NN_PP.jpg" form. such that (M,NN,PP are the integer number)
I1_01_01.jpg;
I1_01_02.jpg;
I1_01_03.jpg;
I1_02_01.jpg;
I1_02_02.jpg;
I1_02_03.jpg;
I2_01_01.jpg;
I2_01_02.jpg;
I2_01_03.jpg;
I2_02_01.jpg;
I2_02_02.jpg;
I2_02_03.jpg;
etc
Now I would like read only those image imahges for all NN (for 01 to 10) i.e.
I1_01_01.jpg;
I1_01_02.jpg;
I1_01_03.jpg;
I2_01_01.jpg;
I2_01_02.jpg;
I2_01_03.jpg;
and so on.
Thanks in advance.

采纳的回答

JAY R
JAY R 2015-3-25
编辑:JAY R 2015-3-25
for XX=1:10
for YY=1:10
for Z = 1:10
Iname1=sprintf('I%1.2d_%1.2d_%d.bmp', XX, YY,Z)
imread(Iname1)
end
end
end
Now one can modify to get the any numbered image.
  1 个评论
Stephen23
Stephen23 2015-3-25
Rather than just accepting your own answer you might liked to have waited for other suggestions, after all this is a forum for discussing and giving code advice. Others might even have solutions that you had not thought of, that might be more suitable for solving the specific talk at hand.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by