Image processing method, device, electronic device and storage medium

By acquiring the exposure parameters and histogram of the image, determining the image type and performing brightness adjustment, the dark details loss and brightness overexposure problems caused by brightness adjustment in the prior art are solved, and the display quality of the image is improved.

CN114119432BActive Publication Date: 2024-11-08SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111320515.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2024-11-08
Estimated Expiration
2041-11-09

AI Technical Summary

Technical Problem

When adjusting the brightness of the display screen, the prior art can easily lead to loss of dark details and overexposure of the bright parts, resulting in poor quality of the display screen.

Method used

By acquiring the exposure parameters and histogram of the image, determining the image type, and targeting brightness adjustments to the image according to the image type and histogram to generate higher quality images.

Benefits of technology

The brightness distribution of the image is improved, the dark details are preserved, and the bright parts are prevented from overexposed, thereby improving the overall quality of the display screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119432B_ABST
    Figure CN114119432B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose an image processing method, device, electronic device and storage medium. The method includes: obtaining a first exposure parameter and a second exposure parameter corresponding to a first image; then determining the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; then obtaining a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram; adjusting the brightness of the first image according to the image type, the target histogram and the restriction parameter to obtain a second image. In the embodiments of the present application, by determining the image type of the first image, the first image is adjusted in a targeted manner according to the image type of the first image, so that different areas of the first image have more appropriate image brightness, thereby obtaining a second image with higher image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image processing method, device, electronic device and storage medium. Background Art

[0002] In the prior art, for different display pictures on a display screen, a global algorithm is often used to improve the entire image, thereby changing the look and feel of the display picture.

[0003] However, the brightness distribution in different display images is different. If the global adjustment method is used, it will lead to the loss of details in the dark part of the image and overexposure of the bright part of the image, which will eventually lead to poor quality of the display image. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, electronic device and storage medium. The image processing method can determine the image type of an image, adjust the image according to the image type, and thus improve the image quality.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising:

[0006] Acquire a first exposure parameter and a second exposure parameter corresponding to the first image;

[0007] determining an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter;

[0008] Acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram;

[0009] The brightness of the first image is adjusted according to the image type, the target histogram and the restriction parameter to obtain a second image.

[0010] In a second aspect, an embodiment of the present application provides an image processing device, comprising:

[0011] A first acquisition module, used to acquire a first exposure parameter and a second exposure parameter corresponding to the first image;

[0012] a determination module, configured to determine an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter;

[0013] A second acquisition module, used to acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram;

[0014] A generating module is used to adjust the brightness of the first image according to the image type, the target histogram and the limiting parameter to obtain a second image.

[0015] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the steps in the image processing method provided in the embodiment of the present application.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps in the image processing method provided in the embodiment of the present application.

[0017] In the embodiment of the present application, the electronic device obtains the first exposure parameter and the second exposure parameter corresponding to the first image; then determines the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; then obtains the target histogram corresponding to the first image and the restriction parameter corresponding to the target histogram; and adjusts the brightness of the first image according to the image type, the target histogram and the restriction parameter to obtain the second image. In the embodiment of the present application, by determining the image type of the first image, the first image is adjusted in a targeted manner according to the image type of the first image, so that different areas of the first image have more appropriate image brightness, thereby obtaining a second image with higher image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 It is a first flow chart of the image processing method provided in an embodiment of the present application.

[0020] Figure 2 It is a second flow chart of the image processing method provided in an embodiment of the present application.

[0021] Figure 3 It is an S-shaped curve diagram corresponding to the adaptive coefficient S and the adaptive threshold P provided in the embodiment of the present application.

[0022] Figure 4 It is an adjustment curve diagram when the image type of the first image is a dark scene image.

[0023] Figure 5It is an adjustment curve diagram when the image type of the first image is a bright-dark scene image.

[0024] Figure 6 It is an adjustment curve diagram when the image type of the first image is a bright scene image.

[0025] Figure 7 It is a structural schematic diagram of the image processing device provided in an embodiment of the present application.

[0026] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0028] In the related art, in order to improve the image quality of the display screen, the current common practice is to use a single image adjustment method to adjust the display images in all scenes. However, since the image scenes in the video are constantly changing, such as different display areas will have brightness changes and color changes, the image scenes corresponding to different frames may be different. If a single image adjustment method is still used, the display quality of the adjusted image will be worse.

[0029] For example, if the brightness of the image is increased without considering the dark area, the details of the dark area will be lost. If the brightness of the highlight area is suppressed, some areas will not be bright enough, resulting in a poor viewing experience of the final display.

[0030] In order to solve this technical problem, the embodiments of the present application provide an image processing method, device, electronic device and storage medium. The image processing method can determine the image type of a first image, and then process the first image according to the image type, thereby improving the image quality of the final displayed image.

[0031] It should be noted that the image processing method is applicable to any electronic device that can process images, such as televisions, smart phones, computers, tablets, smart glasses, head-mounted virtual devices and other electronic devices.

[0032] See also Figure 1 , Figure 1 1 is a schematic diagram of a first process of an image processing method provided in an embodiment of the present application. The image processing method may include the following steps:

[0033] 110. Obtain a first exposure parameter and a second exposure parameter corresponding to the first image.

[0034] Before obtaining the first exposure parameter and the second exposure parameter corresponding to the first image, the electronic device may first obtain an initial image, and then convert the color space of the initial image into an HSV (Hue, Saturation, Value) color space, thereby obtaining the first image. In the HSV color space, H is hue, S is saturation, and V is brightness (brightness).

[0035] The initial image may be a static image, such as a photo, or a frame of a dynamic image, such as a frame of a video. The color space of the initial image may be an RGB (Red, Green, Blue) color space.

