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.

回答 (1 件)

Niwin Anto
Niwin Anto 2018 年 2 月 20 日

4 投票

'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 件のコメント

kawtar oba
kawtar oba 2020 年 3 月 2 日
Hi,
I've to put the value of ''loc'' or it'is just made by matlab
thnk u

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

カテゴリ

ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索

質問済み:

2018 年 2 月 17 日

コメント済み:

2020 年 3 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by