# Patent

## Title
Auto exposure control system and method

## Abstract

An auto exposure control system includes a mean statistics unit that generates a weighted mean brightness value for an image array; a target control unit that determines a target brightness value according to an ambient status that is determined in accordance with an ambient light value, wherein, in one embodiment, the weighted mean brightness value is used as the ambient light value; a stabilization unit that generates stabilization control signals for the target control unit according to the ambient light value and ambient status information provided by the target control unit; and an exposure value control unit that computes a desired exposure value by comparing the target brightness value with the weighted mean brightness value and determines an exposure command according to the desired exposure value.

## Background
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention generally relates to an auto exposure control system and method, and more particularly to an auto exposure control system and method with dynamic target brightness control.
2. Description of Related Art
An auto exposure system is conventionally used to adjust output images of an image sensor to achieve a desired brightness level by applying a proper exposure command such as an integration time, an analog gain and a digital gain determined by the auto exposure system. The proper exposure command is determined according to a desired exposure value which is usually decided by comparing a mean brightness value with a predefined target brightness value, wherein the exposure value may be a product of an integration time and a gain.
For a conventional auto exposure system, the target brightness value is the same for different environments (for example, day and night; outdoor and indoor). Using a fixed target brightness value for all kinds of ambience would be a simple and low cost method. However, it is easy to cause local over-exposure in a high contrast scene.
A need has thus arisen to propose a novel auto exposure system for dynamically adjusting target brightness value in accordance with different conditions as needed.
SUMMARY OF THE INVENTION
In view of the foregoing, it is an object of the embodiment of the present invention to provide an auto exposure control system and method with dynamic target brightness control that is capable of smoothly changing target brightness values without brightness oscillation, undershooting and overshooting.
According to one embodiment, an auto exposure control system includes a mean statistics unit, a target control unit, a stabilization unit and an exposure value control unit. The mean statistics unit generates a weighted mean brightness value for an image array. The target control unit determines a target brightness value according to an ambient status that is determined in accordance with an ambient light value, wherein, in one embodiment, the weighted mean brightness value is used as the ambient light value. The stabilization unit generates stabilization control signals for the target control unit according to the ambient light value and ambient status information provided by the target control unit. The exposure value control unit computes a desired exposure value by comparing the target brightness value with the weighted mean brightness value and generates an exposure command according to the desired exposure value. In one embodiment, the stabilization unit comprises a counter which increments a count number whenever the ambient status information indicates that the ambient status is determined to be changed, wherein the ambient status delays changing until the count number exceeds a predetermined number.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 shows a block diagram illustrated of an auto exposure control system adaptable for an image sensor according to one embodiment of the present invention;
FIG. 2 shows a detailed block diagram illustrated of the target control unit of FIG. 1;
FIG. 3A shows a flow diagram illustrated of an auto exposure control method according to a first embodiment of the present invention;
FIG. 3B shows a detailed flow diagram illustrated of step 13 of FIG. 3A;
FIG. 4 shows ambient status with respect to the ambient light value according to the first embodiment;
FIG. 5A shows a modified flow diagram illustrated of the auto exposure control method with delay function according to the first embodiment of the present invention;
FIG. 5B shows a detailed flow diagram illustrated of step 137 of FIG. 5A;
FIG. 6A shows ambient status with respect to the ambient light value with jump function according to the first embodiment;
FIG. 6B shows a detailed flow diagram illustrated of step 137 of FIG. 5A with delay function and jump function according to the first embodiment of the present invention;
FIG. 7A shows a timing diagram exemplifying undershooting;
FIG. 7B shows a timing diagram when sneak function is adopted;
FIG. 8 shows a detailed flow diagram illustrated of step 135 of FIG. 5A with sneak function according to the first embodiment of the present invention;
FIG. 9A shows a modified flow diagram illustrated of the auto exposure control method with delay function, jump function and sneak function according to the first embodiment of the present invention;
FIG. 9B shows a detailed flow diagram illustrated of step 137 of FIG. 9A;
FIG. 10A and FIG. 10B show the change of the target brightness value with respect to the ambient light value with sneak function;
FIG. 11A and FIG. 11B show the change of the target brightness value with respect to the ambient light value with hysteresis values for the sneak function;
FIG. 12 shows ambient status with respect to the ambient light value according to the second embodiment of the present invention;
FIG. 13 shows a detailed flow diagram illustrated of step 13 of FIG. 3A according to the second embodiment of the present invention; and
FIG. 14 shows ambient status with respect to the ambient light value with the hysteresis function according to the second embodiment of the present invention.



DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows a block diagram illustrated of an auto exposure control system 100 adaptable for an image sensor according to one embodiment of the present invention. In the embodiment, the auto exposure control system 100 may input an image array comprised of a plurality of pixels, and may accordingly generate an exposure command which may include an integration time, an analog gain and a digital gain for the image sensor. The auto exposure control system 100 of the embodiment may be implemented by hardware, software, firmware or their combination. The auto exposure control system 100 of the embodiment may be performed by a processor such as a digital image processor.
In the embodiment, the auto exposure control system 100 may include a mean statistics unit 11 that is configured to generate a weighted mean brightness value for the image array. Specifically, the image array is divided into a plurality of regions, each of which having a specific weighting. The weighted mean brightness value may be generated by multiplying each pixel value by the weighting of the region in which the pixel is located, followed by dividing a sum of the weighted pixel values by a sum of the weightings of each pixel.
The auto exposure control system 100 of the embodiment may include a target control unit 13 that is configured to determine a target brightness value according to an ambient status that is determined in accordance with an ambient light value, wherein, in one embodiment, the weighted mean brightness value is used as the ambient light value. FIG. 2 shows a detailed block diagram illustrated of the target control unit 13 of FIG. 1. Specifically, the target control unit 13 may include an ambient status determining unit 1301 that is configured to determine the ambient status, for example, from status 1 to status N according to the ambient light value. The target control unit 13 may further include a target determining unit 1302 that is configured to determine the target brightness value according to the ambient status.
The auto exposure control system 100 of the embodiment may include a stabilization unit 15 that is configured to generate stabilization control signals for the target control unit 13 according to the ambient light value and ambient status information provided by the target control unit 13. Specifically, the ambient status information may contain a current ambient status, an expected new ambient status and threshold values related to the ambient statuses; the stabilization control signals may contain a status change control signal which verifies a change of the status and a sneak control signal which verifies a pre-change of the target brightness value. In one embodiment, when the target control unit 13 first determines a new ambient status, the ambient status information is sent to the stabilization unit 15. The stabilization unit 15 checks whether the change of the ambient status is appropriate and generates the stabilization control signals for the target control unit 13, wherein the stabilization control signals indicate whether the ambient status and/or the target brightness value are available to change or not.
The auto exposure control system 100 of the embodiment may include an exposure value control unit 14 that is configured to compute a desired exposure value by comparing the target brightness value with the weighted mean brightness value and generate an exposure command such as an integration time, an analog gain and a digital gain according to the desired exposure value. In one embodiment, the desired exposure value is generated according to a ratio or a difference between the target brightness value (generated from the target control unit 13) and the weighted mean brightness value (generated from the mean statistics unit 11). Accordingly, the integration time, the analog gain and the digital gain of the image sensor may be adjusted according to the desired exposure value newly generated from the exposure value control unit 14, such that the image array could possess a proper weighted mean brightness value being close enough to the target brightness value.
The auto exposure control system 100 of the embodiment may further include an ambient light value generating unit 12 that is configured to generate an ambient light value, wherein the ambient light value is provided for the target control unit 13. The ambient light value may be determined by pixel intensity values, an integration time and a gain. In one embodiment, the ambient light value is generated by dividing an average of the pixel intensity values of the image array by the corresponding exposure value. The generated ambient light value may represent an average luminance value which includes both reflectance information and illuminance information for the surrounding of the image sensor
FIG. 3A shows a flow diagram illustrated of an auto exposure control method according to a first embodiment of the present invention. Steps corresponding to the blocks depicted in FIG. 1 are denoted with the same numerals. In step 12, an ambient light value alv is generated. In step 131, the ambient light value is compared with thresholds in order to determine whether the ambient status should be changed (step 132). FIG. 4 shows the ambient status with respect to the ambient light value alv according to the first embodiment. In the embodiment, there are two statuses S1 and S2, and there are two thresholds th1 and th2 for determining the ambient status. The target control unit 13 compares the ambient light value alv with the thresholds th1 and th2 (th1<=th2) in order to determine whether the ambient status should be changed. The ambient status is changed to status S2 when alv>th2 (step 133), the ambient status is changed to status S1 when alv<=th1 (step 133), and the ambient status is maintained when th1<alv<=th2 (step 134). Next, in step 135, the target brightness value is determined according to the ambient status. That is, the target brightness value target2 is used during S2, and the target brightness value target1 is used during S1. FIG. 3B shows a detailed flow diagram illustrated of step 13 of FIG. 3A.
It is a usual occurrence that the ambient status may be changed too frequently such that the target brightness value may accordingly be changed too frequently too. To avoid such problem, a delay scheme (or function) may be adopted in the stabilization unit 15 by using a counter that increments a count number whenever ambient status information provided by the target control unit 13 indicates that the ambient status is going to change, that is, the ambient light value alv>th2 during status S1 or the ambient light value alv<=th1 during status S2. A status change control signal which verifies that the change of the ambient status is available does not generate until the count number exceeds a predetermined number, and the change of the ambient status does not happen until the target control unit 13 receives the status change control signal.
FIG. 5A shows a modified flow diagram illustrated of the auto exposure control method with delay function according to the first embodiment of the present invention. If the delay function is enabled (step 136), the counter is used to check delay condition (step 137) in order to determine whether the ambient status change is available (step 138). FIG. 5B shows a detailed flow diagram illustrated of step 137 of FIG. 5A, where cnt is the count number, and delay_num is the predetermined number.
Once the delay function is enabled, frames of the predetermined number have to go through before the ambient status is changed. Sometimes when there is a large change in the ambient light value, we may want to change the ambient status immediately. To achieve such purpose, a jump scheme (or function) may be adopted in the stabilization unit 15. In the embodiment, as exemplified in FIG. 6A, the ambient status is allowed to change immediately to status S2 when the ambient light value is higher than the by more than a predetermined range range2 (i.e., alv>th2+range2); and the ambient status is allowed to change immediately to status S1 when the ambient light value is substantially lower than th1 by more than a predetermined range range1 (i.e., alv<=th1-range1). It is appreciated that ranger may be different from, or the same as, range2. FIG. 6B shows a detailed flow diagram illustrated of step 137 of the auto exposure control method with delay function and jump function according to the first embodiment of the present invention.
As the change of the ambient status is delayed when the delay function is enabled, the adjustment of the target brightness value is also delayed, which may cause brightness overshooting or undershooting. FIG. 7A shows a timing diagram exemplifying undershooting. To avoid such problem, a sneak scheme (or function) may be adopted in the stabilization unit 15 to adjust the target brightness value before the change of the ambient status. FIG. 8 shows a detailed flow diagram illustrated of step 135 of FIG. 5A with sneak function. In the embodiment, when the ambient light value alv>th2 during status S1, the ambient status would be maintained in status S1 for a predetermined number of frames when the delay function is enabled. If the sneak function is enabled during the delay, a sneak flag is enabled. Once the sneak flag is enabled, a sneak control signal which verifies that the pre-change of the target brightness value is available is sent to the target control unit 13 so that the target brightness value target2 for status S2 would be selected before the ambient status is changed to status S2. The sneak flag will be kept enabled until the ambient status is changed to status S2 or the sneak condition (alv>th2) is invalid. Similarly, when the ambient light value alv<=th1 during status S2, the ambient status would be maintained in status S2 for a predetermined number of frames when the delay function is enabled. If the sneak function is enabled during the delay, a sneak flag is enabled. Once the sneak flag is enabled, a sneak control signal which verifies that the pre-change of the target brightness value is available is sent to the target control unit 13 so that the target brightness value target1 for status S1 would be selected before the ambient status is changed to status S1. The sneak flag will be kept enabled until the ambient status is changed to status S1 or the sneak condition (alv<=th1) is invalid. FIG. 7B shows a timing diagram when sneak function is adopted. FIG. 9A shows a modified flow diagram illustrated of the auto exposure control method with delay function, jump function and sneak function according to the first embodiment of the present invention, and FIG. 9B shows a detailed flow diagram illustrated of step 137 of FIG. 9A.
FIG. 10A and FIG. 10B show a target brightness value is changed with respect to the ambient light value alv with sneak function. If the ambient light value alv varies between the range alv>th2 to alv<=th2 during status S1 (FIG. 10A), or the ambient light value alv varies between the range alv<=th1 to alv>th1 during status S2 (FIG. 10B), the target brightness value will directly be changed between the target brightness values target1 and target2, therefore leading to a brightness oscillation. To avoid such problem, a hysteresis value may be used as shown in FIG. 11A and FIG. 11B. Once the sneak flag is enabled during status S2, the sneak flag would be kept enabled until alv>th1+hyst1 (where hyst1 is a hysteresis value) or the ambient status is changed. Similarly, once the sneak flag is enabled during status S1, the sneak flag would be kept enabled until alv<=th2-hyst2 (where hyst2 is a hysteresis value, which may be different from or the same as hyst1) or the ambient status is changed.
FIG. 12 shows ambient status with respect to the ambient light value alv according to the second embodiment of the present invention. In the embodiment, there are N (N>=2) statuses S1 to SN, and there are N−1 thresholds th1 to thN−1 (where th1<th2<. . . <thN−1) for determining the ambient status. The ambient status is set as Sx when the ambient light value alv<=thx (0<x<N); and the ambient status is set as SN when the ambient light value alv>thN−1. In the embodiment, each of the statuses S1 to SN has a corresponding target brightness value targets to targetN, respectively. Once the ambient status is determined, the target brightness value corresponding to the status (S1, S2 . . . or SN) is set as the determined target brightness value.
The flow diagram illustrated of the auto exposure control method as shown in FIG. 3A may apply to the second embodiment. FIG. 13 shows a detailed flow diagram illustrated of step 13 for the second embodiment.
Since the target brightness value may be changed according to the ambient status which is determined by the ambient light value and the thresholds, this may cause brightness oscillation due to the fluctuation of the ambient light value. Therefore, a hysteresis function may be added to enhance the stability. FIG. 14 shows ambient status with respect to the ambient light value alv with the hysteresis function. The hysteresis function of the embodiment may include the following operations. Assume the current ambient status is Sx, the ambient status and the target brightness value will not be changed until the following conditions are true:

