Skip to content

Transfer Bit Depth#

The Transfer Bit Depth camera feature allows you to change the bit depth used for internal image processing.

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

Using the Feature#

Why Use Transfer Bit Depth#

The transfer bit depth allows you to change the bit depth of the data to be transferred during internal image processing. This can be useful if changing the sensor bit depth is not recommended due to a sensor's specific characteristics.

Info

If the Transfer Bit Depth feature is available for your camera, Basler recommends using this feature instead of changing the sensor bit depth. Only if you're not satisfied with the result, change the sensor bit depth.

Transfer Bit Depth Diagram

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

  • For optimum image quality, set the transfer bit depth to a high value.
    A higher transfer 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 transfer bit depth to a low value.
    A lower sensor bit depth can improve performance because the amount of data to be transferred is reduced.

Use Case#

For some cameras, when using an 8-bit pixel format, the sensor bit depth is automatically set to 10 bit. This depends on the sensor used and is due to the sensor's specific characteristics. Changing the sensor bit depth to a lower value, e.g., to increase the camera's frame rate, is not recommended for these sensors because this would affect certain other sensor characteristics.

This is where the transfer bit depth comes in useful. You can set a value independently of the sensor bit depth used and, e.g., benefit from an increased frame rate.

Transfer Bit Depth Mode#

The Transfer Bit Depth mode allows you to define whether the transfer bit depth can be set independently of the pixel format used. You can set the BslTransferBitDepthMode parameter to one of the following values:

  • Auto: The transfer 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 transfer bit depth is automatically set to 12 bit.
  • Manual: The transfer 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 10-bit data used for internal image processing (pixel format = Mono 8, transfer bit depth = 10 bit).

Setting the Transfer Bit Depth#

  1. Set the BslTransferBitDepthMode parameter to Manual.
  2. Set the BslTransferBitDepth 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 transfer bit depth mode to Manual
camera.BslTransferBitDepthMode.SetValue(BslTransferBitDepthMode_Manual);
// Set the transfer bit depth to 10 bit
camera.BslTransferBitDepth.SetValue(BslTransferBitDepth_Bpp10);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8");
// Set the transfer bit depth mode to Manual
CEnumParameter(nodemap, "BslTransferBitDepthMode").SetValue("Manual");
// Set the transfer bit depth to 10 bit
CEnumParameter(nodemap, "BslTransferBitDepth").SetValue("Bpp10");
// Set the pixel format to Mono 8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono8);
// Set the transfer bit depth mode to Manual
camera.Parameters[PLCamera.BslTransferBitDepthMode].SetValue(PLCamera.BslTransferBitDepthMode.Manual);
// Set the transfer bit depth to 10 bit
camera.Parameters[PLCamera.BslTransferBitDepth].SetValue(PLCamera.BslTransferBitDepth.Bpp10);
/* 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 transfer bit depth mode to Manual */
errRes = PylonDeviceFeatureFromString(hdev, "BslTransferBitDepthMode", "Manual");
CHECK(errRes);
/* Set the transfer bit depth to 10 bit */
errRes = PylonDeviceFeatureFromString(hdev, "BslTransferBitDepth", "Bpp10");
CHECK(errRes);

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

Back to top