Image correction method, device and related equipment

CN122656876APending Publication Date: 2026-08-28PARADIGM PANTHEON (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610983822.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0003]本公开提供一种图像校正方法、装置及相关设备,以解决对待校正图像的调整效果较差的问题

Benefits of technology

[0003] This disclosure provides an image correction method, apparatus, and related equipment to solve the problem of poor adjustment effect on the image to be corrected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122656876A_ABST
    Figure CN122656876A_ABST
Patent Text Reader

Abstract

The present disclosure provides an image correction method, device and related equipment, relating to the technical field of image processing and computer vision, the method comprising: judging the exposure state of a to-be-corrected image; when it is judged that the to-be-corrected image is too dark or backlit, performing the following steps: performing image enhancement on the to-be-corrected image according to the global average brightness of the to-be-corrected image to obtain a basic enhanced image; extracting the gray scale feature of the to-be-corrected image to obtain a gray scale image of the to-be-corrected image; performing image enhancement on the gray scale image to obtain a gray scale enhanced image; fusing the basic enhanced image and the gray scale enhanced image to obtain a desaturated fused image; and fusing the desaturated fused image and the to-be-corrected image to obtain a corrected image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of image processing and computer vision technology, and in particular to an image correction method, apparatus and related equipment. Background Technology

[0002] With the continuous development of electronic technology and imaging equipment, various electronic devices with image acquisition capabilities have been widely used in daily life and professional work scenarios. The image acquisition process is easily affected by external factors such as light intensity, ambient color temperature, obstructions, and shooting angle, leading to abnormal brightness in the image and requiring subsequent correction and optimization. Currently, the mainstream image correction method in the industry is usually to directly adjust the brightness of the image to be corrected. However, this easily amplifies the color noise in the image and causes color distortion, resulting in poor overall image correction performance and failing to meet the requirements of high-quality imaging. Summary of the Invention

[0003] This disclosure provides an image correction method, apparatus, and related equipment to solve the problem of poor adjustment effect on the image to be corrected.

[0004] To solve the above problems, this disclosure is implemented as follows:

[0005] In a first aspect, this disclosure provides an image correction method, comprising:

[0006] Determine the exposure status of the image to be corrected. If it is determined to be too dark or backlit, perform the following steps:

[0007] The image to be corrected is enhanced based on the global average brightness of the image to be corrected, resulting in a base enhanced image;

[0008] Extract the grayscale features of the image to be corrected to obtain the grayscale image of the image to be corrected;

[0009] Image enhancement is performed on a grayscale image to obtain a grayscale enhanced image;

[0010] The base enhancement image and the grayscale enhancement image are fused to obtain a desaturated fused image;

[0011] The desaturated fused image is fused with the image to be corrected to obtain the corrected image.

[0012] Secondly, this disclosure provides an image correction apparatus, comprising:

[0013] The judgment module is used to determine the exposure status of the image to be corrected;

[0014] The basic enhancement module is used to enhance the image to be corrected based on the global average brightness of the image to be corrected when the exposure state is determined to be too dark or backlit, so as to obtain a basic enhanced image.

[0015] The grayscale image acquisition module is used to extract the grayscale features of the image to be corrected and obtain the grayscale image of the image to be corrected.

[0016] The grayscale image enhancement module is used to enhance grayscale images to obtain grayscale enhanced images;

[0017] The desaturation fusion module is used to fuse the base enhanced image and the grayscale enhanced image to obtain a desaturated fused image;

[0018] The image correction module is used to fuse the desaturated fused image with the image to be corrected to obtain the corrected image.

[0019] Thirdly, this disclosure also provides an electronic device, including: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program from the memory to implement the steps of the method disclosed in the first aspect above.

[0020] Fourthly, this disclosure also provides a readable storage medium for storing a program that, when executed by a processor, implements the steps of the method disclosed in the first aspect above.

[0021] Fifthly, this disclosure also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method disclosed in the first aspect above. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart of the image correction method provided in the embodiments of this disclosure;

[0024] Figure 2 This is a flowchart illustrating the specific implementation of step 1000 of the image correction method provided in this embodiment.

[0025] Figure 3 This is a flowchart illustrating the specific implementation of step 1200 of the image correction method provided in this embodiment.

[0026] Figure 4 This is a flowchart illustrating the specific implementation of step 400 of the image correction method provided in this embodiment.

[0027] Figure 5 This is a flowchart illustrating the specific implementation of the image correction method provided in this embodiment, following step 200.

[0028] Figure 6 This is a schematic flowchart of the method for determining the image to be corrected provided in the embodiments of this disclosure;

[0029] Figure 7 This is a flowchart illustrating the specific implementation of step 160 of the image to be corrected method provided in this embodiment of the disclosure;

[0030] Figure 8 This is a flowchart illustrating a specific implementation of the image-to-be-corrected determination method provided in this embodiment of the present disclosure, following step 130.

[0031] Figure 9 This is a schematic diagram illustrating the determination of the exposure state of an image provided in an embodiment of this disclosure;

[0032] Figure 10 This is a schematic diagram of different pixel highlight protection masks provided in the embodiments of this disclosure;

[0033] Figure 11 This is a schematic diagram showing the variation of image enhancement intensity corresponding to different masks with pixel normalized grayscale during the fusion correction process provided in this embodiment of the disclosure, and a schematic diagram showing the variation trend of image enhancement intensity with global normalized brightness under different gains.

[0034] Figure 12 This is a schematic diagram of the structure of an image correction device provided in an embodiment of this disclosure;

[0035] Figure 13 This is a schematic diagram of the structure of an image determination device provided in an embodiment of this disclosure;

[0036] Figure 14 This is a schematic diagram of the structure of an image processing system provided in an embodiment of this disclosure;

[0037] Figure 15 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this disclosure. Detailed Implementation

[0038] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0039] The terms "first," "second," etc., used in the embodiments of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Additionally, the use of "and / or" in this disclosure indicates at least one of the connected objects, such as A and / or B and / or C, representing seven possibilities: including A alone, B alone, C alone, and the presence of both A and B, both B and C, both A and C, and the presence of A, B, and C.

[0040] Please see Figure 1 , Figure 1 This is a schematic flowchart of the image correction method provided in the embodiments of this disclosure. Figure 1 The image correction method shown can be performed by an electronic device, and the specific type of electronic device is not limited here. Optionally, the electronic device may include at least one of the following: smart glasses, embedded and edge-side intelligent vision systems in computing-limited scenarios, consumer-grade high-performance imaging terminals, professional precision imaging and industrial inspection equipment, embedded imaging system equipment, algorithm component equipment, intelligent vision hardware equipment, etc.

