Skip to content

Gain/Exposure Auto#

The Gain/Exposure Auto camera feature automatically adjusts gain and exposure time.

Gain and exposure time are always adjusted together.

This feature is only available on Basler dart BCON for MIPI cameras.

To adjust gain or exposure time manually, use the Gain and Exposure Time features.

Using the Feature#

Enabling or Disabling Gain/Exposure Auto#

To enable or disable the automatic adjustments, set either the GainAuto parameter or the ExposureAuto parameter to one of the following operating modes:

  • Continuous: The camera adjusts gain and exposure time continuously while images are being acquired. If you set the GainAuto parameter to Continuous, the ExposureAuto parameter is automatically set to Continuous as well, and vice versa.
  • Off: Disables the auto function. Gain and exposure time remain at the values resulting from the last automatic adjustment. If you set the GainAuto parameter to Off, the ExposureAuto parameter is automatically set to Off as well, and vice versa.

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.

Sample Code#

// Enable Gain/Exposure Auto
camera.GainAuto.SetValue(GainAuto_Continuous);
// This also enables Gain/Exposure Auto
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Enable Gain/Exposure Auto
CEnumerationPtr(nodemap.GetNode("GainAuto"))->FromString("Continuous");
// This also enables Gain/Exposure Auto
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
INodeMap& nodemap = camera.GetNodeMap();
// Enable Gain/Exposure Auto
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// This also enables Gain/Exposure Auto
CEnumParameter(nodemap, "ExposureAuto").SetValue("Continuous");
// Enable Gain/Exposure Auto
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
// This also enables Gain/Exposure Auto
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Enable Gain/Exposure Auto
Pylon.DeviceFeatureFromString(hdev, "GainAuto", "Continuous");
// This also enables Gain/Exposure Auto
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 */
/* Enable Gain/Exposure Auto */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
/* This also enables Gain/Exposure Auto */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.