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.

On ace 2 and boost cameras, all parameter names of this feature are prefixed with Bsl. Example: BslLightSourcePresetSelector.

In this topic Hide

Using the Feature

Prerequisites

The pixel format must be set to one of the supported pixel formats.

Selecting a Light Source Preset

To select a light source preset, set the LightSourceSelectorLightSourcePreset parameter to one of the following values:

The default light source preset varies by camera model.

Impact on Other Features

When you select a light source preset, the camera adjusts the settings of the following color enhancement features:

The settings will be optimized for the selected light source.

On some camera models, you can choose which features you want the camera to adjust.

Separate Processing

On some camera models,  when you select a light source preset, the camera processes the changes to the features listed above separately. This means that the values of the corresponding parameters visible in the pylon API and the pylon Viewer are not changed.

Example: If you select the  TungstenTungsten2800K light source preset, the camera adjusts the white balance, but the values of the BalanceRatioAbsBalanceRatio parameter don't change.

This has the advantage that you don't lose your color enhancement feature settings when you change the light source preset. Your own settings are independent from the light source preset adjustments.

No Separate Processing

On some camera models, when you select a light source preset, the camera doesn't process the feature changes separately. Instead, the camera directly adjusts the corresponding parameter values.

Example: If you select the  TungstenTungsten2800K light source preset, the values of the BalanceRatioAbsBalanceRatio parameter change. You can see the changes in the pylon Viewer or by accessing the parameter via the pylon API.

This means if you set up the color enhancement features and then change the light source preset, your settings will be overwritten.

Light Source Preset Feature Selector

On some camera models, the BslLightSourcePresetFeatureSelector parameter is available.

If the parameter is available, you can select which features you want the camera to adjust when you select a light source preset.

By default, the camera adjusts all features.

To enable or disable adjustment of a specific feature:

  1. Set the BslLightSourcePresetFeatureSelector parameter to the desired feature, e.g., ColorAdjustment.
  2. Set the BslLightSourcePresetFeatureEnable parameter to true (feature enabled) or false (feature disabled).
  3. Repeat steps 1 and 2 for all features that you want to enable or disable.

External Links

Specifics

Camera Model Pixel Formats Supported Available Light Source Presets Default Light Source Preset Separate Processing? Feature Selector Available?
Mono cameras Light Source Preset feature not supported
All ace 2 GigE color cameras

All

  • Off
  • Tungsten
  • Daylight 5000 K
  • Daylight 6500 K

Off

Yes

Yes

All ace 2 USB 3.0 color cameras

All

  • Off
  • Tungsten
  • Daylight 5000 K
  • Daylight 6500 K

Off

Yes

Yes

acA640-90gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA640-120gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA640-300gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA720-290gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA780-75gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA800-200gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1280-60gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA1300-22gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA1300-30gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA1300-60gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1300-75gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1440-73gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1600-20gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1600-60gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1920-25gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA1920-40gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA1920-48gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA1920-50gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA2000-50gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA2040-25gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA2040-35gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA2440-20gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA2500-14gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Off No No
acA2500-20gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA2500-20gcMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
  • Custom
Daylight 6500 K No No
acA3088-16gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA3800-10gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA4024-8gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA4096-11gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA4112-8gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA4600-7gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA5472-5gc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten
  • Custom
Daylight 5000 K No No
acA640-750uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA640-90uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA640-120uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA720-520uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA800-510uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1300-200uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1300-30uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1440-220uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1600-20uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1920-25uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1920-40uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1920-40ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 6500 K No No
acA1920-150uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1920-155uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA1920-155ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 6500 K No No
acA2040-90uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2000-165uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2040-55uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2040-120uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2440-35uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2440-35ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 6500 K No No
acA2440-75uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2440-75ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 6500 K No No
acA2500-14uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA2500-60uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA3088-57uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA3800-14uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4024-29uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4096-30uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4096-30ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 5000 K No No
acA4096-40uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4096-40ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 5000 K No No
acA4112-20uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4112-20ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 5000 K No No
acA4112-30uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA4112-30ucMED All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
  • Microscope LED 4500 K
  • Microscope LED 5500 K
  • Microscope LED 6000 K
