Image brightness control method and related equipment

By jointly modeling a multidimensional central weight matrix with environmental features, the limitations of image brightness calculation and adjustment in existing technologies are overcome, enabling intelligent and adaptive brightness control in complex scenes and improving exposure accuracy and image quality.

CN121724880APending Publication Date: 2026-03-24KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, the calculation and adjustment of image brightness rely on a center-weighted average brightness model, which makes it difficult to take into account both center detail analysis and global brightness trend judgment. Furthermore, it fails to fully integrate ambient light parameters and image content features, resulting in deviations in target brightness judgment and unstable exposure.

Method used

A multidimensional central weight matrix and environmental features are used for joint modeling. Weighted brightness is calculated using the first and second central weight matrices. The main brightness threshold is dynamically determined by combining the environmental brightness parameters and histogram distribution characteristics of the image, and a target brightness value calculation model is established.

Benefits of technology

It achieves intelligent, adaptive, and highly stable control of image brightness in complex scenes, improving exposure accuracy and overall image quality, reducing the risk of misjudgment, and minimizing exposure fluctuations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724880A_ABST
    Figure CN121724880A_ABST
Patent Text Reader

Abstract

The invention discloses an image brightness control method and related equipment, and relates to the technical field of image processing, and the method comprises the steps: carrying out the brightness weighting calculation of a to-be-processed image based on a first center weight matrix, and obtaining a first weighted brightness value; on the basis of the second central weight matrix, performing brightness weighting calculation on the to-be-processed image to obtain a second weighted brightness value; determining a main brightness threshold according to the environment brightness parameter and the histogram distribution characteristic of the to-be-processed image; determining a target brightness value based on the first weighted brightness value, the second weighted brightness value and a main brightness threshold; and performing brightness control on the to-be-processed image based on the target brightness value. According to the invention, through joint modeling of the multi-dimensional center weight matrix and the environment features, the target brightness value is accurately calculated, intelligent, adaptive and high-stability control of the image brightness in a complex scene can be realized, and the exposure accuracy and the overall image quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and more particularly, to an image brightness control method and related equipment. BACKGROUND

[0002] With the wide application of image processing and intelligent perception technology, brightness control, as a key link in image quality optimization, has important value in the fields of mobile phone photography, security monitoring, automatic driving, industrial detection, etc. Reasonable brightness adjustment not only relates to the presentation of picture details and the restoration of colors, but also directly affects the performance of subsequent image recognition, target detection and other intelligent algorithms. Therefore, developing more accurate and intelligent brightness control methods has become one of the core directions of current image processing technology development.

[0003] In the prior art, the calculation and adjustment of image brightness usually rely on the center weighted average brightness model, that is, a higher weight is given to the center region of the image to calculate the overall brightness level. However, the traditional single center weighted matrix has certain limitations in resolving local changes of the image and processing brightness differences of complex scenes, and it is difficult to balance center detail analysis and global brightness trend judgment. At the same time, some brightness control methods fail to fully combine environmental light parameters and image content features, and in different lighting conditions or high dynamic range images, target brightness judgment deviation, unstable exposure and other problems are prone to occur. That is, the prior art has the technical problems of obvious deficiencies in hierarchy, adaptability and accuracy in the process of calculating the brightness target value. SUMMARY

[0004] A series of simplified concepts are introduced in the summary part of the present application, which will be further described in detail in the specific embodiment part. The summary part of the present application does not mean to try to limit the key features and necessary technical features of the claimed technical solution, and even less means to determine the protection scope of the claimed technical solution.

[0005] The image brightness control method and related equipment provided by the present application can accurately calculate the target brightness value by joint modeling of the multi-dimensional center weight matrix and environmental features, and can realize intelligent, adaptive and high-stability control of image brightness in complex scenes, thereby improving exposure accuracy and overall picture quality.

[0006] In a first aspect, this application provides an image brightness control method, comprising: performing a brightness weighted calculation on an image to be processed based on a first central weight matrix to obtain a first weighted brightness value, wherein the value of the first central weight matrix corresponding to the image center region is greater than the value corresponding to the image edge region; performing a brightness weighted calculation on the image to be processed based on a second central weight matrix to obtain a second weighted brightness value, wherein the value of the second central weight matrix corresponding to the image center region is greater than the value corresponding to the image edge region, and the dimension of the second central weight matrix is ​​greater than the dimension of the first central weight matrix; determining a main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed; determining a target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold; and performing brightness control on the image to be processed based on the target brightness value.

[0007] In some implementations, the step of performing a brightness-weighted calculation on the image to be processed based on the first center weight matrix to obtain a first weighted brightness value includes: dividing the image to be processed into P × Q first image blocks at equal intervals according to a P-row Q-column format; determining a first block brightness matrix corresponding to the image to be processed based on the P × Q first image blocks, wherein the size of the first block brightness matrix is ​​P × Q; and performing a weighted fusion process based on the first block brightness matrix and the first center weight matrix to obtain the first weighted brightness value, wherein the size of the first center weight matrix is ​​P × Q.

[0008] In some embodiments, the step of performing a brightness weighted calculation on the image to be processed based on the second center weight matrix to obtain a second weighted brightness value includes: dividing the image to be processed into equal-distance segments in an M x N format to obtain M × N second image blocks, where M > P and N > Q; determining a second block brightness matrix corresponding to the image to be processed based on the M × N second image blocks, wherein the size of the second block brightness matrix is ​​M × N; and performing a weighted fusion process based on the second block brightness matrix and the second center weight matrix to obtain the second weighted brightness value, wherein the size of the second center weight matrix is ​​M × N.

[0009] In some implementations, determining the second block brightness matrix corresponding to the image to be processed based on the M×N second image blocks includes: performing brightness extraction and matrix filling processing on the M×N second image blocks to obtain a third block brightness matrix, wherein the size of the third block brightness matrix is ​​M×N; obtaining the block brightness value and RGB main channel value of each second image block; querying a first preset mapping relationship based on the ambient brightness parameters of the image to be processed to obtain the main color ratio coefficient; querying a second preset mapping relationship based on the ratio of the RGB main channel value to a preset reference value to obtain the color weight coefficient; identifying the second image block whose product of the main color ratio coefficient, the color weight coefficient, and the RGB main channel value is greater than the block brightness value as the target second image block; and replacing the value corresponding to the target second image block in the third block brightness matrix with the RGB main channel value to obtain the second block brightness matrix.