[0036] It should be noted that after the color space of the initial image is converted into the HSV color space, the hue and saturation information of the first image may be retained unchanged, and the brightness information of the first image may be processed subsequently.

[0037] In some embodiments, the electronic device can obtain a first exposure parameter and a second exposure parameter corresponding to the first image, wherein the first exposure parameter and the second exposure parameter are parameters for measuring the image brightness of the first image, and the overall brightness of the first image can be determined by the first exposure parameter and the second exposure parameter, thereby determining the image type corresponding to the first image.

[0038] In some embodiments, the electronic device may determine multiple reference brightness values ​​in the first image, then determine the first number of pixels corresponding to each reference brightness value in the first image, and finally determine the first exposure parameter based on each reference brightness value and the first number of pixels corresponding to each reference brightness value.

[0039] Specifically, the electronic device may determine a maximum reference brightness value among a plurality of reference brightness values, and then determine the first exposure parameter according to the maximum reference brightness value, each reference brightness value, and the number of first pixels corresponding to each reference brightness value.

[0040] For example, the brightness range corresponding to the first image is 0 to 255, and multiple reference brightness values ​​can be determined within this range. For example, a target brightness range is determined within the brightness range of 0 to 255, such as 150 to 255. All brightness values ​​within the target brightness range can be determined as reference brightness values, where the maximum reference brightness value is 255. Each reference brightness value has a corresponding pixel. For example, the reference brightness value of 155 corresponds to 1 million pixels, and the reference brightness value of 250 corresponds to 2 million pixels. The electronic device can count the number of first pixels corresponding to each reference brightness value.

[0041] In some embodiments, the electronic device can determine multiple brightness intervals within the brightness range corresponding to the first image, then determine the number of second pixels corresponding to multiple target brightness intervals in the multiple brightness intervals, and finally determine the second exposure parameter based on the number of second pixels corresponding to the multiple target brightness intervals.

[0042] For example, the electronic device may first determine an initial histogram of the first image, and then determine a brightness range corresponding to the first image based on the initial histogram, such as a brightness range of 0 to 255 corresponding to the first image. The electronic device then determines multiple brightness intervals within the brightness range, and the multiple brightness intervals do not overlap with each other. Then, the number of second pixels corresponding to each brightness interval is determined.

[0043] For example, multiple brightness intervals can be divided into a low brightness interval, a medium brightness interval, and a high brightness interval. The number of second pixels corresponding to the low brightness interval, the number of second pixels corresponding to the medium brightness interval, and the number of second pixels corresponding to the high brightness interval can be determined. Then, the second exposure parameter is determined according to the number of second pixels corresponding to each brightness interval.

[0044] Specifically, the number of second pixels corresponding to the medium brightness interval and the number of second pixels corresponding to the high brightness interval are added to obtain a first cumulative value, and then the first cumulative value is divided by the number of all pixels in the first image to obtain the second exposure coefficient. Alternatively, the number of second pixels corresponding to the low brightness interval and the number of second pixels corresponding to the medium brightness interval are added to obtain a second cumulative value, and then the second cumulative value is divided by the number of all pixels in the first image to obtain the second exposure coefficient.

[0045] 120. Determine an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter.

[0046] In some embodiments, the electronic device can determine a first weight value corresponding to a first exposure parameter and a second weight value corresponding to a second exposure coefficient, and then determine a third exposure parameter based on the first exposure parameter, the first weight value, the second exposure parameter, and the second weight value, and finally determine the image type corresponding to the first image based on the third exposure coefficient.

[0047] For example, the first weight value is λ, and the second weight value is η, where λ=1-η, η∈(0,1). Then, the first weight value is multiplied by the first exposure parameter to obtain a first product, the second weight value is multiplied by the second exposure parameter to obtain a second product, and the first product and the second product are added to obtain a third exposure parameter.

[0048] After determining the third exposure parameter, the electronic device may determine a target parameter range to which the third exposure parameter belongs within a preset parameter range, and finally determine an image type corresponding to the first picture according to the target parameter range.

[0049] For example, the first brightness parameter and the second brightness parameter are first determined, and the first brightness parameter and the second brightness parameter are preset parameters. When the third exposure parameter is greater than or equal to the first brightness parameter, the image type of the first image is determined to be a completely dark scene image. When the third exposure parameter is greater than or equal to the second brightness parameter, but the third exposure parameter is less than the first brightness parameter, the image type of the first image is determined to be a bright-dark scene image. When the third exposure parameter is greater than or equal to zero, but the third exposure parameter is less than the second brightness parameter, the image type of the first image is determined to be a bright scene image.

[0050] It should be noted that, in actual applications, multiple preset parameter ranges can be preset, each preset parameter range corresponds to an image type, and when the third exposure parameter falls within a preset parameter range, the image type corresponding to the preset parameter range is determined as the image type corresponding to the first image.

[0051] In the embodiment of the present application, the third exposure parameter is jointly determined by the first exposure parameter and the second exposure parameter, and finally the image type of the first image is determined by the third exposure parameter, so that the image type of the first image can be accurately determined.

[0052] 130. Obtain a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram.

[0053] In some embodiments, the electronic device may first determine an initial histogram of the first image, which is the most original histogram of the first image that can reflect the pixel brightness distribution of the first image. Then, the initial histogram corresponding to the first image is smoothed to obtain an adaptive histogram, and then the target histogram corresponding to the first image is determined according to the adaptive histogram.

[0054] The initial histogram is smoothed to obtain an adaptive histogram. The electronic device may use a Contrast Limited Adaptive Histogram Equalization (CLAHE) method to obtain an adaptive histogram.

[0055] In some implementations, the electronic device may determine an adaptive coefficient corresponding to an initial histogram, then determine a maximum value and a minimum value in the initial histogram, and finally smooth the initial histogram according to the adaptive coefficient, the maximum value and the minimum value to obtain an adaptive histogram.

