Skip to content

Exposure Auto#

The Exposure Auto camera feature automatically adjusts the exposure time within specified limits until a target brightness has been reached.

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.

Using the Feature#

Enabling or Disabling Exposure Auto#

To enable or disable the Exposure Auto auto function:

  1. Assign at least one auto function ROI to the Exposure Auto auto function.
    Make sure the auto function ROI overlaps the image ROI, either partially or completely.
  2. Set the ExposureMode parameter to Timed.
  3. Set the ExposureAuto parameter to one of the following operating modes:
    • Once: The camera adjusts the exposure time until the specified target brightness value has been reached. When this has been achieved, or after a maximum of 30 calculation cycles, the camera sets the auto function to Off. To all following images, the camera applies the exposure time resulting from the last calculation.
    • Continuous: The camera adjusts the exposure time continuously while images are being acquired.
    • Off: Disables the Exposure Auto auto function. The exposure time remains at the value resulting from the last automatic or manual adjustment.

Info

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.

Specifying Lower and Upper Limits#

The auto function adjusts the ExposureTime parameter value within limits specified by you.

To change the limits, set the AutoExposureTimeLowerLimit and the AutoExposureTimeUpperLimit parameters to the desired values (in µs).

Example: Assume you have set the AutoExposureTimeLowerLimit parameter to 1000 and the AutoExposureTimeUpperLimit 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 AutoExposureTimeUpperLimit parameter is set to a high value, the camera's frame rate may decrease.

Specifying the Target Brightness Value#

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 AutoTargetBrightness parameter. The parameter's value range depends on the camera model and the pixel format used.

Info

  • The target value calculation does not include other image optimizations, e.g. Gamma. Depending on the image optimizations set, images output by the camera may have a significantly lower or higher average gray value than indicated by the target value.
  • 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.

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.

Specifics#

Info

On some camera models, you can use the Remove Parameter Limits feature to increase the target value parameter limits.

Show all camera models

