Gain Offset Auto#
To adjust gain and offset manually, use the BslThermoGain
and the BslThermoOffset
parameters.
Info
You can only use the Gain Offset Auto feature if the PixelFormat
parameter is set to a pixel format based on DN values (Mono 8, Mono 16, and RGB 8). If you use a different pixel format, all parameters for this feature will appear dimmed.
Using the Feature#
How It Works#
- Gain: The camera searches for the highest and the lowest temperature value in an image. All values in between the highest and the lowest value are getting multiplied with the gain value. By doing so, the value range stretches within limits from 0 to 65.535.
- Offset: The offset specified is deducted from the gray values of all pixels.
Automatic gain offset correction automatically adjusts and combines the gain and the offset values of an image.
Info
Changes in the gain value will be applied to the image immediately. If you have changed the gain value while image acquisition, the next picture may contain the old and the new values. All following pictures will only contain the new values.
Configuring Gain Offset Auto#
Set the BslThermoGainOffsetAuto
parameter to one of the following operating modes:
Once
: Gain and offset are adjusted automatically for the current image. The values calculated are stored for future image acquisitions.Continuous
: Gain and offset are adjusted continuously while images are being acquired until theBslThermoGainOffsetAuto
parameter is set toOff
.Off
: Disables the Gain Offset Auto feature.
Sample Code#
C++ // Select a pixel format that represents the pixel as a DN value, e.g., Mono8 camera.PixelFormat.SetValue(PixelFormat_Mono8); // Enable gain offset auto and set the operating mode to Continuous camera.BslThermoGainOffsetAuto.SetValue(BslThermoGainOffsetAuto_Continuous);
C++ INodeMap& nodemap = camera.GetNodeMap(); // Select a pixel format that represents the pixel as a DN value, e.g., Mono8 CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8"); // Enable gain offset auto and set the operating mode to Continuous CEnumParameter(nodemap, "BslThermoGainOffsetAuto").SetValue("Continuous");
C# // Select a pixel format that represents the pixel as a DN value, e.g., Mono8 camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono8); // Enable gain offset auto and set the operating mode to Continuous camera.Parameters[PLCamera.BslThermoGainOffsetAuto].SetValue(PLCamera.BslThermoGainOffsetAuto.Continuous);
```C / 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 / / Select a pixel format that represents the pixel as a DN value, e.g., Mono8 / errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "Mono8"); CHECK(errRes); / Enable gain offset auto and set the operating mode to Continuous / errRes = PylonDeviceFeatureFromString(hdev, "BslThermoGainOffsetAuto", "Continuous"); CHECK(errRes); ```