The Stacked Zone Imaging feature allows you to define up to eight vertically aligned zones of equal width on the sensor array. 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 ROI 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.
You can enable the zones in any order you like. For example, you can enable zones 2, 4, and 6 and disable zones 1, 3, and 5.
You can place the zones freely around the sensor. For example, you can place zone 1 near the bottom, zone 3 near the top, and zone 2 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.
You can set the StackedZoneImagingZoneOffsetY and StackedZoneImagingZoneHeight parameters in increments of one on mono cameras, and in increments of two on color cameras. For color cameras, the parameter values must be even.
When the Stacked Zone Imaging feature is enabled, 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.
CenterY
If you have enabled the Stacked Zone Imaging feature and then enable binning, the positions and the sizes of the stacked zones 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 Zones Imaging 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.
// Enable stacked zone imagingcamera.StackedZoneImagingEnable.SetValue(true);// Configure width and offset X for all zonescamera.Width.SetValue(200);camera.OffsetX.SetValue(100);// Select zone 1camera.StackedZoneImagingIndex.SetValue(1);// Enable the selected zonecamera.StackedZoneImagingZoneEnable.SetValue(true);// Set the vertical offset for the selected zonecamera.StackedZoneImagingZoneOffsetY.SetValue(100);// Set the height for the selected zonecamera.StackedZoneImagingZoneHeight.SetValue(100);// Select zone 2camera.StackedZoneImagingIndex.SetValue(2);// Enable the selected zonecamera.StackedZoneImagingZoneEnable.SetValue(true);// Set the offset Y for the selected zonecamera.StackedZoneImagingZoneOffsetY.SetValue(250);// Set the height for the selected zonecamera.StackedZoneImagingZoneHeight.SetValue(200);
INodeMap&nodemap=camera.GetNodeMap();// Enable stacked zone imagingCBooleanParameter(nodemap,"StackedZoneImagingEnable").SetValue(true);// Configure width and offset X for all zonesCIntegerParameter(nodemap,"Width").SetValue(200);CIntegerParameter(nodemap,"OffsetX").SetValue(100);// Select zone 1CIntegerParameter(nodemap,"StackedZoneImagingIndex").SetValue(1);// Enable the selected zoneCBooleanParameter(nodemap,"StackedZoneImagingZoneEnable").SetValue(true);// Set the vertical offset for the selected zoneCIntegerParameter(nodemap,"StackedZoneImagingZoneOffsetY").SetValue(100);// Set the height for the selected zoneCIntegerParameter(nodemap,"StackedZoneImagingZoneHeight").SetValue(100);// Select zone 2CIntegerParameter(nodemap,"StackedZoneImagingIndex").SetValue(2);// Enable the selected zoneCBooleanParameter(nodemap,"StackedZoneImagingZoneEnable").SetValue(true);// Set the offset Y for the selected zoneCIntegerParameter(nodemap,"StackedZoneImagingZoneOffsetY").SetValue(250);// Set the height for the selected zoneCIntegerParameter(nodemap,"StackedZoneImagingZoneHeight").SetValue(200);
// Enable stacked zone imagingcamera.Parameters[PLCamera.StackedZoneImagingEnable].SetValue(true);// Configure width and offset X for all zonescamera.Parameters[PLCamera.Width].SetValue(200);camera.Parameters[PLCamera.OffsetX].SetValue(100);// Select zone 1camera.Parameters[PLCamera.StackedZoneImagingIndex].SetValue(1);// Enable the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneEnable].SetValue(true);// Set the vertical offset for the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneOffsetY].SetValue(100);// Set the height for the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneHeight].SetValue(100);// Select zone 2camera.Parameters[PLCamera.StackedZoneImagingIndex].SetValue(2);// Enable the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneEnable].SetValue(true);// Set the offset Y for the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneOffsetY].SetValue(250);// Set the height for the selected zonecamera.Parameters[PLCamera.StackedZoneImagingZoneHeight].SetValue(200);
/* 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 *//* Enable stacked zone imaging */errRes=PylonDeviceSetBooleanFeature(hdev,"StackedZoneImagingEnable",1);CHECK(errRes);/* Configure width and offset X for all zones */errRes=PylonDeviceSetIntegerFeature(hdev,"Width",200);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"OffsetX",100);CHECK(errRes);/* Select zone 1 */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingIndex",1);CHECK(errRes);/* Enable the selected zone */errRes=PylonDeviceSetBooleanFeature(hdev,"StackedZoneImagingZoneEnable",1);CHECK(errRes);/* Set the vertical offset for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingZoneOffsetY",100);CHECK(errRes);/* Set the height for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingZoneHeight",100);CHECK(errRes);/* Select zone 2 */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingIndex",2);CHECK(errRes);/* Enable the selected zone */errRes=PylonDeviceSetBooleanFeature(hdev,"StackedZoneImagingZoneEnable",1);CHECK(errRes);/* Set the offset Y for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingZoneOffsetY",250);CHECK(errRes);/* Set the height for the selected zone */errRes=PylonDeviceSetIntegerFeature(hdev,"StackedZoneImagingZoneHeight",200);CHECK(errRes);
# Enable stacked zone imagingcamera.StackedZoneImagingEnable.Value=True# Configure width and offset X for all zonescamera.Width.Value=200camera.OffsetX.Value=100# Select zone 1camera.StackedZoneImagingIndex.Value=1# Enable the selected zonecamera.StackedZoneImagingZoneEnable.Value=True# Set the vertical offset for the selected zonecamera.StackedZoneImagingZoneOffsetY.Value=100# Set the height for the selected zonecamera.StackedZoneImagingZoneHeight.Value=100# Select zone 2camera.StackedZoneImagingIndex.Value=2# Enable the selected zonecamera.StackedZoneImagingZoneEnable.Value=True# Set the offset Y for the selected zonecamera.StackedZoneImagingZoneOffsetY.Value=250# Set the height for the selected zonecamera.StackedZoneImagingZoneHeight.Value=200