[0010] In some implementations, determining the main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed includes: querying a preset benchmark value mapping table based on the ambient brightness parameters to obtain the corresponding base brightness value and exposure coefficient; converting the histogram distribution characteristics into a scaling factor according to a third preset mapping relationship, wherein the scaling factor ranges from 0 to 1; and determining the main brightness threshold based on the base brightness value, the exposure coefficient, and the scaling factor according to a preset exponential relationship.

[0011] In some implementations, determining the main brightness threshold based on the base brightness value, the exposure coefficient, and the scaling factor according to a preset exponential relationship includes: determining the product of the exposure coefficient and the scaling factor as a target exponential product; calculating a target exponential factor with base 2 and the target exponential product as the exponential value; and determining the product of the base brightness value and the target exponential factor as the main brightness threshold.

[0012] In some implementations, determining the target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold includes: determining the ratio of the main brightness threshold to the second weighted brightness value as a brightness correction ratio; and determining the product of the first weighted brightness value and the brightness correction ratio as the target brightness value.

[0013] Secondly, this application also provides an image brightness control device, comprising: a first brightness value acquisition unit, configured to perform brightness weighted calculation on the image to be processed based on a first central weight matrix to obtain a first weighted brightness value, wherein the value of the first central weight matrix corresponding to the image center region is greater than the value corresponding to the image edge region; a second brightness value acquisition unit, configured to perform brightness weighted calculation on the image to be processed based on a second central weight matrix to obtain a second weighted brightness value, wherein the value of the second central weight matrix corresponding to the image center region is greater than the value corresponding to the image edge region, and the dimension of the second central weight matrix is ​​greater than the dimension of the first central weight matrix; a main brightness threshold acquisition unit, configured to determine a main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed; a target brightness value acquisition unit, configured to determine a target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold; and a brightness control unit, configured to perform brightness control on the image to be processed based on the target brightness value.

[0014] Thirdly, this application also provides an electronic device, including: a memory and a processor, wherein the processor is configured to implement the steps of the image brightness control method described in the first aspect when executing a computer program stored in the memory.

[0015] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image brightness control method described in the first aspect.

[0016] Fifthly, this application also provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implement the image brightness control method provided in the embodiments of this application.

[0017] In summary, this application introduces two central weight matrices with different dimensions to perform weighted brightness calculations on the image separately, obtaining multi-level brightness information. The first matrix provides the overall brightness trend, while the second matrix provides a more detailed analysis of the central region's brightness. Using them together can effectively improve the accuracy of brightness judgment and avoid deviations caused by a single weighting method. By combining the image's environmental brightness parameters and histogram distribution characteristics, the main brightness threshold is dynamically determined, which can be flexibly adjusted according to the actual shooting environment (such as indoor, strong light, low light, etc.) and image content characteristics (such as brightness distribution and color concentration), thereby achieving adaptive brightness control for various complex scenes. By integrating the first weighted brightness value, the second weighted brightness value, and the main brightness threshold, a reasonable target brightness calculation model is established, which can effectively improve the stability and intelligence of brightness adjustment, reduce the risk of misjudgment, and improve the rationality of image exposure. Introducing a more refined target value calculation mechanism in the brightness control stage helps the system quickly converge to the ideal brightness level, reduces exposure oscillation problems, and improves the detail performance in dark areas and the control capability of highlights, thereby improving the overall image quality. In summary, the image brightness control method provided in this application, through joint modeling of a multi-dimensional center weight matrix and environmental features, accurately calculates the target brightness value, enabling intelligent, adaptive, and highly stable control of image brightness in complex scenes, thereby improving exposure accuracy and overall image quality. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit this specification. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating an image brightness control method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the composition structure of an image brightness control device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] The terms used in the specification, claims, and drawings of this application, such as "first," "second," "third," "fourth," etc. (if any), are used to distinguish similar objects and not to describe a specific order or sequence. Therefore, it is to be understood that these terms can be used interchangeably where appropriate, allowing the described embodiments to be used in different orders, unless specifically required by the illustrations or description. Furthermore, the terms "is" and "has," and any variations thereof, are intended to cover, non-exclusively, all possible constituent elements. For example, a process, method, system, product, or apparatus comprising several steps or units is not necessarily limited to the steps or units explicitly listed, but may also include other steps or units not explicitly listed, or steps or units inherent to the process, method, product, or apparatus.

[0020] In this application, a "module" or "unit" refers to a computer program or part of a computer program that has a specific function and works in conjunction with other related parts to achieve a predetermined goal. These modules or units can be implemented by software, hardware (e.g., processing circuitry or memory), or a combination of both. One or more processors or memories can implement one or more modules or units. Furthermore, each module or unit can also be part of a larger module or unit.

[0021] The technical solutions of this application will be described in detail below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are only a part of this application, and not all embodiments. In the following description, the "some embodiments" mentioned are only a subset of all possible embodiments, which may be the same or different subsets, and different embodiments can be combined with each other without conflict.

[0022] Figure 1 This is a schematic flowchart illustrating an image brightness control method provided in an embodiment of this application. For example, see [link to example]. Figure 1 The image brightness control method provided in this application embodiment may include the following steps 101 to 105: Step 101: Based on the first center weight matrix, perform brightness weighted calculation on the image to be processed to obtain the first weighted brightness value, wherein the value of the first center weight matrix in the image center region is greater than the value in the image edge region. In some examples, the first center weight matrix is ​​a two-dimensional matrix used to assign different weight values ​​to different regions of the image. The size of the first center weight matrix is ​​consistent with the number of blocks after image segmentation. Its matrix value is relatively large in the image center region and small in the image edge region, showing a spatial weight distribution with high center and low edge. The first center weight matrix can be generated by a Gaussian function or an elliptic distribution function. The image to be processed refers to the input raw image data, which can be an image frame acquired by a camera or an image read from an image data source (such as JPEG, BMP, or YUV format). In the preprocessing stage, the image to be processed can be converted into a grayscale image or a brightness component for subsequent brightness calculation. Brightness weighting calculation refers to dividing the image into multiple image blocks of a fixed size (such as P rows and Q columns), extracting the brightness value (such as average brightness) of each block, and multiplying it with the weight value at the corresponding position in the first center weight matrix. Finally, the sum of all weighted results is calculated, and the ratio is taken as the sum of all weight values. The calculation formula for brightness weighting calculation can be:

