필터 지우기
필터 지우기

画像のサイズを変えたい I want to change the size of the image

조회 수: 8 (최근 30일)
Senka Okamoto
Senka Okamoto 2018년 7월 13일
편집: Senka Okamoto 2018년 10월 11일
元画像200×200×3のイメージサイズ imds(1 ×1 ImageDatastore)に The image size imds (1 × 1 ImageDatastore) of the original image 200 × 200 × 3
imageSize = [28 28 1];
   auimds = augmentedImageDatastore(imageSize,imds)
とすると28×28×3のイメージサイズになります。28×28×1にするためにはどうすればいいですか?
Then it becomes the image size of 28 × 28 × 3. How can I make it 28 × 28 × 1?
  댓글 수: 2
madhan ravi
madhan ravi 2018년 10월 11일
Are you aware that you flagged your own question as SPAM?
Rena Berman
Rena Berman 2018년 10월 11일
(Answers Dev) Restored edit

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

채택된 답변

Kei Otsuka
Kei Otsuka 2018년 7월 13일
편집: Kei Otsuka 2018년 7월 13일
augmentedImageDatastoreで指定できる出力画像サイズは行・列のみ有効となります。
28x28x3から28x28x1への変更(ex, RGBからグレースケールへの変更等)が必要な場合は、
imageDatastoreのReadFcnとして関数指定することで行うことができます。
例えばですが、以下のような関数を作成し、
function Iout = myrgb2gray(filename)
I = imread(filename);
Iout = rgb2gray(I);
end
ReadFcnとして利用します。
imds.ReadFcn = @(filename)myrgb2gray(filename);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 イメージを使用した深層学習에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!