User`s guide

6 Acquiring Image Data
6-46
“Guidelines for Using an AVI File Object to Log Image Data” on page 6-46
“Closing the DiskLogger AVI file” on page 6-46
Logging Grayscale Images Using an AVI File
When logging images in grayscale format, such as RS170, you must set the value of the
AVI object's Colormap property to be a grayscale colormap. Otherwise, the image data in
the AVI file will not display correctly.
This example uses the MATLAB gray function to create a grayscale colormap and sets
the value of the AVI file object's Colormap property with this colormap.
logfile = avifile('my_datalog.avi','Colormap',gray(256));
Guidelines for Using an AVI File Object to Log Image Data
When you specify the AVI file object as the value of the DiskLogger property, you are
creating a copy of the AVI file object. Do not access the AVI file object using the original
variable name, aviobj, while the video input object is using the file for data logging. To
avoid file access conflicts, keep in mind these guidelines when using an AVI file for data
logging:
Do not close an AVI file object while it is being used for data logging.
Do not use the AVI file addframe function to add frames to the AVI file object while it
is being used for data logging.
Do not change the values of any AVI file object properties while it is being used for
data logging.
Note: AVI files are limited to a bit-depth of 8 bits per pixel for each band. If you have
higher bit data, you should not log it to an AVI file since the AVI format is restricted to 8-
bit data. If you do log higher bit data to an AVI file, it will be scaled and then logged as 8-
bit data.
Closing the DiskLogger AVI file
When data logging has ended, close the AVI file to make it accessible outside the
MATLAB environment. Use the value of the video input object DiskLogger property to
reference the AVI file, rather than the variable returned when you created the AVI file