[0056] The adaptive coefficient may be calculated by Otsu's algorithm (OSTU). For example, if the electronic device obtains the adaptive threshold value P by Otsu's algorithm, the adaptive coefficient is an S-shaped curve with the adaptive highlight maintenance starting point P as the independent variable.

[0057] After the adaptive histogram is obtained, a cumulative histogram can be calculated by the adaptive histogram, and the cumulative histogram is determined as the target histogram corresponding to the first image, wherein the cumulative histogram represents the cumulative probability distribution of the image components in gray levels.

[0058] 140. Adjust the brightness of the first image according to the image type, the target histogram, and the restriction parameter to obtain a second image.

[0059] In some embodiments, the electronic device determines a target adjustment curve type corresponding to the first image based on the image type, then determines an adaptive adjustment index corresponding to the target adjustment curve type based on the target histogram and the restriction parameters, then determines the target adjustment curve based on the target adjustment curve type and the adaptive adjustment index, and finally adjusts the brightness of the first image according to the target adjustment curve to obtain a second image.

[0060] For example, each image type corresponds to an adjustment curve type, and a mapping relationship between image types and adjustment curve types can be established first. After the image type of the first image is determined, the target adjustment curve type can be determined according to the mapping relationship.

[0061] The electronic device calculates an adaptive adjustment index corresponding to the target adjustment curve type according to the target histogram and the restriction parameter, and then determines the adaptive adjustment index as the adaptive adjustment index of the target adjustment type, thereby obtaining the target adjustment curve.

[0062] Finally, the electronic device adjusts the brightness value of each pixel in the first image according to the target adjustment curve, thereby obtaining a second image. It can be understood that the brightness value of each pixel in the first image has a mapped brightness value on the target curve, and the brightness value of each pixel in the first image is adjusted to the mapped brightness value, so that the brightness value of at least part of the pixels in the entire first image is changed, thereby obtaining a second image.

[0063] It is understandable that the second image has a better pixel brightness distribution than the first image. For example, when the first image is a bright-dark scene image, after adjusting the first image, the pixel brightness of the dark area in the second image changes, which can better reflect the details of the dark area, that is, the dark area can be seen more clearly. At the same time, the brightness of the bright area in the second image can be kept unchanged, thereby preventing the bright area from being overexposed.

[0064] It should be noted that for different image types, there are corresponding adjustment curve types to adjust the brightness of the pixels of the first image, so as to obtain a second image with better brightness distribution, and the second image has better image quality.

[0065] In some embodiments, in the process of generating the second image, the hue and saturation corresponding to each pixel of the first image and the mapped brightness value corresponding to each pixel may be used to generate the second image. The second image is only better than the first image in terms of the brightness distribution of the pixels, while the hue and saturation of the second image are the same as those of the first image, thereby ensuring the consistency of the color perception of the second image and the first image as much as possible.

[0066] In some implementations, after the electronic device obtains the second image, the color space of the second image is converted into an RGB color space to obtain a target output image.

[0067] In the embodiment of the present application, the electronic device obtains the first exposure parameter and the second exposure parameter corresponding to the first image; then determines the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; then obtains the target histogram corresponding to the first image and the restriction parameter corresponding to the target histogram; and adjusts the brightness of the first image according to the image type, the target histogram and the restriction parameter to obtain the second image. In the embodiment of the present application, by determining the image type of the first image, the first image is adjusted in a targeted manner according to the image type of the first image, so that different areas of the first image have more appropriate image brightness, thereby obtaining a second image with higher image quality.

[0068] See also Figure 2 , Figure 2: is a second flow chart of the image processing method provided in the embodiment of the present application. The image processing method may include the following steps:

[0069] 201. Determine a plurality of reference brightness values ​​in a first image, and determine, in the first image, a first number of pixels corresponding to each of the plurality of reference brightness values.

[0070] In some embodiments, the brightness range corresponding to the first image can be determined first. For example, the brightness range corresponding to the first image is 0 to 255. Multiple reference brightness values ​​can be determined within this range. For example, a target brightness range is determined within the brightness range of 0 to 255, such as 150 to 255. All brightness values ​​within the target brightness range can be determined as reference brightness values, where the maximum reference brightness value is 255. Each reference brightness value has a corresponding pixel. For example, the reference brightness value of 155 corresponds to 1 million pixels, and the reference brightness value of 250 corresponds to 2 million pixels. The electronic device can count the number of first pixels corresponding to each reference brightness value.

[0071] 202. Determine a first exposure parameter according to each reference brightness value and a first number of pixels corresponding to each reference brightness value.

[0072] Specifically, the electronic device may determine a maximum reference brightness value among a plurality of reference brightness values, and then determine the first exposure parameter according to the maximum reference brightness value, each reference brightness value, and the number of first pixels corresponding to each reference brightness value.

[0073] For example, the electronic device may multiply each reference brightness value by the first number of pixels corresponding to each reference brightness value to obtain a first product, and then add the first products corresponding to multiple reference brightness values ​​to obtain a first cumulative value. At the same time, the electronic device accumulates the first number of pixels corresponding to each reference brightness value to obtain a second cumulative value. Finally, the first cumulative value is divided by the maximum reference brightness value, and then divided by the first cumulative value to obtain the first exposure parameter.

[0074] For details, please refer to the first exposure coefficient calculation formula:

[0075]

[0076] Wherein, exp is the first exposure coefficient, L is the maximum reference brightness value, k is the reference brightness value, and h(k) is the first number of pixels corresponding to the reference brightness value. Wherein, K is within the brightness range corresponding to the first image, for example, if the brightness range of the first image is 0 to L, then K is within the range of 0 to L.

