Image processing method and device, electronic equipment, chip and medium

By acquiring and fusing the brightness mapping relationship under different exposure parameters in image processing, adjusting the brightness of image pixel points, the problem of insufficient image contrast is solved and clearer image performance is achieved.

CN119559104APending Publication Date: 2025-03-04BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311095469.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-28
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, it is difficult to effectively adjust the image brightness at different exposure degrees in image processing, resulting in insufficient details of the dark and bright areas of the image and insufficient contrast.

Method used

By acquiring the first brightness histogram of the input image, equalizing the process based on a plurality of preset exposure parameters, multiple first brightness mapping relationships are obtained, these mapping relationships are fused to obtain the second brightness mapping relationship, and finally adjusting the brightness value of the image pixel point according to the mapping relationship.

Benefits of technology

Image brightness adjustment for different exposure degrees is achieved, which enhances the detailed performance of the dark and bright areas of the image and improves the contrast of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559104A_ABST
    Figure CN119559104A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, electronic equipment, a chip and a medium, and relates to the technical field of image processing, and the method comprises the steps: obtaining a first brightness histogram corresponding to an input image; based on a plurality of preset exposure parameters, equalization processing is carried out on the first brightness histogram, a plurality of first brightness mapping relations corresponding to the plurality of preset exposure parameters are acquired, and the plurality of preset exposure parameters are set based on different exposure degrees; fusing the plurality of first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image; based on the second brightness mapping relation, the first brightness values of the multiple pixel points of the input image are adjusted to obtain an output image, the brightness of the input image is adjusted according to different exposure degrees, details of the dark area and the bright area of the image are enhanced, and the image contrast is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In image processing, the clarity and contrast of an image are affected by the environment, light, etc., resulting in poor image quality. Image enhancement is needed to improve the image quality. Image enhancement is to enhance the contrast of an image by certain means. It mainly solves the problem of low contrast caused by a small grayscale range of the image. Its function is to enlarge the grayscale range of the image, making the image clearer.

[0003] The related technology is to perform equalization processing on the statistical histogram of the input image to obtain a brightness mapping relationship, and improve the contrast of the input image through the brightness mapping relationship. Summary of the invention

[0004] The present disclosure provides an image processing method, device, electronic device, chip and medium to solve the problem of contrast enhancement in the related art, adjust the brightness of an input image according to different exposure levels, enhance the details of dark and bright areas of the image, and improve the image contrast.

[0005] A first aspect embodiment of the present disclosure proposes an image processing method, which includes: obtaining a first brightness histogram corresponding to an input image; based on multiple preset exposure parameters, performing equalization processing on the first brightness histogram to obtain multiple first brightness mapping relationships corresponding to the multiple preset exposure parameters, wherein the multiple preset exposure parameters are set based on different exposure levels; fusing the multiple first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image; based on the second brightness mapping relationship, adjusting the first brightness values ​​of multiple pixel points of the input image to obtain an output image.

[0006] In some embodiments of the present disclosure, obtaining a first brightness histogram corresponding to an input image includes: determining brightness values ​​of multiple pixels of the input image; performing statistics on the brightness values ​​of multiple pixels of the input image to obtain a second brightness histogram; and normalizing the second brightness histogram to obtain a first brightness histogram.

[0007] In some embodiments of the present disclosure, based on multiple preset exposure parameters, a first brightness histogram is equalized to obtain multiple first brightness mapping relationships corresponding to the multiple preset exposure parameters, including: based on multiple preset exposure parameters and the first brightness histogram, obtaining multiple third brightness histograms corresponding to the multiple preset exposure parameters; based on the multiple preset exposure parameters, equalizing the multiple third brightness histograms to obtain multiple first brightness mapping relationships.

[0008] In some embodiments of the present disclosure, multiple first brightness mapping relationships are fused to obtain a second brightness mapping relationship corresponding to an input image, including: based on the second brightness histogram, determining the image types corresponding to multiple third brightness histograms; based on multiple preset thresholds corresponding to the multiple image types, determining multiple weight coefficients corresponding to the multiple image types; based on the multiple weight coefficients, fusing the multiple first brightness mapping relationships to obtain the second brightness mapping relationship corresponding to the input image.

