how can i use imdisp to display images from the folder?
古いコメントを表示
I have code which saves matched images into a folder... how can retrieve images from the folder and display multiple or all images of folder using "imdisp" ...
[MATLAB 7]
回答 (1 件)
Walter Roberson
2017 年 6 月 29 日
編集済み: Walter Roberson
2017 年 6 月 29 日
0 投票
Be careful if your images are named something img_9.bmp img_10.bmp and so on instead of img_09.bmp img_10.bmp (with fixed number of digits). If you use variable number of digits you will probably want to use https://www.mathworks.com/examples/matlab/community/19425-natsortfiles-examples
4 件のコメント
Walter Roberson
2017 年 7 月 1 日
dinfo = dir('*.png');
numfile = length(dinfo);
image_stack = [];
for K = 1 : numfile
thisfile = dinfo(K).name;
thisimage = imread(thisfile);
image_stack(1:size(thisimage,1), 1:size(thisimage,2), :, K) = thisimage;
end
imdisp(image_stack);
hp
2017 年 7 月 3 日
編集済み: Walter Roberson
2017 年 7 月 3 日
hp
2017 年 7 月 3 日
編集済み: Walter Roberson
2017 年 7 月 3 日
Guillaume
2017 年 7 月 3 日
Don't use strcat use fullfile instead.
Don't use length use numel instead.
Your error is because you haven't specified the full path of the file in your imread call.
thisimage = imread(fullfile(dir_in, thisfile));
カテゴリ
ヘルプ センター および File Exchange で Point Grey Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!