Daylight 5000 K No No
acA4600-10uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
acA5472-17uc All
  • Off
  • Daylight 5000 K
  • Daylight 6500 K
  • Tungsten 2800 K
Daylight 5000 K No No
boA4096-93cc All
  • Off
  • Tungstenb
  • Daylight 5000 Kb
  • Daylight 6500 Kb
Off Yes Yes
boA4112-68cc All
  • Off
  • Tungstenb
  • Daylight 5000 Kb
  • Daylight 6500 Kb
Off Yes Yes

All dart BCON for LVDS color cameras

YCbCr422

RGB 8

  • Off
  • Daylight 5000 Ka
  • Daylight 6500 Ka
  • Tungsten 2800 Ka

Daylight 5000 K

No No

All dart BCON for MIPI color cameras

All

  • Daylight 5000 K
  • Daylight 6500 K
  • Fluorescent 4000 K
  • Tungsten 2800 K

Daylight 5000 K

No No

All dart USB 3.0 color cameras

YCbCr422

RGB 8

  • Off
  • Daylight 5000 Ka
  • Daylight 6500 Ka
  • Tungsten 2800 Ka

Daylight 5000 K

No No

All pulse USB 3.0 color cameras

YCbCr422

RGB 8

  • Off
  • Daylight 5000 Ka
  • Daylight 6500 Ka
  • Tungsten 2800 Ka

Daylight 5000 K

No No

aIf the Balance White Auto auto function is set to Off, you must reset the white balance before changing the light source preset. To do so, set the BalanceRatio parameter value for all color channels (red, green, and blue) to 1.

bValid when an IR cut filter is used which passes the range from 400–700 nm of the visible light.

 

Sample Code

