跳转到内容

Black Level#

Black Level 相机功能允许您更改图像的整体亮度。调整相机的黑电平会导致相机输出的像素灰度值发生偏移。

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

该功能的使用#

信息

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

Setting the Black Level#

  1. 如果可用,请设置 BlackLevelSelector parameter to the desired value, e.g., All.
  2. Enter a value for the BlackLevel parameter.

    • The change in the gray value resulting from the BlackLevel parameter value depends on the camera model.
    • Specifying a black level value of 0 effectively disables the respective adjustment.

Black Level Selector#

racer 2 L camera models, the BlackLevelSelector parameter is available. This parameter allows you to apply the black level universally or to a specific line, depending on whether you operate your racer 2 L camera in Single Line or Dual Line sensor acquisition mode.

You can set the BlackLevelSelector 参数设置为以下值:

  • All: The black level is applied universally.
  • Line1, Line2: The black level is applied to line 1 or 2.

信息

  • The black level values specified for line 2 only become effective if the Dual Line sensor acquisition mode is enabled.
  • The black level value specified for All is added to the black level values specified for Line1 and Line2 respectively.
  • If you're using the DSNU correction of the Shading Correction feature, you have to create the shading correction set for DSNU correction again after you have adjusted the sensor black level.

Black Level 补偿#

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

some camera models, you can manually enable or disable this automatic adjustment using the BslBlackLevelCompensationMode parameter.

To do so, set the BslBlackLevelCompensationMode 参数设置为以下值:

  • Sensor: Black level compensation is performed by the image sensor. The sensor tries to compensate for thermally generated voltages that would affect the signals (dark current).
  • Off: Black level compensation is disabled. This is useful, e.g., for quantitative analysis of weak light signals or if you need raw image data without dark current correction.
    Setting the compensation mode to Off resets all internal correction values used for black level compensation.

详情#

显示所有相机型号

