其他分享
首页 > 其他分享> > 视频分帧代码

视频分帧代码

作者:互联网

clc;
clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
video_file=‘vipmen.avi’;
video=VideoReader(video_file);
numFrames =video.NumberOfFrames;% 帧的总数

for k = 1 : numFrames% 读取数据
frame = read(video,k);
imshow(frame);%显示帧
imwrite(frame,strcat(‘E:\picute’,num2str(k),’.jpg’),‘jpg’);% 保存帧
end

标签:视频,读取数据,代码,strcat,jpg,video,file,分帧,frame
来源: https://blog.csdn.net/bj21002000/article/details/123183643