User`s manual
Features
Basler aviator Camera Link 159
7.14 Gamma Correction
The gamma correction feature lets you modify the brightness of the pixel values output by the
camera’s sensor to account for a non-linearity in the human perception of brightness. To accomplish
the correction, a gamma correction factor (γ) is applied to the brightness value (Y) of each pixel
according to the following formula:
The formula uses uncorrected and corrected pixel brightnesses that are normalized by the
maximum pixel brightness. The maximum pixel brightness equals 255 for 8 bit output, 1023 for 10
bit output, and 4095 for 12 bit output.
When the gamma correction factor is set to 1, the output pixel brightness will not be corrected.
A gamma correction factor between 0 and 1 will result in increased overall brightness, and a gamma
correction factor greater than 1 will result in decreased overall brightness.
In all cases, black (output pixel brightness equals 0) and white (output pixel brightness equals 255
for 8 bit output, 1023 for 10 bit output, and 4095 for 12 bit output) will not be corrected.
You can enable or disable the gamma correction feature by setting the value of the Gamma Enable
parameter.
When gamma correction is enabled, the correction factor is determined by the value of the Gamma
parameter. The Gamma parameter can be set in a range from 0 to 3.99902. So if the Gamma
parameter is set to 1.2, for example, the gamma correction factor will be 1.2.
Enabling Gamma Correction and Setting Gamma Using pylon
You can use the pylon API to set the Gamma Enable and Gamma parameter values from within
your application software. The following code snippet illustrates using the API to set the parameter
values:
// Enable the Gamma feature
Camera.GammaEnable.SetValue( true );
// Set the Gamma value to 1.2
Camera.Gamma.SetValue( 1.2 );
You can also use the Basler pylon Viewer application to easily set the parameters.
For more information about the pylon API and the pylon Viewer, see Section 4 on page 45.
Y
corrected
Y
uncorrected
Y
max
---------------------------
⎝⎠
⎛⎞
γ
Y
max
×=