Camera Model Minimum Target Value Maximum Target Value
a2A1920-51gcBAS 0.0a 1.0a
a2A1920-51gcPRO 0.0a 1.0a
a2A1920-51gmBAS 0.0a 1.0a
a2A1920-51gmPRO 0.0a 1.0a
a2A1920-160ucBAS 0.0a 1.0a
a2A1920-160ucPRO 0.0a 1.0a
a2A1920-160umBAS 0.0a 1.0a
a2A1920-160umPRO 0.0a 1.0a
a2A2590-22gcBAS 0.0a 1.0a
a2A2590-22gcPRO 0.0a 1.0a
a2A2590-22gmBAS 0.0a 1.0a
a2A2590-22gmPRO 0.0a 1.0a
a2A2590-60ucBAS 0.0a 1.0a
a2A2590-60ucPRO 0.0a 1.0a
a2A2590-60umBAS 0.0a 1.0a
a2A2590-60umPRO 0.0a 1.0a
a2A3840-13gcBAS 0.0a 1.0a
a2A3840-13gcPRO 0.0a 1.0a
a2A3840-13gmBAS 0.0a 1.0a
a2A3840-13gmPRO 0.0a 1.0a
a2A3840-45ucBAS 0.0a 1.0a
a2A3840-45ucPRO 0.0a 1.0a
a2A3840-45umBAS 0.0a 1.0a
a2A3840-45umPRO 0.0a 1.0a
acA640-90gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA640-90gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA640-90uc 0.2a 0.8a
acA640-90um 0.2a 0.8a
acA640-120gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA640-120gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA640-120uc 0.2a 0.8a
acA640-120um 0.2a 0.8a
acA640-121gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA640-300gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA640-300gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA640-750uc 0.2a 0.8a
acA640-750um 0.2a 0.8a
acA720-290gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA720-290gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA720-520uc 0.2a 0.8a
acA720-520um 0.2a 0.8a
acA780-75gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA780-75gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA800-200gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA800-200gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA800-510uc 0.2a 0.8a
acA800-510um 0.2a 0.8a
acA1280-60gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1280-60gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-22gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-22gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-30gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-30gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-30uc 0.2a 0.8a
acA1300-30um 0.2a 0.8a
acA1300-60gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-60gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-60gmNIR 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1300-75gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1300-75gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1300-200uc 0.2a 0.8a
acA1300-200um 0.2a 0.8a
acA1440-73gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1440-73gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1440-220uc 0.2a 0.8a
acA1440-220um 0.2a 0.8a
acA1600-20gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1600-20gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1600-20uc 0.2a 0.8a
acA1600-20um 0.2a 0.8a
acA1600-60gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1600-60gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1920-25gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1920-25gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA1920-25uc 0.2a 0.8a
acA1920-25um 0.2a 0.8a
acA1920-40gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-40gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-40uc 0.2a 0.8a
acA1920-40ucMED 0.2a 0.8a
acA1920-40um 0.2a 0.8a
acA1920-40umMED 0.2a 0.8a
acA1920-48gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-48gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-50gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-50gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA1920-150uc 0.2a 0.8a
acA1920-150um 0.2a 0.8a
acA1920-155uc 0.2a 0.8a
acA1920-155ucMED 0.2a 0.8a
acA1920-155um 0.2a 0.8a
acA1920-155umMED 0.2a 0.8a
acA2000-50gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2000-50gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2000-50gmNIR 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2000-165uc 0.2a 0.8a
acA2000-165um 0.2a 0.8a
acA2000-165umNIR 0.2a 0.8a
acA2040-25gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2040-25gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2040-25gmNIR 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2040-35gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2040-35gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2040-55uc 0.2a 0.8a
acA2040-55um 0.2a 0.8a
acA2040-90uc 0.2a 0.8a
acA2040-90um 0.2a 0.8a
acA2040-90umNIR 0.2a 0.8a
acA2040-120uc 0.2a 0.8a
acA2040-120um 0.2a 0.8a
acA2440-20gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2440-20gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2440-35uc 0.2a 0.8a
acA2440-35ucMED 0.2a 0.8a
acA2440-35um 0.2a 0.8a
acA2440-35umMED 0.2a 0.8a
acA2440-75uc 0.2a 0.8a
acA2440-75ucMED 0.2a 0.8a
acA2440-75um 0.2a 0.8a
acA2440-75umMED 0.2a 0.8a
acA2500-14gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2500-14gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA2500-14uc 0.2a 0.8a
acA2500-14um 0.2a 0.8a
acA2500-20gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2500-20gcMED 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2500-20gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2500-20gmMED 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA2500-60uc 0.2a 0.8a
acA2500-60um 0.2a 0.8a
acA3088-16gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA3088-16gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA3088-57uc 0.2a 0.8a
acA3088-57um 0.2a 0.8a
acA3800-10gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA3800-10gm 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA3800-14uc 0.2a 0.8a
acA3800-14um 0.2a 0.8a
acA4024-8gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4024-8gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4024-29uc 0.2a 0.8a
acA4024-29um 0.2a 0.8a
acA4096-11gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4096-11gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4096-30uc 0.2a 0.8a
acA4096-30ucMED 0.2a 0.8a
acA4096-30um 0.2a 0.8a
acA4096-30umMED 0.2a 0.8a
acA4096-40uc 0.2a 0.8a
acA4096-40ucMED 0.2a 0.8a
acA4096-40um 0.2a 0.8a
acA4096-40umMED 0.2a 0.8a
acA4112-8gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4112-8gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA4112-20uc 0.2a 0.8a
acA4112-20ucMED 0.2a 0.8a
acA4112-20um 0.2a 0.8a
acA4112-20umMED 0.2a 0.8a
acA4112-30uc 0.2a 0.8a
acA4112-30ucMED 0.2a 0.8a
acA4112-30um 0.2a 0.8a
acA4112-30umMED 0.2a 0.8a
acA4600-7gc 8-bit pixel formats: 2
12-bit pixel formats: 32
8-bit pixel formats: 253
12-bit pixel formats: 4048
acA4600-10uc 0.2a 0.8a
acA5472-5gc 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA5472-5gm 8-bit pixel formats: 50
12-bit pixel formats: 800
8-bit pixel formats: 205
12-bit pixel formats: 3280
acA5472-17uc 0.2a 0.8a
acA5472-17um 0.2a 0.8a
boA4096-93cc 0.0a 1.0a
boA4096-93cm 0.0a 1.0a
boA4112-68cc 0.0a 1.0a
boA4112-68cm 0.0a 1.0a
daA1280-54lc 0.1a 1.0a
daA1280-54lm 0.1a 1.0a
daA1280-54uc 0.1a 1.0a
daA1280-54um 0.1a 1.0a
daA1600-60lc 0.1a 1.0a
daA1600-60lm 0.1a 1.0a
daA1600-60uc 0.1a 1.0a
daA1600-60um 0.1a 1.0a
daA1920-15um 0.1a 1.0a
daA1920-30uc 0.1a 1.0a
daA1920-30um 0.1a 1.0a
daA2500-14lc 0.1a 1.0a
daA2500-14lm 0.1a 1.0a
daA2500-14uc 0.1a 1.0a
daA2500-14um 0.1a 1.0a
daA2500-60mc 0.1a 1.0a
daA2500-60mci 0.1a 1.0a
daA4200-30mci 0.1a 1.0a
puA1280-54uc 0.1a 1.0a
puA1280-54um 0.1a 1.0a
puA1600-60uc 0.1a 1.0a
puA1600-60um 0.1a 1.0a
puA1920-30uc 0.1a 1.0a
puA1920-30um 0.1a 1.0a
puA2500-14uc 0.1a 1.0a
puA2500-14um 0.1a 1.0a

  1. The 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.

