跳转到内容

Gray Value Adjustment Damping#

相机的 Gray Value Adjustment Damping 功能控制在 Exposure Auto 和/或 Gain Auto 启用的情况下,像素灰度值的变化速度。

此功能类似于 Brightness Adjustment Damping 功能,该功能仅在 Basler dartpulse 型号的相机上可用。

该功能的使用#

运作原理#

灰度值调整阻尼系数越低,达到目标亮度值速度越慢。这有助于避免自动功能因对象进出相机视野而中断等。

信息

Brightness Adjustment Damping 功能(仅在 Basler dartpulse 型号的相机上可用)以截然相反的方式工作:亮度调整阻尼系数越低,达到目标亮度值的速度就越快。

指定阻尼系数#

To specify a damping factor:

  1. Exposure Auto 和/或 Gain Auto 自动功能设置为 OnceContinuous
  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
CEnumerationPtr(nodemap.GetNode("GainAuto"))->FromString("Continuous");
// Set gray value adjustment damping to 0.5859
CFloatPtr(nodemap.GetNode("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);
// Enable Gain Auto by setting the operating mode to Continuous
Pylon.DeviceFeatureFromString(hdev, "GainAuto", "Continuous");
// Set gray value adjustment damping to 0.5859
Pylon.DeviceSetFloatFeature(hdev, "GrayValueAdjustmentDampingAbs", 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);

您也可以使用 pylon Viewer 轻松设置参数。