跳转到内容

Black Level#

The Black Level camera feature allows you to change the overall brightness of an image. Adjusting the camera's black level will result in an offset to the pixel's gray values output by the camera.

例如,您可以将图像中每个像素的灰度值增加 3。

该功能的使用#

调整 Black Level#

要调整黑电平,请为 BlackLevel 参数输入一个值。

BlackLevel 参数值导致的灰度值变化取决于相机型号

信息

Basler 建议您在使用任何色彩增强功能之前将黑电平设置为 0,例如,Balance WhiteColor TransformationGamma。应用色彩增强后,您可以根据需要更改黑电平。但是,增加黑电平会降低颜色精确度。

Black Level 补偿#

暗电流可能会对图像质量产生负面影响。某些成像传感器可以通过自动调整黑电平来对此进行补偿。

某些型号的相机上,您可以使用 BslBlackLevelCompensationMode 参数手动启用或禁用此自动调整。

为此,请将 BslBlackLevelCompensationMode 参数设置为以下值:

  • 传感器:黑电平补偿由成像传感器执行。传感器试图补偿会影响信号的热生电压(暗电流)。
  • Off:禁用黑电平补偿。例如,对于弱光信号的定量分析,或者需要未经暗电流校正的原始图像数据时,此功能非常有用。
    将补偿模式设置为 Off 可重置用于黑电平补偿的所有内部校正值。

详情#

显示所有相机型号

