log data in image acquisition explorer
you can use the image acquisition explorer to save acquired image data to a file or as a workspace variable. if you want to save your image data to a file, you can specify the file format and configure other file settings.
after you specify your data logging preferences, you can capture image snapshots and record video. for more information, see preview and acquire data in image acquisition explorer.
log data to workspace
to save image data as a workspace variable, select the workspace variable option in the logging section of the app toolstrip. you can specify the variable name as a valid matlab® variable name that does not already exist in the workspace.
the default values are snapshot1
and
recording1
for image
and video, respectively. after you capture a
snapshot or record a video using those variables, the default
variable names update to snapshot2
or
recording2
, then
snapshot3
or
recording3
, and so on.
after you set your variable names, you can click the capture button to save image data to the workspace or the record button to save video data to the workspace. for more information, see preview and acquire data in image acquisition explorer.
log data to file
to save image data to file, select the file option in the logging section of the app toolstrip. you can then specify file names and additional configuration settings for image and video logging.
image data
in the image field, specify the name you
want to give the file. the default value is
snapshot1.png
. click the settings
icon next to the file name to configure additional file
settings. you can select image file
location and select an image
file format. available settings depend on
the specified file format.
if you select png
, you can specify
the following.
description — add description to image.
if you select tiff
, you can specify
the following.
compression — select compression scheme as
packbits
,none
,lzw
, ordeflate
.description — add description to image.
if you select jpeg
, you can specify
the following.
quality — specify quality of output file from 0 to 100, where 0 is lower quality and higher compression and 100 is higher quality and lower compression. the default value is
75
.bit depth — select number of bits per pixel as
8
or12
.comment — add comment to image.
after you specify the file name, location, and other settings, you can click the capture button to save image data to file. for more information, see preview and acquire data in image acquisition explorer.
video data
in the video field, specify the name you
want to give the file. the default value is
recording1.avi
. click the
settings icon next to the file name to configure additional
file settings. you can select a video file
location and a video file
profile. possible values for
video file profile are
archival
,
motion jpeg avi
,
mpeg-4
,
motion jpeg 2000
, and
uncompressed avi
.
available settings depend on the specified file
profile.
if you select archival
or
motion jpeg 2000
, you can
specify the following.
lossless compression — turn on to make decompressed data identical to input data. the default is off for the
motion jpeg 2000
profile, and on for thearchival
profile.compression ratio — specify the target ratio between number of bytes in the input image and number of bytes in the compressed image as a number greater than 1. the default value is
10
. you can modify this setting only if lossless compression is turned off.frame rate — specify the rate of video playback in frames per second. the default value is
30
.mj2 bit depth — select the number of least-significant bits in input image data as a number from 1 to 16.
if you select motion jpeg avi
or
mpeg-4
, you can specify
the following.
frame rate — specify rate of video playback in frames per second. the default value is
30
.quality — specify quality of output file from 0 to 100, where 0 is lower quality and higher compression and 100 is higher quality and lower compression. the default value is
75
.
if you select uncompressed avi
, you
can specify the following.
frame rate — specify rate of video playback in frames per second. the default value is
30
.
after you specify the file name, location, and other settings, you can click the record button to save video data to file. for more information, see preview and acquire data in image acquisition explorer.
note
if the value of the frame rate specified in the video file settings is different from the frame rate of the preview, the length of the saved video will be different from the specified number of seconds for finite recording. the number of frames saved in the recording is calculated from the frame rate of the preview multiplied by the specified number of seconds to record. (the specified amount of time to record also includes the time required for the acquisition to start.) the length of the saved video is the number of frames divided by the frame rate specified in the video file settings. for example, if the frame rate of the preview is 15 frames per second, the number of seconds to record is 20 seconds, and the frame rate of video playback is 30 frames per second, the length of the saved recording is approximately 10 seconds.