Monday, January 15, 2007

Improved method of capturing sample data

So it seems taking pictures is a poor way of capturing data. A better approach is just to take video footage and cut the frames out of it. I figured out the simple matlab commands for it:

FILENAME = 'MVI_1619.avi';
file_info = aviinfo(FILENAME);
num_frames = file_info.NumFrames;
for current_frame=1:num_frames
%grab the movie frame
movieframe = aviread(FILENAME, current_frame);
%convert to an image and save into cell
imageframe{current_frame} = frame2im(movieframe);
end


I read the research paper in the previous post in more detail. To answer my own question regarding why motion detection is needed rather than just work with a single image, motion detection is used for background detection. By subtracting two frames of a time interval, we can set the foreground to the objects that moved.

No comments: