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.

You can set the sensor bit depth 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).

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.

Setting the Sensor Bit Depth#

To set the sensor bit depth, set the BslSensorBitDepth parameter to the desired value. For example, setting the parameter to Bpp8 sets a bit depth of 8 bpp (bits per pixel).

Sample Code#

// Set the pixel format to Mono 8
camera.PixelFormat.SetValue(PixelFormat_Mono8);
// 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 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 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 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 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 to 8 bit */
errRes = PylonDeviceFeatureFromString(hdev, "BslSensorDataWidth", "Bpp8");
CHECK(errRes);

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