コンテンツにスキップ

Light Source Preset (dart E)#

Light Source Presetカメラ機能を使用すると、特定の光源によるカラーシフトを修正できます。

特定の色温度に応じて、画像取得に使用される光が画像内でカラーシフトを引き起こす可能性があります。これらのカラーシフトは、関連する光源の初期値を選択して修正できます。

機能を使用する#

Light Source Presetの選択#

光源の初期値を選択するには、LightSourcePresetパラメーターを設定します。

BalanceWhiteAutoパラメーターの設定に応じて、使用できるプリセットが異なります。

  • BalanceWhiteAutoパラメーターがContinuousに設定されている場合、LightSourcePresetパラメーターはAutoに設定され、光源の初期値は自動的に決定されます。
  • BalanceWhiteAutoパラメーターがOffに設定されている場合、次のプリセットを使用できます。

    • CoolWhiteFluorescent4250K:色温度が約4 250Kの蛍光灯による色ずれを補正します。
    • Daylight5000K:カメラは、約5000Kの色温度を持つ昼光照明によって生じるカラーシフトを補正します。
    • Daylight6500K:カメラは、約6500Kの色温度を持つ昼光照明によって生じるカラーシフトを補正します。
    • Daylight7500K:カメラは、色温度が約7 500Kの昼光色の光に起因するカラーシフトを補正します。
    • Horizon2500K:カメラは、色温度が約2 500Kの電球色の光に起因するカラーシフトを補正します。
    • Manual:色温度を手動で設定できます。
    • Tungsten2800K:カメラは、2500~3000Kの色温度を持つタングステン照明によって生じるカラーシフトを補正します。

色温度の取得または設定#

BslLightSourceColorTemperatureパラメーターは、現在選択されている光源の初期値の色温度を示します。

また、光源の初期値がManualに設定されている場合、パラメーターを使用して色温度を手動で設定できます。

サンプルコード#

// Set the light source preset to Daylight5000K
camera.LightSourcePreset.SetValue(LightSourcePreset_Daylight5000K);
// Get the color temperature of the currently selected light source preset
int64_t i = camera.BslLightSourceColorTemperature.GetValue();
// Set the light source preset to Manual
camera.LightSourcePreset.SetValue(LightSourcePreset_Manual);
// Manually set the color temperature
camera.BslLightSourceColorTemperature.SetValue(7334);
INodeMap& nodemap = camera.GetNodeMap();
// Set the light source preset to Daylight5000K
CEnumParameter(nodemap, "LightSourcePreset").SetValue("Daylight5000K");
// Get the color temperature of the currently selected light source preset
int64_t i = CIntegerParameter(nodemap, "BslLightSourceColorTemperature").GetValue();
// Set the light source preset to Manual
CEnumParameter(nodemap, "LightSourcePreset").SetValue("Manual");
// Manually set the color temperature
CIntegerParameter(nodemap, "BslLightSourceColorTemperature").SetValue(7334);
// Set the light source preset to Daylight5000K
camera.Parameters[PLCamera.LightSourcePreset].SetValue(PLCamera.LightSourcePreset.Daylight5000K);
// Get the color temperature of the currently selected light source preset
Int64 i = camera.Parameters[PLCamera.BslLightSourceColorTemperature].GetValue();
// Set the light source preset to Manual
camera.Parameters[PLCamera.LightSourcePreset].SetValue(PLCamera.LightSourcePreset.Manual);
// Manually set the color temperature
camera.Parameters[PLCamera.BslLightSourceColorTemperature].SetValue(7334);
/* 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 */
int64_t i = 0;
/* Set the light source preset to Daylight5000K */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourcePreset", "Daylight5000K");
CHECK(errRes);
/* Get the color temperature of the currently selected light source preset */
errRes = PylonDeviceGetIntegerFeature(hdev, "BslLightSourceColorTemperature", &i);
CHECK(errRes);
/* Set the light source preset to Manual */
errRes = PylonDeviceFeatureFromString(hdev, "LightSourcePreset", "Manual");
CHECK(errRes);
/* Manually set the color temperature */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslLightSourceColorTemperature", 7334);
CHECK(errRes);
# Set the light source preset to Daylight5000K
camera.LightSourcePreset.Value = "Daylight5000K"
# Get the color temperature of the currently selected light source preset
i = camera.BslLightSourceColorTemperature.Value
# Set the light source preset to Manual
camera.LightSourcePreset.Value = "Manual"
# Manually set the color temperature
camera.BslLightSourceColorTemperature.Value = 7334

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