An automatic exposure control method, camera, medium and product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN MILESIGHT IOT CO LTD
- Filing Date
- 2025-05-26
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本发明的实施例提供了一种自动曝光控制方法、摄像机、介质及产品,旨在解决现有技术难以考虑系统延迟对曝光参数进行调整,并且难以适应不同延迟帧数场景导致兼容能力差的问题
[0038]针对n帧延迟调节的系统,获取当前帧的画面亮度,结合预设的第一目标亮度计算初始增益调节步长;提取当前帧之前n-1帧的画面亮度,计算各帧画面亮度与第一目标亮度之间的增益调节步长并累加,形成累加增益调节步长;利用累加增益调节步长对当前帧的画面亮度进行校正,得到校正后的画面亮度;依据校正后的画面亮度、初始增益调节步长与第一目标亮度之间的关系推导第二目标亮度;最终根据校正后的画面亮度和第二目标亮度计算第一目标增益调节步长。本发明通过融合n帧延迟周期内的历史画面亮度数据进行递归累加调节,量化系统延迟影响并动态适配不同延迟帧数场景,提升了曝光参数调整的时效性与系统兼容性,实现低延迟、高精度的画面亮度闭环控制。
Smart Images

Figure CN120529193B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an automatic exposure control method, camera, medium, and product. Background Technology
[0002] In image signal processing (ISP) systems, the key bottleneck of automatic exposure control lies in the superposition of two delays: the transmission delay in acquiring brightness information from the sensor, and the processing delay from the issuance of exposure parameters to the ISP system acquiring the brightness changes. The accumulation of these two types of delays makes it difficult for traditional simple PID control algorithms to achieve fast and smooth convergence, resulting in significant lag in image brightness adjustment, which affects real-time performance and image stability.
[0003] Automatic exposure feedback latency is typically quantified in frames. For example, "n+3 frame latency" means that after the algorithm calculates and issues new parameters for the nth frame, the brightness change can only be observed in the (n+3)th frame. Different chip platforms exhibit significant latency characteristics; for instance, the Hisilicon platform has n+4 frames, while the Novatek platform has n+3 frames. Existing algorithms lack compatibility with multi-latency scenarios, requiring independent parameter adjustments for cross-platform adaptation, leading to low development efficiency and fragmented control logic. Therefore, designing an adjustment algorithm that can dynamically adapt to different latency frame numbers has become a pressing technical challenge for the industry. Summary of the Invention
[0004] Embodiments of the present invention provide an automatic exposure control method, camera, medium, and product, which aim to solve the problems of existing technologies that make it difficult to adjust exposure parameters considering system latency and that have poor compatibility due to difficulty in adapting to different latency frame rate scenarios.
[0005] To achieve the above objectives, in a first aspect, the present invention provides an automatic exposure control method for automatically controlling the exposure of a system with n-frame delay adjustment, comprising the following steps:
[0006] Obtain the brightness of the current frame, and calculate the initial gain adjustment step size using the current frame brightness and a preset first target brightness. The initial gain adjustment step size is calculated using the following formula:
[0007] S0 = |20000lgE1-20000lgT1|,
[0008] In the formula, S0 represents the initial gain adjustment step size; E1 represents the brightness of the current frame; and T1 represents the brightness value of the first target.
[0009] Obtain the screen brightness of n-1 frames prior to the current frame, determine n-1 gain adjustment step sizes between the screen brightness of the n-1 frames and the first target brightness, and accumulate the n-1 gain adjustment step sizes to obtain the accumulated gain adjustment step size;
[0010] The brightness of the current frame is corrected according to the cumulative gain adjustment step size to obtain the corrected brightness.
[0011] The second target brightness is obtained based on the corrected image brightness, the first target brightness and the image brightness of the current frame, and the second target brightness keeps the difference between the first target brightness and the image brightness of the current frame unchanged.
[0012] The first target gain adjustment step size is calculated using the corrected image brightness and the second target brightness;
[0013] The second target gain adjustment step size is obtained by fusing the first target gain adjustment step size with the initial gain adjustment step size;
[0014] By establishing a correspondence between the predetermined initial gain adjustment step size and the proportional coefficient, the first proportional coefficient corresponding to the current initial gain adjustment step size is obtained. The second target gain adjustment step size is then adjusted using the first proportional coefficient to obtain the third target gain adjustment step size.
[0015] The current exposure parameters are adjusted based on the third target gain adjustment step size.
[0016] Furthermore, the corrected image brightness range is 0-1023.
[0017] Furthermore, the corrected image brightness is calculated using the following formula:
[0018] E2=E1×10(L n-1 / 20000),
[0019] In the formula, E2 represents the corrected image brightness; L n-1 This indicates the cumulative gain adjustment step size.
[0020] Furthermore, when the corrected image brightness is less than the first target brightness, the second target brightness is calculated using the following formula:
[0021] T2 = T1 + |E2 - E1|;
[0022] When the corrected image brightness is greater than or equal to the first target brightness, the second target brightness is calculated using the following formula:
[0023] T2 = E2 + |E1 - T1|;
[0024] In the formula, T2 represents the brightness of the second target.
[0025] Furthermore, the first target gain adjustment step size is calculated using the following formula:
[0026] S g1 =|20000lgE2-20000lgT2|,
[0027] In the formula, S g1 This indicates the first target gain adjustment step size.
[0028] Furthermore, the second target gain adjustment step size is calculated using the following formula:
[0029] S g2 = k×S0+(1-k)×S g1 ,
[0030] In the formula, S g2 This indicates the second target gain adjustment step size; k is a predetermined fusion coefficient, between 0 and 1.
[0031] Furthermore, the third target gain adjustment step size is calculated using the following formula:
[0032] S g3 =p×(S) g2 / 128),
[0033] In the formula, S g3 This indicates the third target gain adjustment step size; p is the first proportional coefficient.
[0034] In a second aspect, the present invention provides a camera, including a memory and a processor, wherein the memory stores at least one program, which is executed by the processor to implement the automatic exposure control method as described above.
[0035] Thirdly, the present invention provides a computer-readable storage medium storing at least one program, which is executed by a processor to implement the automatic exposure control method described above.
[0036] Fourthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the automatic exposure control method as described above.
[0037] The above technical solution has the following technical effects:
[0038] For a system adjusting n-frame delay, the system acquires the brightness of the current frame and calculates an initial gain adjustment step size based on a preset first target brightness. It then extracts the brightness of the previous n-1 frames, calculates the gain adjustment step size between the brightness of each frame and the first target brightness, and accumulates these steps to form an accumulated gain adjustment step size. The accumulated gain adjustment step size is used to correct the brightness of the current frame, resulting in a corrected brightness. Based on the corrected brightness, the initial gain adjustment step size, and the relationship between the first target brightness and the second target brightness, a second target brightness is derived. Finally, the first target gain adjustment step size is calculated based on the corrected brightness and the second target brightness. This invention uses recursive accumulated adjustment by fusing historical brightness data within an n-frame delay period to quantify the impact of system delay and dynamically adapt to different delay frame number scenarios. This improves the timeliness and system compatibility of exposure parameter adjustments, achieving low-latency, high-precision closed-loop control of image brightness.
[0039] In a further embodiment, the first target gain adjustment step size is fused with the initial gain adjustment step size to obtain a second target gain adjustment step size. Then, based on a predetermined correspondence between the initial gain adjustment step size and a scaling factor, a first scaling factor corresponding to the current initial gain adjustment step size is obtained. This scaling factor is then used to adjust the second target gain adjustment step size to obtain a third target gain adjustment step size. Finally, the current exposure parameters are adjusted according to the third target gain adjustment step size. This process, through multi-step fusion and dynamic scaling factor adaptation mechanisms, further suppresses the adjustment lag problem caused by system latency, improves the response accuracy and dynamic adaptability of exposure parameter adjustment, and ensures the stability and consistency of image brightness under different frame rate delays. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating an embodiment of the automatic exposure control method of the present invention. Detailed Implementation
[0041] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments and to explain the operating principles of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention. Components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0042] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0043] Example 1:
[0044] Figure 1This is a flowchart illustrating an embodiment of an automatic exposure control method according to the present invention. The method is used for automatic exposure control of a system with n-frame delay adjustment, and includes the following steps:
[0045] Obtain the current frame's brightness, and calculate the initial gain adjustment step size using the current frame's brightness and a preset first target brightness. In one specific implementation, the initial gain adjustment step size is calculated using the following formula:
[0046] S0 = |20000lgE1-20000lgT1|,
[0047] In the formula, S0 represents the initial gain adjustment step size; E1 represents the brightness of the current frame; and T1 represents the brightness value of the first target.
[0048] In one specific implementation, the image data processed by the system is raw RAW data without post-processing, typically processed at a predetermined number of bits, such as 10 bits. Here, 10 bits means that the brightness or color information of each pixel is stored by 10 binary numbers, with a value range of 0 to 1023 (i.e., 2 to the power of 10 minus 1), which means that each pixel can present 1024 different brightness or color levels.
[0049] Obtain the image brightness of n-1 frames prior to the current frame, determine n-1 gain adjustment steps between the image brightness of n-1 frames and the brightness of the first target, accumulate n-1 gain adjustment steps, and obtain the accumulated gain adjustment step.
[0050] The brightness of the current frame is corrected according to the cumulative gain adjustment step size to obtain the corrected brightness; preferably, the range of the corrected brightness is limited to 0-1023; in this way, in the initial stage of adjustment, if the brightness of the image itself is almost overexposed, the range of the corrected brightness is limited to 0-1023, so that the difference between the calculated gain adjustment step size and the uncompensated value is not significant, thereby speeding up the adjustment speed in the case of overexposure.
[0051] For example, in a 3-frame delay system, when n is greater than three, the accumulated ineffective adjustment frames in the nth frame are the (n-1)th and (n-2)th frames. If adjustment is stopped at this point, it will eventually be adjusted twice more before stopping. The adjustment content is the adjustment content of the (n-1)th and (n-2)th frames. Therefore, when calculating the screen brightness of the current frame, the influence of the cumulative gain adjustment step size of these two frames needs to be considered. The corrected screen brightness is the screen brightness of the current frame when it will theoretically take effect. Adjusting based on the corrected screen brightness can solve the impact of system delay.
[0052] In one specific implementation, the cumulative brightness adjustment step size is calculated using the following formula:
[0053]
[0054] In the formula, L n-1 S represents the cumulative gain adjustment step size for the first n-1 delayed frames in an n-frame delay system; i The gain adjustment step size for the i-th delayed frame preceding the current frame;
[0055] The corrected image brightness is calculated using the following formula:
[0056] E2=E1×10(L n-1 / 20000),
[0057] In the formula, E2 represents the corrected image brightness.
[0058] The second target brightness is obtained based on the corrected image brightness, the first target brightness, and the image brightness of the current frame, wherein the second target brightness keeps the difference between the first target brightness and the image brightness of the current frame unchanged.
[0059] In one specific implementation, when the corrected image brightness is less than the first target brightness, the second target brightness is calculated using the following formula:
[0060] T2 = T1 + |E2 - E1|;
[0061] When the corrected image brightness is greater than or equal to the first target brightness, the second target brightness is calculated using the following formula:
[0062] T2 = E2 + |E1 - T1|;
[0063] In the formula, T2 represents the brightness of the second target.
[0064] In one specific implementation, according to the formula for the initial gain adjustment step size, for the same interval, the initial gain adjustment step size is larger for the earlier interval and smaller for the later interval after conversion and subtraction of the current frame's brightness and the first target brightness data. For example, when the first target brightness is 20 and the current frame's brightness is 30, the interval or difference between them is 10, and the calculated initial gain adjustment step size is 3521; when the first target brightness is 1000 and the current frame's brightness is 1010, the interval or difference between them is also 10, but the calculated initial gain adjustment step size is only 86. However, after delay correction of the current frame's brightness, the interval between the corrected brightness and the first target brightness changes. Therefore, to maintain the interval or difference between the first target brightness and the current frame's brightness, the second target brightness needs to be calculated based on the corrected brightness, the first target brightness, and the current frame's brightness.
[0065] The gain adjustment step size of the first target is calculated using the corrected image brightness and the brightness of the second target.
[0066] In one specific implementation, the first target gain adjustment step size is calculated using the following formula:
[0067] S g1 =|20000lgE2-20000lgT2|,
[0068] In the formula, S g1 This indicates the first target gain adjustment step size.
[0069] The second target gain adjustment step size is obtained by fusing the first target gain adjustment step size with the initial gain adjustment step size.
[0070] In one specific implementation, the second target gain adjustment step size is calculated using the following formula:
[0071] S g2 = k×S0+(1-k)×S g1 ,
[0072] In the formula, S g2 The second target gain adjustment step size is indicated; k is a predetermined fusion coefficient, which is between 0 and 1; preferably, k is 0.2.
[0073] In this embodiment, the second target gain adjustment step size utilizes the fusion of historical data and current data. That is, by fusing the accumulated gain of n-1 frames with the initial step size of the current frame, the accumulated error caused by system delay is compensated. The effect deviation of the current frame adjustment command caused by delay is pre-allocated and calculated by accumulating the adjustment amount of historical frames, thus avoiding the deviation of post-adjustment lag.
[0074] By establishing a predetermined correspondence between the initial gain adjustment step size and the proportional coefficient, the first proportional coefficient corresponding to the current initial gain adjustment step size is obtained. The first proportional coefficient is then used to adjust the second target gain adjustment step size to obtain the third target gain adjustment step size. In one specific implementation, the above correspondence is represented by a mapping table. The above proportional coefficient corresponds to the proportional coefficient P in PID control. The above correspondence is obtained through pre-determined debugging.
[0075] In one specific implementation, the third target gain adjustment step size is calculated using the following formula:
[0076] S g3 =p×(S) g2 / 128),
[0077] In the formula, S g3The third target gain adjustment step size is indicated; p is the first proportional coefficient corresponding to the current initial gain adjustment step size, which is obtained according to the predetermined correspondence between the initial gain adjustment step size and the proportional coefficient.
[0078] The current exposure parameters are adjusted based on the third target gain adjustment step size.
[0079] In this embodiment, adjusting the current exposure parameters according to the third target gain adjustment step size is the execution step of the entire adjustment process. The third target gain adjustment step size comprehensively reflects the compensation and adaptation to system latency, real-time error, and hardware characteristics. This adjustment step size is directly applied to the device's exposure parameters, increasing or decreasing the exposure to make the image brightness converge towards the target value. In one specific implementation, the third target gain adjustment step size is a gain result, which is converted into a multiplier, and then the exposure parameters are adjusted according to the multiplier. Assuming the current exposure is 10ms and 1x gain, the calculated third target gain adjustment step size is 10x. If the adjustment is downward, the current exposure is adjusted to 1ms and 1x gain; if the adjustment is upward, due to the 1 / fps limitation of exposure, the exposure time is taken as the maximum value of 40ms, that is, adjusted to 40ms and 2.5x gain.
[0080] In practice, each time adjustment is initiated, historical adjustment data is cleared.
[0081] Example 2:
[0082] The present invention also provides a camera, including a memory and a processor, the memory storing at least one program, the at least one program being executed by the processor to implement the automatic exposure control method as described above.
[0083] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer unit by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0084] Example 3:
[0085] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.
[0086] If the modules / units integrated in the computer unit are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0087] Example 4:
[0088] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the automatic exposure control method as described above.
[0089] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. An automatic exposure control method for automatically controlling the exposure of a system with n-frame delay adjustment, characterized in that, Includes the following steps: Obtain the brightness of the current frame, and calculate the initial gain adjustment step size using the current frame brightness and a preset first target brightness. The initial gain adjustment step size is calculated using the following formula: S0 = |20000lgE1-20000lgT1|, In the formula, S0 represents the initial gain adjustment step size; E1 represents the brightness of the current frame; and T1 represents the brightness value of the first target. Obtain the screen brightness of n-1 frames prior to the current frame, determine n-1 gain adjustment step sizes between the screen brightness of the n-1 frames and the first target brightness, and accumulate the n-1 gain adjustment step sizes to obtain the accumulated gain adjustment step size; The brightness of the current frame is corrected according to the cumulative gain adjustment step size to obtain the corrected brightness. The second target brightness is obtained based on the corrected image brightness, the first target brightness and the image brightness of the current frame, and the second target brightness keeps the difference between the first target brightness and the image brightness of the current frame unchanged. The first target gain adjustment step size is calculated using the corrected image brightness and the second target brightness; The second target gain adjustment step size is obtained by fusing the first target gain adjustment step size with the initial gain adjustment step size; By establishing a correspondence between the predetermined initial gain adjustment step size and the proportional coefficient, the first proportional coefficient corresponding to the current initial gain adjustment step size is obtained. The second target gain adjustment step size is then adjusted using the first proportional coefficient to obtain the third target gain adjustment step size. The current exposure parameters are adjusted based on the third target gain adjustment step size.
2. The automatic exposure control method according to claim 1, characterized in that, The corrected image brightness range is 0-1023.
3. The automatic exposure control method according to claim 1, characterized in that, The corrected image brightness is calculated using the following formula: E2=E1×10(L n-1 / 20000), In the formula, E2 represents the corrected image brightness; L n-1 This indicates the cumulative gain adjustment step size.
4. The automatic exposure control method according to claim 3, characterized in that, When the corrected image brightness is less than the first target brightness, the second target brightness is calculated using the following formula: T2 = T1 + |E2 - E1|; When the corrected image brightness is greater than or equal to the first target brightness, the second target brightness is calculated using the following formula: T2 = E2 + |E1 - T1|; In the formula, T2 represents the brightness of the second target.
5. The automatic exposure control method according to claim 4, characterized in that, The first target gain adjustment step size is calculated using the following formula: S g1 =|20000lgE2-20000lgT2|, In the formula, S g1 This indicates the first target gain adjustment step size.
6. The automatic exposure control method according to claim 5, characterized in that, The second target gain adjustment step size is calculated using the following formula: S g2 =k×S0+(1-k)×S g1 , In the formula, S g2 This indicates the second target gain adjustment step size; k is a predetermined fusion coefficient, between 0 and 1.
7. The automatic exposure control method according to claim 6, characterized in that, The third target gain adjustment step size is calculated using the following formula: S g3 =p×(S g2 / 128), In the formula, S g3 The third target gain adjustment step size is represented by p; p is the first proportional coefficient.
8. A camera, characterized in that, It includes a memory and a processor, the memory storing at least one program, the at least one program being executed by the processor to implement the automatic exposure control method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is executed by a processor to implement the automatic exposure control method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the automatic exposure control method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Rapid calibration method and device for image sensor and equipment
CN106982333A
Gain adjustment method and device for image exposure
CN111770283A