Skip to content

Image ROI (dart E)#

The Image ROI camera feature allows you to specify the part of the sensor array that you want to use for image acquisition.

ROI is short for region of interest.

If an image ROI has been specified, the camera will only transmit pixel data from within that region. On most cameras, this increases the camera's maximum frame rate significantly.

Using the Feature#

Changing Position and Size of an Image ROI#

With the factory settings enabled, the camera is set to a default resolution. However, you can change the position and size as required.

To change the position and size of the image ROI:

  1. Make sure the camera is idle, i.e., not capturing images.
  2. Use the following parameters to specify the size of the image ROI:

    • Width
    • Height
  3. Use the following parameters to specify the position of the image ROI:

    • OffsetX
    • OffsetY

The origin of the image ROI is in the top left corner of the sensor array (column 0, row 0).

Example: Assume that you have specified the following settings:

  • Width = 16
  • Height = 10
  • OffsetX = 2
  • OffsetY = 6

This creates the following image ROI:

Image ROI Example

Decreasing the size (especially the height) of the image ROI increases the camera's maximum frame rate significantly.

Guidelines#

When you are specifying an image ROI, follow these guidelines:

Guideline Example
OffsetX + WidthWidthMax Camera with a 1920 x 1080 pixel sensor:
OffsetX + Width ≤ 1920
OffsetY + HeightHeightMax Camera with a 1920 x 1080 pixel sensor:
OffsetY + Height ≤ 1080

Specifics#

Image ROI Sizes#

Camera Model Minimum Width Width Increment Minimum Height Height Increment
daA2500-60mc 2 2 2 2
daA2500-60mci 96 8 64 8
daA3840-30mc 2 2 2 2
daA4200-30mci 96 8 64 8

Image ROI Offsets#

Camera Model Offset X Increment Offset Y Increment
daA2500-60mc 2 2
daA2500-60mci 8 8
daA3840-30mc 2 2
daA4200-30mci 8 8

Sample Code#

// Set the width to the maximum value
int64_t maxWidth = camera.WidthMax.GetValue();
camera.Width.SetValue(maxWidth);
// Set the height to 500
camera.Height.SetValue(500);
// Set the offset to 0
camera.OffsetX.SetValue(0);
camera.OffsetY.SetValue(0);
INodeMap& nodemap = camera.GetNodeMap();
// Set the width to the maximum value
int64_t maxWidth = CIntegerParameter(nodemap, "WidthMax").GetValue();
CIntegerParameter(nodemap, "Width").SetValue(maxWidth);
// Set the height to 500
CIntegerParameter(nodemap, "Height").SetValue(500);
// Set the offset to 0
CIntegerParameter(nodemap, "OffsetX").SetValue(0);
CIntegerParameter(nodemap, "OffsetY").SetValue(0);
// Set the width to the maximum value
Int64 maxWidth = camera.Parameters[PLCamera.WidthMax].GetValue();
camera.Parameters[PLCamera.Width].SetValue(maxWidth);
// Set the height to 500
camera.Parameters[PLCamera.Height].SetValue(500);
// Set the offset to 0
camera.Parameters[PLCamera.OffsetX].SetValue(0);
camera.Parameters[PLCamera.OffsetY].SetValue(0);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
int64_t maxWidth = 0;
/* Set the width to the maximum value */
errRes = PylonDeviceGetIntegerFeature(hdev, "WidthMax", &maxWidth);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", maxWidth);
CHECK(errRes);
/* Set the height to 500 */
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 500);
CHECK(errRes);
/* Set the offset to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetX", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetY", 0);
CHECK(errRes);
# Set the width to the maximum value
maxWidth = camera.WidthMax.Value
camera.Width.Value = maxWidth
# Set the height to 500
camera.Height.Value = 500
# Set the offset to 0
camera.OffsetX.Value = 0
camera.OffsetY.Value = 0
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
int64_t maxWidth = 0;
/* Set the width to the maximum value */
errRes = PylonDeviceGetIntegerFeature(hdev, "WidthMax", &maxWidth);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", maxWidth);
CHECK(errRes);
/* Set the height to 500 */
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 500);
CHECK(errRes);
/* Set the offset to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetX", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetY", 0);
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.