跳转到内容
STAGING SERVER
DEVELOPMENT SERVER

Exposure Auto (dart E)#

相机的 Exposure Auto 功能会自动在指定限值内调整曝光时间,直到达到目标亮度为止。

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

要手动调整曝光时间,请使用 Exposure Time 功能。

该功能的使用#

启用或禁用 Exposure Auto#

若要启用或禁用 Exposure Auto 自动功能,请将 ExposureAuto 参数设置为以下工作模式之一:

  • Continuous:在采集图像的同时,相机持续调整 Exposure Time。
  • Off:禁用 Exposure Auto 自动功能。Exposure Time 将保持上次自动或手动调整后的值。

信息

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

指定上限#

信息

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

该自动功能将在您指定的范围内调整 ExposureTime 参数值设置为指定限制范围内。

若要更改上限,请将 AutoExposureTimeUpperLimit 参数设置为所需的值(单位为 µs)。

在自动调节过程中,曝光时间绝不会超过指定的上限。

如果上限设置得较高,相机的帧率可能会下降。

指定目标亮度值#

信息

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

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

若要指定目标值,请使用 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 轻松设置参数。