Read Images by date created, not my name

1 回表示 (過去 30 日間)
KaMu
KaMu 2014 年 1 月 27 日
コメント済み: KaMu 2014 年 1 月 27 日
Hello, is it possible in Matlab to read images by date created? I cant use foor loop as its hard to predict the images names.
For example, I have images with name:" F1_23.jpg,F1_51.jpg,F3_12.jpg". I have 4,450 images named like that, it is impossible to use 'for loops' as numbers not in ordered, but they are created in serial time one after another and I need to read them by the time they created in the folder. Can any of Matlab experts here can help?

採用された回答

Walter Roberson
Walter Roberson 2014 年 1 月 27 日
No. Use this instead:
dirinfo = dir('*.jpg');
[sortedtimes, sortorder] = sort([dirinfo.datenum]);
dirinfo = dirinfo(sortorder);
Then dirinfo will be the file information in increasing date modification order.
for K = 1 : length(dirinfo)
thisfile = dirinfo(K).name;
thisimage = imread(thisfile);
....
end
  1 件のコメント
KaMu
KaMu 2014 年 1 月 27 日
Thank you Walter Roberson! Great job!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by