[0023] Where P is the number of rows in the first center weight matrix, and Q is the number of columns in the first center weight matrix. The first weighted brightness value, For the image to be processed, segmented according to row P and column Q, the first... The average brightness value of the block, This corresponds to the value of the first center weight matrix. The first weighted brightness value reflects the global brightness assessment value of the image under the overall view, with the center as the main area of ​​interest, after weighted processing. It has the advantages of strong representativeness and sensitivity to the area of ​​human visual attention. For example, in an image with a size of 640×480, it can be divided into 16×12 blocks (i.e., P=16, Q=12), with each block being 40×40 pixels in size. By calculating the average brightness value of each block, multiplying it element-wise with the first center weight matrix of size 16×12 and summing the results, and finally dividing by the sum of the element-wise values ​​of the first center weight matrix, the first weighted brightness value can be obtained.

[0024] By implementing step 101, the first center weight matrix is ​​used to perform brightness weighted calculation on the image, which can quickly obtain the overall brightness trend of the central region of the image. The first center weight matrix gives higher weight to the image center, which helps to prioritize the brightness changes of the area of ​​interest to the user, and can have higher brightness judgment sensitivity, thereby improving the initial accuracy of brightness estimation.

[0025] Step 102: Based on the second center weight matrix, perform brightness weighted calculation on the image to be processed to obtain the second weighted brightness value. The value of the second center weight matrix in the image center region is greater than the value in the image edge region, and the dimension of the second center weight matrix is ​​greater than the dimension of the first center weight matrix. In some examples, the second center weight matrix refers to a two-dimensional weight matrix with higher spatial resolution than the first center weight matrix. It is used to evaluate the brightness distribution of an image at a finer granularity. The second center weight matrix also follows the distribution rule of high weight in the center and low weight at the edges, that is, the weight value corresponding to the central region of the image is larger and the weight value of the edge region is smaller, so as to reflect the focusing characteristics of visual attention. Unlike the first center weight matrix, the second center weight matrix has a higher dimension. For example, when the first matrix is ​​P×Q (such as 16×12), the second matrix can be M×N (such as 32×24) to provide more refined brightness judgment capabilities. The brightness weighting calculation process is similar to the first weighting step, but with higher resolution. Specifically, the image to be processed is first divided into M×N smaller image blocks, and the brightness value of each block is extracted. Then, these brightness values ​​are multiplied and superimposed one by one with the weight values ​​at the corresponding positions in the second center weight matrix. Finally, the ratio is calculated by summing these weight values ​​with all the weight values ​​to obtain the second weighted brightness value, which is the weighted average of the dominant brightness of the image center region at a finer granular level. The formula for calculating the second weighted brightness value is:

[0026] Where M is the number of rows in the second center weight matrix, and N is the number of columns in the second center weight matrix. The first weighted brightness value, For an image to be processed segmented into M rows and N columns, the first... The average brightness value of the block, This corresponds to the value of the second center weight matrix.

[0027] For example, assuming the image to be processed is 640×480 pixels, it is first divided into 16×12 blocks of 40×40 pixels for processing in step 101. Then, it is further divided into 32×24 blocks of 20×20 pixels for fine-grained weighted processing in this step. The image is segmented and brightness extracted. A normalized second weight matrix (32×24 dimensions) is generated using a two-dimensional Gaussian kernel function, and each block is multiplied, weighted, and summed. Finally, the weighted value is calculated by summing this weighted value with all other weights to obtain the second weighted brightness value. Compared to the first weighted brightness value, the second weighted brightness value can more effectively capture local overexposure or underexposure in the central area of ​​the image, making it particularly suitable for high-precision exposure control scenarios, such as face recognition and product defect detection, where more detailed brightness judgment is required.

[0028] By implementing step 102, based on step 101, a second center weight matrix with a higher dimension is further introduced to perform a more granular brightness weighted analysis on the image. This second center weight matrix can provide a more accurate regional brightness distribution, especially capturing more details in the central region of the image. It helps to make up for the limitations of low-dimensional weight matrices in judgment in complex image scenes, thereby improving the ability to perceive local brightness fluctuations.

[0029] Step 103: Determine the main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed; In some examples, the ambient brightness parameter refers to the numerical quantification information reflecting the external ambient lighting conditions when the image to be processed was captured. It can be obtained in real time by the light sensor in the image acquisition device, or indirectly estimated by the statistical value of the overall brightness distribution of the image. In scenarios without external sensors, the ambient brightness can also be approximated by calculating the average brightness of the entire image or the central area based on the original pixel data of the image to be processed. Histogram distribution characteristics refer to the distribution pattern of image brightness values ​​across the entire grayscale range. It mainly includes information such as the peak position, distribution width, skewness, and proportion of bright / dark areas of the grayscale histogram. Histogram distribution characteristics can be used to characterize the overall contrast, exposure balance, and dominant brightness areas of an image. For example, in low-light images, the histogram is mostly concentrated in the low grayscale area, while in overexposed images, it is concentrated in the high grayscale area. The primary brightness threshold is a reference brightness value used in subsequent brightness control to determine whether the current image brightness deviates from the desired state. Its function is to serve as an important benchmark for calculating the target brightness value. The primary brightness threshold can be determined by fusing ambient brightness parameters with histogram distribution characteristics, dynamically adapting to different shooting conditions and image characteristics. For example, in one specific implementation, if the ambient brightness parameter is 350 Lux, corresponding to a base brightness value of 128 and an exposure factor of 1.2, and the histogram analysis yields a scaling factor of 0.75, then the primary brightness threshold can be calculated using the following formula: Primary brightness threshold = 128 × 2 1.2×0.75 ≈128×2 0.9 ≈236. This main brightness threshold not only reflects the brightness requirements of the external lighting environment, but also takes into account the dynamic adjustment factor of the actual brightness distribution of the image, thereby effectively improving the adaptability and robustness of the image brightness control strategy and avoiding brightness misjudgment in high-contrast or polarized light environments.

[0030] By implementing step 103, the main brightness threshold is dynamically calculated by combining ambient brightness parameters and image histogram distribution characteristics, enabling the system to perceive the actual shooting environment (such as brightness, contrast intensity, etc.) and adaptively adjust the exposure reference standard accordingly. This can effectively improve the exposure accuracy and versatility in different scenarios (such as night scene, backlight, strong light), and is particularly suitable for application scenarios with high requirements for environmental perception and image balance, such as mobile phone photography, automatic exposure systems, and vehicle image acquisition.

