Backlight Compensation#
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:
- Enable the Exposure Auto auto function or the Gain Auto auto function or both.
- Enter a value for the
AutoBacklightCompensation
parameter. The parameter's value range is 0 to 0.5.
Sample Code#
/* 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);
You can also use the pylon Viewer to easily set the parameters.