read multiple image at the same time?
显示 更早的评论
Hi everyone! I want to read many image files(.jpg,.png and so on) at the same time. I mean I want to choose the images (shift+all or shift + ...). uigetfile gives me to choose one image and uigetdir give one directory.It's not OK for me. which command should I use.? Give me suggestion.
采纳的回答
更多回答(1 个)
KSSV
2017-9-7
You can get all the image files present folder using dir . Check the code below.
Files=[dir('*.jpg');dir('*.png');dir('*.bmp')] ; % Get jpg, png and bmp files in the present folder
N = length(Files) ; % Total number of image files
for i = 1:N % loop for each file
I = imread(Files(i).name) ; % Read the file
% Do what you want
end
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!