[0041] Among them, the embedded and edge-side intelligent vision systems in the above-mentioned computing power-constrained scenarios may include at least one of the following: vehicle vision perception and advanced driver assistance systems, intelligent security monitoring edge devices, etc.

[0042] The aforementioned consumer-grade high-performance imaging terminals may include at least one of the following: image signal processor (ISP) systems of smartphones and tablets, vision pipelines of drones and action cameras, etc.

[0043] The aforementioned embedded imaging system device may include at least one of the following: ISP firmware or algorithm modules integrated into smartphones, dashcams, security cameras, etc.

[0044] The aforementioned specialized precision imaging and industrial inspection equipment may include at least one of the following: medical imaging diagnostic equipment, industrial automated inspection systems, etc.

[0045] The aforementioned algorithm component devices may include at least one of the following: post-processing software, mobile application (App), cloud image restoration platform, etc.

[0046] The aforementioned intelligent vision hardware devices may include at least one of the following: drones, medical imaging equipment, and visual front-end processing systems for industrial quality inspection equipment, etc.

[0047] like Figure 1 As shown, the image correction method may include the following steps:

[0048] Step 200: Determine the exposure status of the image to be corrected;

[0049] The specific type of exposure state of the image to be corrected is not limited here. Optionally, the exposure state of the image to be corrected may include the following states: too dark, backlit, too bright, normal, or high contrast in shadows. When the exposure state of the image to be corrected includes too dark, backlit, or too bright, the image to be corrected needs to be corrected; when the exposure state of the image to be corrected includes normal or high contrast in shadows, the image to be corrected does not need to be corrected. In this way, by judging the exposure state of the image to be corrected, it can be accurately determined whether the image to be corrected needs to be corrected.

[0050] Among them, "too dark" can be understood as the brightness of the image to be corrected being too low; "backlight" can be understood as the presence of light from a source behind the subject of the image and shining towards the lens in the image to be corrected; "too bright" can be understood as the brightness of the image to be corrected being too high; "high contrast in shadows" can be understood as a state in which the contrast between light and dark areas is strong, the bright areas are bright, the shadows are dark, the light and shadow boundaries are sharp, and the dark areas are greatly compressed, which is a normal light and shadow presentation effect of the image; "normal" can be understood as the image to be corrected not exhibiting states such as "too dark," "backlight," "too bright," or "high contrast in shadows."

[0051] It should be noted that the specific method for determining the exposure state of the image to be corrected is not limited here. Optionally, the exposure state of the image to be corrected can be determined by comparing the brightness information between different regions in the image to be corrected. For specific implementation methods, please refer to the relevant descriptions below. Alternatively, the electronic device can also determine the exposure state of the image to be corrected through a preset artificial intelligence (AI) model.

[0052] If the image is determined to be too dark or backlit, follow these steps:

[0053] Step 400: Perform image enhancement on the image to be corrected based on the global average brightness of the image to be corrected to obtain the base enhanced image;

[0054] When the exposure of the image to be corrected is too dark or backlit, it indicates that the overall brightness of the image is insufficient. Therefore, image enhancement can be performed on the image to be corrected based on its global average brightness to obtain a base enhanced image. By increasing the brightness, the visual quality of the image is improved, thereby increasing the accuracy of subsequent processing of the base enhanced image.

[0055] The specific method for enhancing the image to be corrected based on the global average brightness of the image to be corrected, to obtain the base enhanced image, is not limited here. Optionally, the brightness of the image to be corrected can be adjusted to the global average brightness, and the image to be corrected after adjusting the brightness to the global average brightness is the base enhanced image. Alternatively, the acquisition scene coefficient of the image to be corrected can be obtained, and the product of the acquisition scene coefficient and the global average brightness can be calculated to obtain a brightness adjustment value. The brightness of the image to be corrected is adjusted according to the brightness adjustment value to obtain the base enhanced image. The acquisition scene coefficient can be related to the acquisition scene of the image to be corrected. For example, when the acquisition scene of the image to be corrected is an outdoor scene or a scene with good lighting conditions, the acquisition scene coefficient can be smaller; when the acquisition scene of the image to be corrected is an indoor scene or a scene with poor lighting conditions, the acquisition scene coefficient can be larger. The specific acquisition scene coefficient can be determined according to the content of the image to be corrected.

[0056] Step 600: Extract the grayscale features of the image to be corrected to obtain the grayscale image of the image to be corrected;

[0057] In this process, the dark areas of the image to be corrected correspond to pixel areas with lower grayscale values, and these areas often contain a large amount of detailed texture. In this way, by generating a grayscale image based on the grayscale features of the image to be corrected, the details in the dark areas can be completely preserved.

[0058] Optionally, the grayscale features of the image to be corrected are extracted to generate an initial grayscale image. Then, the initial grayscale image can be normalized to obtain the grayscale image of the image to be corrected. This can also be understood as: the grayscale image of the image to be corrected is the image obtained after normalizing the initial grayscale image.

[0059] It should be noted that the process of extracting the grayscale features of the image to be corrected and obtaining the grayscale image of the image to be corrected only needs to be performed once, and the grayscale image can be reused in subsequent processes.

[0060] Step 800: Perform image enhancement on the grayscale image to obtain a grayscale enhanced image;

[0061] The specific method of image enhancement for grayscale images is not limited here. Optionally, display enhancement processing can be performed on the detailed features included in the grayscale image. Display enhancement processing can include brightness adjustment processing, size enlargement processing, and detailed feature highlighting processing.

[0062] Step 1000: Fuse the base enhanced image and the grayscale enhanced image to obtain a desaturated fused image;

[0063] The base enhancement image is the image to be corrected after brightness enhancement, while the grayscale enhancement image is an image containing more detailed features. By fusing the base enhancement image and the grayscale enhancement image, some grayscale components are introduced into the dark areas of the image to be corrected, effectively balancing color saturation and visual noise. This can suppress color artifacts that appear in the dark areas after brightness enhancement, avoid color noise and color distortion problems, and improve the visual fidelity of the image to be corrected.

[0064] Step 1200: Fuse the desaturated fused image with the image to be corrected to obtain the corrected image.