Sample Code#

ace classic/U/L GigE Cameras#

// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoExposureTimeLowerLimitRaw.GetMin();
double maxUpperLimit = camera.AutoExposureTimeUpperLimitRaw.GetMax();
camera.AutoExposureTimeLowerLimitRaw.SetValue(minLowerLimit);
camera.AutoExposureTimeUpperLimitRaw.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);
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("AutoExposureTimeLowerLimitRaw"))->GetMin();
double maxUpperLimit = CFloatPtr(nodemap.GetNode("AutoExposureTimeUpperLimitRaw"))->GetMax();
CFloatPtr(nodemap.GetNode("AutoExposureTimeLowerLimitRaw"))->SetValue(minLowerLimit);
CFloatPtr(nodemap.GetNode("AutoExposureTimeUpperLimitRaw"))->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");
INodeMap& nodemap = camera.GetNodeMap();
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoExposureTimeLowerLimitRaw").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoExposureTimeUpperLimitRaw").GetMax();
CFloatParameter(nodemap, "AutoExposureTimeLowerLimitRaw").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoExposureTimeUpperLimitRaw").SetValue(maxUpperLimit);
// Set the target brightness value to 128
CIntegerParameter(nodemap, "AutoTargetValue").SetValue(128);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionAOISelector").SetValue("AOI1");
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionAOIUsageIntensity").SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "ExposureAuto").SetValue("Continuous");
// Set the Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoExposureTimeLowerLimitRaw].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoExposureTimeUpperLimitRaw].GetMaximum();
camera.Parameters[PLCamera.AutoExposureTimeLowerLimitRaw].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoExposureTimeUpperLimitRaw].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 = Pylon.DeviceGetFloatFeatureMin(hdev, "AutoExposureTimeLowerLimitRaw");
double maxUpperLimit = Pylon.DeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimitRaw");
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimitRaw", minLowerLimit);
Pylon.DeviceSetFloatFeature(hdev, "AutoExposureTimeUpperLimitRaw", 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");
/* 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, "AutoExposureTimeLowerLimitRaw", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoExposureTimeUpperLimitRaw", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeLowerLimitRaw", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoExposureTimeUpperLimitRaw", 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);

Other Cameras#

// 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("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");
INodeMap& nodemap = camera.GetNodeMap();
// Set the  Exposure Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoExposureTimeLowerLimit").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoExposureTimeUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoExposureTimeLowerLimit").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoExposureTimeUpperLimit").SetValue(maxUpperLimit);
// Set the target brightness value to 0.6
CFloatParameter(nodemap, "AutoTargetBrightness").SetValue(0.6);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionROISelector").SetValue("ROI1");
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionROIUseBrightness").SetValue(true);
// Enable Exposure Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "ExposureAuto").SetValue("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, "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, "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.