Convert, 3D matrix to Video

I want to convert a 3D matrix, say "100x150x75" to a video in matlab. How can I do that? I have converted a 3D matrix to a video, but output was very distorted video.

回答 (1 件)

Melika Bahmanabasdi
Melika Bahmanabasdi 2020 年 5 月 8 日

3 投票

VidObj = VideoWriter('movie.avi', 'Uncompressed AVI'); %set your file name and video compression
VidObj.FrameRate = 30; %set your frame rate
open(VidObj);
for f = 1:size(T, 3) %T is your "100x150x75" matrix
writeVideo(VidObj,mat2gray(T(:,:,f)));
end
close(VidObj);

タグ

質問済み:

2014 年 4 月 19 日

回答済み:

2020 年 5 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by