[0065] The process involves fusing the desaturated image with the image to be corrected. This preserves the original color characteristics and visual appeal of the image to be corrected while maintaining the noise reduction and color fidelity in the dark areas. The resulting corrected image not only has significantly improved brightness but also avoids color noise and color distortion in dark areas, resulting in a substantial improvement in overall image quality.

[0066] Compared to directly adjusting the brightness of the image to be corrected, which can easily lead to amplified color noise and color distortion in the darker areas, this embodiment of the present disclosure, through steps 200 to 1200, first obtains a base enhancement image and a grayscale enhancement image, and then fuses them to obtain a desaturated fused image. This process introduces some grayscale components into the dark areas of the image to be corrected, effectively balancing color saturation and visual noise, suppressing color artifacts, color noise, and color distortion in the dark areas after brightness enhancement, and improving the visual fidelity of the image to be corrected. Further fusion of the desaturated fused image and the image to be corrected preserves the original color characteristics and visual appeal of the image to be corrected, while also continuing the advantages of noise reduction and color fidelity in the dark areas of the desaturated fused image. The final corrected image has sufficient brightness, and there is no significant noise or distortion in the dark areas, resulting in a significant improvement in overall image quality.

[0067] As an optional implementation method, see [link to implementation details]. Figure 2 Step 1000, fusing the base enhanced image and the grayscale enhanced image to obtain a desaturated fused image, includes the following steps:

[0068] Step 1010: Obtain the base mask of the image to be corrected based on the grayscale image, wherein the base mask indicates the degree of brightness adjustment of each pixel of the image to be corrected;

[0069] Step 1020: Using the base mask, fuse the base enhancement image and the grayscale enhancement image to obtain a desaturated fused image.

[0070] The basic method for obtaining the base mask of the image to be corrected from the grayscale image is not limited here. Optionally, the base mask can be generated based on the grayscale features of the grayscale image. Alternatively, the difference between the grayscale value of each pixel in the grayscale image and the brightness value of the corresponding pixel in the image to be corrected can be calculated to obtain multiple differences, and then the multiple differences can be combined to obtain the base mask.

[0071] Optionally, the base enhancement image and the grayscale enhancement image are fused using a base mask to obtain a desaturated fused image. This can be understood as follows: according to the brightness adjustment degree of each pixel in the image to be corrected indicated by the base mask, the brightness of each pixel in the base enhancement image and the corresponding pixel in the grayscale enhancement image are adjusted separately, and then the corresponding pixels after brightness adjustment are fused to generate a desaturated fused image.

[0072] Optionally, the base mask can be adopted. This indicates that the basic mask can also be called the basic mask component, and the formula for calculating the basic mask can be found below:

[0073]

[0074] in, Used to represent the base mask. Here, n represents the grayscale value of the normalized grayscale image, and n is the enhancement intensity adjustment coefficient. For example, if n is 1, and the grayscale value of the grayscale image is... If it is 0, then The corresponding value is 1, which makes the intensity of brightening the areas that need to be brightened in the desaturated fused image high when the base enhanced image and the grayscale enhanced image are fused; if the grayscale value of the grayscale image is... If 255 / 255=1, then The corresponding value is 0, which makes the base enhancement image and the grayscale enhancement image merged so that the areas that need to be brightened in the desaturated fused image are not brightened at all. In this way, by increasing the value of n, the attenuation of the brightness intensity of the above-mentioned areas that need to be brightened can be accelerated. For example, if n=2, the area that originally needed to be brightened by 0.5 will become brightened by 0.25.

[0075] Optionally, the desaturated fused image can be used. express, The calculation formula can be found below:

[0076] ;

[0077] in, Used to represent the base enhanced image; Same as the definition of the basic mask, that is It can also be used to represent a base mask; Used to indicate desaturation intensity; Used to represent a grayscale enhanced image, where... This is the global base gain coefficient, detailed below. G represents the grayscale value of the normalized grayscale image.

[0078] In this embodiment, the base mask indicates the degree of brightness adjustment for each pixel in the image to be corrected. By using the base mask to fuse the base enhancement image and the grayscale enhancement image to obtain a desaturated fused image, pixel-level differentiated brightness adjustment can be achieved, abandoning the globally uniform adjustment method. This effectively improves the flexibility and accuracy of brightness adjustment. Furthermore, since the grayscale enhancement image has no color noise in the dark areas, fusing a portion of the grayscale component in the dark areas of the base enhancement image can effectively balance color saturation and visual noise, suppressing color artifacts, color noise, and color distortion problems generated in the dark areas after brightness enhancement, and significantly improving the visual fidelity and display effect of the image to be corrected.

[0079] As an optional implementation method, see [link to implementation details]. Figure 3 Step 1200, fusing the desaturated fused image with the image to be corrected to obtain the corrected image, includes:

[0080] Step 1210: Calculate the specular protection mask of the image to be corrected, whereby the specular protection mask indicates the degree of brightness constraint on each pixel of the image to be corrected.

[0081] Step 1220: Obtain the adjustment mask based on the base mask and the specular protection mask;

[0082] Step 1230: Using an adjustment mask, fuse the desaturated fused image with the image to be corrected to obtain the corrected image.

[0083] The specific method for obtaining the adjustment mask based on the base mask and the highlight protection mask is not limited here. Optionally, the product of the base mask and the highlight protection mask can be directly determined as the adjustment mask; alternatively, the base mask and the highlight protection mask can be fused to generate the above-mentioned adjustment mask.

[0084] Optionally, the highlight protection mask can be represented by P, and the formula for calculating the highlight protection mask can be found in the following content:

[0085] P =

[0086] Where P represents the highlight protection mask. The parameters are used to limit the calculation results to the [0,1] interval. G represents the grayscale value of the normalized grayscale image, and t1 and t2 represent the preset normalized brightness thresholds used to divide the brightness enhancement interval of the image to be corrected. For example, when t2=0.75 and t1=0.5, it means that the brightness threshold corresponding to t1 is 255*0.5 and the brightness threshold corresponding to t2 is 255*0.75. Under the constraint of the specular protection mask, when the desaturated fused image and the image to be corrected are fused to obtain the corrected image: the area with brightness greater than t2 will no longer be brightened; the area with brightness between t1 and t2 will have a linear decrease in brightness intensity from t1 to t2; and the area with brightness lower than t1 will remain fully enhanced.