[0009] In some embodiments of the present disclosure, adjusting the first brightness values ​​of multiple pixel points of an input image based on a second brightness mapping relationship to obtain an output image includes: traversing multiple pixel points of the input image, and determining the second brightness values ​​corresponding to the multiple pixel points based on the second brightness mapping relationship; and adjusting the first brightness values ​​of the multiple pixel points based on the second brightness value.

[0010] A second aspect embodiment of the present disclosure proposes an image processing device, which includes: an acquisition unit, used to acquire a first brightness histogram corresponding to an input image; a processing unit, used to equalize the first brightness histogram based on multiple preset exposure parameters, and acquire multiple first brightness mapping relationships corresponding to the multiple preset exposure parameters, where the multiple preset exposure parameters are set based on different exposure levels; a fusion unit, used to fuse the multiple first brightness mapping relationships, and acquire a second brightness mapping relationship corresponding to the input image; and an adjustment unit, used to adjust the first brightness values ​​of multiple pixel points of the input image based on the second brightness mapping relationship to obtain an output image.

[0011] In some embodiments of the present disclosure, the acquisition unit is used to: determine the brightness values ​​of multiple pixels of the input image; perform statistics on the brightness values ​​of multiple pixels of the input image to obtain a second brightness histogram; and normalize the second brightness histogram to obtain a first brightness histogram.

[0012] In some embodiments of the present disclosure, the processing unit is used to: obtain multiple third brightness histograms corresponding to the multiple preset exposure parameters based on the multiple preset exposure parameters and the first brightness histogram; and perform equalization processing on the multiple third brightness histograms based on the multiple preset exposure parameters to obtain multiple first brightness mapping relationships.

[0013] In some embodiments of the present disclosure, the fusion unit is used to: determine the image types corresponding to multiple third brightness histograms based on the second brightness histogram; determine multiple weight coefficients corresponding to the multiple image types based on multiple preset thresholds corresponding to the multiple image types; and fuse multiple first brightness mapping relationships based on the multiple weight coefficients to obtain a second brightness mapping relationship corresponding to the input image.

[0014] In some embodiments of the present disclosure, the adjustment unit is used to: traverse multiple pixel points of the input image, determine the second brightness values ​​corresponding to the multiple pixel points based on the second brightness mapping relationship; and adjust the first brightness values ​​of the multiple pixel points based on the second brightness value.

[0015] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure.

[0016] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0017] The fifth aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals and send signals to the processor, the signals include computer instructions stored in the memory, when the processor executes the computer instructions, the chip executes the method described in the first aspect embodiment of the present disclosure.

[0018] In summary, according to the image processing method proposed in the present disclosure, a first brightness histogram corresponding to an input image is obtained; based on a plurality of preset exposure parameters, the first brightness histogram is equalized to obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, wherein the plurality of preset exposure parameters are set based on different exposure levels; the plurality of first brightness mapping relationships are fused to obtain a second brightness mapping relationship corresponding to the input image; based on the second brightness mapping relationship, the first brightness values ​​of a plurality of pixel points of the input image are adjusted to obtain an output image, thereby adjusting the brightness of the input image for different exposure levels, enhancing the details of dark and bright areas of the image, and improving the image contrast.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0021] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0022] Figure 2A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0023] Figure 3 A flowchart of a specific image processing method provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0028] In image processing, the clarity and contrast of an image are affected by the environment, light, etc., resulting in poor image quality. Image enhancement is needed to improve the image quality. Image enhancement is to enhance the contrast of an image by certain means. It mainly solves the problem of low contrast caused by a small grayscale range of the image. Its function is to enlarge the grayscale range of the image, making the image clearer.

[0029] Contrast is the ratio of black to white in the image, that is, the gradient from black to white. The larger the ratio, the more gradients from black to white, and the richer the color performance. The contrast has a critical impact on visual effects. Generally speaking, the greater the contrast, the clearer and more eye-catching the pattern, and the brighter and more colorful the color; while a small contrast will make the entire image gray. High contrast is very helpful for the clarity, detail performance, and grayscale performance of the image. In some areas with large black-white contrast text display, CAD display, and black-and-white photo display, high-contrast products have advantages in black-and-white contrast, clarity, and integrity.

