The pixel data for the auto function can come from one or multiple auto function ROIs.
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.
To adjust the exposure time manually, use the Exposure Time feature.
In this topic Hide
To enable or disable the Exposure Auto auto function, set the ExposureAuto parameter to one of the following operating modes:
When the camera is capturing images continuously, the auto function takes effect with a short delay. The first few images may not be affected by the auto function.
The auto function adjusts the ExposureTimeAbsExposureTime parameter value within limits specified by you.
To change the limits, set the AutoExposureTimeAbsLowerLimitAutoExposureTimeLowerLimit and the AutoExposureTimeAbsUpperLimitAutoExposureTimeUpperLimit parameters to the desired values (in µs).
Example: Assume you have set the AutoExposureTimeAbsLowerLimitAutoExposureTimeLowerLimit parameter to 1000 and the AutoExposureTimeAbsUpperLimitAutoExposureTimeUpperLimit parameter to 5000. During the automatic adjustment process, the exposure time will never be lower than 1000 µs and never higher than 5000 µs.
If the AutoExposureTimeAbsUpperLimitAutoExposureTimeUpperLimit parameter is set to a high value, the camera’s frame rate may decrease.
The auto function adjusts the exposure time until a target brightness value, i.e., an average gray value, has been reached.
To specify the target value, use the AutoTargetValueAutoTargetBrightness parameter. The parameter's value range depends on the camera model and the pixel format used.
On Basler ace GigE camera models, you can also specify a Gray Value Adjustment Damping factor. On Basler dart and pulse camera models, you can specify a Brightness Adjustment Damping factor.
When a damping factor is used, the target value is reached more slowly.
On some camera models, you can use the Remove Parameter Limits feature to increase the target value parameter limits.
Camera Model | Minimum Target Value |
Maximum Target Value |
---|---|---|
All ace 2 GigE camera models | Feature not supported | Feature not supported |
All ace 2 USB 3.0 camera models | Feature not supported | Feature not supported |
All ace classic GigE camera models | 2 / 32a | 253 / 4048a |
All ace U GigE camera models |
50 / 800a |
205 / 3280a |
All ace L GigE camera models | 50 / 800a | 205 / 3280a |
All ace USB 3.0 camera models | 0.2b | 0.8b |
All boost CXP-12 camera models | Feature not supported | Feature not supported |
All dart BCON for LVDS camera models | 0.1b | 1.0b |
All dart BCON for MIPI camera models | Feature not supported (see Gain/Exposure Auto) | Feature not supported (see Gain/Exposure Auto) |
All dart USB 3.0 camera models | 0.1b | 1.0b |
All pulse USB 3.0 camera models | 0.1b | 1.0b |
a8-bit / 12-bit pixel format
bThe parameter's value range is based on the gray value range of the pixel format selected. For example, if you have selected an 8-bit pixel format, the maximum gray value is 256. Therefore, a parameter value of 0.5 corresponds to a gray value of approximately 128.
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoExposureTimeAbsLowerLimit.GetMin();
double maxUpperLimit = camera.AutoExposureTimeAbsUpperLimit.GetMax();
camera.AutoExposureTimeAbsLowerLimit.SetValue(minLowerLimit);
camera.AutoExposureTimeAbsUpperLimit.SetValue(maxUpperLimit);
// Set the target brightness value to 128
camera.AutoTargetValue.SetValue(128);
// Select auto function ROI 1
camera.AutoFunctionAOISelector.SetValue(AutoFunctionAOISelector_AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionAOIUsageIntensity.SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoExposureTimeLowerLimit.GetMin();
double maxUpperLimit = camera.AutoExposureTimeUpperLimit.GetMax();
camera.AutoExposureTimeLowerLimit.SetValue(minLowerLimit);
camera.AutoExposureTimeUpperLimit.SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
camera.AutoTargetBrightness.SetValue(0.6);
// Select auto function ROI 1
camera.AutoFunctionROISelector.SetValue(AutoFunctionROISelector_ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionROIUseBrightness.SetValue(true);
// 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 minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatPtr(nodemap.GetNode("AutoExposureTimeAbsLowerLimit"))->GetMin();
double maxUpperLimit = CFloatPtr(nodemap.GetNode("AutoExposureTimeAbsUpperLimit"))->GetMax();
CFloatPtr(nodemap.GetNode("AutoExposureTimeAbsLowerLimit"))->SetValue(minLowerLimit);
CFloatPtr(nodemap.GetNode("AutoExposureTimeAbsUpperLimit"))->SetValue(maxUpperLimit);
// Set the target brightness value to 128
CIntegerPtr(nodemap.GetNode("AutoTargetValue"))->SetValue(128);
// Select auto function ROI 1
CEnumerationPtr(nodemap.GetNode("AutoFunctionAOISelector"))->FromString("AOI1");
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanPtr(nodemap.GetNode("AutoFunctionAOIUsageIntensity"))->SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatPtr(nodemap.GetNode("AutoExposureTimeLowerLimit"))->GetMin();
double maxUpperLimit = CFloatPtr(nodemap.GetNode("AutoExposureTimeUpperLimit"))->GetMax();
CFloatPtr(nodemap.GetNode("AutoExposureTimeLowerLimit"))->SetValue(minLowerLimit);
CFloatPtr(nodemap.GetNode("AutoExposureTimeUpperLimit"))->SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
CFloatPtr(nodemap.GetNode("AutoTargetBrightness"))->SetValue(0.6);
// Select auto function ROI 1
CEnumerationPtr(nodemap.GetNode("AutoFunctionROISelector"))->FromString("ROI1");
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanPtr(nodemap.GetNode("AutoFunctionROIUseBrightness"))->SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoExposureTimeAbsLowerLimit].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoExposureTimeAbsUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoExposureTimeAbsLowerLimit].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoExposureTimeAbsUpperLimit].SetValue(maxUpperLimit);
// Set the target brightness value to 128
camera.Parameters[PLCamera.AutoTargetValue].SetValue(128);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionAOISelector].SetValue(PLCamera.AutoFunctionAOISelector.AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionAOIUsageIntensity].SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoExposureTimeLowerLimit].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoExposureTimeUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoExposureTimeLowerLimit].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoExposureTimeUpperLimit].SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
camera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionROISelector].SetValue(PLCamera.AutoFunctionROISelector.ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionROIUseBrightness].SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = Pylon.DeviceGetFloatFeatureMin(hdev, "AutoExposureTimeAbsLowerLimit");
double maxUpperLimit = Pylon.DeviceGetFloatFeatureMax(hdev, "AutoExposureTimeAbsUpperLimit");
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeAbsLowerLimit", minLowerLimit);
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeAbsUpperLimit", maxUpperLimit);
// Set the target brightness value to 128
Pylon.DeviceSetIntegerFeature(hdev, "AutoTargetValue", 128);
// Select auto function ROI 1
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionAOISelector", "AOI1");
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
Pylon.DeviceSetBooleanFeature(hdev, "AutoFunctionAOIUsageIntensity", true);
// Enable Exposure Auto by setting the operating mode to Continuous
Pylon.DeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = Pylon.DeviceGetFloatFeatureMin(hdev, "AutoExposureTimeLowerLimit");
double maxUpperLimit = Pylon.DeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimit");
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimit", minLowerLimit);
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeUpperLimit", maxUpperLimit);
// Set the target brightness value to 0.6
Pylon.DeviceSetFloatFeature(hdev, "AutoTargetBrightness", 0.6);
// Select auto function ROI 1
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionROISelector", "ROI1");
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
Pylon.DeviceSetBooleanFeature(hdev, "AutoFunctionROIUseBrightness", true);
// Enable Exposure Auto by setting the operating mode to Continuous
Pylon.DeviceFeatureFromString(hdev, "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 minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the Exposure Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoExposureTimeAbsLowerLimit", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoExposureTimeAbsUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeAbsLowerLimit", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeAbsUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Set the target brightness value to 128 */
errRes = PylonDeviceSetIntegerFeature(hdev, "AutoTargetValue", 128);
CHECK(errRes);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionAOISelector", "AOI1");
CHECK(errRes);
/* Enable the 'Intensity' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionAOIUsageIntensity", 1);
CHECK(errRes);
/* Enable Exposure Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
double minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the Exposure Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoExposureTimeLowerLimit", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimit", minLowerLimit);
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);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionROISelector", "ROI1");
CHECK(errRes);
/* Enable the 'Brightness' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionROIUseBrightness", 1);
CHECK(errRes);
/* Enable Exposure Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.