[0031] Step 104: Determine the target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold; In some examples, the target brightness value refers to the core control parameter used to guide subsequent image brightness adjustments (such as exposure compensation, brightness enhancement, or suppression). Its aim is to bring the overall image brightness closer to the ideal visual effect, balancing visual emphasis in the central area of ​​the image with overall exposure balance. The target brightness value is not a direct measurement of the current image brightness, but rather a control reference value obtained by integrating multi-dimensional brightness information and threshold judgment. First, the ratio between the main brightness threshold and the second weighted brightness value can be calculated to obtain the degree to which the current brightness deviates from the desired value. Then, this ratio is multiplied by the first weighted brightness value to obtain the target brightness value, thus completing the dynamic adaptive calculation of the brightness target. For example, if the first weighted brightness value is 110, the second weighted brightness value is 180, and the main brightness threshold is 200, then the target brightness value is 110 × (200 / 180) ≈ 122.

[0032] By implementing step 104, the system comprehensively utilizes the ability of the first weighted brightness value to represent the overall brightness trend of the image, as well as the sensitivity of the second weighted brightness value to the details in the center of the image. Simultaneously, a master brightness threshold is introduced as a reference for the expected brightness, thereby achieving a brightness target setting that balances the central visual focus area with global exposure requirements. This not only improves brightness control accuracy but also avoids exposure misjudgments caused by single-point metering and local weight deviations. It is particularly suitable for applications requiring rapid response in dynamic lighting environments, such as mobile devices, autonomous driving cameras, and surveillance systems.

[0033] Step 105: Perform brightness control on the image to be processed based on the target brightness value; In some examples, the overall brightness level of the original image to be processed can be adjusted based on a predetermined target brightness value to make the actual brightness of the image as close as possible to the set target brightness, thereby achieving more reasonable exposure and better visual effects. This brightness control operation can be implemented through image enhancement algorithms such as linear gain adjustment, gamma correction, and brightness shift. The specific method can be flexibly configured according to the hardware platform capabilities and scenario requirements. The implementation of brightness control typically includes: calculating the average brightness value of the current image, comparing it with the target brightness value, calculating the ratio to obtain a brightness adjustment factor; and then using this brightness adjustment factor to scale or weight the brightness channels of all pixels in the image to be processed. For example, when the current average brightness is 100 and the target brightness is 120, the brightness gain coefficient is 1.2, and the brightness of all pixels is adjusted by multiplying this coefficient.

[0034] By implementing step 105, brightness control is performed based on the accurately calculated target brightness value, which can achieve more precise image brightness adjustment. It can quickly converge to the ideal exposure level in a short time, avoid exposure fluctuations, and improve the detail performance of dark and bright areas of the image, thereby improving the overall image quality clarity and visual comfort.

[0035] In summary, this embodiment introduces two central weight matrices of different dimensions to perform weighted brightness calculations on the image, obtaining multi-level brightness information. The first matrix provides the overall brightness trend, while the second matrix provides a more detailed analysis of the central region's brightness. Using them together can effectively improve the accuracy of brightness judgment and avoid deviations caused by a single weighting method. By combining the image's environmental brightness parameters and histogram distribution characteristics, the main brightness threshold is dynamically determined, which can be flexibly adjusted according to the actual shooting environment (such as indoor, strong light, low light, etc.) and image content characteristics (such as brightness distribution and color concentration), thereby achieving adaptive brightness control for various complex scenes. By integrating the first weighted brightness value, the second weighted brightness value, and the main brightness threshold, a reasonable target brightness calculation model is established, which can effectively improve the stability and intelligence of brightness adjustment, reduce the risk of misjudgment, and improve the rationality of image exposure. Introducing a more refined target value calculation mechanism in the brightness control stage helps the system quickly converge to the ideal brightness level, reduces exposure oscillation problems, and improves the detail performance in dark areas and the control capability of highlights, thereby improving the overall image quality. In summary, the image brightness control method provided in this application uses a multi-dimensional center weight matrix and environmental features to jointly model and accurately calculate the target brightness value. This enables intelligent, adaptive, and highly stable control of image brightness in complex scenes, thereby improving exposure accuracy and overall image quality.

[0036] In some embodiments, step 101 may include: dividing the image to be processed into P×Q first image blocks by equal intervals according to the format of P rows and Q columns; determining the first block brightness matrix corresponding to the image to be processed based on the P×Q first image blocks, wherein the size of the first block brightness matrix is ​​P×Q; and performing weighted fusion processing based on the first block brightness matrix and the first center weight matrix to obtain a first weighted brightness value, wherein the size of the first center weight matrix is ​​P×Q.

[0037] In some examples, P and Q represent the number of blocks in the vertical (rows) and horizontal (columns) directions of the image to be processed, respectively. This means dividing the entire image into P rows and Q columns of equal-sized image regions, resulting in a total of P × Q first image blocks. For example, for an image with a resolution of 480 × 480, if P = 6 and Q = 6, the image will be equally divided into 6 rows × 6 columns, resulting in 36 first image blocks, each with a pixel size of 80 × 80. Equal-distance segmentation refers to dividing the image into several rectangular regions at fixed intervals and with uniform dimensions to ensure that all blocks have the same size, thus facilitating uniform brightness calculation. The P×Q first image blocks refer to each rectangular region after the image to be processed is divided, used for subsequent brightness feature extraction. After extracting the brightness features of each block, a two-dimensional matrix is ​​formed, called the first block brightness matrix, with a size of P×Q. Each element in the first block brightness matrix represents the average brightness value of the corresponding image block (such as calculating the region mean after converting an RGB image to grayscale, or extracting the average value of the brightness channel Y). For example, under a 6×6 division, the first block brightness matrix is ​​a 6×6 two-dimensional matrix, and its (i,j)-th element represents the average brightness value of the image block in the i-th row and j-th column. The first weighted brightness value is obtained by performing weighted fusion processing based on the first block brightness matrix and the first central weight matrix. This involves multiplying each brightness value in the first block brightness matrix element-wise with the corresponding weight value in the first central weight matrix, summing all products, and then dividing by the sum of all weight values. This completes the weighted average calculation of the brightness.

[0038] By implementing the above embodiments, dividing the image into regions according to P×Q and combining it with a first center weight matrix of equal size, a fast and low-complexity center-weighted brightness estimation can be achieved. This is particularly effective in image processing devices with limited hardware resources (such as embedded cameras). It can efficiently capture the overall brightness trend of the central region of the image and provide a real-time and accurate basic reference for subsequent brightness decisions, which helps to improve the speed of overall brightness judgment and real-time response capability.

