please any one help me for how to create a image database and it's store .mat file

3 ビュー (過去 30 日間)
indrani dalui
indrani dalui 2020 年 5 月 4 日
回答済み: Ameer Hamza 2020 年 5 月 4 日
how to create .mat file

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 5 月 4 日
That depends on what do you mean by the database of the images. See imageDatastore: https://www.mathworks.com/help/releases/R2020a/matlab/ref/matlab.io.datastore.imagedatastore.html, but that is not equivalent to creating a .mat file for images.
You can load all the images and save them in a cell array. The cell array can then be stored in .mat file.
files = dir('*.jpg'); % read all jpg images in current folder
images = cell(1,numel(files));
for i=1:numel(files)
images{i} = imread(fullfile(files(i).folder, files(i).name)); % load images in the cell array
end
save('images.mat', 'images');

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by