For this example, we will create a time-lapse video with the red color isolated in the scene. We will use a frame rate of 2 frames per minute and perform the acquisition for 2 hours. This will create a video consisting of 2 (frames/minute) * 2 hours * 60 (minutes / hour) = 240 frames. Between two consecutive acquisitions, the first acquired frame will be processed for color isolation:
The first step is to reset our hardware devices and set the video input to our preferred hardware and resolution:
>> imaqreset >> vidObj = videoinput('winvideo', 1, 'dvsd_720x576');
Next, we will preallocate the space needed for the 240 frames of our video:
>> tl = uint8(zeros(576,720,3,240));
Next, we should write a small function to perform the color isolation. It is a simplified version of the
ROIColorIsolation.m
function developed for Chapter 4, Working with Color Images. It goes as follows:function [output] = ColorIsolation(image...