Gamma (BCON for MIPI)#
Using the Feature#
How It Works#
The camera applies a gamma correction value (γ) to the brightness value of each pixel according to the following formula (red pixel value (R) of a color camera shown as an example):
The maximum pixel value (Rmax) equals, e.g., 255 for 8-bit pixel formats or 1 023 for 10-bit pixel formats.
Configuring Gamma Correction#
To configure gamma correction, set the Gamma
parameter to the desired value. The parameter's value range is 0 to ≈4. - Gamma = 1: The overall brightness remains unchanged. - Gamma < 1: The overall brightness increases. - Gamma > 1: The overall brightness decreases.
In all cases, black pixels (brightness = 0) and white pixels (brightness = maximum) will not be adjusted.
Info
If you enable gamma correction and the pixel format is set to a 12-bit pixel format, some image information will be lost. Pixel data output will still be 12-bit, but the pixel values will be interpolated during the gamma correction process.
Additional Parameters#
Depending on your camera model, the following additional parameters are available:
BslColorSpace
: Allows you to select one of the following gamma correction modes:RGB
: No additional gamma correction value is applied.sRGB
: The image brightness is optimized for display on an sRGB monitor. A gamma correction value of approximately 0.4 is applied. For more information, see the footnotes in the Specifics section.
External Links#
Specifics#
Camera Model | Additional Parameters |
---|---|
daA2500-60mc | Gamma feature not supported |
daA2500-60mci | BslColorSpacea |
daA3840-30mc | Gamma feature not supported |
daA4200-30mci | BslColorSpacea |
-
If the color space is set to
sRGB
, a gamma correction value of approximately 0.4 is applied, theGamma
parameter becomes read-only, and theGamma
parameter value is ignored.
Sample Code#
// Set the Gamma value to 1.2
camera.Gamma.SetValue(1.2);
INodeMap& nodemap = camera.GetNodeMap();
// Set the Gamma value to 1.2
CFloatParameter(nodemap, "Gamma").SetValue(1.2);
/* 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 Gamma value to 1.2 */
errRes = PylonDeviceSetFloatFeature(hdev, "Gamma", 1.2);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.