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

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 參數設定為所需的數值(以 µs 為單位)。

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

如果上限設定得很高,相機的格率可能會下降。

指定目標亮度值#

資訊

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

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

若要指定目標值,請使用 AutoTargetBrightness 參數的值。

資訊

  • 目標值的計算不包含其他影像優化,例如 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 輕鬆設定參數。