相机型号 BslBlackLevelCompensationMode 参数可用 BlackLevel 参数值的更改 导致的灰度值变化
a2A1920-51gcBAS ± 1 ± 1
a2A1920-51gcPRO ± 1 ± 1
a2A1920-51gmBAS ± 1 ± 1
a2A1920-51gmPRO ± 1 ± 1
a2A1920-160ucBAS ± 1 ± 1
a2A1920-160ucPRO ± 1 ± 1
a2A1920-160umBAS ± 1 ± 1
a2A1920-160umPRO ± 1 ± 1
a2A2448-23gcBAS ± 1 ± 1
a2A2448-23gcPRO ± 1 ± 1
a2A2448-23gmBAS ± 1 ± 1
a2A2448-23gmPRO ± 1 ± 1
a2A2448-75ucBAS ± 1 ± 1
a2A2448-75ucPRO ± 1 ± 1
a2A2448-75umBAS ± 1 ± 1
a2A2448-75umPRO ± 1 ± 1
a2A2590-22gcBAS ± 1 ± 0.0625
a2A2590-22gcPRO ± 1 ± 0.0625
a2A2590-22gmBAS ± 1 ± 0.0625
a2A2590-22gmPRO ± 1 ± 0.0625
a2A2590-60ucBAS ± 1 ± 0.0625
a2A2590-60ucPRO ± 1 ± 0.0625
a2A2590-60umBAS ± 1 ± 0.0625
a2A2590-60umPRO ± 1 ± 0.0625
a2A2600-20gcBAS ± 1 ± 1
a2A2600-20gcPRO ± 1 ± 1
a2A2600-20gmBAS ± 1 ± 1
a2A2600-20gmPRO ± 1 ± 1
a2A2600-64ucBAS ± 1 ± 1
a2A2600-64ucPRO ± 1 ± 1
a2A2600-64umBAS ± 1 ± 1
a2A2600-64umPRO ± 1 ± 1
a2A2840-14gcBAS ± 1 ± 1
a2A2840-14gcPRO ± 1 ± 1
a2A2840-14gmBAS ± 1 ± 1
a2A2840-14gmPRO ± 1 ± 1
a2A2840-48ucBAS ± 1 ± 1
a2A2840-48ucPRO ± 1 ± 1
a2A2840-48umBAS ± 1 ± 1
a2A2840-48umPRO ± 1 ± 1
a2A3840-13gcBAS ± 1 ± 0.0625
a2A3840-13gcPRO ± 1 ± 0.0625
a2A3840-13gmBAS ± 1 ± 0.0625
a2A3840-13gmPRO ± 1 ± 0.0625
a2A3840-45ucBAS ± 1 ± 0.0625
a2A3840-45ucPRO ± 1 ± 0.0625
a2A3840-45umBAS ± 1 ± 0.0625
a2A3840-45umPRO ± 1 ± 0.0625
a2A4096-9gcBAS ± 1 ± 1
a2A4096-9gcPRO ± 1 ± 1
a2A4096-9gmBAS ± 1 ± 1
a2A4096-9gmPRO ± 1 ± 1
a2A4096-30ucBAS ± 1 ± 1
a2A4096-30ucPRO ± 1 ± 1
a2A4096-30umBAS ± 1 ± 1
a2A4096-30umPRO ± 1 ± 1
a2A4200-12gcBAS ± 1 ± 1
a2A4200-12gcPRO ± 1 ± 1
a2A4200-12gmBAS ± 1 ± 1
a2A4200-12gmPRO ± 1 ± 1
a2A4200-40ucBAS ± 1 ± 1
a2A4200-40ucPRO ± 1 ± 1
a2A4200-40umBAS ± 1 ± 1
a2A4200-40umPRO ± 1 ± 1
a2A4504-5gcBAS ± 1 ± 1
a2A4504-5gcPRO ± 1 ± 1
a2A4504-5gmBAS ± 1 ± 1
a2A4504-5gmPRO ± 1 ± 1
a2A4504-18ucBAS ± 1 ± 1
a2A4504-18ucPRO ± 1 ± 1
a2A4504-18umBAS ± 1 ± 1
a2A4504-18umPRO ± 1 ± 1
a2A5320-7gcBAS ± 1 ± 1
a2A5320-7gcPRO ± 1 ± 1
a2A5320-7gmBAS ± 1 ± 1
a2A5320-7gmPRO ± 1 ± 1
a2A5320-23ucBAS ± 1 ± 1
a2A5320-23ucPRO ± 1 ± 1
a2A5320-23umBAS ± 1 ± 1
a2A5320-23umPRO ± 1 ± 1
a2A5328-4gcBAS ± 1 ± 1
a2A5328-4gcPRO ± 1 ± 1
a2A5328-4gmBAS ± 1 ± 1
a2A5328-4gmPRO ± 1 ± 1
a2A5328-15ucBAS ± 1 ± 1
a2A5328-15ucPRO ± 1 ± 1
a2A5328-15umBAS ± 1 ± 1
a2A5328-15umPRO ± 1 ± 1
acA640-90gc 8 位像素格式:±64
12 位像素格式:±4
± 1
acA640-90uc ± 1 ± 1
acA640-121gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA640-300gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA640-300gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA640-750uc ± 1 ± 1
acA640-750um ± 1 ± 1
acA720-290gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA720-290gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA720-520uc ± 1 ± 1
acA720-520um ± 1 ± 1
acA800-200gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA800-200gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA800-510uc ± 1 ± 1
acA800-510um ± 1 ± 1
acA1280-60gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1280-60gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-60gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-60gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-60gmNIR 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-75gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-75gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1300-200uc ± 1 ± 1
acA1300-200um ± 1 ± 1
acA1440-73gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1440-73gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1440-220uc ± 1 ± 1
acA1440-220um ± 1 ± 1
acA1600-20gc 8 位像素格式:±64
12 位像素格式:±4
± 1
acA1600-20uc ± 1 ± 1
acA1600-60gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1600-60gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1920-25gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-25gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-25uc ± 1 ± 1
acA1920-25um ± 1 ± 1
acA1920-40gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-40gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-40uc ± 1 ± 1
acA1920-40ucMED ± 1 ± 1
acA1920-40um ± 1 ± 1
acA1920-40umMED ± 1 ± 1
acA1920-48gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1920-48gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA1920-50gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-50gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA1920-150uc ± 1 ± 1
acA1920-150um ± 1 ± 1
acA1920-155uc ± 1 ± 1
acA1920-155ucMED ± 1 ± 1
acA1920-155um ± 1 ± 1
acA1920-155umMED ± 1 ± 1
acA2000-50gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2000-50gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2000-50gmNIR 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2000-165uc ± 1 ± 1
acA2000-165um ± 1 ± 1
acA2000-165umNIR ± 1 ± 1
acA2040-25gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2040-25gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2040-25gmNIR 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2040-35gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2040-35gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2040-55uc ± 1 ± 1
acA2040-55um ± 1 ± 1
acA2040-90uc ± 1 ± 1
acA2040-90um ± 1 ± 1
acA2040-90umNIR ± 1 ± 1
acA2040-120uc ± 1 ± 1
acA2040-120um ± 1 ± 1
acA2440-20gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2440-20gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2440-35uc ± 1 ± 1
acA2440-35ucMED ± 1 ± 1
acA2440-35um ± 1 ± 1
acA2440-35umMED ± 1 ± 1
acA2440-75uc ± 1 ± 1
acA2440-75ucMED ± 1 ± 1
acA2440-75um ± 1 ± 1
acA2440-75umMED ± 1 ± 1
acA2500-14gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2500-14gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA2500-14uc ± 1 ± 1
acA2500-14um ± 1 ± 1
acA2500-20gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA2500-20gcMED 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA2500-20gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA2500-20gmMED 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA2500-60uc ± 1 ± 1
acA2500-60um ± 1 ± 1
acA3088-16gc 8 位像素格式:±16
12 位像素格式:大约 ±1
± 1
acA3088-16gm 8 位像素格式:±16
12 位像素格式:大约 ±1
± 1
acA3088-57uc ± 1 大约 ±1
acA3088-57ucMED ± 1 大约 ±1
acA3088-57um ± 1 大约 ±1
acA3088-57umMED ± 1 大约 ±1
acA3800-10gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA3800-10gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA3800-14uc ± 1 ± 1
acA3800-14um ± 1 ± 1
acA4024-8gc 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA4024-8gm 8 位像素格式:±4
10 位像素格式:±1
12 位像素格式:±1
± 1
acA4024-29uc ± 1 大约 ±1
acA4024-29um ± 1 大约 ±1
acA4096-11gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA4096-11gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA4096-30uc ± 1 ± 1
acA4096-30ucMED ± 1 ± 1
acA4096-30um ± 1 ± 1
acA4096-30umMED ± 1 ± 1
acA4096-40uc ± 1 ± 1
acA4096-40ucMED ± 1 ± 1
acA4096-40um ± 1 ± 1
acA4096-40umMED ± 1 ± 1
acA4112-8gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA4112-8gm 8 位像素格式:±16
12 位像素格式:±1
± 1
acA4112-20uc ± 1 ± 1
acA4112-20ucMED ± 1 ± 1
acA4112-20um ± 1 ± 1
acA4112-20umMED ± 1 ± 1
acA4112-30uc ± 1 ± 1
acA4112-30ucMED ± 1 ± 1
acA4112-30um ± 1 ± 1
acA4112-30umMED ± 1 ± 1
acA4600-7gc 8 位像素格式:±16
12 位像素格式:±1
± 1
acA4600-10uc ± 1 ± 1
acA5472-5gc ± 1 8 位像素格式:±1
12 位像素格式:±4
acA5472-5gm ± 1 8 位像素格式:±1
12 位像素格式:±4
acA5472-17uc ± 1 8 位像素格式:±1
12 位像素格式:±4
acA5472-17ucMED ± 1 8 位像素格式:±1
12 位像素格式:±4
acA5472-17um ± 1 8 位像素格式:±1
12 位像素格式:±4
acA5472-17umMED ± 1 8 位像素格式:±1
12 位像素格式:±4
boA4096-93cc ± 1 ± 1
boA4096-93cm ± 1 ± 1
boA4112-68cc ± 1 ± 1
boA4112-68cm ± 1 ± 1
boA4500-45cc ± 1 ± 1
boA4500-45cm ± 1 ± 1
boA4504-100cc ± 1 ± 1
boA4504-100cm ± 1 ± 1
boA5320-150cc ± 1 ± 1
boA5320-150cm ± 1 ± 1
boA5328-100cc ± 1 ± 1
boA5328-100cm ± 1 ± 1
boA6500-36cc ± 1 ± 1
boA6500-36cm ± 1 ± 1
boA8100-16cc ± 1 ± 1
boA8100-16cm ± 1 ± 1
daA1280-54uc ± 1a ± 1
daA1280-54um ± 1a ± 1
daA1600-60uc ± 1a ± 1
daA1600-60um ± 1a ± 1
daA1920-15um ± 1a ± 1
daA1920-30uc ± 1a ± 1
daA1920-30um ± 1a ± 1
daA1920-160uc ± 1 ± 1
daA1920-160um ± 1 ± 1
daA2448-70uc ± 1 ± 1
daA2448-70um ± 1 ± 1
daA2500-14uc ± 1a ± 1
daA2500-14um ± 1a ± 1
daA3840-45uc ± 1 ± 0.0625
daA3840-45um ± 1 ± 0.0625
puA1280-54uc ± 1a ± 1
puA1280-54um ± 1a ± 1
puA1600-60uc ± 1a ± 1
puA1600-60um ± 1a ± 1
puA1920-30uc ± 1a ± 1
puA1920-30um ± 1a ± 1
puA2500-14uc ± 1a ± 1
puA2500-14um ± 1a ± 1

  1. 在 daA1280-54um/uc、daA1280-54lm/uc 和 puA1280-54um/uc 相机上,在增益设置之后将黑电平设置应用于像素数据。在其他所有 dart 和 pulse 相机上,在增益设置之前应用黑电平设置。