[0077] 203. Determine a plurality of brightness intervals within a brightness range corresponding to the first image, and determine the number of second pixels corresponding to a plurality of target brightness intervals in the plurality of brightness intervals.

[0078] For example, the electronic device may first determine an initial histogram of the first image, and then determine a brightness range corresponding to the first image based on the initial histogram, such as a brightness range of 0 to 255 corresponding to the first image. The electronic device then determines multiple brightness intervals within the brightness range, and the multiple brightness intervals do not overlap with each other. Then, the number of second pixels corresponding to each brightness interval is determined.

[0079] Specifically, the electronic device may determine a first exposure threshold and a second exposure threshold corresponding to the first image, and then determine a plurality of brightness intervals within a brightness range corresponding to the first image according to the first exposure threshold and the second exposure threshold.

[0080] For example, the first exposure threshold and the second exposure threshold are considered to be set, and the first exposure threshold and the second exposure threshold are within the brightness range corresponding to the first image. The brightness interval [0, t1] is a low brightness interval, the brightness interval (t1, t2) is a medium brightness interval, and the brightness interval (t2, L] is a high brightness interval. The value of L can be 255.

[0081] 204. Determine a second exposure parameter according to the second pixel quantities respectively corresponding to the plurality of target brightness intervals, and determine an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter.

[0082] The electronic device may determine that the number of second pixels corresponding to the low brightness interval is M1, the number of second pixels corresponding to the medium brightness interval is M2, and the number of second pixels corresponding to the high brightness interval is M3.

[0083] In some embodiments, the electronic device may add the second pixel quantity M1 corresponding to the low brightness interval and the second pixel quantity M2 corresponding to the medium brightness interval to obtain the second exposure parameter.

[0084] In some embodiments, the electronic device may determine the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter.

[0085] Specifically, the electronic device can determine a first weight value corresponding to the first exposure parameter and a second weight value corresponding to the second exposure coefficient, and then determine a third exposure parameter based on the first exposure parameter, the first weight value, the second exposure parameter, and the second weight value, and finally determine the image type corresponding to the first image based on the third exposure coefficient.

[0086] For example, the first weight value is λ, and the second weight value is η, where λ=1-η, η∈(0,1). Then, the first weight value is multiplied by the first exposure parameter to obtain a first product, the second weight value is multiplied by the second exposure parameter to obtain a second product, and the first product and the second product are added to obtain a third exposure parameter.

[0087] After determining the third exposure parameter, the electronic device may determine a target parameter range to which the third exposure parameter belongs within a preset parameter range, and finally determine an image type corresponding to the first picture according to the target parameter range.

[0088] For example, the first brightness parameter and the second brightness parameter are first determined, and the first brightness parameter and the second brightness parameter are preset parameters. When the third exposure parameter is greater than or equal to the first brightness parameter, the image type of the first image is determined to be a completely dark scene image. When the third exposure parameter is greater than or equal to the second brightness parameter, but the third exposure parameter is less than the first brightness parameter, the image type of the first image is determined to be a bright-dark scene image. When the third exposure parameter is greater than or equal to zero, but the third exposure parameter is less than the second brightness parameter, the image type of the first image is determined to be a bright scene image.

[0089] It should be noted that, in actual applications, multiple preset parameter ranges can be preset, each preset parameter range corresponds to an image type, and when the third exposure parameter falls within a preset parameter range, the image type corresponding to the preset parameter range is determined as the image type corresponding to the first image.

[0090] In the embodiment of the present application, the third exposure parameter is jointly determined by the first exposure parameter and the second exposure parameter, and finally the image type of the first image is determined by the third exposure parameter, so that the image type of the first image can be accurately determined.

[0091] 205. Perform smoothing processing on the initial histogram corresponding to the first image to obtain an adaptive histogram.

[0092] In some implementations, the electronic device may determine an adaptive coefficient corresponding to an initial histogram, then determine a maximum value and a minimum value in the initial histogram, and finally smooth the initial histogram according to the adaptive coefficient, the maximum value and the minimum value to obtain an adaptive histogram.

[0093] For details, please refer to the adaptive smoothing formula, and use the adaptive smoothing formula to smooth the initial histogram to obtain an adaptive histogram. The adaptive smoothing formula is as follows:

[0094]

[0095] S=f smooth (p)

[0096] Among them, h w (l) is the function corresponding to the adaptive histogram, h max is the maximum value in the initial histogram, h minis the minimum value in the initial histogram, h(l) is the function corresponding to the initial histogram, and S is the adaptive coefficient.

[0097] The adaptive coefficient may be calculated by Otsu's algorithm (OSTU). For example, if the electronic device obtains the adaptive threshold value P by Otsu's algorithm, the adaptive coefficient is an S-shaped curve with the adaptive highlight maintenance starting point P as the independent variable.

[0098] For details, please refer to Figure 3 , Figure 3 is an S-shaped curve corresponding to the adaptive coefficient S and the adaptive threshold P provided in the embodiment of the present application. max is the maximum value of the adaptive coefficient S, S min is the minimum value of the adaptive coefficient S. The horizontal axis is the adaptive threshold P, and the vertical axis is the adaptive coefficient S. Figure 3 It can be seen that when the P value increases, the adaptive coefficient S will gradually decrease. smooth (p) is Figure 3 The S-shaped curve shown in .

[0099] Through the above method, the adaptive smoothing process of the initial histogram is completed, thereby obtaining an adaptive histogram.

[0100] 206. Determine a target histogram corresponding to the first image according to the adaptive histogram.

[0101] In some implementations, the electronic device determines a target histogram corresponding to the adaptive histogram by using a cumulative histogram calculation formula, wherein the target histogram is the cumulative histogram.

