画像データセットを4-D doubleに変換する方法

回帰用の畳み込みニューラル ネットワークの学習
を自分の画像データセットで行いたいのですが,
画像データセットを4-D doubleに変換する方法がわかりません.
どなたかご教示お願い致します.

 Accepted Answer

Kenta
Kenta on 14 Aug 2019

2 votes

% 自分の取り込みたいサイズに合わせてDを作成
D=zeros(135,198,3,10);
for i=1:10
% 積み重ねていきたい画像を読み込んでいく(通常は下のように同一のものは読まない)
I=imread('onion.png');
% Dのi番目の画像として格納
D(:,:,:,i)=I;
end
例えばこのようにすれば可能です。Iは同一の画像を読み込んでしまっていますが、実際の場合は、順次対象のデータセットから読んでいけばよいです。

1 Comment

C2houlihan
C2houlihan on 26 Dec 2019
気が付くのが遅くなってしまい申し訳ありませんでした.
丁寧なご回答を頂きありがとうございます.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 14 Aug 2019

Commented:

on 26 Dec 2019

Community Treasure Hunt

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

Start Hunting!