Image brightness self-adaptive adjusting method in backlight scene, storage medium and terminal device
By adaptively adjusting the automatic exposure target value and combining scene brightness and image partitioning information, the problem of insufficient dynamic range of image sensors in backlit scenes is solved, thus improving image quality in backlit scenes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI HUGE IC CO LTD
- Filing Date
- 2025-10-31
- Publication Date
- 2026-07-21
AI Technical Summary
In backlit scenarios, the insufficient dynamic range of existing image sensors leads to underexposure of the main subject and loss of image details. Furthermore, using HDR mode or adjusting image gain via curves increases costs or affects image quality in normal scenarios.
By adaptively adjusting the target value of automatic exposure, the system uses scene brightness, image sensor exposure value, global brightness histogram, and regional average brightness information to determine whether it is a backlit scene and calculates a new AE target value to increase exposure and prevent the image from darkening.
In backlit scenes, the exposure is adaptively adjusted to keep the dark areas of the image bright and clear, improving image quality without affecting the image noise in normal scenes, thus achieving low-cost image enhancement.
Smart Images

Figure CN121309975B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image imaging technology, specifically relating to an image brightness adaptive adjustment method, storage medium, and terminal device in backlit scenarios. Background Technology
[0002] Currently, in image sensor-based imaging systems, automatic exposure (AE) control is a key technology for achieving high-quality image capture. Its basic principle is to adjust the exposure time and exposure gain to make the average brightness of the scene captured by the sensor approach a preset target value (such as 18% grayscale). However, when the camera is shooting in a backlit scene, the high-brightness pixels in the image significantly increase the average metering value. Since the AE allocates exposure based on the current average metering value, the increased average metering value causes the AE to reduce the overall exposure. This results in the main parts of the image becoming dark due to underexposure, losing image details, and severely affecting image quality.
[0003] The aforementioned technical problem stems from the insufficient dynamic range of the image sensor. While image sensors with HDR (High Dynamic Range) mode can be used to increase the dynamic range of the image, this requires hardware replacement. HDR image sensors are significantly more expensive than ordinary image sensors, and the image processing algorithms within the sensor chip also need to be adapted, further increasing costs. Another solution is to adjust the image gain using a curve, but this affects images captured in normal scenes, leading to increased image noise and a decrease in the overall signal-to-noise ratio.
[0004] Therefore, designing an automatic exposure adjustment scheme that can adaptively adjust brightness in backlit scenarios is an urgent problem to be solved. Summary of the Invention
[0005] This invention provides an image brightness adaptive adjustment method, storage medium, and terminal device for backlit scenes, aiming to improve image acquisition performance in backlit scenes at low cost; this invention is achieved through the following technical solutions.
[0006] In a first aspect, the present invention provides an image brightness adaptive adjustment method in a backlit scene, comprising:
[0007] S100. Configure the camera's AE target value to an original AE target value;
[0008] S200, Obtain current image data;
[0009] S300: Obtain AE statistical calculation information based on the current image data;
[0010] S400: Determine whether there is a backlight scene in the current image based on the AE statistical calculation information; if yes, proceed to step S500.
[0011] S500, calculates the new AE target value in backlit scenes;
[0012] S600: Update the camera's AE target value configuration using the new AE target value.
[0013] As a preferred technical solution, in step S300, the AE statistical calculation information includes at least one of the following: (1) scene brightness and image sensor exposure value; (2) image global brightness histogram information; (3) image partition average brightness information.
[0014] As a preferred technical solution, in step S400, it is determined whether the current image meets the detection condition one for a backlight scene based on the scene brightness and the exposure value of the image sensor; it is determined whether the current image meets the detection condition two for a backlight scene based on the global brightness histogram information of the image; it is determined whether the current image meets the detection condition three for a backlight scene based on the average brightness information of the image partition; only when all three detection conditions are met is it determined that the current image has a backlight scene.
[0015] As a preferred technical solution, the specific judgment method for detection condition one includes the following steps:
[0016] S411, Pre-calibrate a scene brightness threshold and an image sensor exposure threshold;
[0017] S412. Determine whether the brightness of the current image scene is higher than the scene brightness threshold and whether the exposure value of the image sensor is lower than the exposure threshold. If yes, determine that the current image scene meets the detection condition one; otherwise, determine that there is no backlight scene.
[0018] As a preferred technical solution, the specific judgment method for detection condition two includes the following steps:
[0019] S421. Divide the image pixels into dark pixels, bright pixels, and normal pixels;
[0020] S422. Calculate the number of dark and bright pixels in the current image using the luminance histogram: Define the statistical intervals in the luminance histogram below the luminance threshold T1 as dark pixels, and sum them up to obtain the number of dark pixels. The statistical intervals in the brightness histogram that are above the brightness threshold T2 are defined as bright pixels, and the summation is used to obtain the number of bright pixels. T1 < T2;
[0021] S423. Determine whether the following formula 1 is satisfied:
[0022] Formula 1;
[0023] If so, the current image is determined to meet detection condition two; otherwise, the current image is determined to not have a backlit scene. = ; ; , and This is a preset quantity threshold.
[0024] As a preferred technical solution, the specific judgment method for detection condition three includes the following steps:
[0025] S431. Divide the current image into QxQ regions, and calculate the average pixel brightness of each region to obtain the average brightness of the image region.
[0026] S432. Based on the location information of the partition, select a two-dimensional normal distribution or a custom weight distribution to assign weight values to each region;
[0027] S433. Traverse all partitions, judge based on the average brightness of the partition and the dark area threshold, and sum the weight values of all areas judged as dark areas to obtain the weight sum value.
[0028] S434. Determine whether the weighted cumulative value is greater than a preset value. If yes, determine that the current image meets the detection condition three; otherwise, determine that the current image does not have a backlight scene.
[0029] As a preferred technical solution, in step S300, the AE statistical calculation information also includes the current AE target value; in step S400, when it is determined that there is no backlight scene in the current image frame according to the AE statistical calculation information, the original AE target value is set as a new AE target value and step S600 is executed.
[0030] As a preferred technical solution, in step S400, when it is determined that there is no backlight scene in the current image frame based on the AE statistical calculation information, the following operations are performed:
[0031] If a backlight scene was detected in the previous image, the adjusted AE target value corresponding to the previous image is set as the new AE target value and step S600 is executed; otherwise, the original AE target value is set as the new AE target value and step S600 is executed.
[0032] Secondly, the present invention also provides a storage medium, wherein the computer storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor and executed by the steps of the above-described image brightness adaptive adjustment method in a backlight scenario.
[0033] Thirdly, the present invention also provides a terminal device, comprising: a processor and a storage medium; wherein the storage medium stores a computer program, the computer program being adapted to be loaded by the processor and to execute the steps of the above-described image brightness adaptive adjustment method under backlight scenarios.
[0034] The beneficial effects of the technical solution of the present invention include: being able to adaptively identify whether there is a situation in the current image where the image is darkened due to backlight or backlighting, and adaptively adjust the target brightness value of the AE exposure adjustment algorithm to keep the dark parts of the image bright and clear. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is the main flowchart of the image brightness adaptive adjustment method in a backlit scene provided in the embodiments of the present invention.
[0037] Figure 2 This is a detailed control flowchart of the image brightness adaptive adjustment method in a backlit scene provided in the embodiments of the present invention.
[0038] Figure 3 This is a schematic diagram of image partitioning weighting in the image brightness adaptive adjustment method under backlight scenarios provided in the embodiments of the present invention.
[0039] Figure 4 This is a schematic diagram of the structure of a terminal device provided by the present invention. Detailed Implementation
[0040] To make the technical solution of the present invention clearer and its technical advantages more apparent, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of the present invention.
[0041] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings. For ease of explanation, the orientations are defined in conjunction with the drawings. These orientation definitions are merely for the purpose of clearly describing the relative positional relationships and are not intended to limit the actual orientation of the product or device during production, use, or sale. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Moreover, in the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0042] This invention aims to solve the problems of underexposure, resulting in dark images and loss of detail in shadows when a camera is in a backlit scene, where strong light sources cause overall underexposure. In backlit scenes, by appropriately increasing the AE target value to increase the exposure value, the overall image can be brightened, shadow details restored, and image quality improved. This invention has wide applications in camera surveillance, image recognition, and other scenarios. To make the objectives, technical solutions, and advantages of this invention clearer, the embodiments of this invention will be described in further detail below with reference to the accompanying drawings.
[0043] like Figure 1 As shown, as a basic implementation method, the image brightness adaptive adjustment method in a backlit scene provided in this embodiment includes:
[0044] S100. Configure the camera's AE target value to an original AE target value;
[0045] S200, Obtain current image data;
[0046] S300: Obtain AE statistical calculation information based on the current image data;
[0047] S400: Determine whether there is a backlight scene in the current image based on the AE statistical calculation information; if yes, proceed to step S500.
[0048] S500, calculates the new AE target value in backlit scenes;
[0049] S600: Update the camera's AE target value configuration using the new AE target value.
[0050] It is understood that, as a feasible implementation method, the AE statistical calculation information in step S300 may include at least one of the following: (1) scene brightness and image sensor exposure value; (2) image global brightness histogram information; (3) image partition average brightness information. The image partition average brightness is obtained by dividing the image into different regions and then calculating the average brightness value of each region. The remaining statistical information is provided by other modules of the system and can be obtained in a typical ISP hardware and software processing flow. In addition, when calculating the AE statistical information, the current target brightness value can also be obtained through AE calculation for subsequent use.
[0051] Of course, as a preferred implementation, the AE statistical calculation information includes all of the following three items: (1) scene brightness and image sensor exposure value; (2) global image brightness histogram information; and (3) average brightness information of image zones. Based on this, combined with Figure 2 As shown, in step S400, it is necessary to determine whether the current image meets the detection condition one for a backlight scene based on the scene brightness and the exposure value of the image sensor; to determine whether the current image meets the detection condition two for a backlight scene based on the global brightness histogram information of the image; and to determine whether the current image meets the detection condition three for a backlight scene based on the average brightness information of the image partition. Only when all three detection conditions are met is it determined that the current image has a backlight scene.
[0052] When determining the first detection condition based on scene brightness and image sensor exposure value, it is mainly considered that when in a backlit scene, the scene brightness and image sensor (sensor) exposure value will meet certain conditions, namely, the scene brightness is higher than a set threshold and the sensor exposure value is lower than a set threshold.
[0053] Specifically, the method for determining the detection condition one includes the following steps:
[0054] S411. Pre-calibrate a scene brightness threshold and an image sensor exposure threshold. The configuration is different for different sensors.
[0055] S412. Determine whether the brightness of the current image scene is higher than the scene brightness threshold and whether the exposure value of the image sensor is lower than the exposure threshold. If yes, determine that the current image scene meets the detection condition one; otherwise, determine that there is no backlight scene.
[0056] When determining the second detection condition based on the global brightness histogram information of the image, the main consideration is that when a backlit scene exists in the image, the brightness histogram will exhibit a distinct bimodal shape, meaning that the bright and dark areas in the image are separate, resulting in a large dynamic range. Based on this characteristic, this invention divides image pixels into dark pixels, bright pixels, and normal pixels. The number of dark and bright pixels is calculated using the brightness histogram, and corresponding thresholds are set. When the threshold conditions are met, condition two is considered satisfied; otherwise, it is determined that a backlit scene does not exist.
[0057] Specifically, the specific judgment method for the second detection condition includes the following steps:
[0058] S421. Divide the image pixels into dark pixels, bright pixels, and normal pixels;
[0059] S422. Calculate the number of dark and bright pixels in the current image using the luminance histogram: Define the statistical intervals in the luminance histogram below the luminance threshold T1 as dark pixels, and sum them up to obtain the number of dark pixels. The statistical intervals in the brightness histogram that are above the brightness threshold T2 are defined as bright pixels, and the summation is used to obtain the number of bright pixels. T1 < T2;
[0060] S423. Determine whether the following formula 1 is satisfied:
[0061] Formula 1;
[0062] If so, the current image is determined to meet detection condition two; otherwise, the current image is determined to not have a backlit scene. = ; ; , and This is a preset quantity threshold.
[0063] In the specific judgment method of the above detection condition two, by setting multiple threshold levels, the accuracy of backlight judgment can be increased and the false judgment rate can be reduced; at the same time, the setting of multiple threshold levels can increase the flexibility of the algorithm, so that it can be used for cameras in different scenarios.
[0064] When determining the second detection condition based on the global brightness histogram information of the image, the main method is to perform a weighted calculation based on the average brightness of the image partitions to determine whether it is in a backlit scene.
[0065] Specifically, the method for determining the third detection condition includes the following steps:
[0066] S431. Divide the current image into QxQ regions, and calculate the average pixel brightness of each region to obtain the average brightness of the image region.
[0067] S432. Based on the location information of the partition, select a two-dimensional normal distribution or a custom weight distribution to assign weight values to each region;
[0068] S433. Traverse all partitions, judge based on the average brightness of the partition and the dark area threshold, and sum the weight values of all areas judged as dark areas to obtain the weight sum value.
[0069] S434. Determine whether the weighted cumulative value is greater than a preset value. If yes, determine that the current image meets the detection condition three; otherwise, determine that the current image does not have a backlight scene.
[0070] Combination Figure 3 As shown, for example, suppose an image is divided into 25 regions. Each region needs to be traversed, and a threshold is applied to each region. If the average pixel value of a region is less than the dark area threshold, the region is considered a dark area, and its assigned weight value is accumulated. After traversing all regions, the weight values for all dark areas are obtained. After obtaining the dark area weight values, a threshold is applied to this accumulated weight value; the accumulated dark area weight value must be greater than a set threshold. By setting two thresholds, the probability of false positives is further reduced.
[0071] When detection conditions one, two, and three are all met, it is determined that a backlit scene exists in the current image, and adaptive adjustment of the AE target brightness value is performed. Specifically, all partitions are traversed, and partitions with average brightness below the dark area threshold are weighted and averaged to obtain the dark area weighted average value. The new AE target value is derived from the following formula:
[0072] T new =T old +(55-T dark )
[0073] Among them, T new For the new target value of AE, T old T is the target value of the previous AE. dark The AE target value is a weighted average for dark areas. When a backlit scene is detected in the current image, the AE target value will be adaptively adjusted based on the weighted average for dark areas until the dark areas are brightened to the point where none of the above conditions are met. At this point, it means that the new AE target value can provide sufficient exposure to reduce the dark areas in the image, so that the overall image maintains appropriate exposure and the image quality is improved.
[0074] See also Figure 2As described above, step S300 also calculates the current AE target value through AE statistics; based on this, in step S400, when it is determined that there is no backlight scene in the current image based on the AE statistics calculation information, the original AE target value is set as the new AE target value and step S600 is executed.
[0075] See also Figure 2 In a preferred embodiment, in step S400, when it is determined that there is no backlight scene in the current image based on the AE statistical calculation information, an exposure hold judgment is first performed to maintain AE exposure stability and prevent image flicker. The exposure hold judgment condition is as follows: if a backlight scene was detected last time, the backlight scene detection condition is not met this time, and the weighted average change of the overall image is less than a set threshold, then it is determined that the backlight detection condition is not met due to AE adaptive adjustment. In this case, the previous AE target value will remain unchanged until the image changes significantly, at which point AE adjustment will restart. Through these condition judgments, AE exposure stability is maintained, preventing image flicker caused by exposure oscillation.
[0076] In other words, when it is determined in step S400 that there is no backlight scene in the current image frame based on the AE statistical calculation information, the following operations are performed: determine whether a backlight scene was detected in the previous image frame; if yes, set the adjusted AE target value corresponding to the previous image frame to the new AE target value and execute step S600; otherwise, set the original AE target value to the new AE target value and execute step S600.
[0077] As can be seen from the above, the image brightness adaptive adjustment method for backlit scenes provided by this invention first obtains the scene brightness, average brightness value of each area, and global brightness histogram of the current image, and determines the AE target brightness value. Based on the scene brightness, brightness histogram, and the brightness value information of each area of the image obtained from AE statistics, multiple conditions are comprehensively used to determine whether a backlit scene exists in the current image. If so, a new AE target brightness value is estimated by calculation and smoothed with the previous AE target value to prevent image flicker. When the AE target value iterates until the image reaches a suitable exposure value, the current AE target value is maintained until the image content changes, thus maintaining exposure stability. This invention can adaptively identify whether the current image is darkened due to backlighting or backlighting, and adaptively adjust the target brightness value of the AE exposure adjustment algorithm to keep the dark areas of the image bright and clear.
[0078] Please see Figure 4 This invention provides a terminal device and a storage medium for embodiments of the present invention. For example... Figure 4As shown, the terminal device 500 may include: at least one processor 501, at least one network interface 504, a user interface 503, a storage medium 505, and at least one communication bus 502.
[0079] The processor 501 may include one or more processing cores. The processor 501 connects to various parts within the terminal device 500 using various interfaces and lines, and performs various functions and processes data of the terminal device 500 by running or executing instructions, programs, code sets, or instruction sets stored in the storage medium 505, and by calling data stored in the storage medium 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.
[0080] The storage medium 505 may include random access memory (RAM) or read-only memory. Optionally, the storage medium 505 may include a non-transitory computer-readable storage medium. The storage medium 505 may be used to store instructions, programs, code, code sets, or instruction sets. The storage medium 505 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data involved in the various method embodiments described above, etc. Optionally, the storage medium 505 may also be at least one storage device located remotely from the aforementioned processor 501. Figure 4As shown, storage medium 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.
[0081] exist Figure 4 In the terminal device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 501 can be used to call the application stored in the storage medium 505 and specifically execute the method steps of the image brightness adaptive adjustment method in the backlight scene provided in the above embodiment, which will not be described again here.
[0082] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium. When executed, the program can include the method steps of the image brightness adaptive adjustment method in a backlight scene provided in the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0083] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for adaptive adjustment of image brightness in a backlit scene, characterized in that, include: S100. Configure the camera's AE target value to an original AE target value; S200, Obtain current image data; S300. Obtain AE statistical calculation information based on the current image data. The AE statistical calculation information includes: (1) scene brightness and image sensor exposure value; (2) global brightness histogram information of the image; (3) average brightness information of image partitions. S400: Determine whether the current image meets the detection condition one for a backlit scene based on the scene brightness and the image sensor exposure value; determine whether the current image meets the detection condition two for a backlit scene based on the global brightness histogram information of the image; determine whether the current image meets the detection condition three for a backlit scene based on the average brightness information of the image partitions; when all three detection conditions are met, it is determined that the current image has a backlit scene, and step S500 is executed; the method for determining the detection condition three includes the following steps: S431. Divide the current image into QxQ regions, and calculate the average pixel brightness of each region to obtain the average brightness of the image region. S432. Based on the location information of the partition, select a two-dimensional normal distribution or a custom weight distribution to assign weight values to each region; S433. Traverse all partitions, judge based on the average brightness of the partition and the dark area threshold, and sum the weight values of all areas judged as dark areas to obtain the weight sum value. S434. Determine whether the weighted cumulative value is greater than a preset value. If yes, determine that the current image meets the detection condition three; otherwise, determine that the current image does not have a backlight scene. S500, calculates the new AE target value in backlit scenes; S600: Update the camera's AE target value configuration using the new AE target value.
2. The image brightness adaptive adjustment method in a backlit scene according to claim 1, characterized in that, The specific method for determining detection condition one includes the following steps: S411, Pre-calibrate a scene brightness threshold and an image sensor exposure threshold; S412. Determine whether the brightness of the current image scene is higher than the scene brightness threshold and whether the exposure value of the image sensor is lower than the exposure threshold. If yes, determine that the current image scene meets the detection condition one; otherwise, determine that there is no backlight scene.
3. The image brightness adaptive adjustment method in a backlit scene according to claim 1, characterized in that, The specific judgment method for the second detection condition includes the following steps: S421. Divide the image pixels into dark pixels, bright pixels, and normal pixels; S422. Calculate the number of dark and bright pixels in the current image using the luminance histogram: Define the statistical intervals in the luminance histogram below the luminance threshold T1 as dark pixels, and sum them up to obtain the number of dark pixels. The statistical intervals in the brightness histogram that are above the brightness threshold T2 are defined as bright pixels, and the summation is used to obtain the number of bright pixels. T1 < T2; S423. Determine whether the following formula 1 is satisfied: Official 1; If so, the current image is determined to meet detection condition two; otherwise, the current image is determined to not have a backlit scene. = ; ; , and This is a preset quantity threshold.
4. The image brightness adaptive adjustment method in a backlit scene according to any one of claims 1-3, characterized in that, In step S300, the AE statistical calculation information also includes the current AE target value; in step S400, when it is determined that there is no backlight scene in the current image frame according to the AE statistical calculation information, the original AE target value is set as the new AE target value and step S600 is executed.
5. The image brightness adaptive adjustment method in a backlit scene according to any one of claims 1-3, characterized in that, In step S400, if it is determined that there is no backlit scene in the current image frame based on the AE statistical calculation information, the following operations are performed: If a backlight scene was detected in the previous image, the adjusted AE target value corresponding to the previous image is set as the new AE target value and step S600 is executed; otherwise, the original AE target value is set as the new AE target value and step S600 is executed.
6. A storage medium, characterized in that, The computer storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the steps of the image brightness adaptive adjustment method in a backlight scene as described in any one of claims 1-5.
7. A terminal device, characterized in that, include: A processor and a storage medium; wherein the storage medium stores a computer program adapted to be loaded by the processor and to execute the steps of the image brightness adaptive adjustment method in a backlight scene as described in any one of claims 1-5.