Exposure Auto (dart E)#
如果要同时使用 Exposure Auto 和 Gain Auto,使用 Auto Function Profile 功能可以指定如何平衡两者效果。
要手动调整曝光时间,请使用 Exposure Time 功能。
该功能的使用#
启用或禁用 Exposure Auto#
To enable or disable the Exposure Auto auto function, set the ExposureAuto
参数设置为以下工作模式之一:
Continuous
: The camera adjusts the exposure time continuously while images are being acquired.熄灭
: Disables the Exposure Auto auto function. The exposure time remains at the value resulting from the last automatic or manual adjustment.
信息
- 在 daA2500-60mc 相机上,启用或禁用 Exposure Auto 时,也会同时启用或禁用 Gain Auto。
- 当相机连续拍摄图像时,自动功能会在经过较短的延迟后生效。前几张图像可能不受自动功能的影响。
指定上限#
信息
该功能仅适用于 daA…mci 相机。
The auto function adjusts the ExposureTime
parameter value within specified limits.
To change the upper limit, set the AutoExposureTimeUpperLimit
parameters to the desired value (in µs).
During the automatic adjustment process, the exposure time will never be higher than the specified limit.
If the upper limit is set to a high value, the camera's frame rate may decrease.
指定目标亮度值#
信息
该功能仅适用于 daA…mci 相机。
自动功能会调整曝光时间,直至达到目标亮度值(即平均灰度值)为止。
To specify the target value, use the AutoTargetBrightness
parameter.
信息
- 目标值计算不包括其他图像优化,例如 Gamma。根据设置的图像优化,相机输出的图像平均灰度值可能会明显低于或高于目标值。
- The camera also uses the
AutoTargetBrightness
parameter to control the Gain Auto auto function. If you want to use Exposure Auto and Gain Auto at the same time, use the Auto Function Profile feature to specify how the effects of both are balanced.
示例代码#
// 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 轻松设置参数。