User`s guide

Basic Image Acquisition Procedure
In the example, because the TriggerTy pe property is set to 'immediate'
(the default) and the Trigge rRepeat property is set to Inf,theobject
automatically begins executing triggers and acquiring frames of data,
continuously.
Bringing data into the MATL AB workspace The toolbox stores
acquired data in a memory b uffer, a disk file, or both, depending on the
value of the video input object
LoggingMode property. To work with this
data, you must bring it into the MATLAB workspace. To bring multiple
frames into the workspace, u se the
getdata function. Once the data is in
the MATLAB workspace, you can manipulate it as you would a ny other
data. For more information, see Chapter 6, “Working with Acquired Image
Data”.
Note The toolbox provides a convenient way to acquire a single frame of im age
data that doesn’t require starting or triggering the object. See “Bringing a
Single Frame into the Workspace” on page 6-10 for more information.
Running the Example
To run the example, enter the following code at the MATLAB prompt. The
example loops until a specified number of frames have been acquired. In each
loop iteration, the example calls
getdata to bring the two most recent frames
into the MATLAB workspace. To detect motion, the example subtracts one
frame from the other, creating a difference image, and then displays it. Pixels
that have changed values in the acquired frames will have nonzero values in
thedifferenceimage.
The
getdata function removes frames from the memory buffer when it brings
them into the MATLAB workspace. It is important to move frames from the
memory buffer into the MATLAB w orkspace in a timely m anner. If you do
not m ove the acquired frames from memory, you can quickly ex haust all the
memory available on your system.
The application creates a MATLAB figure and sets the
DoubleBuffer
property. This is not directly related to image acquisition but is included
to ensure a smooth display.
1-17