跳至內容
測試伺服器
開發伺服器

Exposure Auto (dart E)#

Exposure Auto camera feature 會在指定的限制內自動調整 exposure time,直到達到目標亮度為止。

如果您想要同時使用 Exposure Auto 與 Gain Auto,請使用 Auto Function Profile 功能來指定兩者效果如何平衡。

若要手動調整曝光時間,請使用 Exposure Time 功能。

使用功能#

啟用或停用 Exposure Auto#

若要啟用或停用「Exposure Auto 」的自動功能,請設定 ExposureAuto 參數設為下列其中一個 Operating Mode:

  • Continuous:相機在擷取影像時會持續調整曝光時間。
  • Off:停用 Exposure Auto 自動功能。曝光時間維持在上次自動或手動調整所得出的數值。

資訊

  • 在 daA2500-60mc 相機上,啟用或停用「Exposure Auto 」功能,也會同時啟用或停用「Gain Auto 」功能。
  • 當相機持續擷取影像時,自動功能會稍有延遲地生效。前幾張影像可能不會受到自動功能的影響。

指定上限#

資訊

此功能僅適用於 daA…mci 攝影機。

自動功能會在您指定的限制內調整 ExposureTime 參數值在指定範圍內。

若要變更上限,請設定 AutoExposureTimeUpperLimit 將參數設定為所需值(單位:微秒)。

在自動調整過程中,曝光時間絕不會超過指定的上限。

若將上限設定為較高的數值,相機的幀率可能會降低。

指定目標亮度值#

資訊

此功能僅適用於 daA…mci 攝影機。

自動功能會調整曝光時間,直到達到目標亮度值(即平均灰階值)為止。

若要指定目標值,請使用 AutoTargetBrightness 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。

資訊

  • 目標值的計算不包含其他影像最佳化功能,例如 Gamma。根據所設定的影像最佳化功能,相機輸出的影像平均灰階值可能會顯著低於或高於目標值所指示的數值。
  • 相機同時也會使用 AutoTargetBrightness 參數來控制 Gain Auto 自動功能。如果您想同時使用 Exposure Auto 和 Gain Auto ,請使用 Auto Function Profile 功能來指定兩者效果的平衡方式。

範例程式碼#

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

您也可以使用 pylon Viewer 輕鬆設定參數。