First, Matlab to break the video into an image frame
Percent read video file
[Filename,pathname]=uigetfile (' *. * ', ' choose a video ');
Path = [pathname filename];
Xyloobj = Videoreader (path);
start = 1;
Nframes = Xyloobj.numberofframes; % gets the total number of video frames for
k = start:nframes% traversal per frame
B1 = Read (Xyloobj, k);
B1 = Imresize (b1,[240,425]); The pixel size of the% transform image
Imwrite (b1,strcat (' 03052\ ', Num2str (k), '. jpg '), ' jpg ');% ' 03052\ ' The 03052 folder end in the current directory
Second, MATLAB image frame synthesis Video
Path = ' whitecar2\ '; % ' whitecar2\ ' is the WhiteCar2 folder under the current directory
writerobj = videowriter (' Car.avi '); % save the generated video as a video
open (writerobj) called ' Car.avi ';
For i = 57:100
frame = Imread (strcat (Path,num2str (i), '. jpg '));% reads the image from the folder
Writevideo (writerobj,frame);
End
Close (writerobj);