1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
clc
close all
clear all
video = VideoReader('MaVid.avi');
NbF = video.NumberOfFrames;
vidHeight = video.Height;
vidWidth = video.Width;
I=read(video,1);
J(1:NbF) =struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap', colormap('gray') );
i(1:NbF) =struct('cdata', zeros(146, 485, 3, 'uint8'));
for k=1 : NbF
J(k).cdata = read(video,k);
I = J(k).cdata;
i(k).cdata = imcrop(I,[518 172 484 145]);
if max(i(k+1).cdata-i(k).cdata)>100
imwrite(i(k),'Frames.png');
end
end |
Partager