Exposure Auto (dart E)#
如果您想同時使用 Exposure Auto 和 Gain Auto,請使用 Auto Function Profile 功能來指定兩者效果如何平衡。
若要手動調整 exposure time,請使用 Exposure Time 功能。
使用此功能#
啟用或停用 Exposure Auto#
若要啟用或停用 Exposure Auto 自動功能,請設定 ExposureAuto 參數設為下列其中一個 Operating Mode:
Continuous:在擷取影像時,相機會持續調整 exposure time。Off:停用 Exposure Auto 自動功能。exposure time 將保持上次自動或手動調整所產生的數值。
資訊
- 在 daA2500-60mc 相機上,啟用或停用 Exposure Auto 也會同時啟用或停用 Gain Auto。
- 當相機持續擷取影像時,自動功能會稍有延遲地生效。前幾張影像可能不受自動功能影響。
指定上限#
資訊
此功能僅適用於 daA…mci 相機。
自動功能會在您指定的限制內調整 ExposureTime 將參數值設定在指定的限制內。
若要變更上限,請將 AutoExposureTimeUpperLimit 參數設為所需的值 (以 µs 為單位)。
在自動調整過程中,Exposure Time 絕不會超過指定的上限。
如果上限設定為較高的值,相機的幀率可能會下降。
指定目標亮度值#
資訊
此功能僅適用於 daA…mci 相機。
自動功能會調整 exposure time,直到達到目標亮度值(即平均灰階值)為止。
若要指定目標值,請使用 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 輕鬆設定參數。