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

Auto Function Profile (dart E)#

Auto Function Profile 相機功能用於定義在相機進行自動調整時,增益與曝光時間的平衡方式。

使用功能#

設定 Auto Function Profile#

若要設定 Auto Function Profile:

  1. 將相機中的 Gain Auto auto function 以及 Exposure Auto auto function 設為 Continuous.
  2. 將相機中的 AutoFunctionProfile 參數設定為以下值之一:
    • AntiFlicker50Hz: 啟用針對 50 Hz 電源線頻率的閃爍抑制功能(適用於例如歐洲等地)。
    • AntiFlicker60Hz: 啟用針對 60 Hz 電源線頻率的閃爍抑制功能(例如適用於北美地區)。
    • AntiFlickerAuto: 啟用閃爍抑制功能,並具備自動檢測電源線頻率的功能。
    • MinimizeExposureTime: 在自動調整過程中,曝光時間會盡可能縮短。
    • MinimizeGain (預設):在自動調整過程中,增益會維持在盡可能低的水平。

範例程式碼#

// Set the auto function profile to Minimize Gain
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_MinimizeGain);
// Set the auto function profile to Minimize Exposure Time
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_MinimizeExposureTime);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the auto function profile to Minimize Gain
CEnumParameter(nodemap, "AutoFunctionProfile").SetValue("MinimizeGain");
// Set the auto function profile to Minimize Exposure Time
CEnumParameter(nodemap, "AutoFunctionProfile").SetValue("MinimizeExposureTime");
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
CEnumParameter(nodemap, "ExposureAuto").SetValue("Continuous");
// Set the auto function profile to Minimize Gain
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.MinimizeGain);
// Set the auto function profile to Minimize Exposure Time
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.MinimizeExposureTime);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.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 */
/* Set the auto function profile to Minimize Gain */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeGain");
CHECK(errRes);
/* Set the auto function profile to Minimize Exposure Time */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeExposureTime");
CHECK(errRes);
/* Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
# Set the auto function profile to Minimize Gain
camera.AutoFunctionProfile.Value = "MinimizeGain"
# Set the auto function profile to Minimize Exposure Time
camera.AutoFunctionProfile.Value = "MinimizeExposureTime"
# Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.GainAuto.Value = "Continuous"
camera.ExposureAuto.Value = "Continuous"

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