How to Resize Images in ImageDatastore
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm trying to resize several images from a file folder that I put into an ImageDatastore. The example code on Mathworks is the following:
imds.ReadFcn = @(loc)imresize(imread(loc),inputSize);
What is meant by loc? I assumed location but I'm getting errors. Or does this mean I need to make my own function and then call it in my script? Thank you.
0 Kommentare
Antworten (1)
Niwin Anto
am 20 Feb. 2018
'loc' is not the location, it is just a dummy parameter. To resize images in an ImageDatastore, assign a new read function to the ReadFcn property.
inputSize = [227 227];
imds.ReadFcn = @(loc)imresize(imread(loc),inputSize);
imshow(preview(imds));
1 Kommentar
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!