Figure に表示された内容を画像データとして取得するにはどうすればよいですか?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 4 Sep. 2018
Beantwortet: MathWorks Support Team
am 19 Dez. 2018
下記のように、Figure 上にグラフィックスを表示しています。
mesh(peaks(50));
ここで、Figure に表示されているグラフィックスを行列(データ)として取得する方法を教えてください。
Akzeptierte Antwort
MathWorks Support Team
am 4 Sep. 2018
MATLAB の getframe 関数と frame2im 関数を使って行うことができます。
F = getframe(gcf); % フレームとして取得
[X,map] = frame2im(F); % イメージデータに変換
なお、フレーム(F)がトゥルーカラーを含む場合には、map は空となります。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!