[0102] The cumulative histogram calculation formula is as follows:

[0103]

[0104] where cdf w (l) is the function corresponding to the cumulative histogram, j is a corresponding brightness value in the range of 0 to l, is the accumulated value of the brightness values ​​in the range of 0 to 1 in the adaptive histogram, ∑h w (l) is the accumulated value of the brightness values ​​in the adaptive histogram within the range of 0 to L.

[0105] Among them, the cumulative histogram represents the cumulative probability distribution of image components in gray levels.

[0106] 207. Add the second pixel quantities corresponding to the plurality of target brightness intervals to obtain a third pixel quantity.

[0107] It can be known from step 203 that in multiple brightness intervals, each brightness interval corresponds to a second pixel number. Among them, the low brightness interval and the medium brightness interval can be determined as the target brightness interval. Then, the second pixel number corresponding to the low brightness interval is determined to be M1, and the second pixel number corresponding to the medium brightness interval is determined to be M2.

[0108] The second pixel number M1 corresponding to the low brightness interval and the second pixel number M2 corresponding to the medium brightness interval are added together to obtain the third pixel number.

[0109] 208. Determine a restriction parameter corresponding to the target histogram according to the third number of pixels, the first preset coefficient, and the second preset coefficient.

[0110] Among them, a first preset coefficient and a second preset coefficient can be determined, and the first preset coefficient and the second preset coefficient are preset. Then the third pixel number and the first preset coefficient are added to obtain a sum value, and then the sum value is divided by the second preset coefficient to obtain the restriction parameter corresponding to the target histogram.

[0111] The specific calculation formula can be used as follows:

[0112]

[0113] Where limit is the limit parameter, f m is the second pixel number M2 corresponding to the medium brightness interval, f h is the second pixel number M1 corresponding to the high brightness interval, α is the first preset coefficient, and β is the second preset coefficient.

[0114] 209. Determine a target adjustment curve type corresponding to the first image according to the image type.

[0115] In some embodiments, the electronic device determines a target adjustment curve type corresponding to the first image based on the image type, then determines an adaptive adjustment index corresponding to the target adjustment curve type based on the target histogram and the restriction parameters, then determines the target adjustment curve based on the target adjustment curve type and the adaptive adjustment index, and finally adjusts the brightness of the first image according to the target adjustment curve to obtain a second image.

[0116] For example, each image type corresponds to an adjustment curve type, and a mapping relationship between image types and adjustment curve types can be established first. After the image type of the first image is determined, the target adjustment curve type can be determined according to the mapping relationship.

[0117] 210. Determine an adaptive adjustment index corresponding to the target adjustment curve type according to the target histogram and the restriction parameters.

[0118] For another example, a dark scene image corresponds to one type of adjustment curve, a light-dark scene image corresponds to one type of adjustment curve, and a light scene image corresponds to one type of adjustment curve. However, each type of adjustment curve corresponds to one adaptive adjustment index.

[0119] Specifically, the adaptive index may be determined according to the target histogram and the restriction parameter.

[0120] The specific calculation is based on the following adaptive index calculation formula:

[0121] r w (l) = max(limit,1-cdf w (l))

[0122] Among them, r w (l) is the adaptive index, limit is the limit parameter, cdf w (l) is the function corresponding to the target histogram. When the adaptive index is in the range of 0 to 1, the brightness value of the processed image pixel increases. For example, after the first image is processed by the adaptive index, the brightness value of the second image pixel is higher. When the adaptive index is in the range greater than 1, the brightness value of the processed image pixel decreases. For example, after the first image is processed by the adaptive index, the brightness value of the second image pixel is lower.

[0123] 211. Determine a target adjustment curve according to the target adjustment curve type and the adaptive adjustment index.

[0124] In some implementations, after the target adjustment curve type corresponding to the first image is determined, the adaptive index may be used as its corresponding adaptive index to obtain the target adjustment curve.

[0125] For example, when the image type of the first image is a dark scene image, the target adjustment curve corresponding to the first image is:

[0126]

[0127] For example, when the image type of the first image is a bright-dark scene image, the target adjustment curve corresponding to the first image is:

[0128]

[0129] For example, when the image type of the first image is a bright scene image, the target adjustment curve corresponding to the first image is:

[0130]

[0131] Where l is the specific brightness value, and N is the endpoint brightness value of low brightness noise suppression. Low brightness noise suppression function f N (1) It is effective within the brightness value range of 0-N, suppresses the noise of the image in the first image processing process, prevents the noise from being enhanced, and thus increases the image quality of the second image finally generated.

[0132] P is the endpoint of the highlight interval of the highlight brightness preservation weight function, and the highlight brightness preservation function f p (l) is effective in the brightness range of PL, where L is the maximum brightness value (255), so as to maintain the brightness of the highlighted area of ​​the image during the first image processing process and prevent the highlighted area from being overexposed after contrast enhancement.

[0133] 212. Adjust the brightness of the first image according to the target adjustment curve to obtain a second image.

[0134] The electronic device adjusts the brightness value of each pixel in the first image according to the target adjustment curve, thereby obtaining a second image. It can be understood that the brightness value of each pixel in the first image has a mapped brightness value on the target curve, and the brightness value of each pixel in the first image is adjusted to the mapped brightness value, so that the brightness value of at least part of the pixels in the entire first image is changed, thereby obtaining a second image.

[0135] It should be noted that for different image types, there are corresponding adjustment curve types to adjust the brightness of the pixels of the first image, so as to obtain a second image with better brightness distribution, and the second image has better image quality.

[0136] Specifically, when the image type of the first image is a dark scene image, the corresponding adjustment curve is as follows: Figure 4 As shown, Figure 4 The adjustment curve diagram is when the image type of the first image is a dark scene image.

