Stacked Zone Imaging#
Only the pixel data from those zones will be transmitted. This increases the camera's frame rate.
Using the Feature#
Prerequisites#
- Center X and Center Y must be disabled.
- Decimation must be disabled, i.e., the horizontal and vertical decimation factor must be set to 1.
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.
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.
Configuring Stacked Zone Imaging#
- Set the StackedZoneImagingEnable parameter to true.
The Stacked Zone Imaging feature is enabled and can be configured. - 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 StackedZoneImagingIndex parameter to the zone that you want to configure, e.g., 1.
- Set the StackedZoneImagingZoneEnable parameter to true to enable the zone selected in step 4.
- Set the StackedZoneImagingZoneOffsetY parameter to the desired vertical offset. The value is applied to the zone selected in step 4.
- Set the StackedZoneImagingZoneHeight parameter to the desired zone height.
The value is applied to the zone selected in step 4. - 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
- OffsetY
- 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 CBooleanPtr(nodemap.GetNode("StackedZoneImagingEnable"))->SetValue(true); // Configure width and offset X for all zones CIntegerPtr(nodemap.GetNode("Width"))->SetValue(200); CIntegerPtr(nodemap.GetNode("OffsetX"))->SetValue(100); // Select zone 1 CIntegerPtr(nodemap.GetNode("StackedZoneImagingIndex"))->SetValue(1); // Enable the selected zone CBooleanPtr(nodemap.GetNode("StackedZoneImagingZoneEnable"))->SetValue(true); // Set the vertical offset for the selected zone CIntegerPtr(nodemap.GetNode("StackedZoneImagingZoneOffsetY"))->SetValue(100); // Set the height for the selected zone CIntegerPtr(nodemap.GetNode("StackedZoneImagingZoneHeight"))->SetValue(100); // Select zone 2 CIntegerPtr(nodemap.GetNode("StackedZoneImagingIndex"))->SetValue(2); // Enable the selected zone CBooleanPtr(nodemap.GetNode("StackedZoneImagingZoneEnable"))->SetValue(true); // Set the offset Y for the selected zone CIntegerPtr(nodemap.GetNode("StackedZoneImagingZoneOffsetY"))->SetValue(250); // Set the height for the selected zone CIntegerPtr(nodemap.GetNode("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);
// Enable stacked zone imaging Pylon.DeviceSetBooleanFeature(hdev, "StackedZoneImagingEnable", true); // Configure width and offset X for all zones Pylon.DeviceSetIntegerFeature(hdev, "Width", 200); Pylon.DeviceSetIntegerFeature(hdev, "OffsetX", 100); // Select zone 1 Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingIndex", 1); // Enable the selected zone Pylon.DeviceSetBooleanFeature(hdev, "StackedZoneImagingZoneEnable", true); // Set the vertical offset for the selected zone Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingZoneOffsetY", 100); // Set the height for the selected zone Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingZoneHeight", 100); // Select zone 2 Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingIndex", 2); // Enable the selected zone Pylon.DeviceSetBooleanFeature(hdev, "StackedZoneImagingZoneEnable", true); // Set the offset Y for the selected zone Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingZoneOffsetY", 250); // Set the height for the selected zone Pylon.DeviceSetIntegerFeature(hdev, "StackedZoneImagingZoneHeight", 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);
You can also use the pylon Viewer to easily set the parameters.