[0030] Among them, histogram equalization is a method in the field of image processing that uses the image histogram to adjust the contrast. This method is often used to increase the global contrast of many images, especially when the contrast of the useful data of the image is quite close. In this way, the brightness can be better distributed on the histogram. This can be used to enhance the local contrast without affecting the overall contrast. Histogram equalization achieves this function by effectively expanding the commonly used brightness.

[0031] Specifically, in the related technology, the function relationship between the contrast enhancement threshold and the image grayscale dynamic range is established to realize the adaptive selection of the threshold; the gain coefficient required for contrast enhancement of different grayscale dynamic images is determined according to the contrast enhancement threshold and image characteristics; the input image is subjected to a grayscale linear transformation based on the contrast enhancement threshold and gain coefficient obtained in the above steps; the grayscale dynamic range is further corrected in combination with the image characteristics after the grayscale transformation, and the image brightness is adjusted. Therefore, the related technology is suitable for adaptively enhancing the contrast of grayscale images and color images, making the image contrast enhanced, clearer, and more vivid, effectively improving the visual effect of the image.

[0032] However, since the relevant technology is based on equalization processing on the statistical histogram of the input image to obtain a brightness mapping relationship (such as a brightness mapping curve) and improve the contrast of the input image through the brightness mapping relationship, the same brightness mapping relationship is used for different exposure levels, and the histogram cannot be processed through different exposure coefficients.

[0033] In order to solve the problems existing in image processing technology, the present disclosure proposes an image processing solution, which realizes multi-scale exposure processing by presetting exposure parameters, enhances the detail performance of dark and bright areas of the image, and can classify the input image to realize adaptive contrast adjustment of the content.

[0034] The method proposed in the present disclosure can be applied in the field of image enhancement, specifically in the field of image contrast enhancement, and can be applied in scenarios such as terminal photography, video recording, and industrial camera imaging, and is not limited in the embodiments of the present disclosure.

[0035] The image processing method provided in this application is described in detail below with reference to the accompanying drawings.

[0036] Figure 1 This is a flowchart of an image processing method provided by an embodiment of the present disclosure. The solution of the present disclosure can be applied to terminals such as mobile phones and tablet computers, and can be stored in a storable medium in the form of software. When the software is executed, the technical solution of the present disclosure is implemented. Figure 1 As shown, the image processing method includes steps 101-104.

[0037] Step 101: Obtain a first brightness histogram corresponding to an input image.

[0038] In an embodiment of the present disclosure, the first brightness histogram is a brightness histogram obtained by normalizing the second brightness histogram of the input image, wherein the second brightness histogram refers to a histogram obtained by statistically analyzing the input image, and the horizontal axis of the second brightness histogram is the brightness value, and the vertical axis is the number of pixels.

[0039] Normalization is also called grayscale transformation. It adjusts the pixel distribution interval, i.e. the pixel value range, by dividing the count of each attribute on the second brightness histogram by the sum of the counts of all attributes to increase the clarity of the image. For example, some pixels of grayscale images are not distributed in [0, 255], but in a sub-interval of [0, 255]. Through normalization, the pixel distribution can be changed from the sub-interval of [0, 255] to the range of [0, 255].

[0040] Step 102: performing equalization processing on the first brightness histogram based on a plurality of preset exposure parameters to obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, wherein the plurality of preset exposure parameters are set based on different exposure levels.

[0041] In an embodiment of the present disclosure, the preset exposure parameter may be a power function exponent, and the number of preset exposure parameters may be set according to actual needs. In the present disclosure, five preset exposure parameters are taken as an example, namely γ0, γ1, γ2, γ3, and γ4. The first brightness histogram is processed by the preset exposure parameters to obtain multiple third brightness histograms corresponding to the multiple preset exposure parameters, and then the multiple third brightness histograms are respectively equalized to obtain the first brightness mapping relationship corresponding to the multiple preset exposure parameters. Since the multiple preset exposure parameters are set according to different exposure levels, the third brightness histogram and the first brightness mapping relationship correspond to different exposure levels.