[0137] The horizontal axis is the brightness value of the first image, and the vertical axis is the brightness value of the second image. Curve X1 is the target adjustment curve corresponding to the first image, curve X2 is a linear grayscale mapping curve, curve X3 is a grayscale mapping curve in the 0-N brightness range without low-brightness noise processing, and curve X4 is a grayscale mapping curve in the 0-N brightness range after low-brightness noise processing.

[0138] Depend on Figure 4 It can be seen that when the image type of the first image is a dark scene image, the brightness within the brightness range of 0 to N is suppressed to a low brightness, thereby reducing the brightness of the pixels within the brightness range, thereby eliminating low brightness noise. For the range of N to 255, the brightness of the pixels within the brightness range can be brightened to increase the brightness of the picture.

[0139] When the image type of the first image is a bright-dark scene image, the corresponding adjustment curve is as follows: Figure 5 As shown, Figure 5 The adjustment curve diagram is when the image type of the first image is a bright-dark scene image.

[0140] Among them, the horizontal axis is the brightness value of the first image, and the vertical axis is the brightness value of the second image. Curve Y1 is the target adjustment curve corresponding to the first image, curve Y2 is the grayscale mapping curve in the brightness range of 0 to N without low brightness noise processing, and curve Y3 is the grayscale mapping curve in the brightness range of 0 to N with low brightness noise processing. Curve Y4 is the grayscale mapping curve in the brightness range of P to 255 without high brightness brightness retention processing, curve Y5 is the grayscale mapping curve in the brightness range of P to 255 with high brightness brightness retention processing, and curve Y6 is the linear grayscale mapping curve.

[0141] Depend on Figure 5 It can be seen that when the image type of the first image is a bright-dark scene image, the brightness within the brightness range of 0 to N is suppressed to a low brightness, thereby reducing the brightness of the pixels within the brightness range, thereby eliminating low brightness noise. In the brightness range of P to 255, the brightness of the high brightness area of ​​the first image is maintained to prevent the brightness of the high brightness area from becoming low, resulting in a dark brightness in the high brightness area. Thus, the second image is obtained, so that there is no noise in the low brightness area of ​​the second image, and the brightness of the high brightness area is maintained, thereby increasing the contrast of the second image and improving the image quality of the second image.

[0142] When the image type of the first image is a bright scene image, the corresponding adjustment curve is as follows: Figure 6 As shown, Figure 6 The adjustment curve diagram is when the image type of the first image is a bright scene image.

[0143] Among them, the horizontal axis is the brightness value of the first image, and the vertical axis is the brightness value of the second image. Curve Z1 is the target adjustment curve corresponding to the first image, curve Z2 is the linear grayscale mapping curve, and curve Z3 is the grayscale mapping curve in the brightness range of P to 255 without highlight brightness suppression processing. Curve Z4 is the grayscale mapping curve in the brightness range of P to 255 after highlight brightness suppression processing.

[0144] Depend on Figure 6 It can be seen that when the image type of the first image is a bright scene image, high brightness suppression is performed within the brightness range of P to 255 to prevent the image from being too bright and causing overexposure, so that the generated second image has good image quality.

[0145] As can be seen from the above, in the embodiment of the present application, the electronic device determines multiple reference brightness values ​​in the first image, and determines the number of first pixels corresponding to each reference brightness value in the multiple reference brightness values ​​in the first image. Then, the first exposure parameter is determined according to each reference brightness value and the number of first pixels corresponding to each reference brightness value, multiple brightness intervals within the brightness range corresponding to the first image are determined, the number of second pixels corresponding to multiple target brightness intervals in the multiple brightness intervals are determined, the second exposure parameter is determined according to the number of second pixels corresponding to the multiple target brightness intervals, and the image type corresponding to the first image is determined according to the first exposure parameter and the second exposure parameter.

[0146] The electronic device then smoothes the initial histogram corresponding to the first image to obtain an adaptive histogram, determines the target histogram corresponding to the first image based on the adaptive histogram, adds the second pixel numbers corresponding to multiple target brightness intervals to obtain a third pixel number, and determines the restriction parameters corresponding to the target histogram based on the third pixel number, the first preset coefficient and the second preset coefficient.

[0147] Finally, the target adjustment curve type corresponding to the first image is determined according to the image type, the adaptive adjustment index corresponding to the target adjustment curve type is determined according to the target histogram and the restriction parameters, the target adjustment curve is determined according to the target adjustment curve type and the adaptive adjustment index, and the brightness of the first image is adjusted according to the target adjustment curve to obtain the second image.

[0148] Therefore, a corresponding target adjustment curve is determined according to the actual image type of the first image, and the brightness of pixels in different brightness value ranges of the first image are adjusted according to the target adjustment curve, so as to generate a second image with better image quality.

[0149] See also Figure 7 , Figure 7 : is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device includes:

[0150] The first acquisition module 310 is configured to acquire a first exposure parameter and a second exposure parameter corresponding to the first image.

[0151] The first acquisition module 310 is also used to determine multiple reference brightness values ​​in the first image; determine the first number of pixels corresponding to each reference brightness value in the first image; and determine the first exposure parameter based on each reference brightness value and the first number of pixels corresponding to each reference brightness value.

[0152] The first acquisition module 310 is further configured to determine a maximum reference brightness value among the multiple reference brightness values; and determine the first exposure parameter according to the maximum reference brightness value, each reference brightness value, and a first number of pixels corresponding to each reference brightness value.

[0153] The first acquisition module 310 is also used to determine multiple brightness intervals within the brightness range corresponding to the first image; determine the number of second pixels corresponding to multiple target brightness intervals in the multiple brightness intervals; and determine the second exposure parameter according to the number of second pixels corresponding to the multiple target brightness intervals.

[0154] The determination module 320 is configured to determine an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter.

