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.
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:
Make sure the camera is idle, i.e., not capturing images.
If you are using an ace Classic/U/L camera, set the CenterX and CenterY parameters to false.
Use the following parameters to specify the size of the image ROI:
Width
Height
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:
Info
For area scan cameras:
On most cameras, decreasing the size (especially the height) of the image ROI increases the camera's maximum frame rate significantly.
If the Binning feature is enabled, the settings for the image ROI refer to the binned lines and columns and not to the physical lines in the sensor.
On boA5120-230cc and boA5120-230cm cameras, the OffsetY parameter is not available. The position of the image ROI is always centered in vertically.
On boA13440-17cm cameras, the position of the image ROI is always centered horizontally and vertically. If you change the width of the image ROI, the OffsetX parameter value adapts automatically so that the image ROI stays centered horizontally. If you change the height of the image ROI, the OffsetY parameter value adapts automatically so that the image ROI stays centered vertically. Both the OffsetX and OffsetY parameters are read-only.
Info
For line scan cameras:
On all racer 2 cameras, the OffsetY parameter is not available.
On racer 2 cameras with CXP interface, the Height parameter is automatically set to 1 and can't be changed. For these cameras, the single lines are transmitted to the frame grabber individually. The frame grabber then combines them into a frame.
On racer 2 S cameras with GigE or 5GigE interface, you can add several lines to build a frame. Use the Height parameter to define the maximum height of the image ROI, i.e., the height of the resulting frame that is transmitted to the host computer. The maximum number of lines per frame depends on the camera model:
For r2L2048-29gc, r2L2048-58gm, r2L2048-62g5c, r2L2048-172g5m, r2L4096-29gm, and r2L4096-84g5m cameras: 12000
For r2L4096-14gc and r2L4096-42g5c cameras: 10000
Info
For racer 2 S GigE cameras, you can use the Counter and Data Chunks features, in combination with the trigger settings, to specify which lines belong to a frame and which frames belong to the correct test object.
When 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.
// Set the width to the maximum valueint64_tmaxWidth=camera.Width.GetMax();camera.Width.SetValue(maxWidth);// Set the height to 500camera.Height.SetValue(500);// Set the offset to 0,0camera.OffsetX.SetValue(0);camera.OffsetY.SetValue(0);
INodeMap&nodemap=camera.GetNodeMap();// Set the width to the maximum valueint64_tmaxWidth=CIntegerParameter(nodemap,"Width").GetMax();CIntegerParameter(nodemap,"Width").SetValue(maxWidth);// Set the height to 500CIntegerParameter(nodemap,"Height").SetValue(500);// Set the offset to 0,0CIntegerParameter(nodemap,"OffsetX").SetValue(0);CIntegerParameter(nodemap,"OffsetY").SetValue(0);
// Set the width to the maximum valueInt64maxWidth=camera.Parameters[PLCamera.Width].GetMaximum();camera.Parameters[PLCamera.Width].SetValue(maxWidth);// Set the height to 500camera.Parameters[PLCamera.Height].SetValue(500);// Set the offset to 0,0camera.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_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods */int64_tmaxWidth=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);
# Set the width to the maximum valuemaxWidth=camera.Width.Maxcamera.Width.Value=maxWidth# Set the height to 500camera.Height.Value=500# Set the offset to 0,0camera.OffsetX.Value=0camera.OffsetY.Value=0
// Set the width to the maximum valueint64_tmaxWidth=camera.WidthMax.GetValue();camera.Width.SetValue(maxWidth);// Set the height to 500camera.Height.SetValue(500);// Set the offset to 0camera.OffsetX.SetValue(0);camera.OffsetY.SetValue(0);
INodeMap&nodemap=camera.GetNodeMap();// Set the width to the maximum valueint64_tmaxWidth=CIntegerParameter(nodemap,"WidthMax").GetValue();CIntegerParameter(nodemap,"Width").SetValue(maxWidth);// Set the height to 500CIntegerParameter(nodemap,"Height").SetValue(500);// Set the offset to 0CIntegerParameter(nodemap,"OffsetX").SetValue(0);CIntegerParameter(nodemap,"OffsetY").SetValue(0);
// Set the width to the maximum valueInt64maxWidth=camera.Parameters[PLCamera.WidthMax].GetValue();camera.Parameters[PLCamera.Width].SetValue(maxWidth);// Set the height to 500camera.Parameters[PLCamera.Height].SetValue(500);// Set the offset to 0camera.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_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods */int64_tmaxWidth=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 valuemaxWidth=camera.WidthMax.Valuecamera.Width.Value=maxWidth# Set the height to 500camera.Height.Value=500# Set the offset to 0camera.OffsetX.Value=0camera.OffsetY.Value=0