[0042] The first brightness mapping relationship is a brightness mapping result corresponding to the pixel value of each pixel point in the input image at different exposure levels. In the present disclosure, the first brightness mapping relationship can be represented by a first brightness mapping curve.

[0043] Equalization is an image processing method that uses the third brightness histogram of the input image to adjust the contrast. The purpose is to improve the global contrast of the input image, making the bright areas brighter and the dark areas darker. It is often used for images with too bright or too dark backgrounds and foregrounds. The principle is to change the third brightness histogram of the input image from a relatively concentrated grayscale interval to a uniform distribution in the entire grayscale range, that is, to stretch the image nonlinearly and redistribute the image pixel values ​​so that the number of pixels in a certain grayscale range is roughly the same, so that there are certain values ​​in the range [0, 255].

[0044] It should be noted that contrast is the difference between bright and dark areas, and exposure is the amount of light received by the camera film or photosensitive element. Generally, the greater the exposure, the brighter the bright area will be, but at the same time, the details of the dark area will be highlighted. On the contrary, when the exposure is smaller, the bright area will be darker and the details of the dark area will be less obvious.

[0045] Step 103: merge the multiple first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image.

[0046] In an embodiment of the present disclosure, a weight coefficient for fusing the first brightness mapping relationship is determined according to the image type of the third brightness histogram, and multiple first brightness mapping relationships are fused by the weight coefficient to obtain a second brightness mapping relationship. The second brightness mapping relationship can also be represented by a second brightness mapping curve in the present disclosure.

[0047] Among them, the image type of the third brightness histogram is determined according to the second brightness histogram. Since different exposure levels correspond to different third brightness histograms, each third brightness histogram corresponds to an image type. In the present disclosure, the image type is pre-set according to the exposure level. The image type can be divided into low brightness, medium brightness, high brightness, etc. In the present disclosure, 5 image types are taken as an example.

[0048] It can be understood that the second brightness mapping relationship, that is, the shape of the curve in the second brightness mapping curve reflects the magnitude of the enhancement of the bright and dark parts of the input image.

[0049] Step 104: Based on the second brightness mapping relationship, adjust the first brightness values ​​of the plurality of pixels of the input image to obtain an output image.

[0050] In an embodiment of the present disclosure, the input image is traversed through the second brightness mapping relationship to determine the second brightness value of each pixel in the input image, and the first brightness value of the corresponding pixel is adjusted by the second brightness value to obtain an output image.

[0051] In summary, according to the image processing method proposed in the present disclosure, a first brightness histogram corresponding to an input image is obtained; based on a plurality of preset exposure parameters, the first brightness histogram is equalized to obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, wherein the plurality of preset exposure parameters are set based on different exposure levels; the plurality of first brightness mapping relationships are fused to obtain a second brightness mapping relationship corresponding to the input image; based on the second brightness mapping relationship, the first brightness values ​​of a plurality of pixel points of the input image are adjusted to obtain an output image, thereby adjusting the brightness of the input image for different exposure levels, enhancing the details of dark and bright areas of the image, and improving the image contrast.

[0052] based on Figure 1 The embodiment shown, Figure 2 The following further illustrates a flow chart of an image processing method proposed in the present disclosure. Figure 2 based on Figure 1 In the embodiment shown, step 101, step 102, step 103, and step 104 are further defined. Figure 2 In the embodiment shown, step 101 includes step 201, step 202 and step 203; step 102 includes step 204 and step 205; step 103 includes step 206, step 207 and step 208; step 104 includes step 209 and step 210. Figure 2 As shown, the method comprises the following steps:

[0053] Step 201, determining brightness values ​​of a plurality of pixels of an input image.

[0054] In the embodiment of the present disclosure, it is necessary to calculate the brightness value of each pixel in the input image, wherein the brightness value is calculated based on the pixel value of each pixel.

[0055] In an optional embodiment of the present disclosure, the brightness value corresponding to each pixel in the input image may be calculated according to Formula 1.

[0056] Y=0.2126R+0.7152G+0.0722B Formula 1

[0057] Among them, Y is the grayscale brightness value of the current pixel, which is calculated using the standard conversion formula based on the RGB value of the current pixel.