[0155] The determination module 320 is also used to determine a first weight value corresponding to the first exposure parameter and a second weight value corresponding to the second exposure coefficient; determine a third exposure parameter according to the first exposure parameter, the first weight value, the second exposure parameter, and the second weight value; and determine an image type corresponding to the first image according to the third exposure coefficient.

[0156] The determination module 320 is further configured to determine a target parameter range to which the third exposure parameter belongs within a preset parameter range; and determine an image type corresponding to the first picture according to the target parameter range.

[0157] The second acquisition module 330 is used to acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram.

[0158] The second acquisition module 330 is further used to perform smoothing processing on the initial histogram corresponding to the first image to obtain an adaptive histogram; and determine the target histogram corresponding to the first image according to the adaptive histogram.

[0159] The second acquisition module 330 is also used to determine the adaptive coefficient corresponding to the initial histogram; determine the maximum value and the minimum value in the initial histogram; and smooth the initial histogram according to the adaptive coefficient, the maximum value and the minimum value to obtain the adaptive histogram.

[0160] The generating module 340 is configured to adjust the brightness of the first image according to the image type, the target histogram and the limiting parameter to obtain a second image.

[0161] The generation module 340 is also used to determine the target adjustment curve type corresponding to the first image according to the image type; determine the adaptive adjustment index corresponding to the target adjustment curve type according to the target histogram and the restriction parameters; determine the target adjustment curve according to the target adjustment curve type and the adaptive adjustment index; and adjust the brightness of the first image according to the target adjustment curve to obtain the second image.

[0162] In the embodiment of the present application, the electronic device obtains the first exposure parameter and the second exposure parameter corresponding to the first image; then determines the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; then obtains the target histogram corresponding to the first image and the restriction parameter corresponding to the target histogram; and adjusts the brightness of the first image according to the image type, the target histogram and the restriction parameter to obtain the second image. In the embodiment of the present application, by determining the image type of the first image, the first image is adjusted in a targeted manner according to the image type of the first image, so that different areas of the first image have more appropriate image brightness, thereby obtaining a second image with higher image quality.

[0163] Accordingly, the present application also provides an electronic device, such as Figure 8 As shown, the electronic device may include an input unit 401, a display unit 402, a memory 403 including one or more computer-readable storage media, a sensor 405, a processor 404 including one or more processing cores, and a power supply 406. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0164] The input unit 401 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, in a specific embodiment, the input unit 401 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touchpad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 404, and can receive and execute the command sent by the processor 404. In addition, the touch-sensitive surface can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 401 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0165] The display unit 402 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 402 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 404 to determine the type of touch event. Subsequently, the processor 404 provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 8 In the embodiment, the touch-sensitive surface and the display panel are used as two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize input and output functions.

[0166] The memory 403 can be used to store software programs and modules, and the processor 404 executes various functional applications and data processing by running the software programs and modules stored in the memory 403. The memory 403 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 403 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 403 may also include a memory controller to provide the processor 404 and the input unit 401 with access to the memory 403.

[0167] The electronic device may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and / or backlight when the electronic device is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the electronic device, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0168] The processor 404 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 403 and calling data stored in the memory 403, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 404 may include one or more processing cores; preferably, the processor 404 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 404.

[0169] The electronic device also includes a power supply 406 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 404 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 406 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0170] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the processor 404 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 403 according to the following instructions, and the processor 404 will run the applications stored in the memory 403 to achieve various functions:

[0171] Acquire a first exposure parameter and a second exposure parameter corresponding to the first image;

[0172] determining an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter;

[0173] Acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram;

[0174] The brightness of the first image is adjusted according to the image type, the target histogram and the restriction parameter to obtain a second image.

[0175] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0176] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the image processing methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0177] Acquire a first exposure parameter and a second exposure parameter corresponding to the first image;

[0178] determining an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter;

[0179] Acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram;

[0180] The brightness of the first image is adjusted according to the image type, the target histogram and the restriction parameter to obtain a second image.

[0181] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0182] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0183] Since the instructions stored in the storage medium can execute the steps in any image processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0184] The above is a detailed introduction to an image processing method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image processing method, characterized in that: include: Acquire a first exposure parameter and a second exposure parameter corresponding to the first image; determining an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; Acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram; Adjusting the brightness of the first image according to the image type, the target histogram and the restriction parameter to obtain a second image; The step of adjusting the brightness of the first image according to the image type, the target histogram and the limiting parameter to obtain a second image includes: Determining a target adjustment curve type corresponding to the first image according to the image type; The adaptive adjustment index corresponding to the target adjustment curve type is determined according to the target histogram and the limiting parameter; the calculation formula of the adaptive adjustment index is: ,in, is the adaptive adjustment index, is the limiting parameter, is a function corresponding to the target histogram, when the adaptive adjustment index is in the range of 0 to 1, the brightness value of the processed image pixel increases, and when the adaptive adjustment index is in the range of greater than 1, the brightness value of the processed image pixel decreases; Determine a target adjustment curve according to the target adjustment curve type and the adaptive adjustment index; adjusting the brightness of the first image according to the target adjustment curve to obtain the second image; The obtaining of a first exposure parameter corresponding to the first image includes: determining a plurality of reference brightness values ​​in the first image; Determining, in the first image, a first number of pixels corresponding to each reference brightness value of the plurality of reference brightness values; determining the first exposure parameter according to each reference brightness value and the first number of pixels corresponding to each reference brightness value; The obtaining of a second exposure parameter corresponding to the first image includes: Determining a plurality of brightness intervals within a brightness range corresponding to the first image; Determine the number of second pixels corresponding to a plurality of target brightness intervals in the plurality of brightness intervals; determining the second exposure parameter according to the number of second pixels respectively corresponding to the plurality of target brightness intervals; The obtaining of the restriction parameters corresponding to the target histogram includes: Adding the second pixel quantities corresponding to the plurality of target brightness intervals to obtain a third pixel quantity; Determine a restriction parameter corresponding to the target histogram according to the third number of pixels, the first preset coefficient, and the second preset coefficient; The determining the restriction parameter corresponding to the target histogram according to the third number of pixels, the first preset coefficient and the second preset coefficient includes: Adding the third number of pixels and the first preset coefficient to obtain a first result; The first result is divided by the second preset coefficient to obtain the restriction parameter.

