Skip to content

Stacked Zone Imaging#

The Stacked Zone Imaging camera feature allows you to define up to eight zones 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.

Using the Feature#

How It Works#

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.

Stacked Zone Imaging Example

The zones always have the same width and are vertically aligned. To configure the ROI zones, Basler recommends the following procedure:

  1. Define a width and a horizontal offset that is valid for all zones.
  2. Define the heights and vertical offsets of the individual zones.

Configuring Stacked Zone Imaging#

  1. Disable the Center X and Center Y and Decimation features, if available.
  2. Set the StackedZoneImagingEnable parameter to true.
    The Stacked Zone Imaging feature is enabled and can be configured.
  3. Set the OffsetX parameter to the desired horizontal offset. The value is applied to all zones.
  4. Set the Width parameter to the desired zone width. The value is applied to all zones.
  5. Set the StackedZoneImagingIndex parameter to the zone that you want to configure, e.g., 1.
  6. Set the StackedZoneImagingZoneEnable parameter to true to enable the zone selected in step 4.
  7. Set the StackedZoneImagingZoneOffsetY parameter to the desired vertical offset. The value is applied to the zone selected in step 4.
  8. Set the StackedZoneImagingZoneHeight parameter to the desired zone height.
    The value is applied to the zone selected in step 4.
  9. Repeat steps 4 to 7 for every zone you want to configure.

Considerations When Using Stacked Zone Imaging#

  • 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.

Sample Code#

// Enable stacked zone imaging
camera.StackedZoneImagingEnable.SetValue(true);
// Configure width and offset X for all zones
camera.Width.SetValue(200);
camera.OffsetX.SetValue(100);
// Select zone 1
camera.StackedZoneImagingIndex.SetValue(1);
// Enable the selected zone
camera.StackedZoneImagingZoneEnable.SetValue(true);
// Set the vertical offset for the selected zone
camera.StackedZoneImagingZoneOffsetY.SetValue(100);
// Set the height for the selected zone
camera.StackedZoneImagingZoneHeight.SetValue(100);
// Select zone 2
camera.StackedZoneImagingIndex.SetValue(2);
// Enable the selected zone
camera.StackedZoneImagingZoneEnable.SetValue(true);
// Set the offset Y for the selected zone
camera.StackedZoneImagingZoneOffsetY.SetValue(250);
// Set the height for the selected zone
camera.StackedZoneImagingZoneHeight.SetValue(200);
INodeMap& nodemap = camera.GetNodeMap();
// Enable stacked zone imaging
CBooleanParameter(nodemap, "StackedZoneImagingEnable").SetValue(true);
// Configure width and offset X for all zones
CIntegerParameter(nodemap, "Width").SetValue(200);
CIntegerParameter(nodemap, "OffsetX").SetValue(100);
// Select zone 1
CIntegerParameter(nodemap, "StackedZoneImagingIndex").SetValue(1);
// Enable the selected zone
CBooleanParameter(nodemap, "StackedZoneImagingZoneEnable").SetValue(true);
// Set the vertical offset for the selected zone
CIntegerParameter(nodemap, "StackedZoneImagingZoneOffsetY").SetValue(100);
// Set the height for the selected zone
CIntegerParameter(nodemap, "StackedZoneImagingZoneHeight").SetValue(100);
// Select zone 2
CIntegerParameter(nodemap, "StackedZoneImagingIndex").SetValue(2);
// Enable the selected zone
CBooleanParameter(nodemap, "StackedZoneImagingZoneEnable").SetValue(true);
// Set the offset Y for the selected zone
CIntegerParameter(nodemap, "StackedZoneImagingZoneOffsetY").SetValue(250);
// Set the height for the selected zone
CIntegerParameter(nodemap, "StackedZoneImagingZoneHeight").SetValue(200);
// Enable stacked zone imaging
camera.Parameters[PLCamera.StackedZoneImagingEnable].SetValue(true);
// Configure width and offset X for all zones
camera.Parameters[PLCamera.Width].SetValue(200);
camera.Parameters[PLCamera.OffsetX].SetValue(100);
// Select zone 1
camera.Parameters[PLCamera.StackedZoneImagingIndex].SetValue(1);
// Enable the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneEnable].SetValue(true);
// Set the vertical offset for the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneOffsetY].SetValue(100);
// Set the height for the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneHeight].SetValue(100);
// Select zone 2
camera.Parameters[PLCamera.StackedZoneImagingIndex].SetValue(2);
// Enable the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneEnable].SetValue(true);
// Set the offset Y for the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneOffsetY].SetValue(250);
// Set the height for the selected zone
camera.Parameters[PLCamera.StackedZoneImagingZoneHeight].SetValue(200);
/* 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 */
/* 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 imaging
camera.StackedZoneImagingEnable.Value = True
# Configure width and offset X for all zones
camera.Width.Value = 200
camera.OffsetX.Value = 100
# Select zone 1
camera.StackedZoneImagingIndex.Value = 1
# Enable the selected zone
camera.StackedZoneImagingZoneEnable.Value = True
# Set the vertical offset for the selected zone
camera.StackedZoneImagingZoneOffsetY.Value = 100
# Set the height for the selected zone
camera.StackedZoneImagingZoneHeight.Value = 100
# Select zone 2
camera.StackedZoneImagingIndex.Value = 2
# Enable the selected zone
camera.StackedZoneImagingZoneEnable.Value = True
# Set the offset Y for the selected zone
camera.StackedZoneImagingZoneOffsetY.Value = 250
# Set the height for the selected zone
camera.StackedZoneImagingZoneHeight.Value = 200

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