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

Gray Value Adjustment Damping#

Gray Value Adjustment Damping camera feature 可控制啟用 Exposure Auto、Gain Auto 或兩者時,像素灰階值變更的速度。

此功能類似 Brightness Adjustment Damping 功能,該功能僅適用於部分 USB 3.0 Basler dart 和 pulse 相機型號。

使用功能#

運作原理#

gray value adjustment damping 係數越低,達到目標亮度值的速度就越慢。這例如有助於避免自動功能受到進出相機視野的物件干擾。

資訊

Brightness Adjustment Damping 功能僅適用於部分 USB 3.0 Basler dart 和 pulse 相機型號,其運作方式則相反:brightness adjustment damping 係數越低,達到目標亮度值的速度越快。

指定 Damping Factor#

若要指定阻尼係數:

  1. 將相機中的 Exposure Auto 或 Gain Auto 自動功能或兩者以 Once 或 Continuous.
  2. 將相機中的 GrayValueAdjustmentDampingAbs 參數設定為所需的數值。

您可以在 0.0 到 0.78125 的範圍內設定此參數。使用較高的參數值意味著能更快達到目標值。

此係數的預設值為 0.6836。在此設定下,阻尼控制可達到盡可能穩定且快速的狀態。

範例程式碼#

// Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
// Set gray value adjustment damping to 0.5859
camera.GrayValueAdjustmentDampingAbs.SetValue(0.5859);
INodeMap& nodemap = camera.GetNodeMap();
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// Set gray value adjustment damping to 0.5859
CFloatParameter(nodemap, "GrayValueAdjustmentDampingAbs").SetValue(0.5859);
// Enable Gain Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
// Set gray value adjustment damping to 0.5859
camera.Parameters[PLCamera.GrayValueAdjustmentDampingAbs].SetValue(0.5859);
/* 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 */
/* Enable Gain Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
/* Set gray value adjustment damping to 0.5859 */
errRes = PylonDeviceSetFloatFeature(hdev, "GrayValueAdjustmentDampingAbs", 0.5859);
CHECK(errRes);
# Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.Value = "Continuous"
# Set gray value adjustment damping to 0.5859
camera.GrayValueAdjustmentDampingAbs.Value = 0.5859

您也可以 use the pylon Viewer 來輕鬆設定參數。