[0087] It should be noted that the highlight protection mask, also known as the highlight protection factor, indicates the degree of brightness constraint on each pixel of the image to be corrected. The degree of brightness constraint varies depending on the location (or pixel type) of each pixel in the image. See [link to documentation] for details. Figure 10 ,like Figure 10 As shown, the highlight protection mask for pixels with a dark pixel type is 1, which means that pixels with a dark pixel type can be fully enhanced; while the highlight protection mask for pixels with a medium pixel type is 0.6, which means that pixels with a medium pixel type can be enhanced or weakened.

[0088] Optionally, the adjustment mask can be adopted. This means that the adjustment mask is obtained by combining the base mask and the specular protection mask. This can be understood as determining the adjustment mask by multiplying the base mask and the specular protection mask. .

[0089] Optionally, an adjustment mask is used to fuse the desaturated fused image with the image to be corrected to obtain a corrected image, which can be understood according to the following formula:

[0090] ;

[0091] in, Used to represent the corrected image Used to represent desaturated fused images Used to represent the image to be corrected. Used to represent adjustment masks The inverse mask used to represent the adjustment mask.

[0092] In this embodiment, the highlight protection mask indicates the degree of brightness constraint on each pixel of the image to be corrected. An adjustment mask is obtained based on the base mask and the highlight protection mask. Using the adjustment mask, the desaturated fused image and the image to be corrected are fused to obtain the corrected image. By utilizing the constraint effect of the highlight protection mask, the problem of over-brightening in certain areas can be effectively avoided, preventing the loss of highlight details and ensuring that the corrected image has a good visual display effect. Optionally, the aforementioned highlight details may include lights, sky, etc.

[0093] For example: see Figure 11 The right image in the middle, Figure 11 The right image shows three curves: the base mask (i.e., the base power function component), the specular protection mask, and the adjustment mask (i.e., the final enhancement mask). A complete protection zone (i.e., no brightening) is also marked. These curves characterize the variation of image enhancement intensity corresponding to different masks with pixel normalized grayscale during the fusion correction process. Figure 11 In the right-hand graph, the strength of the vertical axis can be understood as the contribution weight of the desaturated fused image to image enhancement of the image to be corrected during fusion. From Figure 11 As can be seen, in the dark area range of approximately 0~0.45 normalized grayscale, the highlight protection mask value is always 1, and the adjustment mask curve completely overlaps with the base mask curve, with both having the same enhancement intensity. This indicates that the adjustment mask fully retains the strong brightening ability of the base mask for shadow areas, and can fully restore dark details. When the pixel grayscale exceeds approximately 0.45, the highlight protection mask begins to decay linearly. The adjustment mask is obtained by multiplying the base mask and the highlight protection mask, and its effect intensity decreases much faster than that of the base mask alone. This can reduce the enhancement amplitude of mid-brightness pixels in advance, avoiding excessive brightening of the mid-brightness area, which would cause the image to appear grayish and lose its sense of layering, resulting in a smoother and more natural transition effect. In the highlight protection area of ​​approximately 0.75~1.0 grayscale, the highlight protection mask is reduced to zero, causing the enhancement intensity of the adjustment mask to drop directly to 0. In this area, there is no superposition of brightening gain, which completely avoids the defects of the base mask in the highlight area, such as weak enhancement, easy highlight clipping, and loss of bright details. In summary, compared to a single base mask, the adjustment mask obtained by this disclosure combines shadow brightening, mid-tone brightness level constraint, and highlight detail protection, resulting in a better overall enhancement effect.

[0094] As an optional implementation method, see [link to implementation details]. Figure 4 Step 400, the step of enhancing the image to be corrected based on the global average brightness of the image to be corrected to obtain the base enhanced image, includes:

[0095] Step 410: Calculate the global base gain coefficient based on the global average brightness of the image to be corrected and the preset normal exposure brightness.

[0096] Step 420: Perform image enhancement on the image to be corrected based on the global base gain coefficient to obtain the base enhanced image.

[0097] It should be noted that the specific method for calculating the global base gain coefficient based on the global average brightness of the image to be corrected and the preset normal exposure brightness is not limited here. Optionally, a first ratio between the preset normal exposure brightness and the global average brightness of the image to be corrected can be calculated, and the first ratio can be determined as the global base gain coefficient. Alternatively, a second ratio between the global average brightness of the image to be corrected and the preset normal exposure brightness can be calculated, and the second ratio can be determined as the global base gain coefficient.

[0098] It should be noted that image enhancement based on the global base gain coefficient to obtain the base enhanced image can be understood as follows: the global base gain coefficient is used to control the intensity of image enhancement. When the brightness of the image to be corrected is relatively low and brightness enhancement is required, the intensity of brightness enhancement can be increased by the global base gain coefficient. When the brightness of the image to be corrected is relatively high but brightness enhancement is still required, the intensity of brightness enhancement can be appropriately reduced by the global base gain coefficient. In this way, sufficient brightness compensation can be provided for the extremely dark content in the image to be corrected, while providing moderate brightness gain for the brighter content in the image to be corrected.

[0099] Optionally, the global average brightness can be adopted. It means, and The preset normal exposure brightness can be represented by T, and the value of T can be 0.5. The global base gain coefficient can be... The formula for calculating the global base gain coefficient can be found below:

[0100] ;

[0101] in, To prevent the minimum value of division by zero, and These are the preset minimum gain and maximum gain, respectively. and The specific value is not limited here; optionally, It can be 0.5. It can be 2.5.

[0102] Optionally, The calculation formula can be found below:

[0103]

[0104] in, Used to represent the strength coefficient Used to represent the image to be corrected. Used to represent a base-enhanced image.

[0105] In this embodiment, image enhancement can be performed on the image to be corrected based on the global base gain coefficient to obtain a base enhanced image. The global base gain coefficient can adaptively adjust the gain: it can provide sufficient brightness compensation for the image to be corrected in extremely dark environments, while maintaining a moderate brightness gain for the image to be corrected in brighter environments, thereby achieving accurate image enhancement and significantly optimizing the imaging quality of the base enhanced image.