[0039] In some embodiments, step 102 may include: dividing the image to be processed into M×N second image blocks in an M-row N-column format to obtain M×N second image blocks, where M>P and N>Q; determining the second block brightness matrix corresponding to the image to be processed based on the M×N second image blocks, where the size of the second block brightness matrix is ​​M×N; and performing weighted fusion processing based on the second block brightness matrix and the second center weight matrix to obtain a second weighted brightness value, where the size of the second center weight matrix is ​​M×N.

[0040] In some examples, M and N represent the number of blocks to be divided in the vertical (row) direction and the horizontal (column) direction, respectively, to construct a higher-resolution image brightness analysis structure. Compared with the parameters P and Q in step 101, the division is more refined, satisfying M>P and N>Q. For example, in the case of an image size of 480×480, if P and Q are both 6, then M and N can both be set to 24, thereby achieving a denser division within the same image area. Equal-distance segmentation refers to dividing the image into several rectangular regions with equal rows and columns according to a uniform grid size, so that each segmented region has the same width and height, thus facilitating uniform brightness feature extraction and matrix construction. By performing equal-distance segmentation of the image in M×N format, M×N second image blocks can be obtained; for example, dividing the image equally into 24 rows × 24 columns yields 576 image blocks, each with a size of 20×20 pixels. Based on the M×N second image blocks, the brightness values ​​of each block can be extracted sequentially, and a two-dimensional matrix can be constructed according to the spatial arrangement of the blocks, which is the second block brightness matrix with a size of M×N. The (i,j)th element of the second block brightness matrix represents the average brightness value of the block in the i-th row and j-th column of the image. A weighted fusion process is performed based on the second block brightness matrix and the second central weight matrix to obtain the second weighted brightness value. This involves multiplying the second block brightness matrix element-wise with the second central weight matrix of the same size (M×N) to obtain a weighted brightness value matrix. The sum of all elements in this matrix is ​​then divided by the sum of all weight values ​​to obtain a brightness evaluation value representing the overall image brightness level, i.e., the second weighted brightness value.

[0041] By implementing the above embodiments, a higher resolution (M×N) second center weight matrix is ​​introduced, which can obtain more granular brightness distribution information of the image while maintaining the center weight principle. This can enhance the perception of details in the central area and the brightness transition at the edges, and is particularly suitable for high dynamic range images or complex lighting scenes. It helps to reduce local brightness deviation and improve the accuracy and regional adaptability of automatic exposure adjustment.

[0042] In some embodiments, the aforementioned determination of the second block brightness matrix corresponding to the image to be processed based on M×N second image blocks may include: performing brightness extraction and matrix filling processing on the M×N second image blocks to obtain a third block brightness matrix, wherein the size of the third block brightness matrix is ​​M×N; obtaining the block brightness value and RGB main channel value of each second image block; querying a first preset mapping relationship based on the ambient brightness parameters of the image to be processed to obtain the main color ratio coefficient; querying a second preset mapping relationship based on the ratio of the RGB main channel value to a preset reference value to obtain the color weight coefficient; determining the second image block whose product of the main color ratio coefficient, the color weight coefficient, and the RGB main channel value is greater than the block brightness value as the target second image block; replacing the value corresponding to the target second image block in the third block brightness matrix with the RGB main channel value to obtain the second block brightness matrix.

[0043] In some examples, brightness extraction and matrix filling processing refers to calculating the brightness values ​​of M×N second image blocks respectively, and filling these brightness values ​​into a two-dimensional matrix according to the spatial position of the corresponding blocks to form a third block brightness matrix. The size of the third block brightness matrix is ​​M×N, and its (i,j)th element is the block brightness value extracted from the second image block in the i-th row and j-th column of the image to be processed. The block brightness value can be the average value of the brightness of all pixels in the block, usually calculated using a grayscale conversion formula, such as: Y=0.299×R+0.587×G+0.114×B, where Y is the block brightness value, and R, G, and B are the average values ​​of the red, green, and blue components of all pixels in the block. At the same time as brightness extraction, the RGB main channel value of each second image block is also extracted, that is, the largest value among R, G, and B. For example, if R=150, G=170, and B=130 for a certain block, then the RGB main channel value is G=170. The ambient brightness parameter characterizes the overall exposure or illumination level of the image to be processed. It can be estimated using the image's average brightness, histogram mean, or image header metadata. Based on the ambient brightness parameter, a first preset mapping relationship can be queried to obtain the primary color proportion coefficient. For example, when the ambient brightness is low (e.g., the average Y value is less than 80), the primary color proportion coefficient can be set to 1.2 according to the mapping relationship; when the brightness is normal, the primary color proportion coefficient can be set to 1.0. The ratio of the extracted RGB primary channel value to a preset reference value (e.g., 255) is calculated, and the corresponding color weight coefficient can be obtained by querying the second preset mapping relationship based on this ratio. For example, if the RGB primary channel value is 204, the ratio to the reference value is 0.8, and the corresponding weight coefficient can be 1.1. The color weight coefficient reflects the relative saturation or importance of the current color component. When the primary color ratio coefficient × color weight coefficient × RGB primary channel value is greater than the current block brightness value, it indicates that the block has stronger brightness characteristics under color dominance and is identified as the target second image block. Finally, the element values ​​corresponding to the target second image block in the third block brightness matrix can be replaced with the corresponding RGB primary channel values ​​to form the final second block brightness matrix, which integrates color perception brightness characteristics and enhances the ability to express the brightness of key areas.

[0044] The first preset mapping relationship is a correspondence rule between the ambient brightness parameter and the primary color ratio coefficient, which is pre-calibrated and stored through experiments. Its core function is to dynamically adjust the weight of the primary color channel in brightness calculation according to the light intensity of the environment in which the image is located, so as to adapt to the color fidelity requirements under different lighting conditions. The establishment of the first preset mapping relationship is based on a large amount of scene test data: In low light environment (such as ambient brightness parameter ≤500 lux), the color channel value of the image is prone to being low due to insufficient light. At this time, the primary color ratio coefficient needs to be reduced (such as set to 0.8) to avoid over-amplifying the influence of the primary color channel and prevent noise from being enhanced. In medium light environment (501~5000 lux), the light is balanced, and the primary color ratio coefficient is set to 1.0 to maintain the natural weight of the primary color channel. In strong light environment (≥5001 lux), high brightness may cause the primary color channel value to be close to saturation (such as close to 255). At this time, the primary color ratio coefficient needs to be increased (such as set to 1.2) to enhance the proportion of the primary color channel in brightness calculation and avoid the primary color feature being masked by the overestimation of brightness value under strong light. For example, when the ambient brightness parameter is 2000 lux (medium light), the primary color ratio coefficient of 1.0 can be directly obtained by querying the mapping relationship; when the ambient brightness parameter is 6000 lux (strong light), the coefficient is 1.2.

