The Stacked ROI camera feature allows you to define multiple zones of varying heights and equal width on the sensor array that will be transmitted as a single image.
Only the pixel data from those zones will be transmitted. This increases the camera's frame rate.
The Stacked ROI feature allows you to define vertically aligned zones of equal width on the sensor array. The maximum number of zones depends on your camera model.
When an image is acquired, only the pixel information from within the defined zones is read out of the sensor. The pixel information is then stacked together and transmitted as a single image.
The zones always have the same width and are vertically aligned. To configure the zones, Basler recommends the following procedure:
Define a width and a horizontal offset that is valid for all zones.
Define the heights and vertical offsets of the individual zones.
Make sure the camera is idle, i.e., not capturing images.
Set the OffsetX parameter to the desired horizontal offset. The value is applied to all zones.
Set the Width parameter to the desired zone width. The value is applied to all zones.
Set the ROIZoneSelector parameter to the zone that you want to configure, e.g., Zone0.
Set the ROIZoneOffset parameter to the desired vertical offset. The value is applied to the zone selected in step 4.
Set the ROIZoneSize parameter to the desired zone height. The value is applied to the zone selected in step 4.
Set the ROIZoneMode parameter to On to enable the zone.
Repeat steps 4 to 7 for every zone you want to configure.
Considerations When Using the Stacked ROI Feature#
You can enable the zones in any order you like. For example, you can enable zones 1, 3, and 5 and disable zones 0, 2, and 4.
You can place the zones freely around the sensor. For example, you can place zone 0 near the bottom, zone 2 near the top, and zone 1 in the middle. However, the camera always starts reading out and transmitting pixel data from the topmost zone on the sensor and then proceeds towards the bottom.
You can define vertically overlapping zones. If two zones overlap, they are transmitted as a single merged zone. The pixel data from the area of overlap is read out and transmitted only once.
When at least one zone has been defined, the following parameters become read-only:
OffsetY: The parameter is set to the vertical offset of the topmost zone.
Height: The parameter is set to the height of the final image, i.e., the sum of the heights of all zones.
If you have configured a zone and then enable binning, the position and the size of the zone are adapted automatically. The parameter values are divided by the corresponding binning factor and rounded down.
If you disable all zones after using the Stacked ROI feature, the size and position of the image ROI is set to the size and position of the zone that was disabled last. For example, assume zones 0, 1, and 2 are enabled. Then, you disable the zones in the following order: 2, 1, 0. As a result, the size and position of the image ROI is set to the size and position of the disabled zone 0.
// Configure width and offset X for all zonescamera.Width.SetValue(200);camera.OffsetX.SetValue(100);// Select zone 0camera.ROIZoneSelector.SetValue(ROIZoneSelector_Zone0);// Set the vertical offset for the selected zonecamera.ROIZoneOffset.SetValue(100);// Set the height for the selected zonecamera.ROIZoneSize.SetValue(100);// Enable the selected zonecamera.ROIZoneMode.SetValue(ROIZoneMode_On);// Select zone 1camera.ROIZoneSelector.SetValue(ROIZoneSelector_Zone1);// Set the vertical offset for the selected zonecamera.ROIZoneOffset.SetValue(250);// Set the height for the selected zonecamera.ROIZoneSize.SetValue(200);// Enable the selected zonecamera.ROIZoneMode.SetValue(ROIZoneMode_On);
INodeMap&nodemap=camera.GetNodeMap();// Configure width and offset X for all zonesCIntegerParameter(nodemap,"Width").SetValue(200);CIntegerParameter(nodemap,"OffsetX").SetValue(100);// Select zone 0CEnumParameter(nodemap,"ROIZoneSelector").SetValue("Zone0");// Set the vertical offset for the selected zoneCIntegerParameter(nodemap,"ROIZoneOffset").SetValue(100);// Set the height for the selected zoneCIntegerParameter(nodemap,"ROIZoneSize").SetValue(100);// Enable the selected zoneCEnumParameter(nodemap,"ROIZoneMode").SetValue("On");// Select zone 1CEnumParameter(nodemap,"ROIZoneSelector").SetValue("Zone1");// Set the vertical offset for the selected zoneCIntegerParameter(nodemap,"ROIZoneOffset").SetValue(250);// Set the height for the selected zoneCIntegerParameter(nodemap,"ROIZoneSize").SetValue(200);// Enable the selected zoneCEnumParameter(nodemap,"ROIZoneMode").SetValue("On");
// Configure width and offset X for all zonescamera.Parameters[PLCamera.Width].SetValue(200);camera.Parameters[PLCamera.OffsetX].SetValue(100);// Select zone 0camera.Parameters[PLCamera.ROIZoneSelector].SetValue(PLCamera.ROIZoneSelector.Zone0);// Set the vertical offset for the selected zonecamera.Parameters[PLCamera.ROIZoneOffset].SetValue(100);// Set the height for the selected zonecamera.Parameters[PLCamera.ROIZoneSize].SetValue(100);// Enable the selected zonecamera.Parameters[PLCamera.ROIZoneMode].SetValue(PLCamera.ROIZoneMode.On);// Select zone 1camera.Parameters[PLCamera.ROIZoneSelector].SetValue(PLCamera.ROIZoneSelector.Zone1);// Set the vertical offset for the selected zonecamera.Parameters[PLCamera.ROIZoneOffset].SetValue(250);// Set the height for the selected zonecamera.Parameters[PLCamera.ROIZoneSize].SetValue(200);// Enable the selected zonecamera.Parameters[PLCamera.ROIZoneMode].SetValue(PLCamera.ROIZoneMode.On);
/* 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 *//* Configure width and offset X for all zones */errRes=PylonDeviceSetIntegerFeature(hdev,"Width",200);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"OffsetX",100);CHECK(errRes);/* Select zone 0 */errRes=PylonDeviceFeatureFromString(hdev,"ROIZoneSelector","Zone0");CHECK(errRes);/* Set the vertical offset for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"ROIZoneOffset",100);CHECK(errRes);/* Set the height for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"ROIZoneSize",100);CHECK(errRes);/* Enable the selected zone */errRes=PylonDeviceFeatureFromString(hdev,"ROIZoneMode","On");CHECK(errRes);/* Select zone 1 */errRes=PylonDeviceFeatureFromString(hdev,"ROIZoneSelector","Zone1");CHECK(errRes);/* Set the vertical offset for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"ROIZoneOffset",250);CHECK(errRes);/* Set the height for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"ROIZoneSize",200);CHECK(errRes);/* Enable the selected zone */errRes=PylonDeviceFeatureFromString(hdev,"ROIZoneMode","On");CHECK(errRes);
# Configure width and offset X for all zonescamera.Width.Value=200camera.OffsetX.Value=100# Select zone 0camera.ROIZoneSelector.Value="Zone0"# Set the vertical offset for the selected zonecamera.ROIZoneOffset.Value=100# Set the height for the selected zonecamera.ROIZoneSize.Value=100# Enable the selected zonecamera.ROIZoneMode.Value="On"# Select zone 1camera.ROIZoneSelector.Value="Zone1"# Set the vertical offset for the selected zonecamera.ROIZoneOffset.Value=250# Set the height for the selected zonecamera.ROIZoneSize.Value=200# Enable the selected zonecamera.ROIZoneMode.Value="On"