Skip to content

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.

For example, you can increase the gray value of each pixel in the image by 3.

Using the Feature#

Adjusting the Black Level#

Info

  • Basler recommends setting the black level to 0 before using any of the color enhancement features, e.g., Balance White, Color Transformation, or Gamma. After the color enhancements have been applied, you can change the black level as desired. However, increasing the black level will decrease the color accuracy.

To adjust the black level, enter a value for the BlackLevel parameter.

The change in the gray value resulting from the BlackLevel parameter value depends on the camera model.

Types of Black Level Adjustment#

On racer 2 L camera models, the BlackLevelSelector parameter is available. This parameter allows you to choose between two types of black level adjustment. You can also perform both types of adjustment at the same time.

To configure black level adjustment:

  1. Set the BlackLevelSelector parameter to one of the following values:
    • All: The black level value is applied universally.
    • SensorAll: The black level value is applied to the sensor.
      You can both increase and decrease the black level, which can be useful, e.g., if you want to set bright pixel values in the dark field to zero.
  2. Specify the desired black level.
  3. Optional: If you want to perform both types of black level adjustment, set the BlackLevelSelector parameter to the other value and repeat step 2.

Specifying a black level value of 0 effectively disables the respective adjustment.

Info

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 Compensation#

Dark current can have a negative impact on image quality. Some image sensors can compensate for this by automatically adjusting the black level.

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

To do so, set the BslBlackLevelCompensationMode parameter to one of the following values:

  • 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.

Specifics#

Show all camera models

