Programmatically Set a Region of Interest (ROI) with NI IMAQdx

Updated Jan 17, 2018

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base
  • LabVIEW Professional

Driver

  • Vision Acquisition Software
  • NI-IMAQdx

Issue Details

I have a camera that uses NI IMAQdx (USB 3.0 Vision, GigE Vision, Camera Link, IEEE-1394 FireWire, USB 2.0 with DirectShow, Ethernet IP) and want to programmatically set a region of interest (ROI) so that I am not grabbing all pixels from the image sensor.

Solution

Some cameras support user-configurable regions of interest (ROIs), which allow you to define the size of the acquired image. If you use this format, you must input the image size using the region of interest attributes, such as offset x, offset y, width, and height. The size and position of the sub-image you are acquiring must be a multiple of the increment attribute, as shown in the following figure, or the driver acquires the smallest sub-image that contains the ROI you defined.
The increment values are camera-specific. Refer to the camera documentation or query the increment attributes for width and height to obtain the actual values.

To set the region of interest attributes in LabVIEW, you can use an IMAQdx property node like in the screenshot below:
Note that the ROI has to be set before starting the acquisition; you cannot change the ROI while the acquisition is in progress. If you change the ROI, you will have to reconfigure and restart the acquisition.

Additional Information

Extracted from the NI-IMAQdx Concepts Help (<National Instruments>\NI-IMAQdx\Help\niimaqdx_concepts.chm):
The region of interest (ROI) specifies a rectangular portion of the image to be captured. If the camera supports scalable video modes, the ROI defines the portion of the image to transfer from the camera to system memory. If the camera does not support scalable video modes, the entire image is transferred from the camera to system memory. In all video modes, the ROI specifies the amount of data decoded by the driver while acquiring into a user buffer.

By default, the driver transfers the entire image. Specify a smaller ROI for the following reasons:
  • To acquire only the necessary subset of data
  • To increase the acquisition speed by reducing the amount of data transferred and/or decoded
  • To allow for multiple simultaneous acquisitions by reducing bandwidth usage

WAS THIS ARTICLE HELPFUL?

Not Helpful