Sensor Bit Depth#
减小传感器位深度可以提高相机的帧速率。增加传感器位深度可以提高图像质量。
该功能的使用#
为什么使用 Sensor Bit Depth#
传感器位深度定义了图像传感器输出的数据的位深度。相机执行的所有其他图像处理均基于此数据。
设置传感器位深度时,请遵循以下准则:
- 为了获得最佳图像质量,请将传感器位深度设置为高值。
较高的传感器位深度可以改善图像质量,因为相机的内部图像计算基于更高的位深度。 - 为了获得最佳性能,请将传感器位深度设置为低值。
较低的传感器位深度可以提高性能,因为传感器的读出时间较短。
Sensor Bit Depth 模式#
Sensor Bit Depth 模式允许您定义是否可以独立于所使用的 Pixel Format 来设置传感器位深。您可以将 BslSensorBitDepthMode 参数设置为以下值:
Auto:传感器位深会根据所使用的 像素格式 自动调整。这是默认设置。例如,如果将 Pixel Format 设置为 Bayer 12,则传感器位深会自动设置为 12 bit。Manual:可以独立于所使用的 Pixel Format 来设置传感器位深。例如,您可以将相机配置为基于 12 位传感器数据输出 8 位图像数据(Pixel Format = Mono 8,Sensor Bit Depth = 12 bit)。
信息
- 在 a2A1920、a2A4504、a2A5320、a2A5328、boA4096、boA4112、boA4504、boA5320、boA5328 以及 dart M 相机上,如果您设置
BslSensorBitDepthMode参数至Auto并选择 8 位 Pixel Format(例如 Mono 8),则传感器位深将设置为 10 bit。这不仅能提高图像 Quality,而且不会牺牲性能。 - 在 boA4096、boA4112、boA4504、boA5320、boA5328、a2A2560-131cmSWIR 和 a2A2048-173cmSWIR 相机上,将 Sensor Bit Depth 设置为 8 bit 会产生以下效果:
- 全井容量减少了1/4倍
- 动态范围减小
- 提高帧速率
- 在 boA13440-17cm 相机上,传感器位深会根据所使用的 Pixel Format 受到限制。传感器输出的数据位深必须始终大于或等于所传输图像数据的格式。例如,如果您将相机配置为输出 12 位图像数据,则传感器数据只能设置为 12 或 14 bit(Pixel Format = Mono 12,Sensor Bit Depth = 12 bit 或 14 bit)。
设置 Sensor Bit Depth#
- 设置
BslSensorBitDepthMode参数至Manual. - 设置
BslSensorBitDepth参数设置为所需的值。
例如,将参数设置为Bpp12可将位深度设置为 12 bpp(每像素位数)。
示例代码#
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);
您也可以使用 pylon Viewer 轻松设置参数。