- read each frame of the video
- perform image analysis
- show the image and hold
- add additional and stop hold
- continue drawing the image
this way youll see the images drawn on screen in a sequence that represents a video. the next stop is exporting it back to video. here is the structure im using:
clear all
close all
clc;
disp('Testing Purposes Only....');
fin = 'sampleVideo.avi';
fout = 'test2.avi';
avi = aviread(fin);
%view output frame by frame in an image
video = {avi.cdata};
for a = 1:length(video)
%---------------------------------
%Do image processing
newImage = rgb2gray(video{a});
%---------------------------------
imshow(newImage); %or use imagesc
axis image off
hold on
%---------------------------------
%add tracing to image
rectangle('Position',[50 50 70 100],'EdgeColor','r');
%---------------------------------
drawnow;
hold off
end;
No comments:
Post a Comment