2. The image processing method according to claim 1, characterized in that: The determining the first exposure parameter according to each reference brightness value and the first number of pixels corresponding to each reference brightness value includes: determining a maximum reference brightness value among the plurality of reference brightness values; The first exposure parameter is determined according to the maximum reference brightness value, each of the reference brightness values, and the first number of pixels corresponding to each of the reference brightness values.

3. The image processing method according to claim 1, characterized in that: The determining a plurality of brightness intervals within a brightness range corresponding to the first image includes: Determine a first exposure threshold and a second exposure threshold corresponding to the first image; The multiple brightness intervals are determined within a brightness range corresponding to the first image according to the first exposure threshold and the second exposure threshold.

4. The image processing method according to claim 1, characterized in that: The determining the image type corresponding to the first image according to the first exposure parameter and the second exposure parameter includes: Determining a first weight value corresponding to the first exposure parameter and a second weight value corresponding to the second exposure parameter; Determine a third exposure parameter according to the first exposure parameter, the first weight value, the second exposure parameter, and the second weight value; An image type corresponding to the first image is determined according to the third exposure parameter.

5. The image processing method according to claim 4, characterized in that: The determining, according to the third exposure parameter, an image type corresponding to the first image includes: Determining a target parameter range to which the third exposure parameter belongs within a preset parameter range; An image type corresponding to the first image is determined according to the target parameter range.

6. The image processing method according to claim 1, characterized in that: The acquiring a target histogram corresponding to the first image includes: Performing smoothing on an initial histogram corresponding to the first image to obtain an adaptive histogram; A target histogram corresponding to the first image is determined according to the adaptive histogram.

7. The image processing method according to claim 6, characterized in that: The step of smoothing the initial histogram corresponding to the first image to obtain an adaptive histogram includes: Determining an adaptive coefficient corresponding to the initial histogram; Determining the maximum and minimum values ​​in the initial histogram; The initial histogram is smoothed according to the adaptive coefficient, the maximum value and the minimum value to obtain the adaptive histogram.

8. The image processing method according to claim 1, characterized in that: The step of adjusting the brightness of the first image according to the target adjustment curve to obtain the second image includes: Determining a mapping brightness value corresponding to each pixel in the first image according to the target adjustment curve; The second image is generated according to the mapped brightness value corresponding to each pixel and the hue and saturation corresponding to each pixel.

9. The image processing method according to claim 7, characterized in that: After adjusting the brightness of the first image according to the target adjustment curve to obtain the second image, the method further includes: The color space of the second image is converted into an RGB color space to obtain a target output image.

10. The image processing method according to any one of claims 1 to 9, characterized in that: Before acquiring the first exposure parameter and the second exposure parameter corresponding to the first image, the method further includes: An initial image is acquired, and a color space of the initial image is converted into an HSV color space to obtain the first image.

11. An image processing device, characterized in that: include: A first acquisition module, used to acquire a first exposure parameter and a second exposure parameter corresponding to the first image; a determination module, configured to determine an image type corresponding to the first image according to the first exposure parameter and the second exposure parameter; A second acquisition module, used to acquire a target histogram corresponding to the first image and a restriction parameter corresponding to the target histogram; A generating module, configured to adjust the brightness of the first image according to the image type, the target histogram and the limiting parameter to obtain a second image; The generation module is also used for: Determining a target adjustment curve type corresponding to the first image according to the image type; The adaptive adjustment index corresponding to the target adjustment curve type is determined according to the target histogram and the limiting parameter; the calculation formula of the adaptive adjustment index is: ,in, is the adaptive adjustment index, is the limiting parameter, is a function corresponding to the target histogram, when the adaptive adjustment index is in the range of 0 to 1, the brightness value of the processed image pixel increases, and when the adaptive adjustment index is in the range of greater than 1, the brightness value of the processed image pixel decreases; Determine a target adjustment curve according to the target adjustment curve type and the adaptive adjustment index; adjusting the brightness of the first image according to the target adjustment curve to obtain the second image; The first acquisition module is also used for: determining a plurality of reference brightness values ​​in the first image; Determining, in the first image, a first number of pixels corresponding to each reference brightness value of the plurality of reference brightness values; determining the first exposure parameter according to each reference brightness value and the first number of pixels corresponding to each reference brightness value; The first acquisition module is also used for: Determining a plurality of brightness intervals within a brightness range corresponding to the first image; Determine the number of second pixels corresponding to a plurality of target brightness intervals in the plurality of brightness intervals; determining the second exposure parameter according to the number of second pixels respectively corresponding to the plurality of target brightness intervals; The second acquisition module is also used for: Adding the second pixel quantities corresponding to the plurality of target brightness intervals to obtain a third pixel quantity; Determine a restriction parameter corresponding to the target histogram according to the third number of pixels, the first preset coefficient, and the second preset coefficient; The second acquisition module is also used for: Adding the third number of pixels and the first preset coefficient to obtain a first result; The first result is divided by the second preset coefficient to obtain the restriction parameter.

12. An electronic device, characterized in that: include: A memory storing executable program code, and a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the steps in the image processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the image processing method according to any one of claims 1 to 10.