[0106] For example, see Figure 11 , Figure 11 The left graph in the figure illustrates the trend of image enhancement intensity with global normalized brightness under different gains. The horizontal axis represents the global normalized brightness of the input image, and the vertical axis represents the image brightening weight coefficient, used to characterize the brightness enhancement intensity of the image to be processed. The average brightness correction target value is set to 0.55 in the figure. The long dashed line in the figure represents the original calculated gain without maximum and minimum gain constraints, which increases sharply inversely as the global brightness of the image decreases. For example, the maximum gain is preset to 2.5 and the minimum gain to 0.5, which are used together to limit the brightening amplitude. The thick solid line represents the global base gain coefficient actually used after the limiting in this disclosure. As shown in the figure: when the overall image brightness is low, the original calculated gain far exceeds 2.5. After limiting, the global base gain coefficient is forcibly constrained to the maximum gain limit of 2.5 to prevent excessive gain in low-light images from amplifying noise and causing image distortion. When the overall brightness exceeds the inflection point, the original calculated gain falls between the minimum gain of 0.5 and the maximum gain of 2.5. The global base gain coefficient after limiting decreases smoothly in sync with the original calculated gain. The closer the image brightness is to the target mean of 0.55, the closer the gain weight is to 0. If the overall image brightness continues to increase and the original calculated gain is below 0.5, the global base gain coefficient will be limited to the minimum gain of 0.5 to prevent the overall bright image gain from approaching 0 and not performing any brightness correction at all, ensuring that the entire image can achieve a moderate brightness adjustment towards the target mean. Compared to the unconstrained original computational gain, this scheme achieves bidirectional truncation by simultaneously setting an upper and lower gain limit. This ensures effective brightening of low-light images while avoiding noise amplification, color banding, and highlight clipping distortion caused by excessive gain. It also prevents the correction of bright images from completely disappearing, achieving adaptive, balanced, and controllable global dynamic brightness correction across the entire brightness range.

[0107] As an optional implementation, step 800, the step of enhancing the grayscale image to obtain a grayscale enhanced image, includes: enhancing the grayscale image based on the global base gain coefficient to obtain a grayscale enhanced image.

[0108] The calculation method for the global base gain coefficient can be found in the relevant descriptions in the above implementation methods, and will not be repeated here.

[0109] Optionally, the grayscale enhanced image can be: That is, the global base gain coefficient can be calculated first. The sum of 1 and 2 is then calculated, and the product of the sum and the gray value G of the grayscale image is calculated. The grayscale image can be understood as the grayscale image obtained after normalization.

[0110] Optionally, enhancing the grayscale image based on the global base gain coefficient to obtain the grayscale enhanced image can also be understood as follows: first, calculate the base image enhancement intensity corresponding to the grayscale image, then calculate the product of the global base gain coefficient and the base image enhancement intensity to obtain the corrected enhancement intensity, and then enhance the grayscale image according to the above corrected enhancement intensity to obtain the grayscale enhanced image.

[0111] In this embodiment of the disclosure, image enhancement of grayscale images can also be performed more accurately, further enhancing the display effect of grayscale enhanced images.

[0112] As an optional implementation method, see [link to implementation details]. Figure 5 After step 200, which involves determining the exposure state of the image to be corrected, the method further includes:

[0113] If the exposure of the image to be corrected is determined to be too bright, then the following steps are executed:

[0114] Step 300: Based on the offset of the global average brightness of the image to be corrected relative to the preset normal exposure brightness, reduce the brightness of the image to be corrected to obtain the corrected image.

[0115] Optionally, the brightness of the image to be corrected is reduced based on the offset of the global average brightness of the image to be corrected relative to the preset normal exposure brightness, to obtain a corrected image. This can be understood as: calculating the difference between the global average brightness of the image to be corrected and the preset normal exposure brightness, determining the difference as the offset, and then reducing the brightness of the image to be corrected by the offset to obtain a corrected image.

[0116] In this embodiment of the present disclosure, when it is determined that the exposure state of the image to be corrected is too bright, it means that the brightness of the image to be corrected needs to be reduced. Therefore, the brightness of the image to be corrected can be reduced according to the offset of the global average brightness of the image to be corrected relative to the preset normal exposure brightness, so as to obtain the corrected image. This makes the brightness adjustment of the corrected image more accurate and enhances the display effect of the corrected image.

[0117] As an optional implementation method, see [link to implementation details]. Figure 6This disclosure also provides a method for determining an image to be corrected, and the method provided in this disclosure further includes:

[0118] Step 100: Divide the original image into multiple sub-regions;

[0119] The specific method of dividing the multiple sub-regions is not limited here. Optionally, the multiple sub-regions can be divided in a 3×3 pattern, that is, the image to be corrected can be a rectangular image, and the image to be corrected can be divided into 3 rows of 3 sub-regions. In this case, the multiple sub-regions can be referred to as a nine-square grid. Alternatively, the multiple sub-regions can be divided in a 4×4 pattern, that is, the image to be corrected can be a rectangular image, and the image to be corrected can be divided into 4 rows of 4 sub-regions.

[0120] Step 110: Obtain the sub-region brightness of each sub-region;

[0121] Optionally, the sub-region brightness of each sub-region can be the average brightness of all pixels within each sub-region, or alternatively, the sub-region brightness of each sub-region can be the average brightness of multiple randomly selected pixels.

[0122] For example: the brightness of each sub-region can be adopted. The first row represents the sub-regions, while i and j are used to represent the sub-region numbers. The three sub-regions in the first row can be represented by [the specific sub-regions]. , , This indicates that the three sub-regions in the second row can be used respectively. , , This indicates that the three sub-regions in the third row can be used respectively. , , express.

[0123] Step 120: Calculate the sub-region brightness range based on the maximum and minimum sub-region brightness.

[0124] This involves calculating the difference between the maximum and minimum sub-region brightness within a sub-region, and defining this difference as the sub-region brightness range. For example, the maximum sub-region brightness can be calculated using... This indicates that the brightness of the smallest sub-region can be achieved using... This indicates that the extreme difference in brightness between sub-regions can be represented by... This indicates that, therefore, .

[0125] Step 130: Determine whether the brightness range of the sub-region is greater than the contrast threshold of the sub-region, and whether the brightness of the smallest sub-region is greater than the minimum brightness threshold.

[0126] The specific methods for determining the regional contrast threshold and the minimum brightness threshold are not limited here. Optionally, both the regional contrast threshold and the minimum brightness threshold can be empirical values; alternatively, the regional contrast threshold and the minimum brightness threshold can be dynamically changed values ​​based on the specific brightness of the original image.

[0127] Step 140: If not, obtain the global average brightness of the original image;

