I wish to import all the image into a .mat file for machine learning.

1 次查看(过去 30 天)
How to solve the error as the existing image file is in jpg type?
Or is there any alternative method to prepare dataset for machine learning
  1 个评论
Walter Roberson
Walter Roberson 2021-6-11
There are a number of different problems with what you have done.
But I recommend that instead of trying to fix it, that you instead use an imageDatastore https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html . Many of the Deep Learning algorithms already know how to handle those.

请先登录,再进行评论。

回答(1 个)

Shadaab Siddiqie
Shadaab Siddiqie 2021-6-15
编辑:Shadaab Siddiqie 2021-8-4
From my understanding you want to import multiple images into MATLAB. Here is a code which might help you:
% Read in all images from a folder called 'images'
imgFolder = fullfile('images');
imgs = imageDatastore(imgFolder);
numOfImgs = length(imgs.Files);
for ii = 1:numOfImgs
% do operation on the images as your requirement
end
You can refer imageDatastore for more information.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by