alv>thx+hystup, where hystup>=0; or/and

alv<=thx−1−hystdw, where 0<=hystdw<=thx−1.

It is appreciated that hystdw may be different from, or the same as, hystup.
The delay function adopted in the first embodiment may be adopted in the second embodiment as well. A counter is used to control the delay function. Specifically, the counter increments a count number whenever ambient status information provided by the target control unit 13 indicates that the ambient status is going to change. Once the count number exceeds a predetermined number, the counter is reset and a status change control signal is sent to the target control unit 13 to verify the change of the ambient status.
The jump function adopted in the first embodiment may be adopted in the second embodiment as well. Specifically, the ambient status is allowed to change immediately when the change of the ambient light value exceeds a predetermined range. Assume the current ambient status is Sx and there are two predetermined range rangeup and rangedw. The ambient status is changed immediately to Sx+k when thx+k−1<alv<=thx+k and alv>thx+rangeup. The ambient status is allowed to change immediately to Sx−j when thx−j−1<alv<=thx−j and alv<=thx−rangedw. It is appreciated that rangeup may be different from, or the same as rangedw.
The sneak function adopted in the first embodiment may be adopted in the second embodiment as well. Specifically, if the current ambient status is Sx and is going to change to Sy (i.e., thy−1<alv<=thy), the status change control signal would maintain the ambient status in Sx for a predetermined number of frames when the delay function is enabled. If the sneak function is also enabled, a sneak flag is enabled. Once the sneak flag is enabled, a sneak control signal which verifies that the pre-change of the target brightness value is available is sent to the target control unit 13 so that the target brightness value targety for status Sy would be selected before the ambient status is changed to Sy. The sneak flag will be kept enabled until the ambient status is changed or the sneak condition is invalid.
The hysteresis value used in the first embodiment to avoid the oscillation problem during sneaking may be adopted in the second embodiment as well. Once the sneak flag is enabled, the target brightness value would be targety, which will not be changed until alv>thy+hystsneak_up or alv<=thy−hystsneak_dw. It is appreciated that hystsneak_up may be different from, or the same as hystsneak_dw.
Although specific embodiments have been illustrated and described, it will be appreciated by those skilled in the art that various modifications may be made without departing from the scope of the present invention, which is intended to be limited solely by the appended claims.

