Skip to content

Thermal Image Correction#

The Thermal Image Correction feature allows you to improve the image quality.

Using the Feature#

How It Works#

Basler thermography cameras offer two methods to improve the image quality:

  • Using the internal correction data set. This is the recommended option.
  • Performing dark frame correction. Dark frame correction should only be used in extreme situations when the internal correction data set doesn't produce the desired results. When performing dark frame correction, the camera closes the shutter and acquires so-called dark frames. Using these dark frames, it calculates a correction data set.

    Example: Assume that the camera was pointed at a very warm object for a long time. Due to the prolonged exposure, the sensor itself has heated up which means that it can't accurately measure the temperature of the target object anymore. By performing a dark frame correction this effect will be counterbalanced, effectively resetting the sensor.

Performing Thermal Image Correction#

Set the BslMdicSource parameter to one of the following values:

Info

If you choose the CorrectionSet option, this is a one-time operation. The correction data set stays active for all future image acquisitions until you set the BslMdicSource parameter to a different value.

Performing Dark Frame Correction#

You can manually create a correction data set to improve the image quality via the dark frame correction.

To configure dark frame correction:

  1. Set the BslMdicSource parameter to DarkFrame.
  2. Specify how many frames you want to use via the BslDarkFrameCorrectionImages parameter.
  3. Use the BslDarkFrameCorrectionTriggerSource parameter to specify how you want to trigger the dark frame correction. You have the following options:
    • Frames: Dark frame correction is performed after a specified number of frames have been acquired. Use the BslDarkFrameCorrectionFrames parameter to specify the number of frames.

    Info

    The camera automatically adjusts the value of the BslDarkFrameCorrectionFrames parameter on the integer scale to the next power of two. E.g., image you have entered 11 as parameter value. The camera will automatically set the value to 16.

    • DeltaTemperature: Dark frame correction is performed when a certain temperature delta is reached. Use the BslDarkFrameCorrectionDeltaTemperature parameter to specify the desired temperature delta.
  4. Set the BslDarkFrameCorrectionMode to one of the following modes:

    • Once: Dark frame correction is enabled and performed immediately.
    • Continuous: Dark frame correction is performed automatically based on the trigger source selected.
    • Off: Dark frame correction is disabled.

Sample Code#

Correction Set#

C++ // Select the internal correction set camera.BslMdicSource.SetValue(BslMdicSource_CorrectionSet);

C++ INodeMap& nodemap = camera.GetNodeMap(); // Select the internal correction set CEnumParameter(nodemap, "BslMdicSource").SetValue("CorrectionSet");

C# // Select the internal correction set camera.Parameters[PLCamera.BslMdicSource].SetValue(PLCamera.BslMdicSource.CorrectionSet);

```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 the internal correction set / errRes = PylonDeviceFeatureFromString(hdev, "BslMdicSource", "CorrectionSet"); CHECK(errRes); ```

Dark Frame Correction - Frames as Trigger Source#

C++ // Select and enable the dark frame correction camera.BslMdicSource.SetValue(BslMdicSource_Darkframe); // Specify the number of frames used for dark frame correction camera.BslDarkFrameCorrectionImages.SetValue(10); // Select Frames as trigger source for dark frame correction camera.BslDarkFrameCorrectionTriggerSource.SetValue(BslDarkFrameCorrectionTriggerSource_Frames); // Set the number of frames after which the dark frame correction is performed, e.g., 1000 camera.BslDarkFrameCorrectionFrames.SetValue(1000); // Enable dark frame correction continuously. The dark frame correction is executed after every 1000 frames. camera.BslDarkFrameCorrectionMode.SetValue(BslDarkFrameCorrectionMode_Continuous);

C++ INodeMap& nodemap = camera.GetNodeMap(); // Select and enable the dark frame correction CEnumParameter(nodemap, "BslMdicSource").SetValue("Darkframe"); // Specify the number of frames used for dark frame correction CIntegerParameter(nodemap, "BslDarkFrameCorrectionImages").SetValue(10); // Select Frames as trigger source for dark frame correction CEnumParameter(nodemap, "BslDarkFrameCorrectionTriggerSource").SetValue("Frames"); // Set the number of frames after which the dark frame correction is performed, e.g., 1000 CIntegerParameter(nodemap, "BslDarkFrameCorrectionFrames").SetValue(1000); // Enable dark frame correction continuously. The dark frame correction is executed after every 1000 frames. CEnumParameter(nodemap, "BslDarkFrameCorrectionMode").SetValue("Continuous");

