Skip to content

Gain Auto (BCON for MIPI)#

The Gain Auto camera feature automatically adjusts the gain within specified limits until a target brightness value has been reached.

If you want to use Gain Auto and Exposure Auto at the same time, use the Auto Function Profile feature to specify how the effects of both are balanced.

To adjust the gain manually, use the Gain feature.

Using the Feature#

Enabling or Disabling Gain Auto#

To enable or disable the Gain Auto auto function, set the GainAuto parameter to one of the following operating modes: - Continuous: The camera adjusts the gain continuously while images are being acquired. - Off: Disables the Gain Auto auto function. The gain remains at the value resulting from the last automatic or manual adjustment.

Info

  • On daA2500-60mc cameras, enabling or disabling Gain Auto also enables or disables Exposure Auto.
  • 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 Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("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 Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);

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