コンテンツにスキップ
ステージングサーバー
開発サーバー

Light Source Preset (dart E)#

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

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

機能を使用する#

Light Source Presetの選択#

Light Source Presetを選択するには、次のように設定します。 LightSourcePreset パラメータ。

利用可能なプリセットは、 BalanceWhiteAuto パラメータ設定によって異なります。

  • If the BalanceWhiteAuto パラメータが次のように設定されていること: Continuousでは、 LightSourcePreset パラメータが次のように設定されていること: Auto、Light Source Presetが自動的に決定されます。
  • If the BalanceWhiteAuto パラメータが次のように設定されていること: Offの場合、以下のプリセットを利用できます:

    • CoolWhiteFluorescent4250K:カメラは、色温度が約4 250 Kの蛍光灯によって引き起こされる色かぶりを補正します。
    • Daylight5000K:色温度約5 000 Kの昼光照明による色シフトを補正します。
    • Daylight6500K:色温度約6 500 Kの昼光照明による色シフトを補正します。
    • Daylight7500K:カメラは、色温度が約7 500 Kの昼光によって引き起こされる色かぶりを補正します。
    • Horizon2500K:カメラは、色温度が約2 500 Kの夕光によって引き起こされる色かぶりを補正します。
    • Manual:色温度を 手動で.
    • Tungsten2800K:色温度約2 500~3 000 Kのタングステン照明による色シフトを補正します。

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

イメージ BslLightSourceColorTemperature パラメータは、現在選択されているLight Source Presetの色温度を示します。

また、Light Source Presetが 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

pylon Viewer を使用してパラメータを簡単に設定することもできます。