[0045] The second preset mapping relationship is a correspondence rule between the predefined ratio of the RGB main channel value to the preset baseline value (255) and the color weight coefficient. Its core function is to adjust the weight of the main color channel in brightness calculation based on the relative saturation of the main color channel (the higher the ratio, the higher the saturation), so as to avoid the brightness calculation deviation in highly saturated color areas. The preset baseline value 255 is the maximum theoretical value of the RGB channel. Therefore, the ratio of the RGB main channel value / 255 ranges from 0 to 1, directly reflecting the saturation of the main color channel: the lower the ratio (e.g., ≤0.3), the more unsaturated the main color channel is, and the lower the brightness weight requirement is; the higher the ratio (e.g., ≥0.7), the more saturated the main color channel is, and its weight in brightness calculation needs to be strengthened to highlight the color characteristics. Based on this, the second mapping relationship is usually set as follows: when the ratio is ≤0.3, the color weight coefficient is 0.6 (weakening the influence); when the ratio is 0.3~0.7, the coefficient is 0.8 (medium weight); when the ratio is ≥0.7, the coefficient is 1.0 (strengthening the influence). For example, if the RGB main channel value of a certain block is 200, its ratio to 255 is approximately 0.78. Querying this mapping relationship will yield a color weight coefficient of 1.0, which enhances the role of this highly saturated main color channel in brightness calculation and avoids color distortion caused by low brightness values.

[0046] For example, the image to be processed is divided into 32×24 blocks. After extracting the Y value and the maximum RGB value of each block, the main color ratio coefficient (e.g., 1.1) is looked up according to the lighting parameters. Then, the ratio (180 / 255≈0.71) is calculated based on the RGB main channel value (e.g., 180) to find the color weight coefficient (e.g., 1.05). The product of the three is 1.1×1.05×180=207.9. If the Y value of the block is 190, the replacement condition is met. The corresponding value 190 in the original third block brightness matrix is ​​replaced with 180 to obtain the second block brightness matrix.

[0047] By implementing the above embodiments, the main color ratio coefficient and color weight coefficient are introduced in the process of constructing the brightness matrix, and the replacement process is carried out by judging the relationship between the RGB main channel value and the brightness value. This can effectively identify and suppress the interference caused by large color blocks (such as red flowers, blue sky, etc.) on brightness judgment, prevent the brightness bias problem caused by color saturation, avoid abnormal adjustment of image brightness, significantly improve color accuracy and brightness control stability, and is suitable for scenarios with high requirements for color reproduction, such as face detection and landscape shooting.

[0048] In some embodiments, the aforementioned step 103 may include: querying a preset baseline value mapping table based on ambient brightness parameters to obtain the corresponding base brightness value and exposure coefficient; converting the histogram distribution characteristics into a scaling factor according to a third preset mapping relationship, wherein the scaling factor ranges from 0 to 1; and determining the main brightness threshold based on the base brightness value, exposure coefficient, and scaling factor according to a preset exponential relationship.

[0049] In some examples, the preset baseline value mapping table refers to a pre-established correspondence table for different ambient brightness parameters. This table is used to look up the matching baseline brightness value and exposure coefficient based on the overall lighting conditions of the image. The baseline brightness value reflects the recommended image brightness target for the current environment (e.g., 70 for low light, 120 for normal light, and 180 for strong light). The exposure coefficient is used to adjust the sensitivity or intensity of the brightness target, typically ranging from 0.8 to 1.5, to compensate for exposure deviations in different scenes. Ambient brightness parameters can be obtained through the image's grayscale mean, histogram distribution centroid, or external lighting sensors. The third preset mapping relationship refers to a function mapping established between the image's brightness histogram distribution characteristics (e.g., uniformity, skewness, concentration) and the corresponding scaling factor. For example, if the image brightness is concentrated in the mid-gray area, the corresponding scaling factor is larger (e.g., 0.8); if the brightness is concentrated in the dark or bright areas, indicating image skewness, the scaling factor is smaller (e.g., 0.3). The scaling factor ranges from 0 to 1 and reflects the balance or shift trend of the current image brightness distribution. Determining the main brightness threshold according to a preset exponential relationship involves combining the base brightness value, exposure coefficient, and scaling factor, and then determining the main brightness threshold using a formula of the following form:

[0050] in, Main brightness threshold, Based on the basic brightness value, For exposure factor, As a scaling factor, the exponential relationship allows the scaling factor to have a non-linear enhancement or suppression effect on brightness adjustment. For example, if the ambient brightness parameter of the image is 85 (dark scene), and the base brightness value obtained by looking up the preset reference value mapping table is 90, the exposure factor is 1.2; the image histogram is dark and concentrated, with a skewed distribution, and the scaling factor is 0.4; then the calculated main brightness threshold is approximately 145.

[0051] Through the implementation of the above embodiments, the main brightness threshold is dynamically generated by combining the ambient brightness parameters and image histogram features of the image, which has significant scene adaptability. By querying the mapping table to obtain the basic brightness value and exposure coefficient, and introducing a scaling factor adjustment, the brightness benchmark can be dynamically adjusted according to different lighting environments (such as indoor low light, outdoor strong light, and night scene), which can improve the level of intelligence of brightness control and ensure that the best exposure can be achieved quickly and stably in multiple scenes.

[0052] In some embodiments, the aforementioned determination of the main brightness threshold based on the base brightness value, exposure coefficient, and scaling factor according to a preset exponential relationship may include: determining the product of the exposure coefficient and the scaling factor as the target exponential product; calculating the target exponential factor with base 2 and the target exponential product as the exponential value; and determining the main brightness threshold by multiplying the base brightness value and the target exponential factor.

[0053] In some examples, the target exponent product refers to the numerical result obtained by multiplying the exposure factor and the scaling factor, used as the exponent part in subsequent exponential calculations. The exposure factor reflects the amplification effect of ambient light intensity on brightness adjustment, while the scaling factor represents the uniformity of image brightness distribution. Their product comprehensively reflects the sensitivity of the current image to changes in the brightness threshold. This product can be obtained through ordinary multiplication operations; for example, if the exposure factor is 1.2 and the scaling factor is 0.4, then the target exponent product is 1.2 × 0.4 = 0.48. The target exponent factor is the value obtained by exponentially multiplying the target exponent product to a base of 2; specifically, it can be expressed as:

