Import Images to MATLAB with same sorting in File

Status
Not open for further replies.

panda1234

Full Member level 2
Joined
Jan 22, 2015
Messages
125
Helped
4
Reputation
8
Reaction score
4
Trophy points
18
Visit site
Activity points
1,172
Hi,
I have 100 pictures and i want to imports these in MATLAB for this we can write below code:
Dir = 'Pictures\';

% Read images from Images folder

Imgs = dir(fullfile(Dir, '*.bmp'));
for j=1:length(Imgs)

pic{j} = imread(fullfile(Dir, Imgs(j).name)); % Read image

end
but with this Method my sorting was vanished for example in folder i have picture that it's name is Pic10 and it's number in MATLAB is 2.but i want to numbers in MATLAB as same as in folder.
What do i do?
Thanks
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…