跳转到内容

Gain Auto (dart E)#

相机的 Gain Auto 功能会在指定的限值内自动调整增益,直到达到目标亮度值为止。

如果要同时使用 Gain Auto 和 Exposure Auto,使用 Auto Function Profile 功能可以指定如何平衡两者效果。

要手动调整增益,请使用 Gain 功能。

该功能的使用#

启用或禁用 Gain Auto#

To enable or disable the Gain Auto auto function, set the GainAuto parameter to one of the following operating modes:

  • Continuous: The camera adjusts the gain continuously while images are being acquired.
  • Off: Disables the Gain Auto auto function. The gain remains at the value resulting from the last automatic or manual adjustment.

信息

  • 在 daA2500-60mc 相机上,启用或禁用 Gain Auto 时,同时也会启用或禁用 Exposure Auto。
  • 当相机连续拍摄图像时,自动功能会在经过较短的延迟后生效。前几张图像可能不受自动功能的影响。

指定上限#

信息

该功能仅适用于 daA…mci 相机。

The auto function adjusts the Gain parameter value within specified limits.

To change the upper limit, set the AutoGainUpperLimit parameters to the desired value (in µs).

在自动调节过程中,增益不会高于指定的限值范围。

指定目标亮度值#

信息

该功能仅适用于 daA…mci 相机。

自动功能会调整增益,直至达到目标亮度值(即平均灰度值)为止。

To specify the target value, use the AutoTargetBrightness parameter.

信息

  • 目标值计算不包括其他图像优化,例如 Gamma。根据设置的图像优化,相机输出的图像平均灰度值可能会明显低于或高于目标值。
  • The camera also uses the AutoTargetBrightness parameter to control the Exposure Auto auto function. If you want to use Gain Auto and Exposure Auto at the same time, use the Auto Function Profile feature to specify how the effects of both are balanced.

示例代码#

// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = camera.AutoGainUpperLimit.GetMax();
camera.AutoGainUpperLimit.SetValue(maxUpperLimit);
// Specify the target value
camera.AutoTargetBrightness.SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = CFloatParameter(nodemap, "AutoGainUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoGainUpperLimit").SetValue(maxUpperLimit);
// Specify the target value
CFloatParameter(nodemap, "AutoTargetBrightness").SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// Set the the Gain Auto auto function to its maximum upper limit
double maxUpperLimit = camera.Parameters[PLCamera.AutoGainUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoGainUpperLimit].SetValue(maxUpperLimit);
// Specify the target value
camera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);
// Enable Gain Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.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 the Gain Auto auto function to its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoGainUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Specify the target value */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoTargetBrightness", 0.6);
CHECK(errRes);
/* Enable Gain Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
# Set the the Gain Auto auto function to its maximum upper limit
maxUpperLimit = camera.AutoGainUpperLimit.Max
camera.AutoGainUpperLimit.Value = maxUpperLimit
# Specify the target value
camera.AutoTargetBrightness.Value = 0.6
# Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.Value = "Continuous"

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