User`s guide

Bringing Image Data into the MATL AB Workspace
Bringing Image Data into the MATLAB Workspace
In this section.. .
“Overview” on page 6-3
“Moving M ultiple Frames into the Workspace” on page 6-4
“Viewing Frames in the Mem ory Buffer” on page 6-6
“Bringing a Single Frame into the Workspace” on page 6-10
Overview
The t oolbo x provides three ways to move frames from the memory buffer
into the MATLAB workspace:
Removing m ultiple frames from the buffer —Tomoveaspecified
number of frames from the memory buffer into the workspace, use the
getdata function. The getdata function removes the frames from the
memory buffer as it moves them into the workspace. The function blocks
the MATLAB command line until all the requested frames are available, or
until a t imeout value expire s. For more inform ation, see “Moving Multiple
Frames into the Workspace” on page 6-4.
Viewing the most recently acquired frames in the buffer —Tobring
the most recently a cquired frames in the memory buffer into the workspace
without removing them from the buffer, use the
peekdata function. W hen
returning frames,
peekdata starts with the most recently acquired frame
and works backward in the memory buffer. In contrast,
getdata starts
at the beginning of the buffer, returning the oldest acquired frame first.
peekdata does not block the command line and is not guaranteed to return
all the frames you request. For more information, see “Viewing Frames
in the Memory Buffer” on page 6-6.
Bringing a single frame of data into the workspace —Asa
convenience, the toolbox provides the
getsnapshot function, which
returns a single fram e of data into the MATLAB workspace. Because the
getsnapshot function does not require starting the object or triggering an
acquisition, it is the easiest way to bring image data into the workspace.
getsnapshot is independent of the memory buffer; it can return a frame
even if the me mory buffer is empty, and the frame returned does not affect
6-3