Image ROI

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 (formerly AOI = area 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.

The image ROI settings are independent from the auto function ROI settings.

In this topic Hide

Using the Feature

Prerequisites

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. Use the following parameters to specify the size of the image ROI:
  2. Use the following parameters to specify the position of the image ROI:

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:

This creates the following image ROI:

Image ROI Example

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

The WidthMax and HeightMax parameter values adapt to the current settings for Binning, Decimation, or Scaling (if available).

Specifics

Image ROI Sizes

Camera Model

Minimum Width

Width Increment

Minimum Height

Height Increment

a2A1920-51gmBAS 4 4 4 2
a2A1920-51gcBAS 4 4 4 2
a2A1920-160umBAS 4 4 4 2
a2A1920-160ucBAS 4 4 4 2
acA640-90gm 1 1 1 1
acA640-90gc 2 2 2 2
acA640-120gm 1 1 1 1
acA640-120gc 2 2 2 2
acA640-121gm 1 1 1 1
acA640-300gm 16 16 1 1
acA640-300gc 16 16 2 2
acA720-290gm 1 1 1 1
acA720-290gc 2 2 2 2
acA780-75gm 1 1 1 1
acA780-75gc 2 2 2 2
acA800-200gm 16 16 1 1
acA800-200gc 16 16 2 2
acA1280-60gm 1 1 1 1
acA1280-60gc 2 2 2 2
acA1300-22gm 1 1 1 1
acA1300-22gc 2 2 2 2
acA1300-30gm 1 1 1 1
acA1300-30gc 2 2 2 2
acA1300-60gm 1 1 1 1
acA1300-60gc 2 2 2 2
acA1300-60gmNIR 1 1 1 1
acA1300-75gm 16 16 1 1
acA1300-75gc 16 16 2 2
acA1440-73gm 1 1 1 1
acA1440-73gc 2 2 2 2
acA1600-20gm 1 1 1 1
acA1600-20gc 2 2 2 2
acA1600-60gm 1 1 1 1
acA1600-60gc 2 2 2 2
acA1920-25gm 64 1 64 1
acA1920-25gc 64 2 64 2
acA1920-40gm 1 1 1 1
acA1920-40gc 2 2 2 2
acA1920-48gm 32 32 1 1
acA1920-48gc 32 32 2 2
acA1920-50gm 1 1 1 1
acA1920-50gc 2 2 2 2
acA2000-50gm 1 1 1 1
acA2000-50gc 2 2 2 2
acA2000-50gmNIR 1 1 1 1
acA2040-25gm 1 1 1 1
acA2040-25gc 2 2 2 2
acA2040-25gmNIR 1 1 1 1
acA2040-35gm 1 1 1 1
acA2040-35gc 2 2 2 2
acA2440-20gm 1 1 1 1
acA2440-20gc 2 2 2 2
acA2500-14gm 64 1 64 1
acA2500-14gc 64 2 64 2
acA2500-20gm 32 32 1 1
acA2500-20gc 32 32 2 2
acA2500-20gmMED 32 32 1 1
acA2500-20gcMED 32 32 2 2
acA3088-16gm 376 4 320 2
acA3088-16gc 376 4 320 2
acA3800-10gm 1 1 1 1
acA3800-10gc 2 2 2 2
acA4024-8gm 8 4 5 1
acA4024-8gc 8 4 6 2
acA4096-11gm 16 1 1 1
acA4096-11gc 16 2 2 2
acA4112-8gm 16 1 1 1
acA4112-8gc 16 2 2 2
acA4600-7gc 2 2 2 2
acA5472-5gm 8 4 5 1
acA5472-5gc 8 4 6 2
acA640-750um 16 16 1 1
acA640-750uc 16 16 2 2
acA640-90um 1 1 1 1
acA640-90uc 2 2 2 2
acA640-120um 1 1 1 1
acA640-120uc 2 2 2 2
acA720-520um 1 4 1 1
acA720-520uc 2 4 2 2
acA800-510um 16 16 1 1
acA800-510uc 16 16 2 2
acA1300-200um 16 16 1 1
acA1300-200uc 16 16 2 2
acA1300-30um 1 1 1 1
acA1300-30uc 2 2 2 2
acA1440-220um 1 4 1 1
acA1440-220uc 2 4 2 2
acA1600-20um 1 1 1 1
acA1600-20uc 2 2 2 2
acA1920-25um 64a 1 64a 1
acA1920-25uc 64a 2 64a 2
acA1920-40um 4 4 1 1
acA1920-40uc 4 4 2 2
acA1920-40umMED 4 4 1 1
acA1920-40ucMED 4 4 2 2
acA1920-150um 32 32 1 1
acA1920-150uc 32 32 2 2
acA1920-155um 4 4 1 1
acA1920-155uc 4 4 2 2
acA1920-155umMED 4 4 1 1
acA1920-155ucMED 4 4 2 2
acA2040-90um 8 8 1 1
acA2040-90uc 8 8 2 2
acA2040-90umNIR 8 8 1 1
acA2000-165um 8 8 1 1
acA2000-165uc 8 8 2 2
acA2000-165umNIR 8 8 1 1
acA2040-55um 4 4 1 1
acA2040-55uc 4 4 2 2
acA2040-120um 4 4 1 1
acA2040-120uc 4 4 2 2
acA2440-35um 4 4 1 1
acA2440-35uc 4 4 2 2
acA2440-35umMED 4 4 1 1
acA2440-35ucMED 4 4 2 2
acA2440-75um 4 4 1 1
acA2440-75uc 4 4 2 2
acA2440-75umMED 4 4 1 1
acA2440-75ucMED 4 4 2 2
acA2500-14um 64a 1 64a 1
acA2500-14uc 64a 2 64a 2
acA2500-60um 32 32 1 1
acA2500-60uc 32 32 2 2
acA3088-57um 376 4 320 2
acA3088-57uc 376 4 320 2
acA3800-14um 64a 1 64a 1
acA3800-14uc 64 2 64 2
acA4024-29um 8 4 5 1
acA4024-29uc 8 4 6 2
acA4096-30um 4 4 1 1
acA4096-30uc 4 4 2 2
acA4096-30umMED 4 4 1 1
acA4096-30ucMED 4 4 2 2
acA4096-40um 4 4 1 1
acA4096-40uc 4 4 2 2
acA4096-40umMED 4 4 1 1
acA4096-40ucMED 4 4 2 2
acA4112-20um 4 4 1 1
acA4112-20uc 4 4 2 2
acA4112-20umMED 4 4 1 1
acA4112-20ucMED 4 4 2 2
acA4112-30um 4 4 1 1
acA4112-30uc 4 4 2 2
acA4112-30umMED 4 4 1 1
acA4112-30ucMED 4 4 2 2
acA4600-10uc 64 2 64 2
acA5472-17um 8 4 5 1
acA5472-17uc 8 4 6 2
boA4096-93cm tbd tbd tbd tbd
boA4096-93cc tbd tbd tbd tbd
boA4112-68cm tbd tbd tbd tbd
boA4112-68cc tbd tbd tbd tbd
daA1280-54lm 16 2 8 2
daA1280-54lc 16 2 8 2
daA1600-60lm 16 2 8 2
daA1600-60lc 16 2 8 2
daA2500-14lm 4 2 4 2
daA2500-14lc 4 2 4 2
daA2500-60mc (SD820) Image ROI feature not supported - - -
daA1280-54um 16 2 8 2
daA1280-54uc 16 2 8 2
daA1600-60um 16 2 8 2
daA1600-60uc 16 2 8 2
daA1920-15um 4 2 4 2
daA1920-30um 4 2 4 2
daA1920-30uc 4 2 4 2
daA2500-14um 4 2 4 2
daA2500-14uc 4 2 4 2
puA1280-54um 16 2 8 2
puA1280-54uc 16 2 8 2
puA1600-60um 16 2 8 2
puA1600-60uc 16 2 8 2
puA1920-30um 4 2 4 2
puA1920-30uc 4 2 4 2
puA2500-14um 4 2 4 2
puA2500-14uc 4 2 4 2

aWhen binning is enabled, the minimum width and minimum height are reduced. Values are rounded up to the nearest integer. Example: If you have configured horizontal binning by 3, the effective minimum width is 64 / 3 = 21.333 ≈ 22.

Image ROI Offsets

Camera Model

Minimum Offset X

Offset X Increment

Minimum Offset Y

Offset Y Increment

a2A1920-51gmBAS 0 4 0 2
a2A1920-51gcBAS 0 4 0 2
a2A1920-160umBAS 0 4 0 2
a2A1920-160ucBAS 0 4 0 2
acA640-90gm 0 1 0 1
acA640-90gc 0 2 0 2
acA640-120gm 0 1 0 1
acA640-120gc 0 2 0 2
acA640-121gm 0 1 0 1
acA640-300gm 0 16 0 1
acA640-300gc 0 16 0 2
acA720-290gm 0 2 0 2
acA720-290gc 0 2 0 2
acA780-75gm 0 1 0 1
acA780-75gc 0 2 0 2
acA800-200gm 0 16 0 1
acA800-200gc 0 16 0 2
acA1280-60gm 0 1 0 1
acA1280-60gc 0 2 0 2
acA1300-22gm 0 1 0 1
acA1300-22gc 0 2 0 2
acA1300-30gm 0 1 0 1
acA1300-30gc 0 2 0 2
acA1300-60gm 0 1 0 1
acA1300-60gc 0 2 0 2
acA1300-60gmNIR 0 1 0 1
acA1300-75gm 0 16 0 1
acA1300-75gc 0 16 0 2
acA1440-73gm 0 2 0 2
acA1440-73gc 0 2 0 2
acA1600-20gm 0 1 0 1
acA1600-20gc 0 2 0 2
acA1600-60gm 0 1 0 1
acA1600-60gc 0 2 0 2
acA1920-25gm 0 1 0 1
acA1920-25gc 0 2 0 2
acA1920-40gm 0 2 0 2
acA1920-40gc 0 2 0 2
acA1920-48gm 0 1 0 1
acA1920-48gc 0 2 0 2
acA1920-50gm 0 2 0 2
acA1920-50gc 0 2 0 2
acA2000-50gm 0 1 0 1
acA2000-50gc 0 2 0 2
acA2000-50gmNIR 0 1 0 1
acA2040-25gm 0 1 0 1
acA2040-25gc 0 2 0 2
acA2040-25gmNIR 0 1 0 1
acA2040-35gm 0 2 0 2
acA2040-35gc 0 2 0 2
acA2440-20gm 0 2 0 2
acA2440-20gc 0 2 0 2
acA2500-14gm 0 1 0 1
acA2500-14gc 0 2 0 2
acA2500-20gm 0 1 0 1
acA2500-20gc 0 2 0 2
acA2500-20gmMED 0 1 0 1
acA2500-20gcMED 0 2 0 2
acA3088-16gm 0 2 0 2
acA3088-16gc 0 2 0 2
acA3800-10gm 0 1 0 1
acA3800-10gc 0 2 0 2
acA4024-8gm 0 4 0 1
acA4024-8gc 0 4 0 2
acA4096-11gm 0 2 0 2
acA4096-11gc 0 2 0 2
acA4112-8gm 0 2 0 2
acA4112-8gc 0 2 0 2
acA4600-7gc 0 2 0 2
acA5472-5gm 0 4 0 1
acA5472-5gc 0 4 0 2
acA640-750um 0 16 0 1
acA640-750uc 0 16 0 2
acA640-90um 0 1 0 1
acA640-90uc 0 2 0 2
acA640-120um 0 1 0 1
acA640-120uc 0 2 0 2
acA720-520um 0 4 0 2
acA720-520uc 0 2 0 2
acA800-510um 0 16 0 1
acA800-510uc 0 16 0 2
acA1300-200um 0 16 0 1
acA1300-200uc 0 16 0 2
acA1300-30um 0 1 0 1
acA1300-30uc 0 2 0 2
acA1440-220um 0 4 0 2
acA1440-220uc 0 2 0 2
acA1600-20um 0 1 0 1
acA1600-20uc 0 2 0 2
acA1920-25um 0 1 0 1
acA1920-25uc 0 2 0 2
acA1920-40um 0 4 0 2
acA1920-40uc 0 4 0 2
acA1920-40umMED 0 4 0 2
acA1920-40ucMED 0 4 0 2
acA1920-150um 0 32 0 1
acA1920-150uc 0 32 0 2
acA1920-155um 0 4 0 1
acA1920-155uc 0 4 0 2
acA1920-155umMED 0 4 0 1
acA1920-155ucMED 0 4 0 2
acA2040-90um 0 1 0 1
acA2040-90uc 0 2 0 2
acA2040-90umNIR 0 1 0 1
acA2000-165um 0 1 0 1
acA2000-165uc 0 2 0 2
acA2000-165umNIR 0 1 0 1
acA2040-55um 0 4 0 2
acA2040-55uc 0 4 0 2
acA2040-120um 0 4 0 2
acA2040-120uc 0 4 0 2
acA2440-35um 0 4 0 2
acA2440-35uc 0 4 0 2
acA2440-35umMED 0 4 0 2
acA2440-35ucMED 0 4 0 2
acA2440-75um 0 4 0 2
acA2440-75uc 0 4 0 2
acA2440-75umMED 0 4 0 2
acA2440-75ucMED 0 4 0 2
acA2500-14um 0 1 0 1
acA2500-14uc 0 2 0 2
acA2500-60um 0 32 0 1
acA2500-60uc 0 32 0 2
acA3088-57um 0 4 0 2
acA3088-57uc 0 4 0 2
acA3800-14um 0 1 0 1
acA3800-14uc 0 2 0 2
acA4024-29um 0 4 0 1
acA4024-29uc 0 4 0 2
acA4096-30um 0 4 0 2
acA4096-30uc 0 4 0 2
acA4096-30umMED 0 4 0 2
acA4096-30ucMED 0 4 0 2
acA4096-40um 0 4 0 2
acA4096-40uc 0 4 0 2
acA4096-40umMED 0 4 0 2
acA4096-40ucMED 0 4 0 2
acA4112-20um 0 4 0 2
acA4112-20uc 0 4 0 2
acA4112-20umMED 0 4 0 2
acA4112-20ucMED 0 4 0 2
acA4112-30um 0 4 0 2
acA4112-30uc 0 4 0 2
acA4112-30umMED 0 4 0 2
acA4112-30ucMED 0 4 0 2
acA4600-10uc 0 2 0 2
acA5472-17um 0 4 0 1
acA5472-17uc 0 4 0 2
boA4096-93cm tbd tbd tbd tbd
boA4096-93cc tbd tbd tbd tbd
boA4112-68cm tbd tbd tbd tbd
boA4112-68cc tbd tbd tbd tbd
All dart BCON for LVDS camera models 0 2 0 2
All dart BCON for MIPI camera models Image ROI feature not supported - - -
All dart USB 3.0 camera models 0 2 0 2
All pulse USB 3.0 camera models 0 2 0 2

Image ROI Characteristics

Camera Model Decreasing Height Increases Frame Rate Significantly
a2A1920-51gmBAS Yes
a2A1920-51gcBAS Yes
a2A1920-160umBAS Yes
a2A1920-160ucBAS Yes
acA640-90gm Yes
acA640-90gc Yes
acA640-120gm Yes
acA640-120gc Yes
acA640-121gm Yes
acA640-300gm Yes
acA640-300gc Yes
acA720-290gm Yes
acA720-290gc Yes
acA780-75gm Yes
acA780-75gc Yes
acA800-200gm Yes
acA800-200gc Yes
acA1280-60gm Yes
acA1280-60gc Yes
acA1300-22gm Yes
acA1300-22gc Yes
acA1300-30gm Yes
acA1300-30gc Yes
acA1300-60gm Yes
acA1300-60gmNIR Yes
acA1300-60gc Yes
acA1300-75gm Yes
acA1300-75gc Yes
acA1440-73gm Yes
acA1440-73gc Yes
acA1600-20gm Yes
acA1600-20gc Yes
acA1600-60gm Yes
acA1600-60gc Yes
acA1920-25gm Yes
acA1920-25gc Yes
acA1920-40gm Yes
acA1920-40gc Yes
acA1920-48gm Yes
acA1920-48gc Yes
acA1920-50gm Yes
acA1920-50gc Yes
acA2000-50gm Yes
acA2000-50gmNIR Yes
acA2000-50gc Yes
acA2040-25gm Yes
acA2040-25gmNIR Yes
acA2040-25gc Yes
acA2040-35gm Yes
acA2040-35gc Yes
acA2440-20gm Yes
acA2440-20gc Yes
acA2500-14gm Yes
acA2500-14gc Yes
acA2500-20gm Yes
acA2500-20gc Yes
acA2500-20gmMED Yes
acA2500-20gcMED Yes
acA3088-16gm Yes
acA3088-16gc Yes
acA3800-10gm Yes
acA3800-10gc Yes
acA4024-8gm No
acA4024-8gc No
acA4096-11gm Yes
acA4096-11gc Yes
acA4112-8gm Yes
acA4112-8gc Yes
acA4600-7gc Yes
acA5472-5gm No
acA5472-5gc No
acA640-750um Yes
acA640-750uc Yes
acA640-90um Yes
acA640-90uc Yes
acA640-120um Yes
acA640-120uc Yes
acA720-520um Yes
acA720-520uc Yes
acA800-510um Yes
acA800-510uc Yes
acA1300-200um Yes
acA1300-200uc Yes
acA1300-30um Yes
acA1300-30uc Yes
acA1440-220um Yes
acA1440-220uc Yes
acA1600-20um Yes
acA1600-20uc Yes
acA1920-25um Yes
acA1920-25uc Yes
acA1920-40um Yes
acA1920-40uc Yes
acA1920-40umMED Yes
acA1920-40ucMED Yes
acA1920-150um Yes
acA1920-150uc Yes
acA1920-155um Yes
acA1920-155uc Yes
acA1920-155umMED Yes
acA1920-155ucMED Yes
acA2040-90um Yes
acA2040-90umNIR Yes
acA2040-90uc Yes
acA2000-165um Yes
acA2000-165umNIR Yes
acA2000-165uc Yes
acA2040-55um Yes
acA2040-55uc Yes
acA2040-120um Yes
acA2040-120uc Yes
acA2440-35um Yes
acA2440-35uc Yes
acA2440-35umMED Yes
acA2440-35ucMED Yes
acA2440-75um Yes
acA2440-75uc Yes
acA2440-75umMED Yes
acA2440-75ucMED Yes
acA2500-14um Yes
acA2500-14uc Yes
acA2500-60um Yes
acA2500-60uc Yes
acA3088-57um Yes
acA3088-57uc Yes
acA3800-14um Yes
acA3800-14uc Yes
acA4024-29um No
acA4024-29uc No
acA4096-30um Yes
acA4096-30uc Yes
acA4096-30umMED Yes
acA4096-30ucMED Yes
acA4096-40um Yes
acA4096-40uc Yes
acA4096-40umMED Yes
acA4096-40ucMED Yes
acA4112-20um Yes
acA4112-20uc Yes
acA4112-20umMED Yes
acA4112-20ucMED Yes
acA4112-30um Yes
acA4112-30uc Yes
acA4112-30umMED Yes
acA4112-30ucMED Yes
acA4600-10uc Yes
acA5472-17um No
acA5472-17uc No
boA4096-93cm tbd
boA4096-93cc tbd
boA4112-68cm tbd
boA4112-68cc tbd
All dart BCON for LVDS camera models Yes
All dart BCON for MIPI camera models Image ROI feature not supported
All dart USB 3.0 camera models Yes
All pulse USB 3.0 camera models Yes

Sample Code

// Set the width to the maximum value
int64_t maxWidth = camera.Width.GetMax();
camera.Width.SetValue(maxWidth);
// Set the height to 500
camera.Height.SetValue(500);
// Set the offset to 0,0
camera.OffsetX.SetValue(0);
camera.OffsetY.SetValue(0);
// 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 = CIntegerPtr(nodemap.GetNode("Width"))->GetMax();
CIntegerPtr(nodemap.GetNode("Width"))->SetValue(maxWidth);
// Set the height to 500
CIntegerPtr(nodemap.GetNode("Height"))->SetValue(500);
// Set the offset to 0,0
CIntegerPtr(nodemap.GetNode("OffsetX"))->SetValue(0);
CIntegerPtr(nodemap.GetNode("OffsetY"))->SetValue(0);
// Set the width to the maximum value
int64_t maxWidth = CIntegerPtr(nodemap.GetNode("WidthMax"))->GetValue();
CIntegerPtr(nodemap.GetNode("Width"))->SetValue(maxWidth);
// Set the height to 500
CIntegerPtr(nodemap.GetNode("Height"))->SetValue(500);
// Set the offset to 0
CIntegerPtr(nodemap.GetNode("OffsetX"))->SetValue(0);
CIntegerPtr(nodemap.GetNode("OffsetY"))->SetValue(0);
// Set the width to the maximum value
Int64 maxWidth = camera.Parameters[PLCamera.Width].GetMaximum();
camera.Parameters[PLCamera.Width].SetValue(maxWidth);
// Set the height to 500
camera.Parameters[PLCamera.Height].SetValue(500);
// Set the offset to 0,0
camera.Parameters[PLCamera.OffsetX].SetValue(0);
camera.Parameters[PLCamera.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);
// Set the width to the maximum value
Int64 maxWidth = Pylon.DeviceGetIntegerFeatureMax(hdev, "Width");
Pylon.DeviceSetIntegerFeature(hdev, "Width", maxWidth);
// Set the height to 500
Pylon.DeviceSetIntegerFeature(hdev, "Height", 500);
// Set the offset to 0,0
Pylon.DeviceSetIntegerFeature(hdev, "OffsetX", 0);
Pylon.DeviceSetIntegerFeature(hdev, "OffsetY", 0);
// Set the width to the maximum value
Int64 maxWidth = Pylon.DeviceGetIntegerFeature(hdev, "WidthMax");
Pylon.DeviceSetIntegerFeature(hdev, "Width", maxWidth);
// Set the height to 500
Pylon.DeviceSetIntegerFeature(hdev, "Height", 500);
// Set the offset to 0
Pylon.DeviceSetIntegerFeature(hdev, "OffsetX", 0);
Pylon.DeviceSetIntegerFeature(hdev, "OffsetY", 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 = PylonDeviceGetIntegerFeatureMax(hdev, "Width", &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,0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetX", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetY", 0);
CHECK(errRes);
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.