コンテンツにスキップ

Gain Auto (dart E)#

Gain Autoカメラ機能により、明るさの目標値に達するまで、指定された範囲内でゲインが自動的に調整されます。

Gain AutoとExposure Autoを同時に使用する場合は、Auto Function Profile機能を使用して、両方の効果のバランスを調整する方法を指定します。

ゲインを手動で調整するには、Gain機能を使用します。

機能を使用する#

Gain Autoの有効化/無効化#

Gainのオートファンクションを有効または無効にするには、GainAutoパラメーターを次のいずれかの動作モードに設定します。

  • Continuous:画像の取得中にカメラがゲインを継続的に調整します。
  • Off:Gain Autoオートファンクションを無効にします。ゲインは、最後の自動調整または手動調整の結果の値に維持されます。

情報

  • daA2500-60mcカメラでは、Gain Autoを有効または無効にすると、Exposure Autoも有効または無効になります。
  • カメラが画像を連続的にキャプチャしている場合、オートファンクションは短い遅延を伴って有効になります。最初の何枚かの画像は、オートファンクションの影響を受けない場合があります。

上限値の指定#

情報

この機能は、daA…mciカメラでのみ使用できます。

オートファンクションは、指定された制限内でGainパラメーター値を調整します。

上限値を変更するには、AutoGainUpperLimitパラメーターを値(μs)に設定します。

自動調整プロセス中、ゲインが指定された制限を超えることはありません。

明るさの目標値の指定#

情報

この機能は、daA…mciカメラでのみ使用できます。

オートファンクションにより、明るさの目標値(平均グレー値など)に達するまでゲインが調整されます。

目標値を指定するには、AutoTargetBrightnessパラメーターを使用します。

情報

  • 目標値の計算には、Gammaなどの他の画像最適化は含まれません。設定された画像最適化によっては、カメラから出力される画像の平均グレー値が、目標値で示されたグレー値よりも大幅に低くなったり高くなったりする場合があります。
  • また、カメラはAutoTargetBrightnessパラメーターを使用して、Exposure Autoのオートファンクションを制御します。Gain AutoとExposure Autoを同時に行う場合は、Auto Function Profile機能を使用して、両方の効果のバランスの調整方法を指定します。

サンプルコード#

// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = camera.AutoGainUpperLimit.GetMax();
camera.AutoGainUpperLimit.SetValue(maxUpperLimit);
// Specify the target value
camera.AutoTargetBrightness.SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = CFloatParameter(nodemap, "AutoGainUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoGainUpperLimit").SetValue(maxUpperLimit);
// Specify the target value
CFloatParameter(nodemap, "AutoTargetBrightness").SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = camera.Parameters[PLCamera.AutoGainUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoGainUpperLimit].SetValue(maxUpperLimit);
// Specify the target value
camera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
/* 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 */
double maxUpperLimit = 0;
/* Set the the Gain Auto auto function to its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoGainUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Specify the target value */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoTargetBrightness", 0.6);
CHECK(errRes);
/* Enable Gain Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
# Set the the Gain Auto auto function to its maximum upper limit
maxUpperLimit = camera.AutoGainUpperLimit.Max
camera.AutoGainUpperLimit.Value = maxUpperLimit
# Specify the target value
camera.AutoTargetBrightness.Value = 0.6
# Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.Value = "Continuous"

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