Exposure Auto#
オートファンクションの画素データは、1つ以上のオートファンクションROIから取得できます。
Exposure AutoとGain Autoを同時に使用する場合は、Auto Function Profile機能を使用して、両方の効果のバランスを調整する方法を指定します。
露光時間を手動で調整するには、Exposure Time機能を使用します。
機能を使用する#
Exposure Autoの有効化/無効化#
Exposure Autoオートファンクションを有効または無効にするには、次の手順に従います。
- Exposure Autoオートファンクションに少なくとも1つのオートファンクションROIを割り当てます。
オートファンクションROIが画像ROIと部分的または完全にオーバーラップするようにしてください。 ExposureMode
パラメーターをTimed
に設定します。- パラメーターを
ExposureAuto
パラメーターを次のいずれかの動作モードに設定します。Once
:カメラは、指定された明るさの目標値に達するまで露光時間を調整します。これが達成された場合、または最大30回の計算サイクル後に、カメラはオートファンクションをOff
に設定します。それ以後のすべての画像には、最後の計算から得られた露光時間が適用されます。Continuous
:カメラは、画像の取得中に継続的に露光時間を調整します。Off
:Exposure Autoオートファンクションを無効にします。露光時間は、最後の自動調整または手動調整の結果として得られた値に維持されます。
情報
カメラが画像を連続的にキャプチャしている場合、オートファンクションは短い遅延を伴って有効になります。最初の何枚かの画像は、オートファンクションの影響を受けない場合があります。
上限値/下限値の指定#
オートファンクションにより、ExposureTime
パラメーター値がユーザーが指定した制限内で調整されます。
制限値を変更するには、AutoExposureTimeLowerLimit
パラメーターとAutoExposureTimeUpperLimit
パラメーターを目的の値(µs)に設定します。
例:AutoExposureTimeLowerLimit
パラメーターを1000に、AutoExposureTimeUpperLimit
パラメーターを5000に設定したとします。自動調整プロセスでは、露光時間が1000µs未満になることはなく、5000µsを超えることもありません。
AutoExposureTimeUpperLimit
パラメーターを高い値に設定すると、カメラのフレームレートが低下することがあります。
明るさの目標値の指定#
オートファンクションにより、明るさの目標値(平均グレー値など)に達するまで露光時間が調整されます。
目標値を指定するには、AutoTargetBrightness
パラメーターを使用します。
情報
- 目標値の計算には、Gammaなどの他の画像最適化は含まれません。設定された画像最適化によっては、カメラから出力される画像の平均グレー値が、目標値で示されたグレー値よりも大幅に低くなったり高くなったりする場合があります。
- また、カメラは、
AutoTargetBrightness
パラメーターを使用してGain Autoオートファンクションを制御します。Exposure AutoとGain Autoを同時に使用する場合は、Auto Function Profile機能を使用して、両方の効果のバランスを調整する方法を指定します。 - For racer 2 S line scan cameras with CXP interface, the following is true:
The algorithm for generating the target brightness value is applied on the "camera side", and therefore only applied to a single line, not to the complete frame. The complete frame is built in the frame grabber where the randomly selected lines with the applied target brightness value are part of the assembled frame. - 一部のカメラモデルでは、Remove Parameter Limits機能を使用して目標値のパラメーター制限域を拡げることができます。
Basler ace GigEカメラモデルでは、Gray Value Adjustment Damping係数を指定することもできます。Basler dartおよびpulseカメラモデルでは、Brightness Adjustment Damping係数を指定できます。
ダンピング係数を使用すると、目標値に達するまでの時間が長くなります。
サンプルコード#
ace Classic/U/L GigEカメラ#
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoExposureTimeLowerLimitRaw.GetMin();
double maxUpperLimit = camera.AutoExposureTimeUpperLimitRaw.GetMax();
camera.AutoExposureTimeLowerLimitRaw.SetValue(minLowerLimit);
camera.AutoExposureTimeUpperLimitRaw.SetValue(maxUpperLimit);
// Set the target brightness value to 128
camera.AutoTargetValue.SetValue(128);
// Select auto function ROI 1
camera.AutoFunctionAOISelector.SetValue(AutoFunctionAOISelector_AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionAOIUsageIntensity.SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoExposureTimeLowerLimitRaw").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoExposureTimeUpperLimitRaw").GetMax();
CFloatParameter(nodemap, "AutoExposureTimeLowerLimitRaw").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoExposureTimeUpperLimitRaw").SetValue(maxUpperLimit);
// Set the target brightness value to 128
CIntegerParameter(nodemap, "AutoTargetValue").SetValue(128);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionAOISelector").SetValue("AOI1");
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionAOIUsageIntensity").SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "ExposureAuto").SetValue("Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoExposureTimeLowerLimitRaw].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoExposureTimeUpperLimitRaw].GetMaximum();
camera.Parameters[PLCamera.AutoExposureTimeLowerLimitRaw].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoExposureTimeUpperLimitRaw].SetValue(maxUpperLimit);
// Set the target brightness value to 128
camera.Parameters[PLCamera.AutoTargetValue].SetValue(128);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionAOISelector].SetValue(PLCamera.AutoFunctionAOISelector.AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionAOIUsageIntensity].SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.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 minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the Exposure Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoExposureTimeLowerLimitRaw", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimitRaw", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimitRaw", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeUpperLimitRaw", maxUpperLimit);
CHECK(errRes);
/* Set the target brightness value to 128 */
errRes = PylonDeviceSetIntegerFeature(hdev, "AutoTargetValue", 128);
CHECK(errRes);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionAOISelector", "AOI1");
CHECK(errRes);
/* Enable the 'Intensity' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionAOIUsageIntensity", 1);
CHECK(errRes);
/* Enable Exposure Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
# Set the Exposure Auto auto function to its minimum lower limit
# and its maximum upper limit
minLowerLimit = camera.AutoExposureTimeLowerLimitRaw.Min
maxUpperLimit = camera.AutoExposureTimeUpperLimitRaw.Max
camera.AutoExposureTimeLowerLimitRaw.Value = minLowerLimit
camera.AutoExposureTimeUpperLimitRaw.Value = maxUpperLimit
# Set the target brightness value to 128
camera.AutoTargetValue.Value = 128
# Select auto function ROI 1
camera.AutoFunctionAOISelector.Value = "AOI1"
# Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
# for the auto function ROI selected
camera.AutoFunctionAOIUsageIntensity.Value = True
# Enable Exposure Auto by setting the operating mode to Continuous
camera.ExposureAuto.Value = "Continuous"
その他のカメラ#
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoExposureTimeLowerLimit.GetMin();
double maxUpperLimit = camera.AutoExposureTimeUpperLimit.GetMax();
camera.AutoExposureTimeLowerLimit.SetValue(minLowerLimit);
camera.AutoExposureTimeUpperLimit.SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
camera.AutoTargetBrightness.SetValue(0.6);
// Select auto function ROI 1
camera.AutoFunctionROISelector.SetValue(AutoFunctionROISelector_ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionROIUseBrightness.SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoExposureTimeLowerLimit").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoExposureTimeUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoExposureTimeLowerLimit").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoExposureTimeUpperLimit").SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
CFloatParameter(nodemap, "AutoTargetBrightness").SetValue(0.6);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionROISelector").SetValue("ROI1");
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionROIUseBrightness").SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "ExposureAuto").SetValue("Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoExposureTimeLowerLimit].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoExposureTimeUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoExposureTimeLowerLimit].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoExposureTimeUpperLimit].SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
camera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionROISelector].SetValue(PLCamera.AutoFunctionROISelector.ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionROIUseBrightness].SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.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 minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the Exposure Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoExposureTimeLowerLimit", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimit", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Set the target brightness value to 0.6 */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoTargetBrightness", 0.6);
CHECK(errRes);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionROISelector", "ROI1");
CHECK(errRes);
/* Enable the 'Brightness' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionROIUseBrightness", 1);
CHECK(errRes);
/* Enable Exposure Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
# Set the Exposure Auto auto function to its minimum lower limit
# and its maximum upper limit
minLowerLimit = camera.AutoExposureTimeLowerLimit.Min
maxUpperLimit = camera.AutoExposureTimeUpperLimit.Max
camera.AutoExposureTimeLowerLimit.Value = minLowerLimit
camera.AutoExposureTimeUpperLimit.Value = maxUpperLimit
# Set the target brightness value to 0.6
camera.AutoTargetBrightness.Value = 0.6
# Select auto function ROI 1
camera.AutoFunctionROISelector.Value = "ROI1"
# Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
# for the auto function ROI selected
camera.AutoFunctionROIUseBrightness.Value = True
# Enable Exposure Auto by setting the operating mode to Continuous
camera.ExposureAuto.Value = "Continuous"
pylon Viewerを使用して、パラメーターを簡単に設定することもできます。