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.

 採用された回答

Image Analyst
Image Analyst 2017 年 9 月 7 日

0 投票

Specify the 'MultiSelect' option to be 'on':
[baseFileName, folder] = uigetfile(...,'MultiSelect', 'on')

1 件のコメント

Joe Joe
Joe Joe 2017 年 9 月 12 日
Thank You for your help. This is really helpful for me.

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

その他の回答 (1 件)

KSSV
KSSV 2017 年 9 月 7 日

0 投票

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

2 件のコメント

Joe Joe
Joe Joe 2017 年 9 月 7 日
sorry for my wrong question, I want to open multiple image files with GUI not intend to read. [fileName,pathName] = uigetfile('*.*','Select Images')
imageDir = fullfile(pathName, fileName);
images = imageDatastore(imageDir)
This code is ok for 1 time to select the image. But I want to select N times.
KSSV
KSSV 2017 年 9 月 7 日
[filename, pathname] = ...
uigetfile({'*.jpg';'*.png';'*.bmp'},'File Selector');

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

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2017 年 9 月 7 日

コメント済み:

2017 年 9 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by