Camera Model BslBlackLevelCompensationMode Parameter Available Change in BlackLevel Parameter Value Resulting Change in Gray Value
a2A640-240gmSWIR No ± 1 ± 1
a2A640-240umSWIR No ± 1 ± 1
a2A1280-80gmSWIR No ± 1 ± 1
a2A1280-125umSWIR No ± 1 ± 1
a2A1920-51gcBAS No ± 1 ± 1
a2A1920-51gcPRO No ± 1 ± 1
a2A1920-51gmBAS No ± 1 ± 1
a2A1920-51gmPRO No ± 1 ± 1
a2A1920-160ucBAS No ± 1 ± 1
a2A1920-160ucPRO No ± 1 ± 1
a2A1920-160umBAS No ± 1 ± 1
a2A1920-160umPRO No ± 1 ± 1
a2A1920-165g5cBAS No ± 1 ± 1
a2A1920-165g5mBAS No ± 1 ± 1
a2A2048-35gmSWIR No ± 1 ± 1
a2A2048-110umSWIR No ± 1 ± 1
a2A2440-98g5cBAS No ± 1 ± 1
a2A2440-98g5mBAS No ± 1 ± 1
a2A2448-23gcBAS No ± 1 ± 1
a2A2448-23gcPRO No ± 1 ± 1
a2A2448-23gmBAS No ± 1 ± 1
a2A2448-23gmPRO No ± 1 ± 1
a2A2448-75ucBAS No ± 1 ± 1
a2A2448-75ucPRO No ± 1 ± 1
a2A2448-75umBAS No ± 1 ± 1
a2A2448-75umPRO No ± 1 ± 1
a2A2448-105g5cBAS No ± 1 ± 1
a2A2448-105g5mBAS No ± 1 ± 1
a2A2448-120cc No ± 1 ± 1
a2A2448-120cm No ± 1 ± 1
a2A2448-210cc No ± 1 ± 1
a2A2448-210cm No ± 1 ± 1
a2A2560-20gmSWIR No ± 1 ± 1
a2A2560-70umSWIR No ± 1 ± 1
a2A2590-22gcBAS No ± 1 ± 0.0625
a2A2590-22gcPRO No ± 1 ± 0.0625
a2A2590-22gmBAS No ± 1 ± 0.0625
a2A2590-22gmPRO No ± 1 ± 0.0625
a2A2590-60ucBAS No ± 1 ± 0.0625
a2A2590-60ucPRO No ± 1 ± 0.0625
a2A2590-60umBAS No ± 1 ± 0.0625
a2A2590-60umPRO No ± 1 ± 0.0625
a2A2600-20gcBAS No ± 1 ± 1
a2A2600-20gcPRO No ± 1 ± 1
a2A2600-20gmBAS No ± 1 ± 1
a2A2600-20gmPRO No ± 1 ± 1
a2A2600-64ucBAS No ± 1 ± 1
a2A2600-64ucPRO No ± 1 ± 1
a2A2600-64umBAS No ± 1 ± 1
a2A2600-64umPRO No ± 1 ± 1
a2A2840-14gcBAS No ± 1 ± 1
a2A2840-14gcPRO No ± 1 ± 1
a2A2840-14gmBAS No ± 1 ± 1
a2A2840-14gmPRO No ± 1 ± 1
a2A2840-14gmUV No ± 1 ± 1
a2A2840-48ucBAS No ± 1 ± 1
a2A2840-48ucPRO No ± 1 ± 1
a2A2840-48umBAS No ± 1 ± 1
a2A2840-48umPRO No ± 1 ± 1
a2A2840-48umUV No ± 1 ± 1
a2A2840-67g5cBAS No ± 1 ± 1
a2A2840-67g5mBAS No ± 1 ± 1
a2A2840-67g5mUV No ± 1 ± 1
a2A2840-86cc No ± 1 ± 1
a2A2840-86cm No ± 1 ± 1
a2A3840-13gcBAS No ± 1 ± 0.0625
a2A3840-13gcPRO No ± 1 ± 0.0625
a2A3840-13gmBAS No ± 1 ± 0.0625
a2A3840-13gmPRO No ± 1 ± 0.0625
a2A3840-45ucBAS No ± 1 ± 0.0625
a2A3840-45ucPRO No ± 1 ± 0.0625
a2A3840-45umBAS No ± 1 ± 0.0625
a2A3840-45umPRO No ± 1 ± 0.0625
a2A4096-9gcBAS No ± 1 ± 1
a2A4096-9gcPRO No ± 1 ± 1
a2A4096-9gmBAS No ± 1 ± 1
a2A4096-9gmPRO No ± 1 ± 1
a2A4096-30ucBAS No ± 1 ± 1
a2A4096-30ucPRO No ± 1 ± 1
a2A4096-30umBAS No ± 1 ± 1
a2A4096-30umPRO No ± 1 ± 1
a2A4096-44g5cBAS No ± 1 ± 1
a2A4096-44g5mBAS No ± 1 ± 1
a2A4096-67cc No ± 1 ± 1
a2A4096-67cm No ± 1 ± 1
a2A4200-12gcBAS No ± 1 ± 1
a2A4200-12gcPRO No ± 1 ± 1
a2A4200-12gmBAS No ± 1 ± 1
a2A4200-12gmPRO No ± 1 ± 1
a2A4200-40ucBAS No ± 1 ± 1
a2A4200-40ucPRO No ± 1 ± 1
a2A4200-40umBAS No ± 1 ± 1
a2A4200-40umPRO No ± 1 ± 1
a2A4504-5gcBAS No ± 1 ± 1
a2A4504-5gcPRO No ± 1 ± 1
a2A4504-5gmBAS No ± 1 ± 1
a2A4504-5gmPRO No ± 1 ± 1
a2A4504-18ucBAS No ± 1 ± 1
a2A4504-18ucPRO No ± 1 ± 1
a2A4504-18umBAS No ± 1 ± 1
a2A4504-18umPRO No ± 1 ± 1
a2A4504-27g5cBAS No ± 1 ± 1
a2A4504-27g5mBAS No ± 1 ± 1
a2A4504-42cc No ± 1 ± 1
a2A4504-42cm No ± 1 ± 1
a2A4508-6gcBAS No ± 1 ± 1
a2A4508-6gcPRO No ± 1 ± 1
a2A4508-6gmBAS No ± 1 ± 1
a2A4508-6gmPRO No ± 1 ± 1
a2A4508-20ucBAS No ± 1 ± 1
a2A4508-20ucPRO No ± 1 ± 1
a2A4508-20umBAS No ± 1 ± 1
a2A4508-20umPRO No ± 1 ± 1
a2A5320-7gcBAS No ± 1 ± 1
a2A5320-7gcPRO No ± 1 ± 1
a2A5320-7gmBAS No ± 1 ± 1
a2A5320-7gmPRO No ± 1 ± 1
a2A5320-23ucBAS No ± 1 ± 1
a2A5320-23ucPRO No ± 1 ± 1
a2A5320-23umBAS No ± 1 ± 1
a2A5320-23umPRO No ± 1 ± 1
a2A5320-34g5cBAS No ± 1 ± 1
a2A5320-34g5mBAS No ± 1 ± 1
a2A5320-52cc No ± 1 ± 1
a2A5320-52cm No ± 1 ± 1
a2A5328-4gcBAS No ± 1 ± 1
a2A5328-4gcPRO No ± 1 ± 1
a2A5328-4gmBAS No ± 1 ± 1
a2A5328-4gmPRO No ± 1 ± 1
a2A5328-15ucBAS No ± 1 ± 1
a2A5328-15ucPRO No ± 1 ± 1
a2A5328-15umBAS No ± 1 ± 1
a2A5328-15umPRO No ± 1 ± 1
a2A5328-22g5cBAS No ± 1 ± 1
a2A5328-22g5mBAS No ± 1 ± 1
a2A5328-35cc No ± 1 ± 1
a2A5328-35cm No ± 1 ± 1
acA640-121gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA640-300gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA640-300gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA640-750uc No ± 1 ± 1
acA640-750um No ± 1 ± 1
acA720-290gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA720-290gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA720-520uc No ± 1 ± 1
acA720-520um No ± 1 ± 1
acA800-200gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA800-200gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA800-510uc No ± 1 ± 1
acA800-510um No ± 1 ± 1
acA1280-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1280-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-60gmNIR No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-75gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-75gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-200uc No ± 1 ± 1
acA1300-200um No ± 1 ± 1
acA1440-73gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1440-73gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1440-220uc No ± 1 ± 1
acA1440-220um No ± 1 ± 1
acA1600-20gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1600-20uc No ± 1 ± 1
acA1600-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1600-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-25gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-25gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-25uc No ± 1 ± 1
acA1920-25um No ± 1 ± 1
acA1920-40gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-40gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-40uc No ± 1 ± 1
acA1920-40ucMED No ± 1 ± 1
acA1920-40um No ± 1 ± 1
acA1920-40umMED No ± 1 ± 1
acA1920-48gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-48gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-50gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-50gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-150uc No ± 1 ± 1
acA1920-150um No ± 1 ± 1
acA1920-155uc No ± 1 ± 1
acA1920-155ucMED No ± 1 ± 1
acA1920-155um No ± 1 ± 1
acA1920-155umMED No ± 1 ± 1
acA2000-50gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2000-50gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2000-165uc No ± 1 ± 1
acA2000-165um No ± 1 ± 1
acA2040-25gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-25gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-25gmNIR No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-35gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-35gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-55uc No ± 1 ± 1
acA2040-55um No ± 1 ± 1
acA2040-90uc No ± 1 ± 1
acA2040-90um No ± 1 ± 1
acA2040-90umNIR No ± 1 ± 1
acA2040-120uc No ± 1 ± 1
acA2040-120um No ± 1 ± 1
acA2440-20gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2440-20gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2440-35uc No ± 1 ± 1
acA2440-35ucMED No ± 1 ± 1
acA2440-35um No ± 1 ± 1
acA2440-35umMED No ± 1 ± 1
acA2440-75uc No ± 1 ± 1
acA2440-75ucMED No ± 1 ± 1
acA2440-75um No ± 1 ± 1
acA2440-75umMED No ± 1 ± 1
acA2500-14gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2500-14gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2500-14uc No ± 1 ± 1
acA2500-14um No ± 1 ± 1
acA2500-20gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gcMED No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gmMED No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-60uc No ± 1 ± 1
acA2500-60um No ± 1 ± 1
acA3088-16gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± approx. 1
± 1
acA3088-16gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± approx. 1
± 1
acA3088-57uc No ± 1 ± approx. 1
acA3088-57ucMED Yes ± 1 ± approx. 1
acA3088-57um No ± 1 ± approx. 1
acA3088-57umMED Yes ± 1 ± approx. 1
acA3800-10gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA3800-10gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA3800-14uc No ± 1 ± 1
acA3800-14um No ± 1 ± 1
acA4024-8gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA4024-8gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA4024-29uc No ± 1 ± approx. 1
acA4024-29um No ± 1 ± approx. 1
acA4096-11gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4096-11gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4096-30uc No ± 1 ± 1
acA4096-30ucMED No ± 1 ± 1
acA4096-30um No ± 1 ± 1
acA4096-30umMED No ± 1 ± 1
acA4096-40uc No ± 1 ± 1
acA4096-40ucMED No ± 1 ± 1
acA4096-40um No ± 1 ± 1
acA4096-40umMED No ± 1 ± 1
acA4112-8gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4112-8gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4112-20uc No ± 1 ± 1
acA4112-20ucMED No ± 1 ± 1
acA4112-20um No ± 1 ± 1
acA4112-20umMED No ± 1 ± 1
acA4112-30uc No ± 1 ± 1
acA4112-30ucMED No ± 1 ± 1
acA4112-30um No ± 1 ± 1
acA4112-30umMED No ± 1 ± 1
acA5472-5gc No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-5gm No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17uc No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17ucMED No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17um No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17umMED No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
boA1936-400cc No ± 1 ± 1
boA1936-400cm No ± 1 ± 1
boA2448-250cc No ± 1 ± 1
boA2448-250cm No ± 1 ± 1
boA2832-190cc No ± 1 ± 1
boA2832-190cm No ± 1 ± 1
boA4096-93cc No ± 1 ± 1
boA4096-93cm No ± 1 ± 1
boA4096-180cc No ± 1 ± 1
boA4096-180cm No ± 1 ± 1
boA4112-68cc No ± 1 ± 1
boA4112-68cm No ± 1 ± 1
boA4500-45cc No ± 1 ± 1
boA4500-45cm Yes ± 1 ± 1
boA4504-100cc No ± 1 ± 1
boA4504-100cm No ± 1 ± 1
boA5120-150cc No ± 1 ± 1
boA5120-150cm No ± 1 ± 1
boA5120-230cc No ± 1 ± 1
boA5120-230cm No ± 1 ± 1
boA5320-150cc No ± 1 ± 1
boA5320-150cm No ± 1 ± 1
boA5328-100cc No ± 1 ± 1
boA5328-100cm No ± 1 ± 1
boA6500-36cc No ± 1 ± 1
boA6500-36cm Yes ± 1 ± 1
boA8100-16cc No ± 1 ± 1
boA8100-16cm Yes ± 1 ± 1
boA9344-30cc No ± 1 ± 1
boA9344-30cm No ± 1 ± 1
boA9344-70cc No ± 1 ± 1
boA9344-70cm No ± 1 ± 1
boA13440-17cm No ± 1 ± 1
daA720-520uc Yes ± 1 ± 1
daA720-520um Yes ± 1 ± 1
daA1280-54uc No ± 1a ± 1
daA1280-54um No ± 1a ± 1
daA1440-220uc Yes ± 1 ± 1
daA1440-220um Yes ± 1 ± 1
daA1600-60uc No ± 1a ± 1
daA1600-60um No ± 1a ± 1
daA1920-15um No ± 1a ± 1
daA1920-30uc No ± 1a ± 1
daA1920-30um No ± 1a ± 1
daA1920-160uc No ± 1 ± 1
daA1920-160um No ± 1 ± 1
daA2448-70uc No ± 1 ± 1
daA2448-70um No ± 1 ± 1
daA2500-14uc No ± 1a ± 1
daA2500-14um No ± 1a ± 1
daA3840-45uc No ± 1 ± 0.0625
daA3840-45um No ± 1 ± 0.0625
dmA720-290gc No ± 1 ± 1
dmA720-290gm No ± 1 ± 1
dmA1440-73gc No ± 1 ± 1
dmA1440-73gm No ± 1 ± 1
dmA1920-51gc No ± 1 ± 1
dmA1920-51gm No ± 1 ± 1
puA1280-54uc No ± 1a ± 1
puA1280-54um No ± 1a ± 1
puA1600-60uc No ± 1a ± 1
puA1600-60um No ± 1a ± 1
puA1920-30uc No ± 1a ± 1
puA1920-30um No ± 1a ± 1
puA2500-14uc No ± 1a ± 1
puA2500-14um No ± 1a ± 1
r2L2048-29gc No ± 1 ± 1
r2L2048-58gm No ± 1 ± 1
r2L2048-62cc No ± 1 ± 1
r2L2048-62g5c No ± 1 ± 1
r2L2048-172cm No ± 1 ± 1
r2L2048-172g5m No ± 1 ± 1
r2L4096-14gc No ± 1 ± 1
r2L4096-29gm No ± 1 ± 1
r2L4096-42cc No ± 1 ± 1
r2L4096-42g5c No ± 1 ± 1
r2L4096-84cm No ± 1 ± 1
r2L4096-84g5m No ± 1 ± 1
r2L8192-200cm No ± 1 ± approx. 1
r2L16384-120cm No ± 1 ± approx. 1

  1. On daA1280-54um/uc, daA1280-54lm/uc, and puA1280-54um/uc cameras, the black level settings are applied to the pixel data after the gain settings. On all other dart and pulse cameras, the black level settings are applied before the gain settings.

Sample Code#

ace Classic/U/L GigE Cameras#
// 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"
Other Cameras#
// Enable sensor black level adjustment
// Note: Available on racer 2 L camera models only
camera.BlackLevelSelector.SetValue(BlackLevelSelector_Sensor);
// 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 sensor black level adjustment
// Note: Available on racer 2 L camera models only
CEnumParameter(nodemap, "BlackLevelSelector").SetValue("Sensor");
// 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 sensor black level adjustment
// Note: Available on racer 2 L camera models only
camera.Parameters[PLCamera.BlackLevelSelector].SetValue(PLCamera.BlackLevelSelector.Sensor);
// 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 sensor black level adjustment */
/* Note: Available on racer 2 L camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BlackLevelSelector", "Sensor");
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 sensor black level adjustment
# Note: Available on racer 2 L camera models only
camera.BlackLevelSelector.Value = "Sensor"
# 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"

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