Figure に表示された内容を画像データとして取得するにはどうすればよいですか?
2 views (last 30 days)
Show older comments
MathWorks Support Team
on 4 Sep 2018
Answered: MathWorks Support Team
on 19 Dec 2018
下記のように、Figure 上にグラフィックスを表示しています。
mesh(peaks(50));
ここで、Figure に表示されているグラフィックスを行列(データ)として取得する方法を教えてください。
Accepted Answer
MathWorks Support Team
on 4 Sep 2018
MATLAB の getframe 関数と frame2im 関数を使って行うことができます。
F = getframe(gcf); % フレームとして取得
[X,map] = frame2im(F); % イメージデータに変換
なお、フレーム(F)がトゥルーカラーを含む場合には、map は空となります。
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!