How to Resize Images in ImageDatastore

조회 수: 16 (최근 30일)
Wazzer
Wazzer 2018년 2월 17일
댓글: kawtar oba 2020년 3월 2일
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일
'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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by