[0058] Step 202: Count the brightness values ​​of multiple pixels of the input image to obtain a second brightness histogram.

[0059] In an embodiment of the present disclosure, the brightness value of each pixel in the input image is counted to obtain a second brightness histogram. The second brightness histogram is a statistical graph of the distribution of brightness values ​​of each pixel in the input image.

[0060] In an optional embodiment of the present disclosure, the brightness value of each pixel of the input image may be counted according to Formula 2 to obtain a second brightness histogram whose abscissa is the brightness value and whose ordinate is the number of pixels:

[0061]

[0062] Where H represents the second brightness histogram. If the size of the input image is 8 bits and the value range is [0, 255], the step is set to 4, that is, every 4 values ​​are a bin, and the second brightness histogram has a total of 64 bins. Bin refers to a number of small color intervals obtained by dividing the color space. The second brightness histogram can be obtained by calculating the pixel values ​​of the pixels in each color interval. The more bins there are, the stronger the resolution of the second brightness histogram for color.

[0063] Step 203: normalize the second brightness histogram to obtain a first brightness histogram.

[0064] In an embodiment of the present disclosure, in order to reduce the limitation of using the number of grayscale brightness values ​​as a statistical result, the number of grayscale brightness values ​​can be represented by the proportion of the grayscale brightness values ​​in all pixels of the input image, that is, the second brightness histogram can be normalized to ensure that the statistical results of each grayscale brightness value of the first brightness histogram are between 0% and 100%.

[0065] In an optional embodiment of the present disclosure, the statistically obtained second brightness histogram may be normalized using Formula 3:

[0066]

[0067] Among them, h is the first brightness histogram after normalization, H is the second brightness histogram, and sum is the total number of pixels counted.

[0068] Step 204: Based on the plurality of preset exposure parameters and the first brightness histogram, a plurality of third brightness histograms corresponding to the plurality of preset exposure parameters are obtained.

[0069] In the present disclosure, the preset exposure parameter is set based on the exposure degree, and specifically may be a power function index, where the larger the power function index is, the smaller the exposure degree is.

[0070] In an embodiment of the present disclosure, the first brightness histogram may be processed by a plurality of preset exposure parameters to obtain third brightness histograms at different exposure levels, wherein each preset exposure parameter corresponds to a third brightness histogram.

[0071] In an optional embodiment of the present disclosure, taking 5 power function exponents as an example, that is, different power function exponents γ0, γ1, γ2, γ3, and γ4 are preset, the normalized first brightness histogram in step 203 is processed respectively by formula 4:

[0072] h_γ[bin]=(h[bin]) γ Formula 4

[0073] Among them, γ is γ0, γ1, γ2, γ3, γ4 respectively, and h is the first brightness histogram.

[0074] Step 205 : performing equalization processing on the plurality of third brightness histograms based on the plurality of preset exposure parameters to obtain a plurality of first brightness mapping relationships.

[0075] In an embodiment of the present disclosure, the third brightness histogram is equalized by using a plurality of preset exposure parameters to obtain a first brightness mapping relationship of different exposure levels.

[0076] The equalization process is to expand the range of grayscale brightness values ​​in the input image through a mapping relationship, increase the gap between two grayscale brightness values ​​in the original range, and then interpolate the grayscale brightness values ​​in the input image to improve the contrast of the input image, thereby highlighting the texture in the input image.

[0077] It is understandable that the contrast of the input image after the equalization processing will be significantly increased, and the distribution of the third brightness histogram of the input image will be more uniform.

[0078] In an optional embodiment of the present disclosure, the third brightness histogram obtained in step 204 is equalized by formula 5 to obtain a first brightness mapping relationship corresponding to different exposure levels, that is, a brightness mapping result corresponding to the pixel value of each pixel point in the input image at different exposure levels:

[0079]

[0080] TC_γ[i]=i*p_γ[i] Formula 5

[0081] Among them, γ are γ0, γ1, γ2, γ3, γ4 respectively.

[0082] Step 206: Determine the image types corresponding to the plurality of third brightness histograms based on the second brightness histogram.