示例代码#

ace Classic/U/L GigE 相机#
// Set the black level to 32
camera.BlackLevelRaw.SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.SetValue(BslBlackLevelCompensationMode_Off);
INodeMap& nodemap = camera.GetNodeMap();
// Set the black level to 32
CIntegerParameter(nodemap, "BlackLevelRaw").SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
CEnumParameter(nodemap, "BslBlackLevelCompensationMode").SetValue("Off");
// Set the black level to 32
camera.Parameters[PLCamera.BlackLevelRaw].SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.Parameters[PLCamera.BslBlackLevelCompensationMode].SetValue(PLCamera.BslBlackLevelCompensationMode.Off);
/* 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 black level to 32 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BlackLevelRaw", 32);
CHECK(errRes);
/* Disable black level compensation */
/* Note: Available on selected camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BslBlackLevelCompensationMode", "Off");
CHECK(errRes);
其他相机#
// Set the black level to 32
camera.BlackLevel.SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.SetValue(BslBlackLevelCompensationMode_Off);
INodeMap& nodemap = camera.GetNodeMap();
// Set the black level to 32
CIntegerParameter(nodemap, "BlackLevel").SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
CEnumParameter(nodemap, "BslBlackLevelCompensationMode").SetValue("Off");
// Set the black level to 32
camera.Parameters[PLCamera.BlackLevel].SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.Parameters[PLCamera.BslBlackLevelCompensationMode].SetValue(PLCamera.BslBlackLevelCompensationMode.Off);
/* 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 black level to 32 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BlackLevel", 32);
CHECK(errRes);
/* Disable black level compensation */
/* Note: Available on selected camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BslBlackLevelCompensationMode", "Off");
CHECK(errRes);

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

返回顶部