User`s guide

6 Acquiring Image Data
6-48
CurrentState: 'Open'
2
Configure properties of the AVI file object — You can optionally configure the
properties of the AVI file object. The AVI file object supports properties that control
the data compression used, image quality, and other characteristics of the file. The
example sets the quality property to a midlevel value. By lowering the quality, the
AVI file object creates smaller log files.
aviobj.Quality = 50;
Because this example acquires image data in grayscale format (RS170), you must
also specify the colormap used with the AVI object to ensure that the stored data
displays correctly.
aviobj.Colormap = gray(256);
3
Create a video input object — This example creates a video input object for a
Matrox image acquisition device, using the default video format M_RS170. To run
this example on your system, use the imaqhwinfo function to get the video input
object constructor for your image acquisition device and substitute that syntax for
the following code.
vid = videoinput('matrox',1);
4
Configure video input object properties — Set up disk logging by setting the
value of the DiskLogger property to be aviobj, the AVI file object created in step 1.
Then, set the LoggingMode property to 'disk' (or 'disk&memory'). This example
also sets the TriggerRepeat property.
vid.LoggingMode = 'disk&memory';
vid.DiskLogger = aviobj;
vid.TriggerRepeat = 3;
5
Start the video input object — Start logging data to disk.
start(vid)
The object executes an immediate trigger, acquires frames of data, repeats the
trigger three additional times, and then stops.
To verify that all the frames have been logged to the AVI file, check the value of the
DiskLoggerFrameCount property. This property tells the number of frames that
have been logged to disk.
vid.DiskLoggerFrameCount