[0083] In an embodiment of the present disclosure, the image type corresponding to the third brightness histogram is determined according to the second brightness histogram. Each third brightness histogram corresponds to an image type, and the image type is pre-set. In the present disclosure, the image type can be divided into low brightness, medium brightness, high brightness, etc. Specifically, the image type of the current third brightness histogram can be roughly determined according to the distribution of the second brightness histogram.

[0084] Step 207: Determine a plurality of weight coefficients corresponding to the plurality of image types based on a plurality of preset thresholds corresponding to the plurality of image types.

[0085] In an embodiment of the present disclosure, according to the determined image type corresponding to the third brightness histogram, a preset threshold corresponding to each image type is obtained, and the preset threshold is used to calculate a weight coefficient corresponding to each image type.

[0086] In the present disclosure, the preset threshold is in the form of a soft threshold, which means that the threshold is not fixed but is related to other factors. The soft threshold specifies the variation range of the detected data.

[0087] In an optional embodiment of the present disclosure, taking five image types as an example, weight coefficients of the five image types are determined based on preset thresholds corresponding to the five image types.

[0088] For the first image type, when When weight_1=1;

[0089] When satisfied When weight_1=0;

[0090] otherwise,

[0091] For the second image type, when When weight_2=1;

[0092] When satisfied When weight_2=0;

[0093] otherwise,

[0094] For the third image type, when When weight_3=1;

[0095] When satisfied When weight_3=0;

[0096] otherwise,

[0097] For the fourth image type, when When weight_4=1;

[0098] When satisfied When weight_4=0;

[0099] otherwise,

[0100] For the fifth image type, when When weight_5=1;

[0101] When satisfied When weight_5=0;

[0102] otherwise,

[0103] Among them, T and r, delta represent the preset threshold of the third histogram of the corresponding image type, and weight is the weight coefficient corresponding to the five image types. For example, for the first image type, first calculate the proportion of the second histogram of 0-T1. If it is greater than or equal to r1, it means that the input image is type 1, and the corresponding weight is 1. If the calculated proportion is less than or equal to r1-delta1, it means that the input image cannot be type 1, and the weight is 0. If the calculated proportion is greater than r1-delta1 and less than r1, then the possibility of the input image being of the type needs to be interpolated. The other four types can be obtained by the same method as above.

[0104] Step 208: Based on the multiple weight coefficients, the multiple first brightness mapping relationships are merged to obtain a second brightness mapping relationship corresponding to the input image.

[0105] In the embodiment of the present disclosure, different curve shapes in the second brightness mapping relationship (ie, the second brightness mapping curve) reflect different exposure levels.

[0106] In an optional embodiment of the present disclosure, the first brightness mapping relationship corresponding to different exposure levels obtained in step 205 is obtained by fusing the corresponding weight coefficients of the five image types through Formula 6:

[0107]

[0108] Wherein, weight is the weight coefficient corresponding to each image type calculated in step 207, and TC_γ represents the first brightness mapping relationship (first brightness mapping curve).

[0109] Step 209 , traverse multiple pixel points of the input image, and determine second brightness values ​​corresponding to the multiple pixel points based on the second brightness mapping relationship.

[0110] In an embodiment of the present disclosure, based on the second brightness mapping relationship, a second brightness value of each pixel in the input image is calculated, wherein the second brightness value refers to a brightness value adjusted to different exposure levels.

[0111] In an optional embodiment of the present disclosure, the brightness value Y of each pixel in the input image is mapped by Formula 7 to obtain an enhanced brightness value Y', that is, a second brightness value:

[0112] Y'=TMC(Y) formula 7

[0113] Wherein, Y' represents the second brightness value.

[0114] Step 210: adjusting the first brightness values ​​of the plurality of pixels based on the second brightness value.

[0115] In an embodiment of the present disclosure, the first brightness value is adjusted based on the second brightness value corresponding to each pixel in the input image, wherein adjusting the first brightness value specifically adjusts the brightness values ​​of the three RGB channels of each pixel to ensure that the saturation is not affected.

[0116] In an optional embodiment of the present disclosure, the RGB value of each pixel is processed by formula 8 to obtain R', G', and B' after contrast enhancement:

[0117]

[0118]

[0119]

