Create working avi video.
2 次查看(过去 30 天)
显示 更早的评论
Always when I try to create an .avi video out of matrices I get the following error: Invalid video data - must be numeric or logical data type.
function [video] = CreateVideo(obj)
video = VideoWriter('test.avi');
video.FrameRate = 1;
open(video)
% loop 2d matrix sequence with ones and zeros and create video
for i_inc = 1 : size(obj.square_move_seq_, 3)
gray_img = double(obj.square_move_seq_(:, :, i_inc));
img = cat(3, gray_img, gray_img, gray_img);
writeVideo(video, img);
end
% Finalize the video file.
close(video);
end
Does somebody have a clue what I do wrong?
Thank you very much in advance.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!