相机型号 BslBlackLevelCompensationMode 参数可用 BlackLevel 参数值的更改 导致的灰度值变化
a2A640-240gmSWIR ± 1 ± 1
a2A640-240umSWIR ± 1 ± 1
a2A1280-80gmSWIR ± 1 ± 1
a2A1280-125umSWIR ± 1 ± 1
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
a2A1920-165g5cBAS ± 1 ± 1
a2A1920-165g5mBAS ± 1 ± 1
a2A2048-35gmSWIR ± 1 ± 1
a2A2048-110umSWIR ± 1 ± 1
a2A2440-98g5cBAS ± 1 ± 1
a2A2440-98g5mBAS ± 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
a2A2448-105g5cBAS ± 1 ± 1
a2A2448-105g5mBAS ± 1 ± 1
a2A2448-120cc ± 1 ± 1
a2A2448-120cm ± 1 ± 1
a2A2448-210cc ± 1 ± 1
a2A2448-210cm ± 1 ± 1
a2A2560-20gmSWIR ± 1 ± 1
a2A2560-70umSWIR ± 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-14gmUV ± 1 ± 1
a2A2840-48ucBAS ± 1 ± 1
a2A2840-48ucPRO ± 1 ± 1
a2A2840-48umBAS ± 1 ± 1
a2A2840-48umPRO ± 1 ± 1
a2A2840-48umUV ± 1 ± 1
a2A2840-67g5cBAS ± 1 ± 1
a2A2840-67g5mBAS ± 1 ± 1
a2A2840-67g5mUV ± 1 ± 1
a2A2840-86cc ± 1 ± 1
a2A2840-86cm ± 1 ± 1
a2A3536-9gcBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-9gcPRO ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-9gmBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-9gmPRO ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-31ucBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-31ucPRO ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-31umBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-31umPRO ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-42g5cBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
a2A3536-42g5mBAS ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
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
a2A4096-44g5cBAS ± 1 ± 1
a2A4096-44g5mBAS ± 1 ± 1
a2A4096-67cc ± 1 ± 1
a2A4096-67cm ± 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
a2A4504-27g5cBAS ± 1 ± 1
a2A4504-27g5mBAS ± 1 ± 1
a2A4504-42cc ± 1 ± 1
a2A4504-42cm ± 1 ± 1
a2A4508-6gcBAS ± 1 ± 1
a2A4508-6gcPRO ± 1 ± 1
a2A4508-6gmBAS ± 1 ± 1
a2A4508-6gmPRO ± 1 ± 1
a2A4508-20ucBAS ± 1 ± 1
a2A4508-20ucPRO ± 1 ± 1
a2A4508-20umBAS ± 1 ± 1
a2A4508-20umPRO ± 1 ± 1
a2A5060-4gcBAS ± 1 ± 1
a2A5060-4gmBAS ± 1 ± 1
a2A5060-15ucBAS ± 1 ± 1
a2A5060-15umBAS ± 1 ± 1
a2A5060-21g5cBAS ± 1 ± 1
a2A5060-21g5mBAS ± 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
a2A5320-34g5cBAS ± 1 ± 1
a2A5320-34g5mBAS ± 1 ± 1
a2A5320-52cc ± 1 ± 1
a2A5320-52cm ± 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
a2A5328-22g5cBAS ± 1 ± 1
a2A5328-22g5mBAS ± 1 ± 1
a2A5328-35cc ± 1 ± 1
a2A5328-35cm ± 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-165uc ± 1 ± 1
acA2000-165um ± 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
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
boA1936-400cc ± 1 ± 1
boA1936-400cm ± 1 ± 1
boA2448-250cc ± 1 ± 1
bo2448-250cm ± 1 ± 1
boA2832-190cc ± 1 ± 1
bo2832-190cm ± 1 ± 1
boA4096-93cc ± 1 ± 1
boA4096-93cm ± 1 ± 1
boA4096-180cc ± 1 ± 1
bo4096-180cm ± 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
boA5120-150cc ± 1 ± 1
boA5120-150cm ± 1 ± 1
boA5120-230cc ± 1 ± 1
boA5120-230cm ± 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
boA9344-30cc ± 1 ± 1
boA9344-30cm ± 1 ± 1
boA9344-70cc ± 1 ± 1
boA9344-70cm ± 1 ± 1
boA13440-17cm ± 1 ± 1
daA720-520uc ± 1 ± 1
daA720-520um ± 1 ± 1
daA1280-54uc ± 1a ± 1
daA1280-54um ± 1a ± 1
daA1440-220uc ± 1 ± 1
daA1440-220um ± 1 ± 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
dmA720-290gc ± 1 ± 1
dmA720-290gm ± 1 ± 1
dmA1440-73gc ± 1 ± 1
dmA1440-73gm ± 1 ± 1
dmA1920-51gc ± 1 ± 1
dmA1920-51gm ± 1 ± 1
dmA3536-9gc ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 0.0625
dmA3536-9gm ± 1 10-bit sensor bit depth: ± 1
12-bit sensor bit depth: ± 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
r2L2048-29gc ± 1 ± 1
r2L2048-58gm ± 1 ± 1
r2L2048-62cc ± 1 ± 1
r2L2048-62g5c ± 1 ± 1
r2L2048-172cm ± 1 ± 1
r2L2048-172g5m ± 1 ± 1
r2L4096-14gc ± 1 ± 1
r2L4096-29gm ± 1 ± 1
r2L4096-42cc ± 1 ± 1
r2L4096-42g5c ± 1 ± 1
r2L4096-84cm ± 1 ± 1
r2L4096-84g5m ± 1 ± 1
r2L8192-200cm ± 1 大约 ±1
r2L16384-120cm ± 1 大约 ±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.0);
// 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
CFloatParameter(nodemap, "BlackLevelRaw").SetValue(32.0);
// 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.0);
// 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 = PylonDeviceSetFloatFeature(hdev, "BlackLevelRaw", 32.0);
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.BlackLevelRaw.Value = 32.0
# Disable black level compensation
# Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.Value = "Off"
其他相机#
// Enable a black level adjustment for line 2
// Note: Available on racer 2 L camera models only
camera.BlackLevelSelector.SetValue(BlackLevelSelector_Line2);
// Set the black level to 32
camera.BlackLevel.SetValue(32.0);
// Disable black level compensation
// Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.SetValue(BslBlackLevelCompensationMode_Off);
INodeMap& nodemap = camera.GetNodeMap();
// Enable a black level adjustment for line 2
// Note: Available on racer 2 L camera models only
CEnumParameter(nodemap, "BlackLevelSelector").SetValue("Line2");
// Set the black level to 32
CFloatParameter(nodemap, "BlackLevel").SetValue(32.0);
// Disable black level compensation
// Note: Available on selected camera models only
CEnumParameter(nodemap, "BslBlackLevelCompensationMode").SetValue("Off");
// Enable a black level adjustment for line 2
// Note: Available on racer 2 L camera models only
camera.Parameters[PLCamera.BlackLevelSelector].SetValue(PLCamera.BlackLevelSelector.Line2);
// Set the black level to 32
camera.Parameters[PLCamera.BlackLevel].SetValue(32.0);
// 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 */
/* Enable a black level adjustment for line 2 */
/* Note: Available on racer 2 L camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BlackLevelSelector", "Line2");
CHECK(errRes);
/* Set the black level to 32 */
errRes = PylonDeviceSetFloatFeature(hdev, "BlackLevel", 32.0);
CHECK(errRes);
/* Disable black level compensation */
/* Note: Available on selected camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BslBlackLevelCompensationMode", "Off");
CHECK(errRes);
# Enable a black level adjustment for line 2
# Note: Available on racer 2 L camera models only
camera.BlackLevelSelector.Value = "Line2"
# Set the black level to 32
camera.BlackLevel.Value = 32.0
# Disable black level compensation
# Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.Value = "Off"

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