跳转到内容

Sensor Bit Depth#

相机的 Sensor Bit Depth 功能允许您更改图像传感器输出数据的位深。

减小传感器位深度可以提高相机的帧速率。增加传感器位深度可以提高图像质量。

该功能的使用#

为什么使用 Sensor Bit Depth#

传感器位深度定义了图像传感器输出的数据的位深度。相机执行的所有其他图像处理均基于此数据。

设置传感器位深度时,请遵循以下准则:

  • 为了获得最佳图像质量,请将传感器位深度设置为值。
    较高的传感器位深度可以改善图像质量,因为相机的内部图像计算基于更高的位深度。
  • 为了获得最佳性能,请将传感器位深度设置为值。
    较低的传感器位深度可以提高性能,因为传感器的读出时间较短。

Sensor Bit Depth 模式#

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 参数设置为以下值:

  • 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.
  • 手动: 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).

信息

  • On a2A1920, a2A4504, a2A5320, a2A5328, boA4096, boA4112, boA4504, boA5320, boA5328, and dart M 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.
  • 在 boA4096、boA4112、boA4504、boA5320 和 boA5328 相机上,将传感器位深设置为 8 位会产生以下效果:
    • 全井容量减少了1/4倍
    • 动态范围减小
    • 提高帧速率
  • On boA13440-17cm cameras, the sensor bit depth is limited depending on the pixel format used. The bit depth of the data output by the sensor must always be equal or higher than the format of the image data transmitted. For example, if you configure the camera to output 12-bit image data, the sensor data can only be set to 12 or 14 bit (pixel format = Mono 12, sensor bit depth = 12 bit or 14 bit).

设置 Sensor Bit Depth#

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

示例代码#

// 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.BslSensorBitDepth.SetValue(BslSensorBitDepth_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, "BslSensorBitDepth").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.BslSensorBitDepth].SetValue(PLCamera.BslSensorBitDepth.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, "BslSensorBitDepth", "Bpp8");
CHECK(errRes);
# Set the pixel format to Mono 8
camera.PixelFormat.Value = "Mono8"
# Set the sensor bit depth mode to Manual
camera.BslSensorBitDepthMode.Value = "Manual"
# Set the sensor bit depth to 8 bit
camera.BslSensorBitDepth.Value = "Bpp8"

您也可以使用 pylon Viewer 轻松设置参数。