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

2 Ansichten (letzte 30 Tage)
Ou Jin Sheng
Ou Jin Sheng am 11 Jun. 2021
Bearbeitet: Shadaab Siddiqie am 4 Aug. 2021
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 Kommentar
Walter Roberson
Walter Roberson am 11 Jun. 2021
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shadaab Siddiqie
Shadaab Siddiqie am 15 Jun. 2021
Bearbeitet: Shadaab Siddiqie am 4 Aug. 2021
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.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by