User`s guide

1 Getting Started
1-18
Starting the video input object — You start an object by calling the start
function. Starting an object prepares the object for data acquisition. For example,
starting an object locks the values of certain object properties (they become read
only). Starting an object does not initiate the acquiring of image frames, however. The
initiation of data logging depends on the execution of a trigger.
The following example calls the start function to start the video input object. Objects
stop when they have acquired the requested number of frames. Because the example
specifies a continuous acquisition, you must call the stop function to stop the object.
Triggering the acquisition — To acquire data, a video input object must execute
a trigger. Triggers can occur in several ways, depending on how the TriggerType
property is configured. For example, if you specify an immediate trigger, the object
executes a trigger automatically, immediately after it starts. If you specify a manual
trigger, the object waits for a call to the trigger function before it initiates data
acquisition. For more information, see “Acquiring Image Data” on page 6-2.
In the example, because the TriggerType property is set to 'immediate' (the
default) and the TriggerRepeat property is set to Inf, the object automatically
begins executing triggers and acquiring frames of data, continuously.
Bringing data into the MATLAB workspace — The toolbox stores acquired data
in a memory buffer, 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, use the getdata
function. Once the data is in the MATLAB workspace, you can manipulate it as
you would any other data. For more information, see “Working with Image Data in
MATLAB Workspace” on page 7-11.
Note The toolbox provides a convenient way to acquire a single frame of image data that
doesn't require starting or triggering the object. See “Bringing a Single Frame into the
Workspace” on page 7-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