matlab:读取mp4文件,并把逐帧保存成图片文件,文件名的编号随帧数变化

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%=====ABSTRACT=====

% translate MP4 file to images. cause the appearance of block artifact, the

% frames of mp4 file will undergo down-sampling and gaussian filter before

% saved as images

%

%=====AUTHOR:dp=====

%   

%=====DATE:151117=====

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clc

clear

close all



xyloObj = VideoReader('su35.mp4');

nFrames = xyloObj.NumberOfFrames;

vidHeight = xyloObj.Height;

vidWidth = xyloObj.Width;



for k = 1 : nFrames

    im = read(xyloObj, k);%读取第k帧,存入im中

    imwrite(im, ['original_frame',num2str(k),'.bmp'], 'bmp');%把im存储成图片,并且存储的文件名根据序号改变

end



代码如上咯

阅读更多
个人分类: 2. MATLAB学习笔记
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

matlab:读取mp4文件,并把逐帧保存成图片文件,文件名的编号随帧数变化

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