[0120] Wherein, Y represents the first brightness value, Y' represents the second brightness value, and R, G, and B represent the pixel values ​​of the current pixel in the three channels of RGB, respectively.

[0121] Traverse all pixels of the input image to achieve contrast enhancement of the entire image, and output the enhanced image.

[0122] In summary, through the method provided by the present invention, multi-scale exposure processing is performed through preset exposure parameters, the detail performance of dark and bright areas of the image is enhanced, the contrast of the input image is improved, and at the same time, the image is classified according to the content of the statistical histogram, and adaptive contrast adjustment based on the image content is achieved through preset thresholds corresponding to different image types, thereby improving the efficiency of contrast enhancement of the input image.

[0123] based on Figure 1 , Figure 2 In the embodiment shown, the present disclosure provides a flowchart of a specific image processing method, such as Figure 3 shown.

[0124] In the disclosed embodiment, firstly, the input image is subjected to histogram statistics and normalization processing to obtain a first brightness histogram; the first brightness histogram is preprocessed using different power function curves to obtain a third brightness histogram under different exposure conditions and equalization processing is performed to obtain a first brightness mapping relationship under different exposure conditions, i.e., a first brightness mapping curve; according to the original image content, i.e., according to the second brightness histogram subjected to histogram statistics, the interpolation weight required for fusion of the first brightness mapping relationship is calculated, and multiple first brightness mapping relationships are fused based on the interpolation weight to obtain a final second brightness mapping relationship, i.e., a second brightness mapping curve. The first brightness value of the input pixel is processed to obtain a second brightness value after contrast enhancement, and all pixel points of the image in the input image are traversed to complete the contrast enhancement of the entire image.

[0125] In summary, the image processing method proposed in the present disclosure performs multi-scale exposure processing on the input image, thereby enhancing the detail performance of the dark and bright areas of the image. At the same time, the input image can be classified to achieve adaptive contrast adjustment of the content.

[0126] Figure 4 FIG. 4 is a schematic diagram of the structure of an image processing device 400 provided in an embodiment of the present disclosure. Figure 4 As shown, the image processing device comprises:

[0127] An acquisition unit 410 is used to acquire a first brightness histogram corresponding to an input image;

[0128] The processing unit 420 is used to perform equalization processing on the first brightness histogram based on multiple preset exposure parameters to obtain multiple first brightness mapping relationships corresponding to the multiple preset exposure parameters, where the multiple preset exposure parameters are set based on different exposure levels;

[0129] A fusion unit 430, configured to fuse the multiple first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image;

[0130] The adjustment unit 440 is used to adjust the first brightness values ​​of multiple pixels of the input image based on the second brightness mapping relationship to obtain an output image.

[0131] In some embodiments, the acquisition unit 410 is used to: determine the brightness values ​​of multiple pixels of the input image; perform statistics on the brightness values ​​of multiple pixels of the input image to obtain a second brightness histogram; and normalize the second brightness histogram to obtain a first brightness histogram.

[0132] In some embodiments, the processing unit 420 is used to: obtain multiple third brightness histograms corresponding to multiple preset exposure parameters based on multiple preset exposure parameters and the first brightness histogram; and perform equalization processing on the multiple third brightness histograms based on the multiple preset exposure parameters to obtain multiple first brightness mapping relationships.

[0133] In some embodiments, the fusion unit 430 is used to: determine the image types corresponding to multiple third brightness histograms based on the second brightness histogram; determine multiple weight coefficients corresponding to the multiple image types based on multiple preset thresholds corresponding to the multiple image types; and fuse multiple first brightness mapping relationships based on multiple weight coefficients to obtain a second brightness mapping relationship corresponding to the input image.

[0134] In some embodiments, the adjustment unit 440 is used to: traverse multiple pixel points of the input image, determine second brightness values ​​corresponding to the multiple pixel points based on the second brightness mapping relationship; and adjust the first brightness values ​​of the multiple pixel points based on the second brightness value.

