An automatic exposure control system and method thereof
Patent Information
- Application Number
- CN202510485634.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]1.响应速度慢:在某些情况下,自动曝光方法可能需要较长时间来调整曝光参数以达到理想的曝光水平,特别是在光线条件变化剧烈或场景复杂时,收敛速度可能不够快,导致画面忽明忽暗,影响观看体验
[0127]1).改善图像质量:
Smart Images

Figure CN122970381A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent surveillance video processing technology, and specifically relates to an automatic exposure control system and method. Background Technology
[0002] Exposure parameters are crucial for cameras in video surveillance. Automatic exposure allows the image sensor to adjust these parameters automatically based on scene changes, thereby regulating the brightness of the captured image. Inappropriate exposure parameters can result in overexposed or underexposed videos, while proper exposure parameters ensure the video is at a normal brightness level. Since brightness is critical to image quality, automatic exposure is one of the most important functions of an image sensor system; appropriate exposure settings effectively prevent overexposure and underexposure.
[0003] Currently common automatic exposure adjustment methods cannot adapt to scenes with drastic changes in brightness and cannot quickly complete automatic exposure control, resulting in poor video quality.
[0004] Therefore, the disadvantages of existing automatic exposure technologies are:
[0005] 1. Slow response speed: In some cases, the automatic exposure method may take a long time to adjust the exposure parameters to achieve the ideal exposure level, especially when the lighting conditions change drastically or the scene is complex. The convergence speed may not be fast enough, resulting in the image being sometimes bright and sometimes dark, which affects the viewing experience.
[0006] 2. Exposure oscillation: Automatic exposure methods may exhibit oscillations during adjustment, meaning the image brightness fluctuates. This is usually caused by the algorithm adjusting parameters too aggressively or not responding smoothly enough to environmental changes.
[0007] In addition, the technical terms in this field include:
[0008] Automatic exposure: This usually refers to the technology in photography or videography where the camera automatically adjusts the exposure parameters to achieve the correct exposure.
[0009] Overexposure: This refers to a situation in photography or videography where too much light shines on the camera's sensor, causing certain areas of the image to be too bright and lose detail. It usually manifests as overly bright highlights or even pure white areas, making it impossible to recover the original details and colors.
[0010] Underexposure refers to a situation in photography or videography where insufficient light reaches the camera's sensor, resulting in low image brightness and loss of detail. This typically manifests as excessively dark shadow areas, or even completely black areas, making it impossible to recover the original details and colors.
[0011] Image exposure oscillation: This usually refers to a rapid change or fluctuation in the brightness of an image caused by improper exposure control during image processing.
[0012] Incremental PID control is an improved method based on the proportional-integral-derivative (PID) control algorithm, designed to enhance the system's response speed, stability, and anti-interference capability. The core of incremental PID control lies in calculating the incremental output of the PID controller, enabling more precise regulation of the system output. Summary of the Invention
[0013] To address the aforementioned issues, the purpose of this application is to analyze scene illumination intensity in real time and automatically adjust exposure information to achieve optimal exposure results. This method includes scene illumination intensity detection, automatic adjustment of exposure parameters, and a feedback control mechanism to ensure high-quality images are obtained under various lighting conditions.
[0014] Specifically, the present invention provides an automatic exposure control system, comprising:
[0015] The image acquisition module is used to acquire the current frame image and the exposure information Exp_p of the previous frame;
[0016] The brightness calculation module is used to calculate the brightness Y_c of the current frame image based on the current frame image. The average brightness is obtained by traversing the brightness values of each pixel in the image and taking the average value. The formula for calculating the brightness value is Y = 0.299R + 0.587G + 0.114B, where R, G, and B are the red, green, and blue component values of a pixel in the RGB mode of the image, respectively.
[0017] The error calculation module is used to calculate the error ierror between the target brightness Y_t and the current frame image brightness Y_c, where ierror = Y_t - Y_c;
[0018] The error increment calculation module is used to calculate the increment of the current error and the previous error, inc_ierror, as well as the increment of the previous error and the error before that, inc_error1.
[0019] The threshold judgment module is used to determine whether the current error meets the preset threshold range thres_d≤ierror≤thres_s. If it does not meet the threshold, the exposure parameter update process is initiated.
[0020] The exposure parameter update module selects the appropriate control strategy based on the sign of the error, calculates the exposure increment inc, and updates the exposure information Exp_c. The update formula for the exposure information is as follows:
[0021]
[0022] Where Exp_c represents the exposure information to be updated; Exp_p represents the exposure information of the previous frame; inc represents the increment; and Y_c represents the current scene brightness.
[0023] The preferred value for the target brightness Y_t is 35.
[0024] The preferred value for the lower threshold threshold thres_d is -1, and the preferred value for the upper threshold threshold thres_s is 1.
[0025] When the error ierror is greater than zero, the exposure parameter update module adopts a convergence strategy from bright to dark, and the formula for calculating the increment inc is:
[0026] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0027] Wherein, inc represents the increment; Kp_d represents the proportional coefficient, preferably 110; Ki_d represents the integral coefficient, preferably 240; Kd_d represents the differential coefficient, preferably 100; inc_ierror represents the increment between the current error and the previous error; and inc_ierror1 represents the increment between the previous error and the error before that.
[0028] The convergence strategy from bright to dark also includes the introduction of a priori strategy for control, specifically including: determining whether the error is in an extreme state, and if so, adjusting the speed coefficient speed to a preferred value of 1.2 or 1.5;
[0029] Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.25 or 1.5.
[0030] Determine whether the error exceeds the set maximum value error_m1, preferably 150. If it does, adjust the speed coefficient to the preferred value of 2.
[0031] To control extreme cases, if the current frame brightness Y_c is equal to 255, the increment is directly set to the maximum value max_output, preferably 80.
[0032] When the error (ierror) is less than or equal to zero, the exposure parameter update module adopts a convergence strategy from dark to bright, and the formula for calculating the increment inc is:
[0033] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0034] Wherein, Kp_d is the proportional coefficient, preferably 110; Ki_d is the integral coefficient, preferably 240; and Kd_d is the differential coefficient, preferably 100.
[0035] The convergence strategy from dark to bright also includes the introduction of a priori strategy for control, specifically including: determining whether the error is in an extreme state, and if so, adjusting the speed coefficient speed_d to the preferred value of 1.1 or 1.2;
[0036] Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.2 or 1.5.
[0037] To control extreme cases, if the current frame brightness Y_c is less than the minimum value min_output (preferably 10), the speed coefficient is adjusted to the preferred value of 0.25.
[0038] This application also relates to an automatic exposure control method, comprising the following steps:
[0039] S1, obtain the current frame image and the exposure information Exp_p of the previous frame;
[0040] S2, calculate the average brightness Y_c of the current frame image;
[0041] S3, calculate the error ierror between the target brightness Y_t and the current frame average brightness Y_c;
[0042] S4, calculate the error increments inc_ierror and inc_error1;
[0043] S5. Determine whether the error meets the preset threshold range. If it does, the exposure parameters remain unchanged, and the next loop returns to step S1. If it does not meet the threshold, proceed to step S6.
[0044] S6. Select the appropriate control strategy according to the sign of the error, calculate the exposure increment inc and update the exposure information Exp_c;
[0045] S7 applies the updated exposure information to the image sensor.
[0046] The method further includes:
[0047] S2 calculates the brightness Y_c of the current frame image using the current frame image; further including:
[0048] S2.1. Traverse the image and calculate the brightness value of each pixel in the image: Y = 0.299R + 0.587G + 0.114B, where R, G, and B are the red (R), green (G), and blue (B) component values of a pixel in the RGB mode of the image, respectively, and Y ranges from [0, 255].
[0049] S2.2. Calculate the brightness Y_c of the current frame image based on the obtained brightness values Y of each pixel, within the range [0, 255].
[0050] Where N represents the total number of pixels;
[0051] S3. Calculate the error between the target brightness and the current frame brightness, denoted as ierror.
[0052] ierror = Y_t - Y_c
[0053] Where ierror represents the current error;
[0054] Y_t represents the target brightness, preferably 35;
[0055] Y_c represents the brightness of the current frame;
[0056] S4. Calculate the error increment
[0057] inc_ierror = ierror - error1
[0058] inc_error1 = error1 - error2
[0059] Where ierror represents the current error;
[0060] ierror1 represents the previous error;
[0061] ierror2 represents the error before the one before last;
[0062] inc_ierror is the increment of the current error compared to the previous error;
[0063] inc_ierror1: The previous error and the error increment before that;
[0064] S5. Determine whether the current brightness meets the threshold limit. If threshold_d≤ierror≤thres_s, where threshold_d is the lower limit of the ierror threshold (preferably -1) and threshold_s is the upper limit of the ierror threshold (preferably 1), the exposure parameters remain unchanged if the threshold limit is met, proceed to the next loop and return to step S1. Otherwise, if the threshold limit is not met, update the exposure parameters and proceed to step S6.
[0065] S6. Determine the sign of ierror and whether the current scene converges from bright to dark or from dark to bright.
[0066] If ierror is greater than zero, select step S6.1; otherwise, select step S6.2.
[0067] S6.1. Scene changes from bright to dark
[0068] First calculate the increment
[0069] inc=Kp*inc_ierror+Ki*ierror+Kd*(inc_ierror-inc_error1)
[0070] Whereinc represents the increment;
[0071] Kp represents the proportionality coefficient, preferably 110;
[0072] Ki represents the integral coefficient, preferably 240;
[0073] Kd represents the differential coefficient, preferably 100;
[0074] inc_ierror is the increment of the current error compared to the previous error;
[0075] inc_ierror1: Increment of the previous error and the error before that;
[0076] Introducing prior strategies for control
[0077] S6.1.1. Determine if the error is in an extreme state.
[0078] Determine whether ierror*inc_ierror is less than 0 and inc_ierror*inc_error1 is less than 0. If so, then speed = speed1, where speed1 is preferably 1.2.
[0079] Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10;
[0080] If this holds true, then speed = speed2, where speed2 is preferably 1.5;
[0081] S6.1.2. Determine whether the absolute value of the error is increasing or remaining constant. Determine whether ierror*inc_ierror is greater than 0 or inc_ierror is equal to 0.
[0082] If true, then speed = speed3, where speed3 is preferably 1.25;
[0083] Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10;
[0084] If this is true, then speed = speed4, where speed4 is preferably 1.5;
[0085] S6.1.3. Determine if the error exceeds the set maximum value error_m1, where error_m1 is preferably 150;
[0086] Determine if ierror is greater than error_m1;
[0087] If this is true, then speed = speed5, where speed5 is preferably 2;
[0088] S6.1.4. Control extreme cases and update the increment;
[0089] Determine whether Y_c equals 255.
[0090] Set inc = max_output, where max_output is preferably 80;
[0091] Conversely, inc = inc * speed;
[0092] S6.1.5. Proceed to step S7
[0093] S6.2. Scene transitions from dark to light
[0094] First calculate the increment
[0095] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0096] Whereinc represents the increment;
[0097] Kp_d represents the scaling factor, preferably 100;
[0098] Ki_d represents the integral coefficient, preferably 200;
[0099] Kd_d represents the differential coefficient, preferably 100;
[0100] inc_ierror is the increment of the current error compared to the previous error;
[0101] inc_ierror1: Increment of the previous error and the error before that;
[0102] Introducing prior strategies for control
[0103] S6.2.1. Determine if the error is in an extreme state.
[0104] Determine whether the condition ierror*inc_ierror is less than 0 and inc_ierror*inc_error1 is less than 0 is true;
[0105] If true, then speed_d = speed1_d, where speed1_d is preferably 1.1;
[0106] Further determine whether ierror is greater than error_m1_d, where error_m1_d is preferably 5;
[0107] If true, then speed_d = speed2_d, where speed2_d is preferably 1.2;
[0108] S6.2.2. Determine whether the absolute value of the error is increasing or remaining constant. Determine whether ierror*inc_ierror is greater than 0 or inc_ierror is equal to 0.
[0109] If true, then speed_d = speed3_d, where speed3_d is preferably 1.2;
[0110] Further determine whether ierror is greater than error_m1_d, where error_m1_d is preferably 5;
[0111] If true, then speed_d = speed4_d, where speed4_d is preferably 1.5;
[0112] S6.2.3. Control the extreme cases to prevent convergence overshoot.
[0113] Determine whether Y_c is less than min_output, where min_output is preferably 10;
[0114] The equation is: speed_d = speed5_d, where speed5_d is preferably 0.25;
[0115] S6.2.4. Update Increment
[0116] inc = inc * speed_d;
[0117] S6.2.5. Proceed to step S6.3;
[0118] S6.3. Calculate Exposure Information
[0119]
[0120] Where Exp_c represents the exposure information to be updated;
[0121] Exp_p represents the exposure information of the previous frame;
[0122] inc represents the increment;
[0123] Y_c represents the current scene brightness;
[0124] S7. Update the exposure information and apply it to the image sensor.
[0125] The method can significantly improve the exposure convergence speed, specifically by reducing the number of convergence frames from 103 to 29 in scenes transitioning from dark to bright.
[0126] Therefore, this solution has the following advantages:
[0127] 1) Improve image quality:
[0128] Fast-converging after-exposure (AE) methods can reduce image quality problems caused by improper exposure, such as overexposure or underexposure. By precisely controlling exposure parameters, the method ensures that image details and colors are best rendered, especially in high-contrast scenes, where it better preserves details in highlights and shadows.
[0129] 2) Adapt to changing environments:
[0130] The fast-convergence AE method adapts to various shooting environments, whether indoors, outdoors, or in extreme lighting conditions, quickly adjusting to the appropriate exposure level. This adaptability allows the camera to perform excellently in a variety of scenarios, meeting the shooting needs of different users. Attached Figure Description
[0131] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0132] Figure 1 This is a schematic diagram of the system framework in this application.
[0133] Figure 2 This is a flowchart illustrating the method used in this application.
[0134] Figure 3 and Figure 4 This is a comparative diagram of the same scene's light switching test, in which... Figure 3 This is a schematic diagram of the existing AE convergence scheme. Figure 4 This is a schematic diagram of the AE convergence scheme in this paper. Detailed Implementation
[0135] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0136] This invention relates to a method for controlling the convergence speed of automatic exposure, enabling rapid automatic exposure control based on scene changes. Specifically, it relates to an automatic exposure control system and method, designed to improve the exposure control capabilities of photographic or video recording equipment under different lighting conditions. The system analyzes scene light intensity in real time and automatically adjusts exposure information to achieve optimal exposure results. The method includes scene light intensity detection, automatic adjustment of exposure parameters, and a feedback control mechanism to ensure high-quality images are obtained under various lighting conditions.
[0137] The block diagram of the system is as follows: Figure 1 As shown, it includes:
[0138] The image acquisition module is used to acquire the current frame image and the exposure information Exp_p of the previous frame;
[0139] The brightness calculation module is used to calculate the brightness Y_c of the current frame image based on the current frame image. The average brightness is obtained by traversing the brightness values of each pixel in the image and taking the average value. The formula for calculating the brightness value is Y = 0.299R + 0.587G + 0.114B, where R, G, and B are the red, green, and blue component values of a pixel in the RGB mode of the image, respectively.
[0140] The error calculation module is used to calculate the error ierror between the target brightness Y_t and the current frame image brightness Y_c, where ierror = Y_t - Y_c;
[0141] The error increment calculation module is used to calculate the increment of the current error and the previous error, inc_ierror, as well as the increment of the previous error and the error before that, inc_error1.
[0142] The threshold judgment module is used to determine whether the current error meets the preset threshold range thres_d≤ierror≤thres_s. If it does not meet the threshold, the exposure parameter update process is initiated.
[0143] The exposure parameter update module selects the appropriate control strategy based on the sign of the error, calculates the exposure increment inc, and updates the exposure information Exp_c. The update formula for the exposure information is as follows:
[0144]
[0145] Where Exp_c represents the exposure information to be updated; Exp_p represents the exposure information of the previous frame; inc represents the increment; and Y_c represents the current scene brightness.
[0146] The preferred value for the target brightness Y_t is 35.
[0147] The preferred value for the lower threshold threshold thres_d is -1, and the preferred value for the upper threshold threshold thres_s is 1.
[0148] When the error ierror is greater than zero, the exposure parameter update module adopts a convergence strategy from bright to dark, and the formula for calculating the increment inc is:
[0149] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0150] Where inc represents the increment; Kp_d represents the proportional coefficient, preferably 100; Ki_d represents the integral coefficient, preferably 100; Kd_d represents the derivative coefficient, preferably 1; inc_ierror represents the increment between the current error and the previous error; and inc_ierror1 represents the increment between the previous error and the error before that. This formula also reflects the incremental PID calculation used in this paper.
[0151] The convergence strategy from bright to dark also includes the introduction of a priori strategy for control, specifically including: determining whether the error is in an extreme state, and if so, adjusting the speed coefficient speed to a preferred value of 1.2 or 1.5;
[0152] Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.25 or 1.5.
[0153] Determine whether the error exceeds the set maximum value error_m1, preferably 150. If it does, adjust the speed coefficient to the preferred value of 2.
[0154] To control extreme cases, if the current frame brightness Y_c is equal to 255, the increment is directly set to the maximum value max_output, preferably 80.
[0155] When the error (ierror) is less than or equal to zero, the exposure parameter update module adopts a convergence strategy from dark to bright, and the formula for calculating the increment inc is:
[0156] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0157] Wherein, Kp_d is the proportional coefficient, preferably 100; Ki_d is the integral coefficient, preferably 100; and Kd_d is the differential coefficient, preferably 1.
[0158] The convergence strategy from dark to bright also includes the introduction of a priori strategy for control, specifically including: determining whether the error is in an extreme state, and if so, adjusting the speed coefficient speed_d to the preferred value of 1.1 or 1.2;
[0159] Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.2 or 1.5.
[0160] To control extreme cases, if the current frame brightness Y_c is less than the minimum value min_output (preferably 10), the speed coefficient is adjusted to the preferred value of 0.25.
[0161] The overall process of the method is as follows: Figure 2 As shown, it includes the following steps:
[0162] Step S1. Obtain the current frame image and the exposure information of the previous frame, denoted as Exp_p.
[0163] Step S2. Calculate the brightness Y_c of the current frame image using the current frame image.
[0164] Step S2.1. Traverse the image and calculate the brightness value of each pixel in the image: Y = 0.299R + 0.587G + 0.114B, where R, G, and B are the red (R), green (G), and blue (B) component values of a pixel in the RGB mode of the image, respectively, and Y ranges from [0, 255].
[0165] Step S2.2. Calculate the brightness Y_c range of the current frame image based on the obtained brightness values Y of each pixel, within the range [0, 255].
[0166] Where N represents the total number of pixels;
[0167] Step S3. Calculate the error between the target brightness and the current frame brightness, denoted as ierror.
[0168] ierror = Y_t - Y_c
[0169] Where ierror represents the current error.
[0170] Y_t represents the target brightness, preferably 35.
[0171] Y_c represents the brightness of the current frame.
[0172] Step S4. Calculate the error increment
[0173] inc_ierror = ierror - error1
[0174] inc_error1 = error1 - error2
[0175] Where ierror represents the current error.
[0176] ierror1 indicates the previous error.
[0177] ierror2 represents the error before the previous one.
[0178] inc_ierror: Increment of current error compared to the previous error
[0179] inc_ierror1: Increment of the previous error and the error before that.
[0180] Step S5. Determine whether the current brightness meets the threshold limit. If threshold_d≤ierror≤thres_s (where threshold_d is the lower limit of ierror threshold, preferably -1, and threshold_s is the upper limit of ierror threshold, preferably 1), the exposure parameters remain unchanged and proceed to the next loop to return to step 1. Otherwise, if the threshold limit is not met, update the exposure parameters and proceed to step S6.
[0181] Step S6. Determine the sign of ierror to determine whether the current scene converges from bright to dark or from dark to bright.
[0182] If ierror is greater than zero, select step 7; otherwise, select step S8.
[0183] Step S7. The scene changes from bright to dark.
[0184] First calculate the increment
[0185] inc=Kp*inc_ierror+Ki*ierror+Kd*(inc_ierror-inc_error1)
[0186] This formula also reflects the incremental PID calculation used in this paper;
[0187] Where inc represents the increment.
[0188] Kp represents the proportionality coefficient, preferably 110.
[0189] Ki represents the integral coefficient, preferably 240.
[0190] Kd represents the differential coefficient, preferably 100.
[0191] inc_ierror: Increment of current error compared to the previous error
[0192] inc_ierror1: Increment of the previous error and the error before that.
[0193] Introducing prior strategies for control
[0194] Step S7.1. Determine if the error is in an extreme state.
[0195] Determine if the condition ierror * inc_ierror is less than 0 and inc_ierror * inc_error1 is less than 0 is true.
[0196] If this holds true, then speed = speed1, where speed1 is preferably 1.2.
[0197] Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10.
[0198] If this holds true, then speed = speed2, where speed2 is preferably 1.5.
[0199] Step S7.2. Determine whether the absolute value of the error is increasing or remaining constant.
[0200] Determine if `ierror * inc_ierror` is greater than 0 or `inc_ierror` is equal to 0. If so, then `speed = speed3`, where `speed3` is preferably 1.25.
[0201] Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10.
[0202] If this holds true, then speed = speed4, where speed4 is preferably 1.5.
[0203] Step S7.3. Determine if the error exceeds the set maximum value error_m1, where error_m1 is preferably 150.
[0204] Determine if ierror is greater than error_m1.
[0205] If this holds true, then speed = speed5, where speed5 is preferably 2.
[0206] Step S7.4. Control the extreme cases and update the increment.
[0207] Determine if Y_c equals 255.
[0208] The condition is set as inc = max_output, where max_output is preferably 80.
[0209] Conversely, inc = inc * speed
[0210] Step S7.5. Proceed to step S9;
[0211] Step S8. The scene changes from dark to light.
[0212] First calculate the increment
[0213] inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1)
[0214] This formula also reflects the incremental PID calculation used in this paper;
[0215] Where inc represents the increment.
[0216] Kp_d represents the scaling factor, preferably 100.
[0217] Ki_d represents the integral coefficient, preferably 200.
[0218] Kd_d represents the differential coefficient, preferably 100.
[0219] inc_ierror: Increment of current error compared to the previous error
[0220] inc_ierror1: Increment of the previous error and the error before that.
[0221] Introducing prior strategies for control
[0222] Step S8.1. Determine if the error is in an extreme state.
[0223] Determine if the condition ierror * inc_ierror is less than 0 and inc_ierror * inc_error1 is less than 0 is true.
[0224] If this holds true, then speed_d = speed1_d, where speed1_d is preferably 1.1.
[0225] Further determine whether ierror is greater than error_m1_d. If error_m1_d is preferably 5, then speed_d = speed2_d, where speed2_d is preferably 1.2.
[0226] Step S8.2. Determine whether the absolute value of the error is increasing or remaining constant.
[0227] Determine if `ierror * inc_ierror` is greater than 0 or `inc_ierror` is equal to 0. If so, then `speed_d = speed3_d`, where `speed3_d` is preferably 1.2.
[0228] Further determine whether ierror is greater than error_m1_d. If error_m1_d is preferably 5, then speed_d = speed4_d, where speed4_d is preferably 1.5.
[0229] Step S8.3. Control the limiting cases to prevent convergence overshoot.
[0230] Determine whether Y_c is less than min_output, where min_output is preferably 10.
[0231] The equation is: speed_d = speed5_d, where speed5_d is preferably 0.25.
[0232] Step S8.4. Update Increment
[0233] inc = inc * speed_d
[0234] Step S8.5. Proceed to step 9
[0235] Step S9. Calculate exposure information
[0236]
[0237] Where Exp_c represents the exposure information to be updated.
[0238] Exp_p represents the exposure information of the previous frame.
[0239] inc represents the increment.
[0240] Y_c represents the current scene brightness.
[0241] Step S10. Update the exposure information and apply it to the image sensor.
[0242] like Figure 3 and Figure 4 As shown, this is a comparison of the switching on and off test in the same scene from 0.01 lux to 50 lux, where the horizontal axis is the frame number and the vertical axis is the target brightness Y_t; Figure 3 The existing AE convergence method, from dark to bright (Figures 114-220), shows the convergence process (the entire convergence process requires 103 frames). Figure 4 The image shows the AE convergence scheme presented in this paper, specifically frames 161-190, depicting the convergence process from dark to bright. The entire convergence process requires 29 frames, demonstrating a significant improvement in convergence speed. Specifically, Figure 4 This is the convergence curve of the automatic exposure algorithm for scenes with lights on from 0.01 lux to 50 lux, which is the process of the automatic exposure algorithm in this paper adjusting in real time for the scene.
[0243] This technical solution can be applied to Ingenic's series of chips with automatic exposure algorithm modules and similar chips.
[0244] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An automatic exposure control system, characterized in that, include: The image acquisition module is used to acquire the current frame image and the exposure information Exp_p of the previous frame; The brightness calculation module is used to calculate the brightness Y_c of the current frame image based on the current frame image. The average brightness is obtained by traversing the brightness values of each pixel in the image and averaging them. The formula for calculating the brightness value is Y = 0.299R + 0.587G + 0.114B. Where R, G, and B are the red, green, and blue component values of a pixel in the RGB mode of the image, respectively; The error calculation module is used to calculate the error ierror between the target brightness Y_t and the current frame image brightness Y_c, where ierror = Y_t - Y_c; The error increment calculation module is used to calculate the increment of the current error and the previous error, inc_ierror, as well as the increment of the previous error and the error before that, inc_error1. The threshold judgment module is used to determine whether the current error meets the preset threshold range thres_d≤ierror≤thres_s. If it does not meet the threshold, the exposure parameter update process is initiated. The exposure parameter update module selects the appropriate control strategy based on the sign of the error, calculates the exposure increment inc, and updates the exposure information Exp_c. The update formula for the exposure information is as follows: Where Exp_c represents the exposure information to be updated; Exp_p represents the exposure information of the previous frame; inc represents the increment; and Y_c represents the current scene brightness.
2. The automatic exposure control system according to claim 1, characterized in that, The preferred value for the target brightness Y_t is 35.
3. An automatic exposure control system according to claim 1, characterized in that, The preferred value for the lower threshold threshold thres_d is -1, and the preferred value for the upper threshold threshold thres_s is 1.
4. An automatic exposure control system according to claim 1, characterized in that, When the error ierror is greater than zero, the exposure parameter update module adopts a convergence strategy from bright to dark, and the formula for calculating the increment inc is: inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1) Wherein, inc represents the increment; Kp_d represents the proportional coefficient, preferably 110; Ki_d represents the integral coefficient, preferably 240; Kd_d represents the differential coefficient, preferably 100; inc_ierror represents the increment between the current error and the previous error; and inc_ierror1 represents the increment between the previous error and the error before that.
5. An automatic exposure control system according to claim 4, characterized in that, The light-to-dark convergence strategy also includes introducing a priori strategy for control, specifically including: Determine if the error is in an extreme state. If so, adjust the speed coefficient to the preferred value of 1.2 or 1.
5. Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.25 or 1.
5. Determine whether the error exceeds the set maximum value error_m1, preferably 150. If it does, adjust the speed coefficient to the preferred value of 2. To control extreme cases, if the current frame brightness Y_c is equal to 255, the increment is directly set to the maximum value max_output, preferably 80.
6. An automatic exposure control system according to claim 1, characterized in that, When the error ierror is less than or equal to zero, the exposure parameter update module adopts a convergence strategy from dark to bright, and the formula for calculating the increment inc is: inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1) Wherein, Kp_d is the proportional coefficient, preferably 100; Ki_d is the integral coefficient, preferably 200; and Kd_d is the differential coefficient, preferably 100.
7. An automatic exposure control system according to claim 6, characterized in that, The dark-to-light convergence strategy also includes introducing a priori strategy for control, specifically including: Determine if the error is in an extreme state. If so, adjust the speed coefficient speed_d to the preferred value of 1.1 or 1.
2. Determine whether the absolute value of the error is increasing or remaining constant. If so, adjust the speed coefficient to the preferred value of 1.2 or 1.
5. To control extreme cases, if the current frame brightness Y_c is less than the minimum value min_output (preferably 10), the speed coefficient is adjusted to the preferred value of 0.
25.
8. An automatic exposure control method, characterized in that, Includes the following steps: S1, obtain the current frame image and the exposure information Exp_p of the previous frame; S2, calculate the average brightness Y_c of the current frame image; S3, calculate the error ierror between the target brightness Y_t and the current frame average brightness Y_c; S4, calculate the error increments inc_ierror and inc_error1; S5. Determine whether the error meets the preset threshold range. If it does, the exposure parameters remain unchanged, and the next loop returns to step S1. If it does not meet the threshold, proceed to step S6. S6. Select the appropriate control strategy according to the sign of the error, calculate the exposure increment inc and update the exposure information Exp_c; S7 applies the updated exposure information to the image sensor.
9. The automatic exposure control method according to claim 8, characterized in that, The method further includes: S2 calculates the brightness Y_c of the current frame image using the current frame image; further including: S2.
1. Traverse the image and calculate the brightness value of each pixel. Y = 0.299R + 0.587G + 0.114B Wherein, R, G, and B are the red (R), green (G), and blue (B) component values of a pixel in the RGB mode of the image, respectively, and Y ranges from [0, 255]. S2.
2. Calculate the brightness Y_c of the current frame image based on the obtained brightness values Y of each pixel, within the range [0, 255]. Where N represents the total number of pixels; S3. Calculate the error between the target brightness and the current frame brightness, denoted as ierror, where ierror = Y_t - Y_c. Where ierror represents the current error; Y_t represents the target brightness, preferably 35; Y_c represents the brightness of the current frame; S4. Calculate the error increment inc_ierror = ierror - error1 inc_error1 = error1 - error2 Where ierror represents the current error; ierror1 represents the previous error; ierror2 represents the error before the one before last; inc_ierror is the increment of the current error compared to the previous error; inc_ierror1: Increment of the previous error and the error before that; S5. Determine whether the current brightness meets the threshold limit. If threshold_d≤ierror≤thres_s, where threshold_d is the lower limit of the ierror threshold (preferably -1) and threshold_s is the upper limit of the ierror threshold (preferably 1), the exposure parameters remain unchanged if the threshold limit is met, proceed to the next loop and return to step S1. Otherwise, if the threshold limit is not met, update the exposure parameters and proceed to step S6. S6. Determine the sign of ierror to determine whether the current scene converges from bright to dark or from dark to bright; if ierror is greater than zero, select step S6.1, otherwise select step S6.
2. S6.
1. Scene changes from bright to dark: First calculate the increment inc=Kp*inc_ierror+Ki*ierror+Kd*(inc_ierror-inc_error1) Whereinc represents the increment; Kp represents the proportionality coefficient, preferably 110; Ki represents the integral coefficient, preferably 240; Kd represents the differential coefficient, preferably 100; inc_ierror is the increment of the current error compared to the previous error; inc_ierror1: Increment of the previous error and the error before that; Introducing prior strategies for control S6.1.
1. Determine if the error is in an extreme state. Determine whether ierror*inc_ierror is less than 0 and inc_ierror*inc_error1 is less than 0. If they are true, then speed = speed1, where speed1 is preferably 1.
2. Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10; If this holds true, then speed = speed2, where speed2 is preferably 1.5; S6.1.
2. Determine whether the absolute value of the error is increasing or remaining constant. Determine whether ierror * inc_ierror is greater than 0 or inc_ierror is equal to 0; If true, then speed = speed3, where speed3 is preferably 1.25; Further determine whether ierror is greater than error_m2, where error_m2 is preferably 10; If this is true, then speed = speed4, where speed4 is preferably 1.5; S6.1.
3. Determine if the error exceeds the set maximum value error_m1, where error_m1 is preferably 150; Determine if ierror is greater than error_m1; If this is true, then speed = speed5, where speed5 is preferably 2; S6.1.
4. Control extreme cases and update the increment; Determine whether Y_c equals 255. Set inc = max_output, where max_output is preferably 80; Conversely, inc = inc * speed; S6.1.
5. Proceed to step S7; S6.
2. Scene changes from dark to light: First calculate the increment inc=Kp_d*inc_ierror+Ki_d*ierror+Kd_d*(inc_ierror-inc_error1) Whereinc represents the increment; Kp_d represents the scaling factor, preferably 100; Ki_d represents the integral coefficient, preferably 200; Kd_d represents the differential coefficient, preferably 100; inc_ierror is the increment of the current error compared to the previous error; inc_ierror1: Increment of the previous error and the error before that; Introducing prior strategies for control S6.2.
1. Determine if the error is in an extreme state. Determine whether the condition ierror*inc_ierror is less than 0 and inc_ierror*inc_error1 is less than 0 is true; If true, then speed_d = speed1_d, where speed1_d is preferably 1.1; Further determine whether ierror is greater than error_m1_d, where error_m1_d is preferably 5; If true, then speed_d = speed2_d, where speed2_d is preferably 1.2; S6.2.
2. Determine whether the absolute value of the error is increasing or remaining constant. Determine whether ierror * inc_ierror is greater than 0 or inc_ierror is equal to 0; If true, then speed_d = speed3_d, where speed3_d is preferably 1.2; Further determine whether ierror is greater than error_m1_d, where error_m1_d is preferably 5; If true, then speed_d = speed4_d, where speed4_d is preferably 1.5; S6.2.
3. Control the extreme cases to prevent convergence overshoot. Determine whether Y_c is less than min_output, where min_output is preferably 10; The equation is: speed_d = speed5_d, where speed5_d is preferably 0.25; S6.2.
4. Update Increment inc = inc * speed_d; S6.2.
5. Proceed to step S6.3; S6.
3. Calculate Exposure Information Where Exp_c represents the exposure information to be updated; Exp_p represents the exposure information of the previous frame; inc represents the increment; Y_c represents the current scene brightness; S7. Update the exposure information and apply it to the image sensor.
10. An automatic exposure control method according to claim 8, characterized in that, The method can significantly improve the exposure convergence speed, specifically by reducing the number of convergence frames from 103 to 29 in scenes transitioning from dark to bright.
