how can I display one of the images instead of displaying all? can anybody help me please
1 回表示 (過去 30 日間)
古いコメントを表示
i am trying to read images from a folder and display one of them.
image_folder= 'C:\Octave\Octave-4.2.1\share\octave\packages\images' filename=dir(fullfile(image_folder,'*.jpg')); total_images=numel(filename);
for n=1:total_images f=fullfile(image_folder,filename(n).name); our_images=imread(f)
figure(n)
imshow(our_images)
end
0 件のコメント
採用された回答
YT
2018 年 10 月 28 日
Well you've created a for-loop, so it shows all of the images in those figures. If you only want to display 1 specific image, you should just get rid of the loop and specify wich image you want to display.
image_folder= 'C:\Octave\Octave-4.2.1\share\octave\packages\images'
filename=dir(fullfile(image_folder,'*.jpg'));
n = 20; % from `filename`
f=fullfile(image_folder,filename(n).name);
my_image=imread(f);
figure();
imshow(our_images)
2 件のコメント
YT
2018 年 10 月 30 日
This is another type of question, you should probably create a new post for this.
その他の回答 (1 件)
Image Analyst
2018 年 10 月 30 日
This is a FAQ, so see code in the FAQ: https://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!