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
The pixel format must be set to one of the supported pixel formats.
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.
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.
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:
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 |
Yes |
Yes |
All ace 2 USB 3.0 color cameras | All |
|
Off |
Yes |
Yes |
acA640-90gc | All |
|
Off | No | No |
acA640-120gc | All |
|
Off | No | No |
acA640-300gc | All |
|
Daylight 5000 K | No | No |
acA720-290gc | All |
|
Daylight 5000 K | No | No |
acA780-75gc | All |
|
Off | No | No |
acA800-200gc | All |
|
Daylight 5000 K | No | No |
acA1280-60gc | All |
|
Off | No | No |
acA1300-22gc | All |
|
Off | No | No |
acA1300-30gc | All |
|
Off | No | No |
acA1300-60gc | All |
|
Daylight 5000 K | No | No |
acA1300-75gc | All |
|
Daylight 5000 K | No | No |
acA1440-73gc | All |
|
Daylight 5000 K | No | No |
acA1600-20gc | All |
|
Daylight 5000 K | No | No |
acA1600-60gc | All |
|
Daylight 5000 K | No | No |
acA1920-25gc | All |
|
Off | No | No |
acA1920-40gc | All |
|
Off | No | No |
acA1920-48gc | All |
|
Daylight 5000 K | No | No |
acA1920-50gc | All |
|
Off | No | No |
acA2000-50gc | All |
|
Off | No | No |
acA2040-25gc | All |
|
Off | No | No |
acA2040-35gc | All |
|
Daylight 5000 K | No | No |
acA2440-20gc | All |
|
Daylight 5000 K | No | No |
acA2500-14gc | All |
|
Off | No | No |
acA2500-20gc | All |
|
Daylight 5000 K | No | No |
acA2500-20gcMED | All |
|
Daylight 6500 K | No | No |
acA3088-16gc | All |
|
Daylight 5000 K | No | No |
acA3800-10gc | All |
|
Daylight 5000 K | No | No |
acA4024-8gc | All |
|
Daylight 5000 K | No | No |
acA4096-11gc | All |
|
Daylight 5000 K | No | No |
acA4112-8gc | All |
|
Daylight 5000 K | No | No |
acA4600-7gc | All |
|
Daylight 5000 K | No | No |
acA5472-5gc | All |
|
Daylight 5000 K | No | No |
acA640-750uc | All |
|
Daylight 5000 K | No | No |
acA640-90uc | All |
|
Daylight 5000 K | No | No |
acA640-120uc | All |
|
Daylight 5000 K | No | No |
acA720-520uc | All |
|
Daylight 5000 K | No | No |
acA800-510uc | All |
|
Daylight 5000 K | No | No |
acA1300-200uc | All |
|
Daylight 5000 K | No | No |
acA1300-30uc | All |
|
Daylight 5000 K | No | No |
acA1440-220uc | All |
|
Daylight 5000 K | No | No |
acA1600-20uc | All |
|
Daylight 5000 K | No | No |
acA1920-25uc | All |
|
Daylight 5000 K | No | No |
acA1920-40uc | All |
|
Daylight 5000 K | No | No |
acA1920-40ucMED | All |
|
Daylight 6500 K | No | No |
acA1920-150uc | All |
|
Daylight 5000 K | No | No |
acA1920-155uc | All |
|
Daylight 5000 K | No | No |
acA1920-155ucMED | All |
|
Daylight 6500 K | No | No |
acA2040-90uc | All |
|
Daylight 5000 K | No | No |
acA2000-165uc | All |
|
Daylight 5000 K | No | No |
acA2040-55uc | All |
|
Daylight 5000 K | No | No |
acA2040-120uc | All |
|
Daylight 5000 K | No | No |
acA2440-35uc | All |
|
Daylight 5000 K | No | No |
acA2440-35ucMED | All |
|
Daylight 6500 K | No | No |
acA2440-75uc | All |
|
Daylight 5000 K | No | No |
acA2440-75ucMED | All |
|
Daylight 6500 K | No | No |
acA2500-14uc | All |
|
Daylight 5000 K | No | No |
acA2500-60uc | All |
|
Daylight 5000 K | No | No |
acA3088-57uc | All |
|
Daylight 5000 K | No | No |
acA3800-14uc | All |
|
Daylight 5000 K | No | No |
acA4024-29uc | All |
|
Daylight 5000 K | No | No |
acA4096-30uc | All |
|
Daylight 5000 K | No | No |
acA4096-30ucMED | All |
|
Daylight 5000 K | No | No |
acA4096-40uc | All |
|
Daylight 5000 K | No | No |
acA4096-40ucMED | All |
|
Daylight 5000 K | No | No |
acA4112-20uc | All |
|
Daylight 5000 K | No | No |
acA4112-20ucMED | All |
|
Daylight 5000 K | No | No |
acA4112-30uc | All |
|
Daylight 5000 K | No | No |
acA4112-30ucMED | All |
|
Daylight 5000 K | No | No |
acA4600-10uc | All |
|
Daylight 5000 K | No | No |
acA5472-17uc | All |
|
Daylight 5000 K | No | No |
boA4096-93cc | All |
|
Off | Yes | Yes |
boA4112-68cc | All |
|
Off | Yes | Yes |
All dart BCON for LVDS color cameras |
YCbCr422 RGB 8 |
|
Daylight 5000 K |
No | No |
All dart BCON for MIPI color cameras |
All |
|
Daylight 5000 K |
No | No |
All dart USB 3.0 color cameras |
YCbCr422 RGB 8 |
|
Daylight 5000 K |
No | No |
All pulse USB 3.0 color cameras |
YCbCr422 RGB 8 |
|
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.
// 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.