User`s guide
5 Acquiring Image Data
5-20
Frame Acquisition Loop
The frame acquisition loop is where your adaptor acquires frames from the device and
sends them to the engine. This process involves the following steps:
1
Check whether the specified number of frames has been acquired. The
frame acquisition loop acquires frames from the device until the specified
number of frames has been acquired. Use the IAdaptor member function
isAcquisitionNotComplete() to determine if more frames are needed.
2
If your adaptor supports hardware triggers, you would check whether a hardware
trigger is configured here — “Supporting Hardware Triggers” on page 5-27.
3
Grab a frame from the device. This code is completely dependent on your device
SDK's API. With many device SDKs, you allocate a buffer and the device fills it with
image data. See your device's API documentation to learn how to get frames from
your device.
4
Check whether you need to send the acquired frame to the engine, using the
IAdaptor member function isSendFrame(). This is how the toolbox implements
the FrameGrabInterval property, where users can specify that they only want to
acquire every other frame, for example.
If you need to send a frame to the engine, package the frame in an IAdaptorFrame
object; otherwise, skip to step 5.
a
Create a frame object, using the IEngine object makeFrame() member
function. You must specify the image frame dimensions and frame type when
you create the frame object.
b
Put the acquired image data into the frame object, using the IAdaptorFrame
object setImage() member function. You specify a pointer to the buffer that
contains the image data, the frame width and height and any offsets from the
upper left corner of the image.
Note For information about specifying frame width, height, and offset with
ROIs, see “Supporting ROIs” on page 5-24.
c
Log the time of the acquisition in the frame object, using the IAdaptorFrame
member function setTime(). Device SDKs sometimes provide access to time
stamp information, but you can also use the adaptor kit getCurrentTime()
function.