[0054] in, For the target index factor, For exposure factor, This is a scaling factor.

[0055] The product of the base brightness value and the target index factor is used to determine the main brightness threshold. This means that by multiplying the known base brightness value by the above-mentioned index factor, the main brightness threshold can be obtained. This main brightness threshold is the optimal brightness reference standard determined by the system under the current image brightness distribution and ambient lighting conditions.

[0056] By implementing the above embodiments, the scaling factor is multiplied by the exposure coefficient and used as an exponent. The brightness threshold is then calculated using the exponential growth relationship. This enables non-linear adjustment of the brightness response curve, which can more precisely fit the image sensor's perception characteristics of light changes. This makes the brightness adjustment process smoother and more natural, especially suitable for complex scenes with high contrast and large differences between light and dark, avoiding sudden changes or deviations in brightness adjustment.

[0057] In some embodiments, step 104 may include: determining the ratio of the main brightness threshold to the second weighted brightness value as a brightness correction ratio; and determining the product of the first weighted brightness value and the brightness correction ratio as a target brightness value.

[0058] In some examples, the brightness correction ratio refers to a scaling factor obtained by dividing the main brightness threshold by the second weighted brightness value. This factor is used to adjust the brightness of the first weighted brightness value to bridge the gap between the overall brightness trend and the detailed brightness analysis. The brightness correction ratio reflects the degree of deviation between the current brightness of the image and the target brightness, thus providing a dynamic basis for brightness adjustment. The first weighted brightness value can be used as a global brightness reference, and the brightness correction ratio can be used for adjustment to obtain the final target value for image brightness control. In practice, the first weighted brightness value is usually based on a coarser-grained full-image center weight estimation, while the second weighted brightness value has higher resolution and covers more image details. By comparing the main brightness threshold with the second weighted brightness value to obtain a correction coefficient, which is then used to adjust the first weighted brightness value, both the overall image trend and detailed features can be fully considered, forming a stable yet sensitive brightness control target value.

[0059] By implementing the above embodiments, using the ratio of the main brightness threshold to the second weighted brightness value for brightness correction, and then combining the first weighted brightness value to determine the final target brightness, a robust brightness adjustment ratio model can be constructed. This model can effectively integrate the macroscopic brightness benchmark with the actual brightness perception results of the central area, making the calculation of the target brightness both globally reasonable and locally accurate. It can effectively avoid the deviation caused by a single brightness reference, improve the accuracy of brightness assessment in various complex shooting environments, and enhance the stability of automatic image brightness adjustment and the user's visual experience.

[0060] Furthermore, as an implementation of the aforementioned method embodiments, this application also provides an image brightness control device for implementing the aforementioned method embodiments. This device embodiment corresponds to the aforementioned method embodiments. For ease of reading, this image brightness control device embodiment will not repeat the details of the aforementioned method embodiments one by one, but it should be understood that the device in this application embodiment can correspondingly implement all the contents of the aforementioned method embodiments. For example... Figure 2 As shown, the image brightness control device 20 includes: a first brightness value acquisition unit 201, a second brightness value acquisition unit 202, a main brightness threshold acquisition unit 203, a target brightness value acquisition unit 204, and a brightness control unit 205. The first brightness value acquisition unit 201 is used to perform brightness weighted calculation on the image to be processed based on a first center weight matrix to obtain a first weighted brightness value, wherein the value corresponding to the first center weight matrix in the image center region is greater than the value corresponding to the image edge region. The second brightness value acquisition unit 202 is used to perform brightness weighted calculation on the image to be processed based on a second center weight matrix. A second weighted brightness value is obtained through a brightness weighting calculation, wherein the value corresponding to the center region of the second center weight matrix is ​​greater than the value corresponding to the edge region of the image, and the dimension of the second center weight matrix is ​​greater than the dimension of the first center weight matrix; a main brightness threshold acquisition unit 203 is used to determine the main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed; a target brightness value acquisition unit 204 is used to determine the target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold; and a brightness control unit 205 is used to control the brightness of the image to be processed based on the target brightness value.

[0061] In some embodiments, the first brightness value acquisition unit 201 is further configured to divide the image to be processed into equal segments according to the format of P rows and Q columns to obtain P×Q first image blocks; determine the first block brightness matrix corresponding to the image to be processed based on the P×Q first image blocks, wherein the size of the first block brightness matrix is ​​P×Q; and perform weighted fusion processing based on the first block brightness matrix and the first center weight matrix to obtain a first weighted brightness value, wherein the size of the first center weight matrix is ​​P×Q.

[0062] In some embodiments, the second brightness value acquisition unit 202 is further configured to divide the image to be processed into M×N second image blocks in an M-row N-column format, wherein M>P and N>Q; determine the second block brightness matrix corresponding to the image to be processed based on the M×N second image blocks, wherein the size of the second block brightness matrix is ​​M×N; and perform weighted fusion processing based on the second block brightness matrix and the second center weight matrix to obtain a second weighted brightness value, wherein the size of the second center weight matrix is ​​M×N.

[0063] In some embodiments, the second brightness value acquisition unit 202 is further configured to perform brightness extraction and matrix filling processing on M×N second image blocks to obtain a third block brightness matrix, wherein the size of the third block brightness matrix is ​​M×N; acquire the block brightness value and RGB main channel value of each second image block; query a first preset mapping relationship based on the ambient brightness parameters of the image to be processed to obtain the main color ratio coefficient; query a second preset mapping relationship based on the ratio of the RGB main channel value to a preset reference value to obtain the color weight coefficient; determine the second image block whose product of the main color ratio coefficient, the color weight coefficient, and the RGB main channel value is greater than the block brightness value as the target second image block; replace the value corresponding to the target second image block in the third block brightness matrix with the RGB main channel value to obtain the second block brightness matrix.

[0064] In some embodiments, the main brightness threshold acquisition unit 203 is further configured to query a preset benchmark value mapping table based on the ambient brightness parameter to obtain the corresponding basic brightness value and exposure coefficient; convert the histogram distribution characteristics into a scaling factor according to a third preset mapping relationship, wherein the scaling factor ranges from 0 to 1; and determine the main brightness threshold based on the basic brightness value, exposure coefficient and scaling factor according to a preset exponential relationship.

