matlab如何转换视频到图像或者从视频中截取图像

转载  https://blog.csdn.net/anran_zhou/article/details/70241109
%%将视频转换成帧图片

clc;

clear;

%% 读取视频

video_path='DSC_0443.mov';   

video_obj=VideoReader(video_path); 

frame_number=video_obj.NumberOfFrames;

%% 存储每一帧图片到文件夹image

if ~exist('image','dir')

    mkdir('image');

    disp('successfully create directory image!');

end

for i=1:frame_number

    image_name=strcat('./image/im_',num2str(i),'.jpg'); 

    frame=read(video_obj,i);         

    imwrite(frame,image_name,'jpg');

end

disp('all images are written into directory image')

你可能感兴趣的:(matlab如何转换视频到图像或者从视频中截取图像)