User`s guide
1 Getting Started
Note The example uses functions in Image Processing Toolbox.
% Create video input obje ct.
vid = videoinput('dcam ',1,'Y8_1024x768')
% Set video input object prop erties for this app lication.
% Note that example uses both SET method and dot notation metho d.
set(vid,'TriggerRepeat',Inf);
vid.FrameGrabInterval = 5;
% Set value of a video source obj ect property.
vid_src = getselecteds ource(vid);
set(vid_src,'Tag','motion dete ction setup');
% Create a figure window.
figure;
% Start acquiring frames.
start(vid)
% Calculate difference image and disp lay it.
while(vid.FramesAcquired<=100) % Stop after 1 00 frames
data = getdata(vid,2) ;
diff_im = imabsdiff(d ata(:,:,:,1),data(:,:,:,2));
imshow(diff_im);
end
stop(vid)
1-18