画像のサイズを変えたい I want to change the size of the image
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Senka Okamoto
am 13 Jul. 2018
Bearbeitet: Senka Okamoto
am 11 Okt. 2018
元画像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 Kommentare
Akzeptierte Antwort
Kei Otsuka
am 13 Jul. 2018
Bearbeitet: Kei Otsuka
am 13 Jul. 2018
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu イメージを使用した深層学習 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!