myfirstgitrepo/heartrate/imageextract.m

21 lines
358 B
Matlab

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Image extraction code
%
% Author:LY Pechvattana, MINH Meng Hour
% Date: 19/02/2023
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function v = imageextract(vid)
vid = 'code.avi'
v = VideoReader(vid);
n = 1;
while hasFrame(v)
img = readFrame(v);
imwrite(img,strcat('image',num2str(n),'.png'));
n = n+1
end
n=n-1;