Skip to content

Backlight Compensation#

The Backlight Compensation camera feature allows the camera to compensate for underexposed image regions.

Using the Feature#

How It Works#

If there is a bright light behind your image target, the target may be underexposed and appear silhouetted. The Backlight Compensation feature allows the camera to compensate for this effect.

When the feature is enabled, a given percentage of the brightest pixels in the image (i.e., the pixels with the highest pixel values) are not taken into account for the target brightness value calculations performed by the Gain Auto and Exposure Auto auto functions.

For example, setting the parameter value to 0.3 means that 30 % of the brightest pixels in the image will not be taken into account for the target value calculations.

This allows the camera to properly expose the darker regions of the image.

Adjusting Backlight Compensation#

To adjust the backlight compensation:

  1. Enable the Exposure Auto auto function or the Gain Auto auto function or both.
  2. Enter a value for the AutoBacklightCompensation parameter. The parameter's value range is 0 to 0.5.

Sample Code#

// Set the AutoBacklightCompensation parameter to 0.3
camera.AutoBacklightCompensation.SetValue(0.3);
INodeMap& nodemap = camera.GetNodeMap();
// Set the AutoBacklightCompensation parameter to 0.3
CFloatParameter(nodemap, "AutoBacklightCompensation").SetValue(0.3);
// Set the AutoBacklightCompensation parameter to 0.3
camera.Parameters[PLCamera.AutoBacklightCompensation].SetValue(0.3);
/* 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 AutoBacklightCompensation parameter to 0.3 */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoBacklightCompensation", 0.3);
CHECK(errRes);
# Set the AutoBacklightCompensation parameter to 0.3
camera.AutoBacklightCompensation.Value = 0.3

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