Skip to content

Light Source Preset#

The Light Source Preset camera feature allows you to correct color shifts caused by certain light sources.

Depending on its specific color temperature, the light used for image acquisition can cause color shifts in the image. You can correct these color shifts by selecting the related light source preset.

Using the Feature#

Selecting a Light Source Preset#

To select a light source preset, set the LightSourcePreset parameter to one of the following values (if available):

  • Daylight5000K: The camera corrects color shifts caused by daylight lighting that has a color temperature of about 5 000 K.
  • Daylight6500K: The camera corrects color shifts caused by daylight lighting that has a color temperature of about 6 500 K.
  • Fluorescent4000K: The camera corrects color shifts caused by fluorescent lighting that has a color temperature of about 4 000 K.
  • Tungsten2800K: The camera corrects color shifts caused by tungsten lighting that has a color temperature of about 2 500 to 3 000 K.
  • Off: No light source preset is selected.

The default light source preset varies by camera model.

Info

On Basler dart cameras, the light source presets are calibrated for the IR cut filter in the CS-mount variant. If you are using an S-mount or bare board variant, make sure that your IR cut filter has suitable spectral characteristics.

For more information about the IR cut filter, see your camera topic. You can find your camera topic in the "Models" section.

Specifics#

Camera Model Default Light Source Preset Available Light Source Presets Separate Processing Feature Selector Available
daA2500-60mc Daylight 5000 K Daylight 5000 K
Daylight 6500 K
Fluorescent 4000 K
Tungsten 2800 K
No No
daA2500-60mci Light Source Preset feature not supported Light Source Preset feature not supported No No
daA4200-30mci Light Source Preset feature not supported Light Source Preset feature not supported No No

Sample Code#

// Disable light source presets (no correction)
camera.LightSourcePreset.SetValue(LightSourcePreset_Off);
// Set the light source preset for daylight (at about 5000K)
camera.LightSourcePreset.SetValue(LightSourcePreset_Daylight5000K);
INodeMap& nodemap = camera.GetNodeMap();
// Disable light source presets (no correction)
CEnumParameter(nodemap, "LightSourcePreset").SetValue("Off");
// Set the light source preset for daylight (at about 5000K)
CEnumParameter(nodemap, "LightSourcePreset").SetValue("Daylight5000K");
/* 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 */
/* Disable light source presets (no correction) */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourcePreset", "Off");
CHECK(errRes);
/* Set the light source preset for daylight (at about 5000K) */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourcePreset", "Daylight5000K");
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.