6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MATLABによる動画の作り方 VideoWriter

Posted at
vidObj = VideoWriter('Hoge.avi');
open(vidObj)
for frame = 1:1000
   currFrame = fugafuga( frame );
   writeVideo( vidObj, currFrame );
end
close( vidObj );
  • 上記で fugafuga( ) は C( 1:Nx, 1:Ny, 1:3 ) のR,G,B三次元配列を出力する。値はそれぞれ 0以上1未満のdouble実数。
  • ここで C が2次元配列ならば、グレースケールの動画ができる。値が 0以上255未満の整数でもよい(たぶん自動判別)。
  • 動画作成の方法は他にもいろいろあるが、matlab最新の推奨方法は VideoWriter
  • currFrame を得るために、current figure (gcf) や current axis (gca) を与える方法もある。(たしか getframe 関数を使う)
6
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?