User`s guide

5 Acquiring Image Data
5-24
Supporting ROIs
The toolbox supports the specification of regions of interest (ROIs) in both software and
hardware. The following sections provide more information.
In this section...
“Implementing Software ROI” on page 5-24
“Implementing Hardware ROI” on page 5-26
Implementing Software ROI
When using a software ROI, a toolbox user sets the dimensions of the ROI in the
ROIPosition property. The device returns the entire image frame. Your adaptor
specifies the ROI dimensions when it creates the Frame object to package up the image
data.
User Scenario
Users set the value of the ROIPosition property to specify an ROI. Users specify the
value as a four-element vector in the form:
[Xoffset Yoffset Width Height]
The x- and y-offsets define the position of the ROI in relation to the upper left corner of
the image frame. For more information about this property, see the Image Acquisition
Toolbox documentation.
Suggested Algorithm
To support software ROI, your adaptor must check the value of the ROIposition
property before creating the frame object because you need to specify the ROI
dimensions when you create the frame. This is typically done in the openDevice() or
startCapture() functions.
In your frame acquisition loop, insert the following call to the IAdaptor function
getROI(). Then, use the ROI width and height values when you create the
IAdaptorFrame object, rather than the full image height and width returned by the
device.