// Disable light source presets (no correction)
camera.LightSourceSelector.SetValue(LightSourceSelector_Off);
// Set the light source preset for daylight (at about 5000K)
camera.LightSourceSelector.SetValue(LightSourceSelector_Daylight);
// Set the light source preset for tungsten lighting
camera.LightSourceSelector.SetValue(LightSourceSelector_Tungsten);
// NOTE: On ace 2 and boost cameras, all parameters below must be prefixed with Bsl.
// Example: BslLightSourcePresetSelector
// 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);
// Set the light source preset for tungsten lighting
camera.LightSourcePreset.SetValue(LightSourcePreset_Tungsten2800K);
// Disable adjustment of a specific feature (ace 2 and boost cameras only)
camera.BslLightSourcePresetFeatureSelector.SetValue(BslLightSourcePresetFeatureSelector_ColorAdjustment);
camera.BslLightSourcePresetFeatureEnable.SetValue(false);
INodeMap& nodemap = camera.GetNodeMap();
// Disable light source presets (no correction)
CEnumerationPtr(nodemap.GetNode("LightSourceSelector"))->FromString("Off");
// Set the light source preset for daylight (at about 5000K)
CEnumerationPtr(nodemap.GetNode("LightSourceSelector"))->FromString("Daylight");
// Set the light source preset for tungsten lighting
CEnumerationPtr(nodemap.GetNode("LightSourceSelector"))->FromString("Tungsten");
// NOTE: On ace 2 and boost cameras, all parameters below must be prefixed with Bsl.
// Example: BslLightSourcePresetSelector
// Disable light source presets (no correction)
CEnumerationPtr(nodemap.GetNode("LightSourcePreset"))->FromString("Off");
// Set the light source preset for daylight (at about 5000K)
CEnumerationPtr(nodemap.GetNode("LightSourcePreset"))->FromString("Daylight5000K");
// Set the light source preset for tungsten lighting
CEnumerationPtr(nodemap.GetNode("LightSourcePreset"))->FromString("Tungsten2800K");
// Disable adjustment of a specific feature (ace 2 and boost cameras only)
CEnumerationPtr(nodemap.GetNode("BslLightSourcePresetFeatureSelector"))->FromString("ColorAdjustment");
CBooleanPtr(nodemap.GetNode("BslLightSourcePresetFeatureEnable"))->SetValue(false);
// Disable light source presets (no correction)
camera.Parameters[PLCamera.LightSourceSelector].SetValue(PLCamera.LightSourceSelector.Off);
// Set the light source preset for daylight (at about 5000K)
camera.Parameters[PLCamera.LightSourceSelector].SetValue(PLCamera.LightSourceSelector.Daylight);
// Set the light source preset for tungsten lighting
camera.Parameters[PLCamera.LightSourceSelector].SetValue(PLCamera.LightSourceSelector.Tungsten);
// NOTE: On ace 2 and boost cameras, all parameters below must be prefixed with Bsl.
// Example: BslLightSourcePresetSelector
// Disable light source presets (no correction)
camera.Parameters[PLCamera.LightSourcePreset].SetValue(PLCamera.LightSourcePreset.Off);
// Set the light source preset for daylight (at about 5000K)
camera.Parameters[PLCamera.LightSourcePreset].SetValue(PLCamera.LightSourcePreset.Daylight5000K);
// Set the light source preset for tungsten lighting
camera.Parameters[PLCamera.LightSourcePreset].SetValue(PLCamera.LightSourcePreset.Tungsten2800K);
// Disable adjustment of a specific feature (ace 2 and boost cameras only)
camera.Parameters[PLCamera.BslLightSourcePresetFeatureSelector].SetValue(PLCamera.BslLightSourcePresetFeatureSelector.ColorAdjustment);
camera.Parameters[PLCamera.BslLightSourcePresetFeatureEnable].SetValue(false);
// Disable light source presets (no correction)
Pylon.DeviceFeatureFromString(hdev, "LightSourceSelector", "Off");
// Set the light source preset for daylight (at about 5000K)
Pylon.DeviceFeatureFromString(hdev, "LightSourceSelector", "Daylight");
// Set the light source preset for tungsten lighting
Pylon.DeviceFeatureFromString(hdev, "LightSourceSelector", "Tungsten");
// NOTE: On ace 2 and boost cameras, all parameters below must be prefixed with Bsl.
// Example: BslLightSourcePresetSelector
// Disable light source presets (no correction)
Pylon.DeviceFeatureFromString(hdev, "LightSourcePreset", "Off");
// Set the light source preset for daylight (at about 5000K)
Pylon.DeviceFeatureFromString(hdev, "LightSourcePreset", "Daylight5000K");
// Set the light source preset for tungsten lighting
Pylon.DeviceFeatureFromString(hdev, "LightSourcePreset", "Tungsten2800K");
// Disable adjustment of a specific feature (ace 2 and boost cameras only)
Pylon.DeviceFeatureFromString(hdev, "BslLightSourcePresetFeatureSelector", "ColorAdjustment");
Pylon.DeviceSetBooleanFeature(hdev, "BslLightSourcePresetFeatureEnable", false);
/* 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, "LightSourceSelector", "Off");
CHECK(errRes);
/* Set the light source preset for daylight (at about 5000K) */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourceSelector", "Daylight");
CHECK(errRes);
/* Set the light source preset for tungsten lighting */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourceSelector", "Tungsten");
CHECK(errRes);
/* NOTE: On ace 2 and boost cameras, all parameters below must be prefixed with Bsl. */
/* Example: BslLightSourcePresetSelector */
/* 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);
/* Set the light source preset for tungsten lighting */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourcePreset", "Tungsten2800K");
CHECK(errRes);
/* Disable adjustment of a specific feature (ace 2 and boost cameras only) */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightSourcePresetFeatureSelector", "ColorAdjustment");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "BslLightSourcePresetFeatureEnable", 0);
CHECK(errRes);

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