[0065] In some embodiments, the main brightness threshold acquisition unit 203 is further configured to determine the product of the exposure coefficient and the scaling factor as the target index product; calculate the target index factor with 2 as the base and the target index product as the index value; and determine the main brightness threshold by multiplying the base brightness value and the target index factor.

[0066] In some embodiments, the target brightness value acquisition unit 204 is further configured to determine the ratio of the main brightness threshold to the second weighted brightness value as the brightness correction ratio; and to determine the product of the first weighted brightness value and the brightness correction ratio as the target brightness value.

[0067] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, will cause the processor to perform any step of the image brightness control method provided in this application.

[0068] In some embodiments, the computer-readable storage medium may be a random access memory (RAM), a read-only memory (ROM), flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or it may be a variety of devices that include one or any combination of the above-mentioned memories.

[0069] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0070] In some embodiments, computer-executable instructions may, but do not necessarily, correspond to files in a file system, and may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0071] In some embodiments, computer-executable instructions may be deployed to execute on an electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0072] like Figure 3 As shown, this application also provides an electronic device 30, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, it implements any step of the above-described image brightness control method.

[0073] This application also provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium and executes the computer program or computer-executable instructions, causing the electronic device to perform any step of the image brightness control method described above.

[0074] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An image brightness control method, characterized in that, include: Based on the first center weight matrix, a brightness weighted calculation is performed on the image to be processed to obtain a first weighted brightness value, wherein the value of the first center weight matrix in the image center region is greater than the value in the image edge region. Based on the second center weight matrix, the brightness weighted calculation is performed on the image to be processed to obtain the second weighted brightness value. The value of the second center weight matrix in the image center region is greater than the value in the image edge region, and the dimension of the second center weight matrix is ​​greater than the dimension of the first center weight matrix. The main brightness threshold is determined based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed; The target brightness value is determined based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold. The brightness of the image to be processed is controlled based on the target brightness value.

2. The image brightness control method according to claim 1, characterized in that, The step of performing brightness-weighted calculations on the image to be processed based on the first center weight matrix to obtain a first weighted brightness value includes: The image to be processed is divided into P × Q first image blocks according to the format of P rows and Q columns. Based on the P×Q first image blocks, a first block brightness matrix corresponding to the image to be processed is determined, wherein the size of the first block brightness matrix is ​​P×Q; Based on the first block brightness matrix and the first center weight matrix, a weighted fusion process is performed to obtain the first weighted brightness value, wherein the size of the first center weight matrix is ​​P×Q.

3. The image brightness control method according to claim 2, characterized in that, The step of performing brightness weighted calculation on the image to be processed based on the second center weight matrix to obtain a second weighted brightness value includes: The image to be processed is divided into M×N second image blocks according to the format of M rows and N columns, where M>P and N>Q; Based on the M×N second image blocks, determine the second block brightness matrix corresponding to the image to be processed, wherein the size of the second block brightness matrix is ​​M×N; Based on the second block brightness matrix and the second center weight matrix, a weighted fusion process is performed to obtain the second weighted brightness value, wherein the size of the second center weight matrix is ​​M×N.

4. The image brightness control method according to claim 3, characterized in that, The step of determining the second block brightness matrix corresponding to the image to be processed based on the M×N second image blocks, wherein the size of the second block brightness matrix is ​​M×N, includes: Based on the M×N second image blocks, brightness extraction and matrix filling processes are performed to obtain a third block brightness matrix, wherein the size of the third block brightness matrix is ​​M×N; Obtain the block brightness value and RGB main channel value of each second image block; Based on the ambient brightness parameters of the image to be processed, the first preset mapping relationship is queried to obtain the main color ratio coefficient; Based on the ratio of the RGB main channel value to the preset reference value, the second preset mapping relationship is queried to obtain the color weight coefficient; The second image block whose product of the main color ratio coefficient, the color weight coefficient, and the RGB main channel value is greater than the block brightness value is determined as the target second image block; The values ​​corresponding to the target second image block in the third block brightness matrix are replaced with the RGB main channel values ​​to obtain the second block brightness matrix.

5. The image brightness control method according to claim 1, characterized in that, The step of determining the main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed includes: Based on the ambient brightness parameters, a preset benchmark value mapping table is queried to obtain the corresponding basic brightness value and exposure coefficient; According to the third preset mapping relationship, the histogram distribution characteristics are converted into a scaling factor, wherein the scaling factor ranges from 0 to 1; The main brightness threshold is determined based on the base brightness value, the exposure coefficient, and the scaling factor according to a preset exponential relationship.

6. The image brightness control method according to claim 5, characterized in that, The step of determining the main brightness threshold based on the base brightness value, the exposure coefficient, and the scaling factor according to a preset exponential relationship includes: The product of the exposure coefficient and the scaling factor is determined as the target index product; The target index factor is calculated by multiplying the target index with base 2 and using the product of the target indexes as the index value. The product of the base brightness value and the target index factor is determined as the main brightness threshold.

7. The image brightness control method according to any one of claims 1 to 6, characterized in that, The step of determining the target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold includes: The ratio of the main brightness threshold to the second weighted brightness value is determined as the brightness correction ratio. The product of the first weighted brightness value and the brightness correction ratio is determined as the target brightness value.

8. An image brightness control device, characterized in that, include: The first brightness value acquisition unit is used to perform brightness weighted calculation on the image to be processed based on the first center weight matrix to obtain the first weighted brightness value, wherein the value of the first center weight matrix in the image center region is greater than the value in the image edge region. The second brightness value acquisition unit is used to perform brightness weighted calculation on the image to be processed based on the second center weight matrix to obtain a second weighted brightness value, wherein the value of the second center weight matrix in the image center region is greater than the value in the image edge region, and the dimension of the second center weight matrix is ​​greater than the dimension of the first center weight matrix. The main brightness threshold acquisition unit is used to determine the main brightness threshold based on the ambient brightness parameters and histogram distribution characteristics of the image to be processed. The target brightness value acquisition unit is used to determine the target brightness value based on the first weighted brightness value, the second weighted brightness value, and the main brightness threshold. A brightness control unit is used to control the brightness of the image to be processed based on the target brightness value.

9. An electronic device, comprising: A memory and a processor, characterized in that the processor, when executing a computer program stored in the memory, implements the steps of the image brightness control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the image brightness control method as described in any one of claims 1 to 7.