直接上代码
video=VideoReader('*****.mp4');&读入视频
frame_num=floor(video.Duration*video.FrameRate);
for i=301:500
frame = read(video, i);
imwrite(frame,strcat(num2str(i),'.jpg'));
end
for index=301:500
%% image pre process
pic_index = num2str(index);
s=strcat(pic_index,'.jpg');
A=imread(s);
Agray=rgb2gray(A);
end