[0128] The specific method for obtaining the global average brightness of the original image is not limited here. Optionally, the original image can be first converted from the Blue Green Red (BGR) space to the CIE Lab space, then the brightness of all pixels in the original image in the brightness channel L can be extracted, and the average brightness of all the pixels can be calculated to obtain the global average brightness of the original image. The global average brightness of the original image can be obtained by using... express.

[0129] It should be noted that, optionally, the above-mentioned luminance channel L can also be replaced with the luminance component extracted from color spaces such as Luminance-Chroma Blue-Chroma Red (YCbCr), Hue Saturation Lightness (HSL), or Hue Saturation Value (HSV).

[0130] Step 150: Determine whether the global average brightness of the original image is less than the low brightness threshold, or whether the global average brightness of the original image is greater than the high brightness threshold.

[0131] The specific methods for determining the low brightness threshold and the high brightness threshold are not limited here. Optionally, both the low brightness threshold and the high brightness threshold can be empirical values; alternatively, the low brightness threshold and the high brightness threshold can be dynamically changed values ​​based on the specific brightness of the original image. It should be noted that the low brightness threshold is lower than the high brightness threshold.

[0132] Step 160: If yes, determine that the original image is the image to be corrected.

[0133] If the global average brightness of the original image is less than the low brightness threshold, or if the global average brightness of the original image is greater than the high brightness threshold, then the original image can be determined as an image to be corrected; if the global average brightness of the original image is greater than or equal to the low brightness threshold, and the global average brightness of the original image is less than or equal to the high brightness threshold, then the original image can be determined as a normal image.

[0134] In this embodiment, steps 100 to 160 improve the processing logic of the image to be corrected, thereby enhancing the accuracy of image judgment. Compared to deep learning solutions, this method does not require high-computing-power models, significantly reducing computational overhead while maintaining processing accuracy and efficiency. The solution performs feature judgment by dividing the image into sub-regions and combining the brightness difference of sub-regions with the global average brightness, enabling accurate perception of various complex scenes. Its overall computational complexity is low, requiring no dedicated neural network processor (NPU) acceleration, and can achieve real-time computation on conventional central processing units (CPUs) or low-end ISP chips, possessing extremely high engineering application value. Its comprehensive processing effect is comparable to or even better than artificial intelligence (AI) models.

[0135] Optionally, the image correction method in this embodiment of the present disclosure further includes steps 100 to 160 before performing step 200.

[0136] As an optional implementation method, see [link to implementation details]. Figure 7 Step 160: Determine the original image as the image to be corrected, including:

[0137] Step 161: When the global average brightness of the original image is lower than the low brightness threshold, determine that the exposure state of the image to be corrected is too dark.

[0138] Step 162: When the global average brightness of the original image is greater than the high brightness threshold, the exposure state of the image to be corrected is determined to be too bright.

[0139] Specifically, if the global average brightness of the original image is lower than the low brightness threshold, it indicates that the overall brightness of the original image is too dark, and thus the exposure state of the image to be corrected can be determined to be too dark; if the global average brightness of the original image is greater than the high brightness threshold, it indicates that the overall brightness of the original image is too bright, and thus the exposure state of the image to be corrected can be determined to be too bright.

[0140] In this embodiment of the disclosure, by determining that the global average brightness of the original image is greater than the high brightness threshold or lower than the low brightness threshold, the exposure state of the image to be corrected can be further accurately determined as too bright or too dark, that is, the exposure state of the image to be corrected is further refined.

[0141] Optionally, the image correction method in this embodiment of the present disclosure further includes steps 161 and 162 before performing step 200.

[0142] As an optional implementation method, see [link to implementation details]. Figure 8 If in step 130, it is determined that the brightness range of the sub-region is greater than the contrast threshold of the sub-region, and the brightness of the smallest sub-region is greater than the minimum brightness threshold, then the following steps are executed:

[0143] Step 171: Obtain the brightness of the patch region, which is composed of a single row or a single column of sub-regions in the original image;

[0144] In this context, a patch region is composed of a single row or a single column of sub-regions in the original image. This can be understood as follows: among the multiple sub-regions divided from the original image, all sub-regions in each row constitute a patch region, or all sub-regions in each column constitute a patch region. For example, when the original image is divided into 3×3 sub-regions, following the top-to-bottom direction of the original image, the three sub-regions in the first row constitute the upper patch region, the three sub-regions in the second row constitute the middle patch region, and the three sub-regions in the third row constitute the lower patch region.

[0145] Optionally, the brightness of a patch area can be the average brightness of all sub-regions included in that patch area.

[0146] Step 172: Calculate the brightness range of the patch area based on the maximum and minimum patch area brightness.

[0147] Optionally, the brightness of the upper area can be determined by using... This indicates that the brightness of the aforementioned central area can be achieved using... This indicates that the brightness of the lower area mentioned above can be achieved using... This indicates that the maximum area brightness in the area brightness can be achieved using... This indicates that the minimum area brightness in the area brightness can be achieved using... For areas with extremely poor brightness, the following methods can be used: .

[0148] Optionally, the difference between the maximum and minimum brightness of a patch area can be calculated, and this difference can be determined as the brightness range of the patch area. Therefore, the formula for calculating the brightness range of a patch area can be found in the following description: .

[0149] Step 173: Determine whether the brightness difference of the area is greater than the contrast threshold of the area;

[0150] The specific value of the contrast threshold for the area is not limited here. Optionally, the contrast threshold for the area can be an empirical value, that is, the contrast threshold for the area can be a fixed value; alternatively, the contrast threshold for the area can be a dynamically changing value.

[0151] Step 174: If not, then determine that the original image is a normal image that does not require correction;

[0152] if,

[0153] Step 175: When the area to be corrected is composed of a single sub-region in the original image, the original image is determined to be the image to be corrected, and the exposure state of the image to be corrected is determined to be backlight.

[0154] Step 176: When the patch area is composed of a single row of sub-regions in the original image, determine whether the maximum patch area brightness is in the lowest patch area of ​​the original image.

[0155] Step 177: If not, determine that the original image is the image to be corrected, and determine that the exposure state of the image to be corrected is backlighting;

[0156] When the original image is divided into upper, middle and lower regions, if the upper or middle region has the highest brightness, it indicates that there is a high probability of backlighting in the image to be corrected. Therefore, the exposure state of the image to be corrected can be determined as backlighting.

[0157] Step 178: If yes, determine that the original image is a normal image that does not require correction.

