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

2 ビュー (過去 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 Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!