Low Light Optimization and Day / Night Operation

The purpose of this document is to describe how the auto exposure algorithm controls the camera to achieve the desired mean target brightness of an image in normal and low light conditions. The algorithm also controls the individual RGB gains to achieve white balance and regulates the auto exposure region of interest.

Auto Exposure Algorithm

The camera will adjust the camera's gain and exposure to achieve a target brightness specified by the user. This is done in a closed-loop control loop where the luminance of captured frames is used to adjust the camera exposure and/or gain of subsequent frames. This type of algorithm works well to adapt quickly to changing lighting environments.

image002.gif

Normal Auto Exposure Operation

The camera will increase the exposure and then the gain to a configured ideal limit. This limit is specified as knees for the exposure and gain. These parameters are used to allow the camera to operate within a normal operating range without increasing either parameter to their maximum value.

Extended Auto Exposure Operation

As the ambient lighting decreases to a less-than-desirable level, the camera will increase both the exposure and gain from their ideal limits. The camera will increase the exposure and then the gain to their maximum values. These maximum values will typically provide a useful image in low light settings however these increased settings will lead to increased image blur and noise.

A typical use/case for both the normal and extended autoexposure operation would be an outdoor installation. The algorithm will adjust the exposure and gain of the camera to a minimal value in +1000 LUX day light conditions. At dusk, the camera will increase the exposure and then gain levels to the knee set points. After dusk, the camera will continue to increase exposure to its maximum value and then gain to its maximum to obtain the maximum possible sensitivity available from the imager. The gain and exposure values will decrease as high LUX conditions return (dawn)

Configuring the Algorithm

The limits of the algorithm can be set to match what is necessary for a specific user application. The parameters used to configure the algorithm are listed below:

exposure Current exposure setting of the imager.
gain Current digital and analog gain applied to the captured image.
autogain Boolean value to enable the automatic gain control.
autoexposure Boolean value to enable the automatic exposure control.
autogain_knee Ideal limit of the image gain in normal operating conditions.
autoexposure_knee Ideal limit of the exposure in normal operating conditions.
maximum_gain The maximum allowable gain.
maximum_exposure The maximum allowable imager exposure.

Table 1 -Parameters used to Configure the Autoexposure Low Light Operation

Day Night Camera Operation

The Day Night camera is a special version of the Ethernet camera equipped with an automatic, removable IR cut filter for use in day light conditions. This enables the camera to provide color images when there is sufficient daylight and images in night time conditions with a glass window in place of the IR cut filter and optional IR illumination.

Day Night Thresholds and Hysteresis

The camera uses a normal and a low light threshold to control the Day Night camera. The threshold consists of a Boolean expression that can include the camera's exposure and gain. The camera will require that the threshold is met for a set duration (settling period) before exchange of the IR filter (minimum to high LUX operation) and glass window (IR operation).

When the camera switches to a low light condition, and then IR lighting is turned on, a significant change in the exposure and gain settings will occur. Following the gain and exposure changes under the IR lighting, the exposure and gain may have lowered considerably to accommodate the "bright" IR illumination of the target. Some experimentation for each user case and consideration of the parameters below for normal and low light thresholds, and duration will avoid an oscillation between day and night modes.

Configuring the Day Night Modes

The day night configuration parameters are listed below. The parameters listed are taken from the API manual located on the camera.

ir_shuttle_position The position of the IR filter. 0 = day, 1 = night
low_light_criteria The low light threshold. This is a Boolean expression.
normal_light_criteria The normal light threshold. This is a Boolean expression.
low_light_settings Camera changes applied in low light mode including moving the IR filter.
normal_light_settings Camera changes applied in normal light mode including moving the IR filter.
low_light_stable_duration The low light threshold must be true for this number of seconds to switch to low light mode.
normal_light_stable_duration The normal light threshold must be true for this number of seconds to switch to low light mode.

Table 2 -Parameters used to configure the Day Night Camera

Default Configuration of Day Night Camera

The default configuration of the camera assumes that the camera is to be installed outdoors with ambient night-time IR lighting. The exposure knee is set to 26ms with the normal and low light criteria set to 10ms and 30ms. This configuration limits the cameras exposure to minimize motion blur.

In the case that IR lighting is not present; the day night algorithm is designed to increase the exposure and gain to their maximum values. This is used as a fallback in the case of an IR lighting failure.

autoexposure_knee 26
autogain_knee 100
low_light_criteria exposure > 30
normal_light_criteria exposure < 10
low_light_settings ir_shuttle_position=1, saturation=-100, lighting_frequency=60
normal_light_settings ir_shuttle_position=0, saturation=0, lighting_frequency=0
low_light_stable_duration 10
normal_light_stable_duration 10
maximum_gain 300
maximum_exposure 500

Table 3 - Default Day Night Camera Configuration

This setup allows for an exposure range of 20ms and a 100x gain between the normal and low-light thresholds. This range is easily adjustable by changing the gain knee to optimize the lighting level at which the camera will switch to night mode.

The low-light settings are also optimized for IR lighting. The color noise seen from the black-white images is removed by setting the saturation to its minimum value. As well, IR light sources might use AC or DC power. The camera can be configured to lock its exposure to an AC-powered IR light source by only using 50Hz or 60Hz harmonics. This can be done using the lighting_frequency parameter.