[0158] Specifically, when the maximum brightness area is located in the lowest area of ​​the original image, it indicates that the original image is a high-contrast image with shadows. High-contrast images with shadows do not belong to the category of images requiring correction; therefore, the original image can be identified as a normal image that does not require correction. For example: See [link to relevant documentation]. Figure 9 , Figure 9 The image is divided into three layers (top, middle, and bottom) using a single-row sub-region, with a contrast threshold of 60. The brightness range of the top, middle, and bottom layers in the first row is 8.13, and in the second row it is 20.27. Both ranges are less than the threshold of 60, indicating they are normal images requiring no correction. The brightness range of the third row is 84.60 > 60, with the brightest area located in the middle layer, not at the bottom, indicating a backlit image requiring correction. The brightness range of the fourth row is 68.67 > 60, also indicating an abnormal image with a range exceeding the threshold, but the brightest area falls in the bottom layer, thus classifying it as a high-contrast image with shadows. This image shows significant contrast between upper and lower shadows, allowing for selective brightness correction based on the specific application scenario.

[0159] In this embodiment of the disclosure, the method for determining whether the original image is a normal image that does not need correction or an image to be corrected can be refined, thereby improving the accuracy of determining whether the original image is a normal image or an image to be corrected.

[0160] Optionally, the image correction method in this embodiment of the present disclosure further includes steps 171 to 178 before performing step 200.

[0161] See Figure 12 , Figure 12 This is a structural diagram of an image correction device provided in an embodiment of this disclosure, such as... Figure 12 As shown, the image correction device 50 includes:

[0162] The judgment module 51 is used to judge the exposure state of the image to be corrected;

[0163] The basic enhancement module 52 is used to enhance the image to be corrected based on the global average brightness of the image to be corrected when the judgment module determines that the exposure state is too dark or backlight, so as to obtain a basic enhanced image.

[0164] The grayscale image acquisition module 53 is used to extract the grayscale features of the image to be corrected and obtain the grayscale image of the image to be corrected.

[0165] The grayscale image enhancement module 54 is used to enhance the grayscale image to obtain a grayscale enhanced image;

[0166] The desaturation fusion module 55 is used to fuse the basic enhanced image and the grayscale enhanced image to obtain a desaturation fused image;

[0167] Image correction module 56 is used to fuse the desaturated fused image with the image to be corrected to obtain a corrected image.

[0168] As an optional implementation, the desaturation fusion module 55 includes:

[0169] The base mask generation submodule is used to obtain the base mask of the image to be corrected based on the grayscale image. The base mask indicates the degree of brightness adjustment of each pixel in the image to be corrected.

[0170] The desaturation fusion submodule is used to fuse the base enhancement image and the grayscale enhancement image using the base mask to obtain a desaturation fused image.

[0171] As an optional implementation, the image correction module 56 includes:

[0172] The specular protection mask calculation submodule is used to calculate the specular protection mask of the image to be corrected, wherein the specular protection mask indicates the degree of brightness constraint on each pixel of the image to be corrected.

[0173] The adjustment mask generation submodule is used to obtain the adjustment mask based on the base mask and the specular protection mask.

[0174] The image correction generation submodule is used to fuse the desaturated fused image with the image to be corrected using an adjustment mask to obtain the corrected image.

[0175] As an optional implementation, the basic enhancement module 52 includes:

[0176] The global base gain coefficient calculation submodule is used to calculate the global base gain coefficient based on the global average brightness of the image to be corrected and the preset normal exposure brightness.

[0177] The image enhancement submodule is used to enhance the image to be corrected based on the global base gain coefficient, so as to obtain the base enhanced image.

[0178] As an optional implementation, the grayscale image enhancement module 54 includes:

[0179] The grayscale image enhancement submodule is used to enhance grayscale images based on global base gain coefficients to obtain grayscale enhanced images.

[0180] As an optional implementation, the image correction device 50 further includes:

[0181] The brightness reduction module is used to reduce the brightness of the image to be corrected based on the offset of the global average brightness of the image to be corrected relative to the preset normal exposure brightness when the judgment module determines that the exposure state is too bright, so as to obtain the corrected image.

[0182] Optionally, see Figure 13 This disclosure also provides an image-to-be-corrected determination device 60, which includes:

[0183] Sub-region segmentation module 61 is used to divide the original image into multiple sub-regions;

[0184] Sub-region brightness acquisition module 62 is used to acquire the sub-region brightness of each sub-region;

[0185] The sub-region brightness range calculation module 63 is used to calculate the sub-region brightness range based on the maximum and minimum sub-region brightness in the sub-region brightness.

[0186] The sub-region brightness range judgment module 64 is used to determine whether the sub-region brightness range is greater than the sub-region contrast threshold and whether the minimum sub-region brightness is greater than the minimum brightness threshold.

[0187] The global average brightness acquisition module 65 is used to acquire the global average brightness of the original image if the judgment result of the sub-region brightness difference judgment module is negative.

[0188] The global average brightness judgment module 66 is used to determine whether the global average brightness of the original image is less than the low brightness threshold or whether the global average brightness of the original image is greater than the high brightness threshold.

[0189] The image to be corrected determination module 67 is used to determine the original image as the image to be corrected if the judgment result of the global average brightness judgment module is yes.

[0190] See Figure 14 This disclosure also provides an image processing system 70, including an image determination device 60 and an image correction device 50.

[0191] Optionally, the image to be corrected determination module 67 includes:

[0192] The underexposure determination submodule is used to determine that the exposure state of the image to be corrected is underexposure when the global average brightness of the original image is lower than the low brightness threshold.

[0193] The overexposure determination submodule is used to determine that the exposure state of the image to be corrected is overexposure when the global average brightness of the original image is greater than the high brightness threshold.

[0194] As an optional implementation, the image-to-be-corrected determining device 60 further includes:

[0195] The patch region brightness acquisition module is used to acquire the patch region brightness if the judgment result of the sub-region brightness difference judgment module is yes. The patch region is composed of a single row sub-region or a single column sub-region in the original image.

[0196] The area brightness range calculation module is used to calculate the area brightness range based on the maximum and minimum area brightness of the area.

[0197] The area brightness difference judgment module is used to determine whether the area brightness difference is greater than the area contrast threshold.

[0198] The first normal image determination module is used to determine that the original image is a normal image that does not need to be corrected if the judgment result of the brightness difference judgment module of the area is negative.

[0199] The first backlight determination module is used to determine that if the judgment result of the brightness difference judgment module of the patch area is yes, the original image is determined to be the image to be corrected when the patch area is composed of a single column of sub-regions in the original image, and the exposure state of the image to be corrected is determined to be backlight.