[0135] In summary, through the image processing device, a first brightness histogram corresponding to the input image is obtained; based on multiple preset exposure parameters, the first brightness histogram is equalized to obtain multiple first brightness mapping relationships corresponding to the multiple preset exposure parameters, and the multiple preset exposure parameters are set based on different exposure levels; the multiple first brightness mapping relationships are fused to obtain a second brightness mapping relationship corresponding to the input image; based on the second brightness mapping relationship, the first brightness values ​​of multiple pixel points of the input image are adjusted to obtain an output image, so as to adjust the brightness of the input image according to different exposure levels, enhance the details of the dark and bright areas of the image, and improve the image contrast.

[0136] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides an image processing device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.

[0137] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0138] Figure 51 is a block diagram of an electronic device 500 for implementing the above-mentioned image processing method according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0139] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0140] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0141] The memory 504 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0142] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0143] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0144] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0145] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0146] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0147] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0148] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0149] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0150] An embodiment of the present disclosure further proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the image processing method described in the above embodiment of the present disclosure.

[0151] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the image processing method described in the above embodiment of the present disclosure when a processor is used.

[0152] The embodiment of the present disclosure also provides a chip, such as Figure 6 As shown, the chip includes one or more interface circuits 601 and one or more processors 602; the interface circuit is used to receive signals and send signals to the processor, the signals include computer instructions stored in the memory, when the processor executes the computer instructions, the chip executes the image processing method described in the above embodiment of the present disclosure.

[0153] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0154] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0155] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0156] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0157] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0158] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0159] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0160] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. An image processing method, characterized in that: The method comprises: Obtaining a first brightness histogram corresponding to the input image; Based on a plurality of preset exposure parameters, performing equalization processing on the first brightness histogram to obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, wherein the plurality of preset exposure parameters are set based on different exposure levels; Merging the multiple first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image; Based on the second brightness mapping relationship, the first brightness values ​​of the plurality of pixels of the input image are adjusted to obtain an output image.

2. The method according to claim 1, characterized in that The obtaining of a first brightness histogram corresponding to the input image comprises: Determining brightness values ​​of a plurality of pixels of the input image; Counting the brightness values ​​of multiple pixels of the input image to obtain a second brightness histogram; The second brightness histogram is normalized to obtain a first brightness histogram.

3. The method according to claim 2, characterized in that The equalizing process is performed on the first brightness histogram based on a plurality of preset exposure parameters to obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, comprising: Based on the plurality of preset exposure parameters and the first brightness histogram, acquiring a plurality of third brightness histograms corresponding to the plurality of preset exposure parameters; Based on the multiple preset exposure parameters, the multiple third brightness histograms are equalized to obtain the multiple first brightness mapping relationships.

4. The method according to claim 3, characterized in that The fusing the multiple first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image includes: Based on the second brightness histogram, determining the image types corresponding to the plurality of third brightness histograms; Determining a plurality of weight coefficients corresponding to the plurality of image types based on a plurality of preset thresholds corresponding to the plurality of image types; Based on the multiple weight coefficients, the multiple first brightness mapping relationships are fused to obtain a second brightness mapping relationship corresponding to the input image.

5. The method according to claim 4, characterized in that The adjusting the first brightness values ​​of the plurality of pixels of the input image based on the second brightness mapping relationship to obtain the output image comprises: Traversing a plurality of pixel points of the input image, and determining second brightness values ​​corresponding to the plurality of pixel points based on the second brightness mapping relationship; Based on the second brightness value, the first brightness values ​​of the plurality of pixels are adjusted.

6. An image processing device, characterized in that: The device comprises: An acquisition unit, configured to acquire a first brightness histogram corresponding to the input image; a processing unit, configured to perform equalization processing on the first brightness histogram based on a plurality of preset exposure parameters, and obtain a plurality of first brightness mapping relationships corresponding to the plurality of preset exposure parameters, wherein the plurality of preset exposure parameters are set based on different exposure levels; A fusion unit, configured to fuse the plurality of first brightness mapping relationships to obtain a second brightness mapping relationship corresponding to the input image; An adjustment unit is used to adjust the first brightness values ​​of multiple pixels of the input image based on the second brightness mapping relationship to obtain an output image.

7. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.

9. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal and send the signal to the processor, the signal includes a computer instruction stored in a memory, and when the processor executes the computer instruction, the chip executes the method described in any one of claims 1 to 5.