## Claims

1. An auto exposure control system, comprising:
a mean statistics unit that generates a weighted mean brightness value for an image array;
a target control unit that determines a target brightness value according to an ambient status that is determined in accordance with an ambient light value;
a stabilization unit that generates stabilization control signals for the target control unit according to the ambient light value and ambient status information provided by the target control unit; and
an exposure value control unit that computes a desired exposure value by comparing the target brightness value with the weighted mean brightness value and determines an exposure command according to the desired exposure value.

2. The system of claim 1, wherein the target control unit comprises:
an ambient status determining unit that determines the ambient status from a plurality of statuses according to the ambient light value; and
a target determining unit that determines the target brightness value according to the ambient status.

3. The system of claim 1, wherein the ambient light value is determined by pixel intensity values, an integration time and a gain.

4. The system of claim 3, further comprising an ambient light value generating unit that generates the ambient light value by the pixel intensity values, the integration time and the gain.

5. The system of claim 1, wherein the stabilization unit comprising a counter that increments a count number whenever the ambient status information indicates that the ambient status is determined to be changed, wherein the ambient status delays changing until the count number exceeds a predetermined number.

6. The system of claim 5, when the ambient status delays changing, wherein the ambient status is changed immediately when the ambient light value is changed by more than a predetermined range.