[0200] The maximum area brightness judgment module is used to determine whether the maximum area brightness is in the lowest area of ​​the original image when the area is composed of a single row of sub-regions in the original image, if the judgment result of the area brightness difference judgment module is yes.

[0201] The second backlight determination module is used to determine that the original image is the image to be corrected if the judgment result of the maximum area brightness judgment module is negative, and to determine that the exposure state of the image to be corrected is backlight.

[0202] The second normal image determination module is used to determine that the original image is a normal image that does not need to be corrected if the judgment result of the maximum area brightness judgment module is yes.

[0203] This disclosure also provides an electronic device. See also... Figure 15 The electronic device may include a processor 1501, a memory 1502, and a program 15021 stored in the memory 1502 and executable on the processor 1501. When the program 15021 is executed by the processor 1501, it can achieve... Figure 1 Any steps in the corresponding method embodiments and the achievement of the same beneficial effects will not be repeated here.

[0204] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by hardware related to program instructions, and the program can be stored in a readable medium. This disclosure also provides a readable storage medium storing a computer program, which, when executed by a processor, can implement the above... Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0205] The aforementioned storage media include read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0206] This disclosure also provides a computer program product, including computer instructions, which, when executed by a processor, can perform the above-described functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0207] The above content describes preferred embodiments of this disclosure. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles disclosed herein, and these improvements and modifications should also be considered within the scope of protection of this disclosure.

Claims

1. An image correction method, characterized in that, include: Determine the exposure status of the image to be corrected. If it is determined to be too dark or backlit, perform the following steps: The image to be corrected is enhanced based on the global average brightness of the image to be corrected to obtain a base enhanced image; Extract the grayscale features of the image to be corrected to obtain the grayscale image of the image to be corrected; The grayscale image is enhanced to obtain a grayscale enhanced image; The base enhanced image and the grayscale enhanced image are fused to obtain a desaturated fused image; The desaturated fused image is fused with the image to be corrected to obtain the corrected image.

2. The method according to claim 1, characterized in that, The step of fusing the base enhanced image and the grayscale enhanced image to obtain a desaturated fused image includes: The base mask of the image to be corrected is obtained from the grayscale image, wherein the base mask indicates the degree of brightness adjustment of each pixel of the image to be corrected; Using the base mask, the base enhanced image and the grayscale enhanced image are fused to obtain the desaturated fused image.

3. The method according to claim 2, characterized in that, The step of fusing the desaturated fused image with the image to be corrected to obtain a corrected image includes: Calculate the specular protection mask of the image to be corrected, wherein the specular protection mask indicates the degree of brightness constraint on each pixel of the image to be corrected; An adjustment mask is obtained based on the base mask and the specular protection mask; Using the adjustment mask, the desaturated fused image is fused with the image to be corrected to obtain the corrected image.

4. The method according to any one of claims 1-3, characterized in that, The step of enhancing the image to be corrected based on the global average brightness of the image to be corrected to obtain a base enhanced image includes: The global base gain coefficient is calculated based on the global average brightness of the image to be corrected and the preset normal exposure brightness. The image to be corrected is enhanced based on the global base gain coefficient to obtain a base enhanced image.

5. The method according to claim 1, characterized in that, After the step of determining the exposure state of the image to be corrected, the method further includes: If the exposure of the image to be corrected is determined to be too bright, then the following steps are executed: The brightness of the image to be corrected is reduced based on the offset of the global average brightness of the image to be corrected relative to the preset normal exposure brightness, thereby obtaining the corrected image.

6. The method according to claim 1, characterized in that, Before the step of determining the exposure state of the image to be corrected, the method further includes: The original image is divided into multiple sub-regions; Obtain the sub-region brightness of each of the sub-regions; Calculate the sub-region brightness range based on the maximum and minimum sub-region brightness among the sub-region brightness; Determine whether the brightness range of the sub-region is greater than the sub-region contrast threshold, and whether the brightness of the smallest sub-region is greater than the minimum brightness threshold; If not, obtain the global average brightness of the original image; Determine whether the global average brightness of the original image is less than a low brightness threshold, or whether the global average brightness of the original image is greater than a high brightness threshold; If so, the original image is determined to be the image to be corrected.

7. The method according to claim 6, characterized in that, The step of determining the original image as the image to be corrected includes: When the global average brightness of the original image is lower than the low brightness threshold, the exposure state of the image to be corrected is determined to be too dark. When the global average brightness of the original image is greater than the high brightness threshold, the exposure state of the image to be corrected is determined to be too bright.

8. The method according to claim 6 or 7, characterized in that, If it is determined that the brightness range of the sub-region is greater than the sub-region contrast threshold, and the brightness of the smallest sub-region is greater than the minimum brightness threshold, then the following steps are performed: Obtain the brightness of a patch region, wherein the patch region is composed of a single row sub-region or a single column sub-region in the original image; The brightness range of the patch area is calculated based on the maximum and minimum patch area brightness. Determine whether the brightness range of the area is greater than the area contrast threshold; If not, then the original image is determined to be a normal image that does not require correction; if, When the patch area is composed of a single sub-region in the original image, the original image is determined to be the image to be corrected, and the exposure state of the image to be corrected is determined to be backlighting; When the patch area is composed of a single row of sub-regions in the original image, it is determined whether the brightness of the maximum patch area is in the bottommost patch area of ​​the original image; If not, determine that the original image is the image to be corrected, and determine that the exposure state of the image to be corrected is backlighting; If so, the original image is determined to be a normal image that does not require correction.

9. An image correction device, characterized in that, include: The judgment module is used to determine the exposure status of the image to be corrected; The basic enhancement module is used to enhance the image to be corrected based on the global average brightness of the image to be corrected when the judgment module determines that the exposure state is too dark or backlight, so as to obtain a basic enhanced image. A grayscale image acquisition module is used to extract the grayscale features of the image to be corrected, and obtain the grayscale image of the image to be corrected; A grayscale image enhancement module is used to enhance the grayscale image to obtain a grayscale enhanced image; The desaturation fusion module is used to fuse the base enhanced image and the grayscale enhanced image to obtain a desaturation fused image; The image correction module is used to fuse the desaturated fused image with the image to be corrected to obtain a corrected image.

10. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program in the memory to implement the steps of the image correction method as described in any one of claims 1 to 8.