Skip to content

Sensor Bit Depth#

The Sensor Bit Depth camera feature allows you to change the bit depth of the data output by the image sensor.

Decreasing the sensor bit depth can increase the camera's frame rate. Increasing the sensor bit depth can increase image quality.

Using the Feature#

Why Use Sensor Bit Depth#

The sensor bit depth defines the bit depth of the data output by the image sensor. All further image processing performed by the camera is based on this data.

When setting the sensor bit depth, the following guidelines apply:

  • For optimum image quality, set the sensor bit depth to a high value.
    A higher sensor bit depth can improve image quality because the camera's internal image calculations are based on a higher bit depth.
  • For optimum performance, set the sensor bit depth to a low value.
    A lower sensor bit depth can improve performance because the sensor readout time is shorter.

Sensor Bit Depth Mode#

The sensor bit depth mode allows you to define whether the sensor bit depth can be set independently of the pixel format used. You can set the BslSensorBitDepthMode parameter to one of the following values:

  • Auto: The sensor bit depth is automatically adjusted depending on the pixel format used. This is the default setting. For example, if you set the pixel format to Bayer 12, the sensor bit depth is automatically set to 12 bit.
  • Manual: The sensor bit depth can be set independently of the pixel format used. For example, you can configure the camera to output 8-bit image data based on 12-bit sensor data (pixel format = Mono 8, sensor bit depth = 12 bit).

Info

  • On a2A1920, boA4096, and boA4112 cameras, if you set the BslSensorBitDepthMode parameter to Auto and select an 8-bit pixel format (e.g., Mono 8), the sensor bit depth is set to 10 bit. This improves image quality without sacrificing performance.
  • On boA4096 and boA4112 cameras, setting the sensor bit depth to 8 bit has the following effects:
    • Full well capacity reduced by a factor of 1/4
    • Reduced dynamic range
    • Higher frame rate

Setting the Sensor Bit Depth#

  1. Set the BslSensorBitDepthMode parameter to Manual.
  2. Set the BslSensorBitDepth parameter to the desired value.
    For example, setting the parameter to Bpp12 sets a bit depth of 12 bpp (bits per pixel).

Sample Code#

// Set the pixel format to Mono 8
camera.PixelFormat.SetValue(PixelFormat_Mono8);
// Set the sensor bit depth mode to Manual
camera.BslSensorBitDepthMode.SetValue(BslSensorBitDepthMode_Manual);
// Set the sensor bit depth to 8 bit
camera.BslSensorDataWidth.SetValue(BslSensorDataWidth_Bpp8);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumerationPtr(nodemap.GetNode("PixelFormat"))->FromString("Mono8");
// Set the sensor bit depth mode to Manual
CEnumerationPtr(nodemap.GetNode("BslSensorBitDepthMode"))->FromString("Manual");
// Set the sensor bit depth to 8 bit
CEnumerationPtr(nodemap.GetNode("BslSensorDataWidth"))->FromString("Bpp8");
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8");
// Set the sensor bit depth mode to Manual
CEnumParameter(nodemap, "BslSensorBitDepthMode").SetValue("Manual");
// Set the sensor bit depth to 8 bit
CEnumParameter(nodemap, "BslSensorDataWidth").SetValue("Bpp8");
// Set the pixel format to Mono 8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono8);
// Set the sensor bit depth mode to Manual
camera.Parameters[PLCamera.BslSensorBitDepthMode].SetValue(PLCamera.BslSensorBitDepthMode.Manual);
// Set the sensor bit depth to 8 bit
camera.Parameters[PLCamera.BslSensorDataWidth].SetValue(PLCamera.BslSensorDataWidth.Bpp8);
// Set the pixel format to Mono 8
Pylon.DeviceFeatureFromString(hdev, "PixelFormat", "Mono8");
// Set the sensor bit depth mode to Manual
Pylon.DeviceFeatureFromString(hdev, "BslSensorBitDepthMode", "Manual");
// Set the sensor bit depth to 8 bit
Pylon.DeviceFeatureFromString(hdev, "BslSensorDataWidth", "Bpp8");
/* 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 */
/* Set the pixel format to Mono 8 */
errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "Mono8");
CHECK(errRes);
/* Set the sensor bit depth mode to Manual */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorBitDepthMode", "Manual");
CHECK(errRes);
/* Set the sensor bit depth to 8 bit */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorDataWidth", "Bpp8");
CHECK(errRes);

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