Auto Function Profile

The Auto Function Profile camera feature allows you to specify how gain and exposure time are balanced when the camera is making automatic adjustments.

In this topic Hide

Using the Feature

Prerequisites

The Gain Auto auto function and the Exposure Auto auto function must both be set to Continuous.

Setting the Auto Function Profile

To set the auto function profile, set the AutoFunctionProfile parameter to one of the following values:

Available Auto Function Profiles

Minimize Gain (= Gain Minimum)

The gain is kept as low as possible during the automatic adjustment process. If the exposure time is at its upper limit and the target brightness value has not been reached yet, the gain will be increased in order to reach the target.

Minimize Exposure Time (= Exposure Minimum)

The exposure time is kept as low as possible during the automatic adjustment process. If the gain is at its upper limit and the target brightness value has not been reached yet, the exposure time will be increased in order to reach the target.

Minimize Gain Quick (= Gain Minimum Quick)

This profile works the same as the Minimize Gain profile. The difference is that it reacts more quickly in situations with extreme changes in brightness or where the image brightness changes rapidly. This situation occurs, for example, when microscope objective lenses are changed using the objective turret.

Minimize Exposure Time Quick (= Exposure Minimum Quick)

This profile works the same as the Minimize Exposure Time profile. The difference is that it reacts more quickly in situations with extreme changes in brightness or where the image brightness changes rapidly. This situation occurs, for example, when microscope objective lenses are changed using the objective turret.

Smart

Gain is kept as low as possible and the frame rate will be kept as high as possible during automatic adjustments.

This is a four-step process:

  1. The camera adjusts the exposure time to achieve the target brightness value.
  2. If the exposure time must be increased to achieve the target brightness value, the camera increases the exposure time until a drop in the frame rate is detected.
  3. If a frame rate drop is detected, the camera stops increasing the exposure time and increases the gain until the AutoGainRawUpperLimitAutoGainUpperLimit value is reached.
  4. When the AutoGainRawUpperLimitAutoGainUpperLimit value has been reached, the camera stops increasing the gain and increases the exposure time until the target brightness value is reached. Increasing the exposure time results in a lower frame rate.

Anti-Flicker 50 Hz / 60 Hz

Gain and exposure time are optimized to reduce flickering. If the camera is operating in an environment where the lighting flickers at a 50-Hz or a 60-Hz rate, the flickering lights can cause significant changes in brightness from image to image. Enabling the anti-flicker profile may reduce the effect of the flickering in the captured images.

Choose the frequency (50 Hz or 60 Hz) according your local power line frequency (e.g., North America: 60 Hz, Europe: 50 Hz).

Specifics

Camera Model

Available Auto Function Profiles

All ace 2 GigE camera models None, Auto Function Profile feature not supported
All ace 2 USB 3.0 camera models None, Auto Function Profile feature not supported
All ace GigE camera models
  • Gain Minimum
  • Exposure Minimum
All ace USB 3.0 camera models
  • Minimize Gain
  • Minimize Exposure Time
All MED ace USB 3.0 camera models
  • Minimize Gain
  • Minimize Exposure Time
  • Minimize Gain Quick
  • Minimize Exposure Time Quick
All MED ace GigE camera models
  • Gain Minimum
  • Exposure Minimum
  • Gain Minimum Quick
  • Exposure Minimum Quick
All boost CXP-12 camera models None, Auto Function Profile feature not supported
All dart BCON for LVDS camera models
  • Minimize Gain
  • Minimize Exposure Time
  • Smart
  • Anti-Flicker 50 Hz
  • Anti-Flicker 60 Hz
All dart BCON for MIPI cameras models None, Auto Function Profile feature not supported
All dart USB 3.0 camera models
  • Minimize Gain
  • Minimize Exposure Time
  • Smart
  • Anti-Flicker 50 Hz
  • Anti-Flicker 60 Hz
All pulse USB 3.0 camera models
  • Minimize Gain
  • Minimize Exposure Time
  • Smart
  • Anti-Flicker 50 Hz
  • Anti-Flicker 60 Hz

 

Sample Code

// Set the auto function profile to Gain Minimum
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_GainMinimum);
// Set the auto function profile to Exposure Minimum
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_ExposureMinimum);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
// Set the auto function profile to Minimize Gain
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_MinimizeGain);
// Set the auto function profile to Minimize Exposure Time
camera.AutoFunctionProfile.SetValue(AutoFunctionProfile_MinimizeExposureTime);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the auto function profile to Gain Minimum
CEnumerationPtr(nodemap.GetNode("AutoFunctionProfile"))->FromString("GainMinimum");
// Set the auto function profile to Exposure Minimum
CEnumerationPtr(nodemap.GetNode("AutoFunctionProfile"))->FromString("ExposureMinimum");
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
CEnumerationPtr(nodemap.GetNode("GainAuto"))->FromString("Continuous");
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
// Set the auto function profile to Minimize Gain
CEnumerationPtr(nodemap.GetNode("AutoFunctionProfile"))->FromString("MinimizeGain");
// Set the auto function profile to Minimize Exposure Time
CEnumerationPtr(nodemap.GetNode("AutoFunctionProfile"))->FromString("MinimizeExposureTime");
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
CEnumerationPtr(nodemap.GetNode("GainAuto"))->FromString("Continuous");
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
// Set the auto function profile to Gain Minimum
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.GainMinimum);
// Set the auto function profile to Exposure Minimum
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.ExposureMinimum);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Set the auto function profile to Minimize Gain
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.MinimizeGain);
// Set the auto function profile to Minimize Exposure Time
camera.Parameters[PLCamera.AutoFunctionProfile].SetValue(PLCamera.AutoFunctionProfile.MinimizeExposureTime);
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Set the auto function profile to Gain Minimum
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionProfile", "GainMinimum");
// Set the auto function profile to Exposure Minimum
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionProfile", "ExposureMinimum");
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
Pylon.DeviceFeatureFromString(hdev, "GainAuto", "Continuous");
Pylon.DeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
// Set the auto function profile to Minimize Gain
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeGain");
// Set the auto function profile to Minimize Exposure Time
Pylon.DeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeExposureTime");
// Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous
Pylon.DeviceFeatureFromString(hdev, "GainAuto", "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 */
/* Set the auto function profile to Gain Minimum */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "GainMinimum");
CHECK(errRes);
/* Set the auto function profile to Exposure Minimum */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "ExposureMinimum");
CHECK(errRes);
/* Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
/* Set the auto function profile to Minimize Gain */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeGain");
CHECK(errRes);
/* Set the auto function profile to Minimize Exposure Time */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionProfile", "MinimizeExposureTime");
CHECK(errRes);
/* Enable Gain and Exposure Auto auto functions and set the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);

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