C# // Select and enable the dark frame correction camera.Parameters[PLCamera.BslMdicSource].SetValue(PLCamera.BslMdicSource.Darkframe); // Specify the number of frames used for dark frame correction camera.Parameters[PLCamera.BslDarkFrameCorrectionImages].SetValue(10); // Select Frames as trigger source for dark frame correction camera.Parameters[PLCamera.BslDarkFrameCorrectionTriggerSource].SetValue(PLCamera.BslDarkFrameCorrectionTriggerSource.Frames); // Set the number of frames after which the dark frame correction is performed, e.g., 1000 camera.Parameters[PLCamera.BslDarkFrameCorrectionFrames].SetValue(1000); // Enable dark frame correction continuously. The dark frame correction is executed after every 1000 frames. camera.Parameters[PLCamera.BslDarkFrameCorrectionMode].SetValue(PLCamera.BslDarkFrameCorrectionMode.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 and enable the dark frame correction / errRes = PylonDeviceFeatureFromString(hdev, "BslMdicSource", "Darkframe"); CHECK(errRes); / Specify the number of frames used for dark frame correction / errRes = PylonDeviceSetIntegerFeature(hdev, "BslDarkFrameCorrectionImages", 10); CHECK(errRes); / Select Frames as trigger source for dark frame correction / errRes = PylonDeviceFeatureFromString(hdev, "BslDarkFrameCorrectionTriggerSource", "Frames"); CHECK(errRes); / Set the number of frames after which the dark frame correction is performed, e.g., 1000 / errRes = PylonDeviceSetIntegerFeature(hdev, "BslDarkFrameCorrectionFrames", 1000); CHECK(errRes); / Enable dark frame correction continuously. The dark frame correction is executed after every 1000 frames. / errRes = PylonDeviceFeatureFromString(hdev, "BslDarkFrameCorrectionMode", "Continuous"); CHECK(errRes); ```

Delta Temperature as Trigger Source#

C++ // Select and enable the dark frame correction camera.BslMdicSource.SetValue(BslMdicSource_Darkframe); // Specify the number of frames used for dark frame correction camera.BslDarkFrameCorrectionImages.SetValue(10); // Select delta temperature as trigger source for dark frame correction camera.BslDarkFrameCorrectionTriggerSource.SetValue(BslDarkFrameCorrectionTriggerSource_DeltaTemperature); // Set the delta temperature after which the dark frame correction is performed e.g. 4.0 camera.BslDarkFrameCorrectionDeltaTemperature.SetValue(4.0); // Enable dark frame correction continuously. The darkframe correction is executed as soon as the average temperature changes by 4.0 [K]. camera.BslDarkFrameCorrectionMode.SetValue(BslDarkFrameCorrectionMode_Continuous);

C++ INodeMap& nodemap = camera.GetNodeMap(); // Select and enable the dark frame correction CEnumParameter(nodemap, "BslMdicSource").SetValue("Darkframe"); // Specify the number of frames used for dark frame correction CIntegerParameter(nodemap, "BslDarkFrameCorrectionImages").SetValue(10); // Select delta temperature as trigger source for dark frame correction CEnumParameter(nodemap, "BslDarkFrameCorrectionTriggerSource").SetValue("DeltaTemperature"); // Set the delta temperature after which the dark frame correction is performed e.g. 4.0 CFloatParameter(nodemap, "BslDarkFrameCorrectionDeltaTemperature").SetValue(4.0); // Enable dark frame correction continuously. The darkframe correction is executed as soon as the average temperature changes by 4.0 [K]. CEnumParameter(nodemap, "BslDarkFrameCorrectionMode").SetValue("Continuous");

C# // Select and enable the dark frame correction camera.Parameters[PLCamera.BslMdicSource].SetValue(PLCamera.BslMdicSource.Darkframe); // Specify the number of frames used for dark frame correction camera.Parameters[PLCamera.BslDarkFrameCorrectionImages].SetValue(10); // Select delta temperature as trigger source for dark frame correction camera.Parameters[PLCamera.BslDarkFrameCorrectionTriggerSource].SetValue(PLCamera.BslDarkFrameCorrectionTriggerSource.DeltaTemperature); // Set the delta temperature after which the dark frame correction is performed e.g. 4.0 camera.Parameters[PLCamera.BslDarkFrameCorrectionDeltaTemperature].SetValue(4.0); // Enable dark frame correction continuously. The darkframe correction is executed as soon as the average temperature changes by 4.0 [K]. camera.Parameters[PLCamera.BslDarkFrameCorrectionMode].SetValue(PLCamera.BslDarkFrameCorrectionMode.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 and enable the dark frame correction / errRes = PylonDeviceFeatureFromString(hdev, "BslMdicSource", "Darkframe"); CHECK(errRes); / Specify the number of frames used for dark frame correction / errRes = PylonDeviceSetIntegerFeature(hdev, "BslDarkFrameCorrectionImages", 10); CHECK(errRes); / Select delta temperature as trigger source for dark frame correction / errRes = PylonDeviceFeatureFromString(hdev, "BslDarkFrameCorrectionTriggerSource", "DeltaTemperature"); CHECK(errRes); / Set the delta temperature after which the dark frame correction is performed e.g. 4.0 / errRes = PylonDeviceSetFloatFeature(hdev, "BslDarkFrameCorrectionDeltaTemperature", 4.0); CHECK(errRes); / Enable dark frame correction continuously. The darkframe correction is executed as soon as the average temperature changes by 4.0 [K]. / errRes = PylonDeviceFeatureFromString(hdev, "BslDarkFrameCorrectionMode", "Continuous"); CHECK(errRes); ```

Back to top