7. The system of claim 6, when the ambient status delays changing, a target brightness value corresponding to a specific ambient status Sy is sneakingly selected before the ambient status is changed to said specific ambient status Sy.

8. The system of claim 7, before the ambient status is changed to said specific ambient status Sy, the target brightness value corresponding to said specific ambient status Sy is maintained when the ambient light value is within thy+hystsneak_up and thy−1−hystsneak_dw, where thy is an upper threshold for determining said specific ambient status Sy, thy−1 is a lower threshold for determining said specific ambient status Sy, and hystsneak_up and hystsneak_dw are hysteresis values.

9. The system of claim 1, wherein the ambient status is determined according to N statuses (N>=2) and N−1 thresholds, wherein the ambient status is set as X-th status (0<X<N) when the ambient light value is less than or equal to X-th threshold, and the ambient status is set as N-th status when the ambient light value is greater than N−1-th threshold.

10. The system of claim 9, wherein a current ambient status X and a corresponding target brightness value are not changed until a corresponding ambient light value is greater than the X-th threshold with a first hysteresis amount, and/or the corresponding ambient light value is less than or equal to the X−1-th threshold with a second hysteresis amount.

11. An auto exposure control method, comprising:
generating a weighted mean brightness value for an image array;
determining a target brightness value according to an ambient status that is determined in accordance with an ambient light value;
generating stabilization control signals according to the ambient light value and ambient status information; and
computing a desired exposure value by comparing the target brightness value with the weighted mean brightness value, and determining an exposure command according to the desired exposure value.

12. The method of claim 11, wherein the step of determining the target brightness value comprises:
determining the ambient status from a plurality of statuses according to the ambient light value; and
determining the target brightness value according to the ambient status.

13. The method of claim 11, wherein the ambient light value is determined by pixel intensity values, an integration time and a gain.

14. The method of claim 11, further comprising a step of incrementing a count number whenever the ambient status information indicates that the ambient status is determined to be changed, wherein the ambient status delays changing until the count number exceeds a predetermined number.

15. The method of claim 14, when the ambient status delays changing, wherein the ambient status is changed immediately when the ambient light value is changed by more than a predetermined range.

16. The method of claim 15, when the ambient status delays changing, a target brightness value corresponding to a specific ambient status Sy is sneakingly selected before the ambient status is changed to said specific ambient status Sy.

17. The method of claim 16, before the ambient status is changed to said specific status Sy, the target brightness value corresponding to said specific ambient status Sy is maintained when the ambient light value is within thy+hystsneak_up and thy−1−hystsneak_dw, where thy is an upper threshold for determining said specific ambient status Sy, thy−1 is a lower threshold for determining said specific ambient status Sy, and hystsneak_up and hystsneak_dw are hysteresis values.

18. The method of claim 11, wherein the ambient status is determined according to N statuses (N>=2) and N−1 thresholds, wherein the ambient status is set as X-th status (0<X<N) when the ambient light value is less than or equal to X-th threshold, and the ambient status is set as N-th status when the ambient light value is greater than N−1-th threshold.

19. The method of claim 18, wherein a current ambient status X and a corresponding target brightness value are not changed until a corresponding ambient light value is greater than the X-th threshold with a first hysteresis amount, and/or the corresponding ambient light value is less than or equal to the X−1-th threshold with a second hysteresis amount.