将连续图像帧序列用Matlab转化为视频流
% 声明视频输出路径
outputVideo = VideoWriter( fullfile( 'D:\phd codes\SfmLearner-Pytorch-master\SfmLearner-Pytorch-master\dataset\sequences\00\image_1', 'test.avi' ) );
% 设置视频输出的参数
outputVideo.FrameRate = 24;
outputVideo.Quality = 100
% 启动
open( outputVideo )
% 准备图像,使用该目录下所有png格式图像
imageNames = dir( fullfile( 'D:\phd codes\SfmLearner-Pytorch-master\SfmLearner-Pytorch-master\dataset\sequences\00\image_1','*.png' ) )
for ii = 1 : length( imageNames )
img = imread(fullfile( 'D:\phd codes\SfmLearner-Pytorch-master\SfmLearner-Pytorch-master\dataset\sequences\00\image_1', imageNames(ii).name ) );
writeVideo( outputVideo, img ) % 写入
end
% 关闭写入器,使视频生效
close(outputVideo)`