Image processing method and device, ISP, electronic equipment and computer storage medium

By performing two brightness transformations on the image, using the preset brightness correspondence relationship and the statistically obtained brightness correspondence relationship, the problem of poor details in the middle brightness area in the image brightness processing is solved, and the image quality is improved.

CN120125486APending Publication Date: 2025-06-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510177027.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In the prior art, in image brightness processing, the details of the medium bright area are poor, resulting in poor quality of the output image.

Method used

By converting the image brightness according to the preset first brightness correspondence relationship, a second image is obtained, and statistics on the original image are used to obtain the second brightness correspondence relationship, and then converting the second image is used to obtain the output image.

Benefits of technology

This improves imbalance in image brightness processing and improves image quality of output images, especially in the presentation of the detailed areas of the medium brightness area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125486A_ABST
    Figure CN120125486A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method, which comprises the steps of converting the brightness of an obtained first image according to a preset first brightness corresponding relation to obtain a second image, counting the first image to obtain a second brightness corresponding relation, and converting the brightness of the second image according to the second brightness corresponding relation to obtain a second brightness corresponding relation. And obtaining an output image. The embodiment of the invention further provides an image processing device, the ISP, electronic equipment and a computer storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to image processing technologies, and in particular to an image processing method, apparatus, ISP, electronic device, and computer storage medium. Background Art

[0002] In order to improve the brightness range of an image, in image processing, a Hybrid Log Gamma (HLG) curve or a traditional Gamma curve is usually used for brightness mapping.

[0003] However, the above methods limit the medium-brightness region of the image, resulting in poor detail presentation in this region and thus poor image quality of the output image. Summary of the Invention

[0004] Embodiments of this application provide an image processing method, apparatus, ISP, electronic device, and computer storage medium, which can improve the imbalance in image brightness processing.

[0005] The technical solution of this application is implemented as follows:

[0006] In a first aspect, an embodiment of this application provides an image processing method, including:

[0007] Transform the brightness of the acquired first image according to a preset first brightness correspondence to obtain a second image;

[0008] Perform statistics on the first image to obtain a second brightness correspondence;

[0009] Transform the brightness of the second image according to the second brightness correspondence to obtain an output image.

[0010] In a second aspect, an embodiment of this application provides an image processing apparatus, including:

[0011] A brightness transformation module, configured to transform the brightness of the acquired first image according to a preset first brightness correspondence to obtain a second image;

[0012] A statistics module, configured to perform statistics on the first image to obtain a second brightness correspondence;

[0013] The brightness transformation module is further configured to transform the brightness of the second image according to the second brightness correspondence to obtain an output image.

[0014] In a third aspect, an ISP provided by an embodiment of the present application includes: a processor, configured to call and run a computer program from a memory, so that a device installed with the ISP executes the image processing method as described in one or more of the above embodiments; a transceiver, configured to receive and send information during the process of receiving and sending information between the device and the ISP.

[0015] In a fourth aspect, an electronic device provided by an embodiment of the present application includes: an ISP, a processor, and a storage medium storing executable instructions of the processor as described in one or more of the above embodiments; the storage medium depends on the processor to execute operations through a communication bus.

[0016] In a fifth aspect, an electronic device provided by an embodiment of the present application includes: a processor and a storage medium storing executable instructions of the processor; the storage medium depends on the processor to execute operations through a communication bus, and when the instructions are executed by the processor, the image processing method as described in one or more of the above embodiments is executed.

[0017] In a sixth aspect, a computer storage medium provided by an embodiment of the present application stores executable instructions, and when the executable instructions are executed by one or more processors, the processors execute the image processing method as described in one or more of the above embodiments.

[0018] An embodiment of the present application provides an image processing method, apparatus, ISP, electronic device, and computer storage medium. The brightness of a first image obtained is transformed according to a preset first brightness correspondence relationship to obtain a second image, the first image is statistically analyzed to obtain a second brightness correspondence relationship, and the brightness of the second image is transformed according to the second brightness correspondence relationship to obtain an output image; that is to say, in the embodiment of the present application, after the brightness of the obtained first image is transformed according to the preset first brightness correspondence relationship to obtain a second image, the second brightness correspondence relationship obtained by statistically analyzing the first image is further used to transform the brightness of the second image, so that the obtained output image can process the brightness of the first image twice to make up for the poor effect in some areas after the first brightness processing. The second brightness correspondence relationship obtained by statistically analyzing the first image can reflect the statistical distribution of the first image. Based on this, the determined second brightness correspondence relationship is a brightness correspondence relationship related to the statistical distribution of the first image. Then, based on this, the second brightness processing is implemented, which can improve the image effect of the areas with poor effect after the first brightness processing, thereby improving the image quality of the output image. Description of the Drawings

[0019] Figure 1 It is a schematic diagram of a gamma curve and an HLG curve in the related art;

[0020] Figure 2Schematic flowchart of an optional image processing method provided by an embodiment of the present application;

[0021] Figure 3 Schematic flowchart of an example of an optional image processing method provided by an embodiment of the present application;

[0022] Figure 4a Schematic diagram of an optional initial adaptive transformation curve provided by an embodiment of the present application;

[0023] Figure 4b Schematic diagram of an optional mask image-guided adaptive transformation curve provided by an embodiment of the present application;

[0024] Figure 5 Schematic diagram of an optional transformation curve corrected based on RGB data distribution provided by an embodiment of the present application;

[0025] Figure 6a Schematic diagram of an optional one without chromaticity transformation correction provided by an embodiment of the present application;

[0026] Figure 6b Schematic diagram of an optional chromaticity transformation correction provided by an embodiment of the present application;

[0027] Figure 7 Schematic diagram of an optional HLG transformation curve based on image distribution characteristics provided by an embodiment of the present application;

[0028] Figure 8a Schematic diagram of an optional original image one provided by an embodiment of the present application Figure 1 ;

[0029] Figure 8b Schematic diagram of an optional original image one provided by an embodiment of the present application Figure 2 ;

[0030] Figure 9a Schematic diagram of an optional original image two provided by an embodiment of the present application Figure 1 ;

[0031] Figure 9b Schematic diagram of an optional original image two provided by an embodiment of the present application Figure 2 ;

[0032] Figure 10a Schematic diagram of an optional original image three provided by an embodiment of the present application Figure 1 ;

[0033] Figure 10b Schematic diagram of an optional original image three provided by an embodiment of the present application Figure 2 ;

[0034] Figure 11 Schematic structural diagram of an optional image processing apparatus provided by an embodiment of the present application;

[0035] Figure 12 Schematic structural diagram of an optional ISP provided by an embodiment of the present application;

[0036] Figure 13 Schematic structure of an optional electronic device provided by an embodiment of the present application Figure 1 ;

[0037] Figure 14 Schematic structure of an optional electronic device provided by an embodiment of the present application Figure 2 。 Detailed implementation manners

[0038] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.

[0039] In the related art, Dolby Vision is a high-dynamic range (HDR) video technology developed by Dolby Laboratories. It makes the details in the image clearer and more excellent in visual performance through a wider brightness range and a richer color range. With the rapid development of the mobile terminal screen display technology, especially the improvement in screen brightness, color accuracy, and contrast, more and more smartphones begin to support Dolby Vision technology.

[0040] In order to better display the Dolby video effect, the mobile terminal usually uses HLG for mapping. Figure 1 Schematic diagram of the gamma curve and the HLG curve in the related art, as Figure 1 shown. Compared with the traditional gamma curve, the HLG curve brightens more obviously in the middle and dark regions, and the details are more prominent. However, due to the limitation of the display range, the middle and bright regions will be restricted, resulting in less rich details in this part than in the dark part, and even possible "fogging" effect, making the brightness processing uneven and affecting the overall visual perception of the picture.

[0041] In view of the technical problem of unevenness in image brightness processing, the embodiments of the present application provide an image processing method, Figure 2 Schematic flowchart of an optional image processing method provided by an embodiment of the present application, as Figure 2 shown. The image processing method may include:

[0042] S201: Transform the brightness of the acquired first image according to a preset first brightness correspondence relationship to obtain a second image;

[0043] The image processing method provided by the embodiments of the present application can be applied to the processor of an electronic device or to the Image Signal Processing (ISP) of an electronic device. Among them, the above-mentioned electronic device can be a smart phone, a tablet computer, smart glasses, a smart watch, etc. Here, the embodiments of the present application do not make specific limitations in this regard.

[0044] In order to improve the imbalance in image brightness processing, in the embodiments of the present application, in S201, according to a preset first brightness correspondence, the brightness of the acquired first image is transformed to obtain a second image. Among them, the above-mentioned first image can be an image collected from an image sensor, or a first image obtained by processing the collected image, or an image obtained from other devices. In addition, the above-mentioned first image can be an image obtained by downsampling the acquired image. Here, the embodiments of the present application do not make specific limitations in this regard.

[0045] Among them, the above-mentioned first brightness correspondence can be a gamma curve, an HLG curve, or other correspondences. Here, the embodiments of the present application do not make specific limitations in this regard.

[0046] Here, after the first image is acquired, according to the first brightness correspondence, the brightness of the first image is transformed, so as to obtain the brightness value corresponding to the brightness of the first image, so as to change the brightness of the first image and obtain a second image.

[0047] S202: Statistically analyze the first image to obtain a second brightness correspondence;

[0048] In the embodiments of the present application, after the first image is acquired, statistically analyzing the first image can obtain a second brightness correspondence. Here, mainly the feature information of the first image is statistically analyzed to obtain a second brightness correspondence.

[0049] Here, the above-mentioned feature information of the first image is feature information related to the brightness value of the image. For example, the feature information can be the brightness value, spectral information, ambient light source information, etc.

[0050] Then, here, it can be to statistically analyze the brightness of the first image to obtain a second brightness correspondence, or to statistically analyze the spectral information of the first image to obtain a second brightness correspondence, or to statistically analyze the ambient light source information of the first image to obtain a second brightness correspondence. Here, the embodiments of the present application do not make specific limitations in this regard.

[0051] S203: According to the second brightness correspondence, transform the brightness of the second image to obtain an output image.

[0052] The second image is obtained through the above-mentioned S201, and the second brightness correspondence is obtained through the above-mentioned S202. In S203, according to the second brightness correspondence, the brightness of the second image is transformed to obtain the output image.

[0053] Among them, after the second image is obtained, according to the second brightness correspondence, the brightness of the second image is transformed, so as to obtain the brightness value corresponding to the brightness of the second image, so as to change the brightness of the second image and obtain the output image.

[0054] Here, it should be noted that the image processing method in the embodiments of the present application not only includes the brightness processing of the image, but also may include other processing methods of the image. The embodiments of the present application do not make specific limitations on this.

[0055] In order to obtain the second brightness correspondence, in an optional embodiment, S202 may include:

[0056] Determine the first brightness image of the first image;

[0057] Perform statistics on the first brightness image to obtain the second brightness correspondence.

[0058] It can be understood that after the first image is obtained, the brightness of the first image is determined to obtain the first brightness image. Here, the BT.2020 standard can be used to calculate the first brightness image. Of course, other methods can also be used to calculate the first brightness image. Here, the embodiments of the present application do not make specific limitations on this.

[0059] Then perform statistics on the first brightness image. The statistical method here can be the cumulative histogram method to obtain the statistical result. Based on the statistical result, it can be known the statistical times corresponding to different brightness intervals. The second brightness correspondence can be directly determined based on the statistical times corresponding to different brightness intervals, or the brightness value can be first determined based on the statistical times corresponding to different brightness intervals, and then the second brightness correspondence can be determined according to the brightness value.

[0060] Among them, in directly determining the second brightness correspondence based on the statistical times corresponding to different brightness intervals, the mean values of different brightness intervals can be first determined, so as to generate the second brightness correspondence by using the statistical times corresponding to the mean values; it can also be to perform gamma transformation or logarithmic transformation on the statistical times corresponding to different brightness intervals, and then determine the mean values of the transformed different brightness intervals, so as to generate the second brightness correspondence by using the statistical times corresponding to the mean values. Here, the embodiments of the present application do not make specific limitations on this.

[0061] In this way, by statistically analyzing the first luminance image of the first image, a second luminance correspondence is determined, such that the second luminance correspondence is related to the luminance distribution of the first image, which is beneficial to improving the imbalance problem in image luminance processing and enhancing the image quality.

[0062] Further, in order to determine the second luminance correspondence, in an alternative embodiment, statistically analyzing the first luminance image to obtain the second luminance correspondence may include:

[0063] Statistically analyzing the first luminance image to obtain a first luminance value and a second luminance value;

[0064] Determining the second luminance correspondence according to the first luminance value and the second luminance value.

[0065] It can be understood that when statistically analyzing the first luminance image, the statistical method here can be the cumulative histogram method. After obtaining the statistical result, it can be known from the statistical result the statistical times corresponding to different luminance intervals. Then, based on the statistical times corresponding to different luminance intervals, the first luminance value and the second luminance value are first determined, and then the second luminance correspondence is determined according to the first luminance value and the second luminance value.

[0066] Among them, the first luminance value is less than the second luminance value. That is to say, based on the statistical result, a smaller first luminance value and a larger second luminance value can be determined. Here, in the cumulative histogram, the luminance intervals corresponding to the first preset value and the second preset value can be found, where the first preset value is less than the second preset value. For example, the first preset value is 300 and the second preset value is 900.

[0067] Then, the upper limit value of the luminance interval corresponding to the first preset value is used as the first luminance value, and the upper limit value of the luminance interval corresponding to the second preset value is used as the second luminance value, so as to determine the second luminance correspondence according to the first luminance value and the second luminance value.

[0068] Here, the luminance correspondence of different luminance intervals can be determined with the first luminance value and the second luminance value as the boundaries, so as to obtain the second luminance correspondence.

[0069] In this way, by statistically analyzing the first luminance image, two luminance values can be determined, and then the second luminance correspondence is determined according to the two luminance values, which can make the determined second luminance correspondence related to the statistically obtained first luminance value and second luminance value, and is beneficial to improving the imbalance in image luminance processing.

[0070] In order to implement determining the second luminance correspondence according to two luminance values, in an alternative embodiment, determining the second luminance correspondence according to the first luminance value and the second luminance value may include:

[0071] Use the first brightness value and the second brightness value as the boundary values of a preset piecewise function to obtain the second brightness correspondence.

[0072] Understandably, the first brightness value and the second brightness value can be used as the boundary values of the preset piecewise function. For example, the preset piecewise function can be divided into three segments: less than the first brightness value, greater than or equal to the first brightness value and less than or equal to the second brightness value, and greater than the second brightness value.

[0073] After determining three brightness intervals through the above first brightness value and second brightness value, the piecewise intervals of the preset piecewise function have been determined. In this way, the preset piecewise function can be determined as the second brightness correspondence. The correspondence between the input value and the output value of the above preset piecewise function is the second brightness correspondence. In image processing, the brightness of the second image can be input into the second brightness correspondence, and the output value is the brightness value of the output image.

[0074] In this way, three different brightness intervals can be obtained through the statistics of the second brightness image, so that in the second brightness correspondence, different brightness intervals have different brightness correspondences, thereby enabling the second brightness processing of the image to distinguish different brightness intervals, which is beneficial to improving the image effect.

[0075] In order to improve the effect of the second brightness correspondence on image processing, in an optional embodiment, the above method may further include:

[0076] Correct the second brightness correspondence to obtain the second brightness correspondence again.

[0077] Understandably, after obtaining the second brightness correspondence, the second brightness correspondence can be corrected, so that the second brightness correspondence can be updated.

[0078] Among them, the above correction can be performed using an artificial intelligence (AI) model, or can be performed in the form of a mask image. Here, the embodiments of the present application do not make specific limitations in this regard.

[0079] In addition, the above correction of the second brightness correspondence can be a correction for the brightness processing of the image, or can be a correction for the chromaticity processing of the image. Of course, it can also be a correction for the processing of other parameters of the image. Here, the embodiments of the present application do not make specific limitations in this regard.

[0080] In this way, through the correction of the second brightness correspondence, the re-obtained second brightness correspondence can more accurately implement the brightness transformation of the image, thereby effectively improving the imbalance in the brightness processing of the image.

[0081] In an alternative embodiment, to correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again, the following steps may be included:

[0082] Determine a mask image of the first brightness image according to the second brightness correspondence relationship;

[0083] Use the mask image to correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again.

[0084] It can be understood that, according to the second brightness correspondence relationship, the mask image of the first brightness image can be determined first, and then the mask image can be used to correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again.

[0085] The above mask image is obtained based on the second brightness correspondence relationship. Here, it can be obtained by corresponding the brightness of the second image according to the second brightness correspondence relationship, or it can be obtained by corresponding the brightness of an output image after processing the first image according to the second brightness correspondence relationship. Here, the embodiments of the present application do not make specific limitations in this regard.

[0086] After obtaining the mask image, the second brightness correspondence relationship can be corrected based on the image parameters of the same image block on the mask image and the second image, thereby avoiding excessive suppression of the dark part of the image and improving the image effect.

[0087] Further, in an alternative embodiment, to obtain the mask image, determining a mask image of the first brightness image according to the second brightness correspondence relationship may include:

[0088] Determine a second brightness image corresponding to the first brightness image according to the second brightness correspondence relationship;

[0089] Determine the second brightness image as the mask image.

[0090] It can be understood that after obtaining the first brightness image of the first image, the brightness value corresponding to each brightness value in the first brightness image can be obtained according to the second brightness correspondence relationship, so that the second brightness image can be obtained. Then, the second brightness image is used as the mask image.

[0091] Of course, here, the brightness image of the image obtained after processing the first image can also be used to obtain the mask image in a similar manner to the first image. Here, the embodiments of the present application do not make specific limitations in this regard.

[0092] In this way, a mask image is obtained from the first luminance image of the first image, such that the mask image is related to the first luminance image, and then the mask image is used to correct the second luminance correspondence, which is beneficial to improving the luminance transformation effect of the second luminance correspondence in image processing.

[0093] In order to implement the correction of the second luminance correspondence using the mask image, in an optional embodiment, using the mask image to correct the second luminance correspondence to re-obtain the second luminance correspondence may include:

[0094] Determine a first weight value of a target input parameter in the second luminance correspondence and a second weight value of a target output parameter in the second luminance correspondence according to the target pixel value of the mask image;

[0095] Use the first weight value and the second weight value to perform weighted summation on the target input parameter and the target output parameter to re-obtain the target output parameter in the second luminance correspondence;

[0096] Re-determine the correspondence between the target input parameter and the target output parameter as the second luminance correspondence.

[0097] It can be understood that among them, the target pixel value, the target input parameter, and the target output parameter are different parameters that correspond one by one on the same image block. That is to say, the image blocks of the mask image, the first image, and the second image correspond one by one. Then, for the target image block of the mask image, the target pixel value of this target image block can be obtained, and the luminance of the image block of the first image corresponding to the target image block can be found from the second luminance correspondence, denoted as the target input parameter, and the output parameter corresponding to the target input parameter in the second luminance correspondence is denoted as the target output parameter.

[0098] After determining the target input parameter and the target output parameter, the weight value of the target input parameter can be determined according to the target pixel value, denoted as the first weight value, and the weight value of the target output parameter can also be determined, denoted as the second weight value, where the sum of the first weight value and the second weight value is 1.

[0099] After determining the two weight values, perform weighted summation on the target input parameter and the target output parameter, so that the target output parameter in the second luminance correspondence can be re-obtained. Then, re-determine the correspondence between the target input parameter and the re-determined target output parameter as the second luminance correspondence. In this way, the update of the second luminance correspondence is realized.

[0100] In this way, through the above correction of the second luminance correspondence using the mask image, the problem that the dark part of the second luminance correspondence is overly suppressed and the bright part has unclear levels can be avoided in luminance processing.

[0101] In order to meet the real-time requirements and improve the speed of image processing, in an alternative embodiment, the above method is applied to an ISP. Correspondingly, S203 may include:

[0102] In the brightness transformation module of the ISP, the brightness of the second image is transformed according to the second brightness correspondence relationship to obtain an output image.

[0103] It can be understood that in the above image processing method applied to the ISP, in the brightness transformation module of the ISP, the brightness of the second image is transformed according to the second brightness correspondence relationship to obtain an output image.

[0104] In this way, in the brightness transformation module, the image is processed not only using the first brightness correspondence relationship but also using the second brightness correspondence relationship, and by executing the above image processing method in the ISP, the read / write power consumption can be reduced and the latency can be decreased, thereby meeting the real-time requirements.

[0105] In addition, considering the adverse effect of the above second brightness correspondence relationship on the chrominance of the image, in an alternative embodiment, correcting the second brightness correspondence relationship to re-obtain the second brightness correspondence relationship may include:

[0106] Determine the second brightness image corresponding to the first brightness image according to the second brightness correspondence relationship;

[0107] Determine the brightness correspondence relationship of each channel in the first image according to the second brightness image;

[0108] Redetermine the brightness correspondence relationship of each channel in the first image as the second brightness correspondence relationship.

[0109] It can be understood that since the brightness transformation module acts in the RGB domain, the image indexes the first brightness correspondence relationship with RGB brightness values. If there are obvious mutations in the first brightness correspondence relationship, the proportion of the original RGB components will change, resulting in color cast.

[0110] Based on this, in the embodiments of the present application, first, the second brightness image corresponding to the first brightness image is determined according to the second brightness correspondence relationship. Here, the BT.2020 standard can be used to calculate the brightness values corresponding to the RGB components, thereby obtaining the first brightness image. Then, the second brightness image is determined using the second brightness correspondence relationship.

[0111] After knowing the second brightness image, based on this, the brightness correspondence relationship of each channel in the first image can be determined. Taking the RGB channels as an example, the brightness correspondence relationship of the R channel, the G channel, and the B channel can be determined.

[0112] Here, determining the brightness correspondence relationship of each channel can be obtained by using a preset algorithm based on the RGB values of the first brightness image and the first image, or can be obtained by using an AI model based on the RGB values of the first brightness image and the first image. Here, the embodiments of the present application do not make specific limitations in this regard.

[0113] After obtaining the brightness correspondence relationship of each channel, the brightness correspondence relationship of each channel can be used as the second brightness correspondence relationship. In this way, in the second brightness correspondence relationship, a corresponding brightness correspondence relationship can be set for different channels, avoiding the color cast problem after the image undergoes brightness transformation.

[0114] Further, in order to obtain the brightness correspondence relationship of each channel, in an optional embodiment, determining the brightness correspondence relationship of each channel in the first image according to the second brightness image may include:

[0115] Determine the same pixel values of each channel in the first image;

[0116] Determine the brightness values corresponding to the same pixel values from the second brightness image;

[0117] Determine the correspondence relationship between the same pixel values and the average value of the brightness values corresponding to the same pixel values as the brightness correspondence relationship of each channel in the first image.

[0118] It can be understood that after knowing the second brightness image, the same pixel values of each channel in the first image can be found first. For example, for the R channel, the same pixel value is 30. Determine the brightness value corresponding to the value of 30 in the R channel from the second brightness image, determine the average value or median value of the brightness values corresponding to the value of 30 in the R channel, and then determine the correspondence relationship between 30 and the average value or median value of the brightness values corresponding to 30 as the brightness correspondence relationship of the R channel in the first image.

[0119] In this way, for each channel, the above method can be used to obtain the brightness correspondence relationship of each channel, so that the determined brightness correspondence relationship of each channel can balance the differences in the brightness correspondence relationship between the same pixel values, which is beneficial to improving the color cast problem of the image.

[0120] In order to achieve the correction of the image chromaticity, in an optional embodiment, the above method may further include:

[0121] Determine the chromaticity correction image according to the second brightness correspondence relationship;

[0122] Use the chromaticity correction image to correct the chromaticity of the output image.

[0123] Understandably, after introducing the second brightness correspondence relationship, in order to further correct the chromaticity of the image, after knowing the second brightness correspondence relationship, the chromaticity correction image can be determined according to the second brightness correspondence relationship, so that the chromaticity of the output image can be corrected by using the chromaticity correction image.

[0124] Here, an AI model can be used to determine the chromaticity correction image according to the second brightness correspondence relationship, or the chromaticity correction image can be calculated by using the RGB values of the first image and the second brightness correspondence relationship. Here, the embodiments of the present application do not make specific limitations on this.

[0125] In this way, the chromaticity correction image is determined through the second brightness correspondence relationship, so that after introducing the second brightness correspondence relationship, the correction of chromaticity can be further realized, and the quality of the image can be improved.

[0126] Further, in order to determine the chromaticity correction image, in an optional embodiment, determining the chromaticity correction image according to the second brightness correspondence relationship may include:

[0127] Determine the third brightness image corresponding to the image of each channel in the first image according to the second brightness correspondence relationship;

[0128] Determine the second brightness image corresponding to the first brightness image of the first image according to the second brightness correspondence relationship;

[0129] Determine the chromaticity correction image according to the first brightness image, the second brightness image, and the third brightness image.

[0130] Understandably, after knowing the second brightness correspondence relationship, the brightness value corresponding to the pixel value of each channel of the first image can be found, denoted as the third brightness image, and the second brightness image corresponding to the above first brightness image can also be determined. Thus, after obtaining the first brightness image, the second brightness image, and the third brightness image, the chromaticity correction image is determined based on the three brightness images.

[0131] Here, an AI model can be used to determine the chromaticity correction image according to the three brightness images, or the chromaticity correction image can be calculated by using the three brightness images. Here, the embodiments of the present application do not make specific limitations on this.

[0132] In this way, the chromaticity correction image is determined through the above three brightness images, so that the chromaticity correction image is related to the brightness distribution, which is beneficial to compensating for the chromaticity deviation caused in brightness processing and improving the image quality.

[0133] Further, in order to determine the chromaticity correction image, in an optional embodiment, determining the chromaticity correction image according to the first brightness image, the second brightness image, and the third brightness image may include:

[0134] Determine the ratio image of the second luminance image and the first luminance image;

[0135] Process the third luminance image using the ratio image to obtain a fourth luminance image;

[0136] Perform gamut conversion on the third luminance image and the fourth luminance image to obtain a converted third luminance image and a converted fourth luminance image respectively;

[0137] Determine the difference image between the converted third luminance image and the converted fourth luminance image;

[0138] Use the difference image to determine the chromaticity correction image.

[0139] Understandably, after obtaining the second luminance image and the second luminance image, the ratio between the value on the second luminance image and the value on the first luminance image for each image block can be calculated to obtain the ratio image. Apply the ratio image to the third luminance image, thereby obtaining the fourth luminance image.

[0140] Then, perform gamut conversion on the third luminance image and the fourth luminance image respectively. The RGB domain can be converted to the HSV domain to obtain a converted third luminance image and a converted fourth luminance image respectively. In this way, the converted third luminance image and the converted fourth luminance image are in the HSV domain.

[0141] To achieve chromaticity correction, here, the chromaticity components of the converted third luminance image and the converted fourth luminance image are subtracted to obtain a difference image, which is used as the chromaticity correction image to achieve the correction of the output image.

[0142] Here, it should be noted that the correction of the chromaticity correction image can also occur in the chromaticity correction module after the luminance transformation module.

[0143] In this way, the chromaticity correction image can be obtained through the above method, and this chromaticity correction image is closely related to the luminance distribution of the image and the correspondence of the second luminance. In this way, it is possible to achieve favorable correction of the chromaticity after two luminance transformations, improving the image quality.

[0144] In addition, to meet the real-time requirement and improve the image processing speed, in an optional embodiment, the above method is applied to the ISP. Correspondingly, using the chromaticity correction image to correct the chromaticity of the output image may include:

[0145] In the chromaticity correction module of the ISP, use the chromaticity correction image to correct the chromaticity of the output image.

[0146] Understandably, when the above image processing method is applied to an ISP, in the chrominance correction module of the ISP, the chrominance of the output image is corrected using the chrominance-corrected image.

[0147] In this way, in the chrominance correction module, in addition to correcting the chrominance in the manner of the related art, the chrominance of the output image is also corrected using the above chrominance-corrected image. Here, the output image can be the input image corresponding to the first image obtained in the chrominance correction module.

[0148] In this way, by executing the above image processing method in the ISP, the read / write power consumption can be reduced and the latency can be decreased, thereby meeting the real-time requirements.

[0149] In order to obtain the above first image, in an optional embodiment, the above method may further include:

[0150] Performing segmentation processing on the acquired original image to obtain a segmentation result;

[0151] Determining the target image in the segmentation result as the first image.

[0152] Understandably, in addition to obtaining the first image in the above manner, it is also possible to perform segmentation processing on the original image using an image segmentation algorithm or an AI model after the original image is acquired, thereby obtaining a segmentation result.

[0153] Based on the segmentation result, the target image can be selected therefrom to obtain the first image. Here, the selection method can be obtained through a preset selection rule, or through a trained model, or through the type of image recognition. Here, the embodiments of the present application do not make specific limitations in this regard.

[0154] In this way, by segmenting the original image to obtain the first image, it is possible to implement the processing of a partial region of the image, thereby reducing the workload in image processing and being beneficial to improving the efficiency of image processing.

[0155] The following is an example to describe the above image processing method in one or more of the above embodiments.

[0156] In the related art, a fixed HLG curve is used for mapping in the ISP. When stretching the dark part, it is inevitable to suppress the middle tone region, resulting in damage to the dynamics of scenes such as clouds and sunsets distributed in this interval, weak highlight levels, and a foggy overall appearance. Moreover, in the related art, a pure software solution has high image read / write power consumption and high latency, not meeting the real-time requirements.

[0157] This example proposes a hardware and software solution to improve the dynamic range of Dolby video. The core innovation is to combine the traditional ISP hardware module with the software algorithm, adjust the original HLG curve according to the image distribution characteristics, adaptively improve the dark dynamics, and retain the highlight layering. In addition, in order to alleviate the color cast caused by the unevenness of the RGB domain gamma curve, two chromaticity correction solutions are designed.

[0158] Figure 3 A flowchart of an example of an optional image processing method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the image processing method may include:

[0159] S301: Acquire an image;

[0160] Specifically, in S301, in order to reduce power consumption and improve video performance, this example uses small images to count local data features. That is, based on a step size of 4, the length and width of the acquired original image are sampled to obtain a DS4 small image, thereby obtaining an image and reducing data reading and writing.

[0161] S302: Statistical data distribution;

[0162] S303: Calculate an adaptive transformation curve;

[0163] In the statistical data distribution, the pixel distribution range of different scenes is different, and the tone range that needs to be processed is also different. This example determines the brightness range that needs to improve the contrast based on the image histogram. The details are as follows:

[0164] The original image histogram is counted based on 256 orders, the image cumulative histogram is calculated, and normalized. The brightness interval corresponding to the value of 0.3 in the cumulative histogram is found, which is recorded as the dark mark point a. The brightness interval corresponding to the value of 0.9 in the cumulative histogram is found, which is recorded as the brightness mark point b.

[0165] For calculating the adaptive transformation curve (equivalent to the second brightness correspondence relationship mentioned above), this example mainly improves the layering of the mid-high key range. Therefore, after obtaining A and b, the following formula can be used to obtain the initial adaptive transformation curve:

[0166]

[0167] K = 1 / (ba) (2)

[0168] B = a / (ab) (3)

[0169] Among them, the meaning of the above formula is that the area with a brightness value lower than a is judged as a dark area, and this area needs to be further darkened when enhancing the contrast. The area with a brightness value higher than b is judged as a high-brightness area and needs to be brightened. For the middle tone part between a and b, linear stretching is used to enhance the transparency. Among them,

[0170] To avoid excessive suppression of the dark part and video black cut, in this embodiment, a mask image (mask) is also used to constrain the above formula, and the initial adaptive transformation curve and the pixel brightness value are multiplied in a multiply mode, that is,

[0171] z = x * (1 - m) + y * m (4)

[0172] Among them, based on the initial adaptive curve, the brightness value of the image is input into the initial adaptive curve to obtain the value of m. For example, when the brightness value of the image is less than 300, m = 0; when the brightness value of the image is greater than 800, m = 1. In this way, the above formula (4) is used to update the value of the vertical axis of the initial adaptive transformation curve to control the fusion strength and obtain the adaptive transformation curve.

[0173] Figure 4a FIG. is a schematic diagram of an optional initial adaptive transformation curve provided by an embodiment of the present application. As Figure 4a shown, the curve is divided into three parts. When the brightness value is less than 300, the transformed brightness value is 0; when the brightness value is greater than 800, the transformed brightness value is 1000.

[0174] Figure 4b FIG. is a schematic diagram of an optional mask image-guided adaptive transformation curve provided by an embodiment of the present application. As Figure 4b shown, through the action of the mask image, the transformation of the curve for the dark part and the brightness is a slow transformation.

[0175] S304: Chromaticity correction;

[0176] In the ISP, the gamma module (equivalent to the above brightness transformation module) acts in the RGB domain, and the image indexes the gamma curve with the RGB brightness value. If the gamma curve has obvious upward convexity or downward concavity, the ratio of the original RGB components will change, resulting in color cast. For this reason, two chromaticity correction schemes are designed in this embodiment.

[0177] It can be divided into the following two correction methods:

[0178] The first one is the chromaticity correction scheme based on the RGB data distribution

[0179] Specifically, taking the brightness value Y as the index, by statistically calculating the mapping average value of each RGB component as the final result, the specific steps are as follows:

[0180] Step A1: Calculate the luminance value Y corresponding to the RGB components according to the BT.2020 standard. The formula is as follows:

[0181] Y = 0.2256 * R + 0.5823 * G + 0.0509 * B + 16 (5)

[0182] Step A2: Using the Y value as a reference, index the adaptive transformation curve to obtain the mapped luminance L of the current RGB components;

[0183] Step A3: Traverse the DS4 sub-images and count all the L values corresponding to each RGB value

[0184] For example: when RGB are 30, 40, 50 respectively, Y = 48. Record the data indexed by 48 when R = 30; when RGB are 30, 80, 80 respectively, Y = 73. Record the data indexed by 73 when R = 30;

[0185] Step A4: Take the average of the L values corresponding to each RGB component as the mapped value of the current RGB component.

[0186] For the G channel and B channel, adopt the same method above, so that the sub-adaptive transformation curves of different channels of the image can be obtained.

[0187] Figure 5 Shown in the figure is a schematic diagram of an optional transformation curve corrected based on the RGB data distribution provided by an embodiment of the present application. As Figure 5 shown, it includes the sub-adaptive transformation curve of the R channel, the sub-adaptive transformation curve of the G channel, and the sub-adaptive transformation curve of the B channel.

[0188] Figure 5 is the adaptive transformation curve after chromaticity correction for the blue sky and white clouds scene. In this scene, the GB components are relatively large and the R component is relatively small. Therefore, when performing the same mapping, it can be seen that the red curve is relatively to the left and the blue curve is relatively to the right.

[0189] Second, the chromaticity correction scheme based on the hardware module 2DLUT

[0190] In the ISP platform, the 2DLUT module (equivalent to the above chromaticity correction module) can perform local chromaticity and saturation adjustment on the image. Therefore, in this embodiment, a chromaticity correction scheme based on the hardware 2DLUT module is designed. The steps are as follows:

[0191] Step B1: Index the adaptive transformation curve with the luminance value of the RGB components to obtain new RGB data

[0192] Step B2: Calculate the luminance Y corresponding to the RGB components according to the BT.2020 standard, index the adaptive transformation curve with Y, and apply it equally to the RGB components;

[0193] Step B3: Convert the RGB data in Step B1 and Step B2 to the HSV domain

[0194] Step B4: Based on the chromaticity H calculated in Step B2, statistically calculate the difference between each H and that in Step B1, and use the average difference H_diff as the correction value for each chromaticity H;

[0195] Step B5: Apply the correction value H_diff to the 2DLUT module to perform chromaticity correction on the image, thereby correcting the color cast caused by the gamma curve.

[0196] Figure 6a FIG. is an optional schematic diagram of the present application embodiment without chromaticity correction, as Figure 6a shown, Figure 6b FIG. is an optional schematic diagram of chromaticity correction provided by the present application embodiment, as Figure 6a shown. Compared with 6a1 and 6b1, and compared with 6a2 and 6b2, after chromaticity correction, the color cast problem in some areas of the image is solved.

[0197] S305: Gamma combination.

[0198] To save power consumption, in this embodiment, the adaptive transformation curve is combined with the hardware platform HLG curve to avoid reading and writing the entire image.

[0199] The specific steps are as follows:

[0200] Step C1: Traverse the input x from 0 to 255, and index the corresponding HLG curve output y based on the luminance of the image;

[0201] Step C2: Index the adaptive transformation curve z with y as the reference;

[0202] Step C3: Apply z to y, that is, y = y * z to obtain the mapping result of the adaptive gamma transformation curve.

[0203] Figure 7 FIG. is an optional schematic diagram of the HLG transformation curve based on the image distribution characteristics provided by the present application embodiment, as Figure 7 shown, and this curve can improve the luminance transformation effect of the image.

[0204] In this example, a piecewise function curve is used to enhance the sense of layering in the midtones. In addition, a cumulative histogram can also be used as a mapping curve. For example, a Gamma transformation or a log transformation can be applied to the cumulative histogram, and a required mapping curve can be generated based on the average brightness. In this example, a mask image is used to control the fusion strength of the adaptive curve, and this template can be obtained using AI segmentation technology. This example can be applied not only to Dolby videos but also to Standard Dynamic Range (SDR) scenarios, and only the HLG curve needs to be replaced with an ordinary gamma curve.

[0205] It can be seen that this example combines traditional ISP hardware modules and image feature information to propose a software-hardware combination solution for enhancing the dynamic range of Dolby videos. First, according to the image distribution characteristics, the shadow and highlight intervals to be optimized in the scene are detected. Then, a piecewise function is designed to adaptively generate an LUT curve that enhances the sense of layering in the mid-highlights. To meet the real-time requirements of the video, this solution combines the LUT curve with the ISP hardware gamma module to reduce data reading and writing and lower power consumption. In addition, to correct the color cast that may be caused by the gamma transformation in the RGB domain, a chromaticity correction algorithm based on the RGB data distribution and a chromaticity correction solution based on the 2D LUT module are also designed. Experimental results show that integrating image feature information into the HLG curve can enhance the sense of layering in the highlights for different scenes and increase the transparency of the video.

[0206] Figure 8a A schematic diagram of an optional original image one provided by an embodiment of the present application Figure 1 ; Figure 8b A schematic diagram of an optional original image one provided by an embodiment of the present application Figure 2 ; Compared with 8b1, 8a1, and compared with 8b2, 8a2 can display more image details.

[0207] Figure 9a A schematic diagram of an optional original image two provided by an embodiment of the present application Figure 1 ; Figure 9b A schematic diagram of an optional original image two provided by an embodiment of the present application Figure 2 ; Compared with 9b1, 9a1 can display more image details.

[0208] Figure 10a A schematic diagram of an optional original image three provided by an embodiment of the present application Figure 1 ; Figure 10b A schematic diagram of an optional original image three provided by an embodiment of the present application Figure 2 ; Compared with 10b1, 10a1 can display more image details.

[0209] In this example, a software and hardware combination solution for enhancing the dynamic range of Dolby video is designed. The core idea is to utilize the image distribution characteristics to adaptively enhance the layering in the middle and high brightness intervals and improve the visual effect. Figure 7 The benefits of this example are shown. On the left is the Dolby effect mapped by the original HLG curve on the platform, and on the right is the effect output by this solution. It can be seen that after being processed by the HLG curve, the details in the middle and dark parts are rich and the contrast is good, but the layering of the clouds in the middle and high brightness intervals is poor and relatively foggy. Based on the HLG curve, this example makes an adaptive treatment on the middle and high brightness parts. While retaining the details in the dark parts, it effectively enhances the layering of the middle and high brightness areas such as the clouds, increases the transparency of the picture, and the overall visual effect is good. Therefore, it is verified that this example is an effective solution.

[0210] The embodiment of the present application provides a method for processing an image. According to a preset first brightness correspondence relationship, the brightness of the obtained first image is transformed to obtain a second image. The first image is statistically analyzed to obtain a second brightness correspondence relationship. According to the second brightness correspondence relationship, the brightness of the second image is transformed to obtain an output image; that is to say, in the embodiment of the present application, after the brightness of the obtained first image is transformed according to the preset first brightness correspondence relationship to obtain a second image, the second brightness correspondence relationship obtained by statistically analyzing the first image is also used to transform the brightness of the second image, so that the obtained output image can perform two treatments on the brightness of the first image to make up for the poor effect in some areas after the first brightness treatment. The second brightness correspondence relationship obtained by statistically analyzing the first image can reflect the statistical distribution of the first image. The second brightness correspondence relationship determined based on this is a brightness correspondence relationship related to the statistical distribution of the first image. Then, based on this, the second brightness treatment is realized, which can improve the image effect of the areas with poor effect after the first brightness treatment, thereby improving the image quality of the output image.

[0211] Based on the same inventive concept as the foregoing embodiments, the embodiment of the present application provides an image processing device. Figure 11 For a schematic structural diagram of an optional image processing device provided by the embodiment of the present application, as Figure 11 shown, the image processing device includes: a brightness transformation module 111 and a statistical module 112; wherein,

[0212] The brightness transformation module 111 is configured to transform the brightness of the obtained first image according to a preset first brightness correspondence relationship to obtain a second image;

[0213] The statistical module 112 is configured to statistically analyze the first image to obtain a second brightness correspondence relationship;

[0214] The brightness transformation module 111 is further configured to transform the brightness of the second image according to the second brightness correspondence relationship to obtain an output image.

[0215] In an alternative embodiment, the statistics module 112 is specifically configured to: determine a first brightness image of the first image; perform statistics on the first brightness image to obtain a second brightness correspondence relationship.

[0216] In an alternative embodiment, when the statistics module 112 performs statistics on the first brightness image to obtain a second brightness correspondence relationship, it includes: performing statistics on the first brightness image to obtain a first brightness value and a second brightness value; wherein, the first brightness value is less than the second brightness value; determining the second brightness correspondence relationship according to the first brightness value and the second brightness value.

[0217] In an alternative embodiment, when the statistics module 112 determines the second brightness correspondence relationship according to the first brightness value and the second brightness value, it includes: using the first brightness value and the second brightness value as boundary values of a preset piecewise function to obtain the second brightness correspondence relationship.

[0218] In an alternative embodiment, the apparatus is further configured to: correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again.

[0219] In an alternative embodiment, when the apparatus corrects the second brightness correspondence relationship to obtain the second brightness correspondence relationship again, it includes: determining a mask image of the first brightness image according to the second brightness correspondence relationship; using the mask image to correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again.

[0220] In an alternative embodiment, when the apparatus determines a mask image of the first brightness image according to the second brightness correspondence relationship, it includes: determining a second brightness image corresponding to the first brightness image according to the second brightness correspondence relationship; determining the second brightness image as the mask image.

[0221] In an alternative embodiment, when the apparatus uses the mask image to correct the second brightness correspondence relationship to obtain the second brightness correspondence relationship again, it includes: determining a first weight value of a target input parameter in the second brightness correspondence relationship and a second weight value of a target output parameter in the second brightness correspondence relationship according to a target pixel value of the mask image; using the first weight value and the second weight value to perform weighted summation on the target input parameter and the target output parameter to obtain the target output parameter in the second brightness correspondence relationship again; re - determining the correspondence relationship between the target input parameter and the target output parameter as the second brightness correspondence relationship; wherein, the target pixel value, the target input parameter, and the target output parameter are different parameters corresponding one - to - one on the same image block.

[0222] In an alternative embodiment, the brightness transformation module 111 is disposed in the ISP.

[0223] In an alternative embodiment, the device corrects the second brightness correspondence to obtain the second brightness correspondence again, including: determining a second brightness image corresponding to the first brightness image according to the second brightness correspondence; determining the brightness correspondence of each channel in the first image according to the second brightness image; and re-determining the brightness correspondence of each channel in the first image as the second brightness correspondence.

[0224] In an alternative embodiment, in determining the brightness correspondence of each channel in the first image according to the second brightness image, the device includes: determining the same pixel values of each channel in the first image; determining the brightness values corresponding to the same pixel values from the second brightness image; and determining the correspondence between the same pixel values and the average value of the brightness values corresponding to the same pixel values as the brightness correspondence of each channel in the first image.

[0225] In an alternative embodiment, the device further includes a chromaticity correction module for: determining a chromaticity correction image according to the second brightness correspondence; and correcting the chromaticity of the output image by using the chromaticity correction image.

[0226] In an alternative embodiment, in determining the chromaticity correction image according to the second brightness correspondence, the device includes: determining a third brightness image corresponding to the image of each channel in the first image according to the second brightness correspondence; determining a second brightness image corresponding to the first brightness image of the first image according to the second brightness correspondence; and determining the chromaticity correction image according to the first brightness image, the second brightness image, and the third brightness image.

[0227] In an alternative embodiment, in determining the chromaticity correction image according to the first brightness image, the second brightness image, and the third brightness image, the device includes: determining a ratio image of the second brightness image and the first brightness image; processing the third brightness image by using the ratio image to obtain a fourth brightness image; performing gamut conversion on the third brightness image and the fourth brightness image to obtain a converted third brightness image and a converted fourth brightness image respectively; determining a difference image between the converted third brightness image and the converted fourth brightness image; and determining the difference image as the chromaticity correction image.

[0228] In an alternative embodiment, the chromaticity correction module is disposed in the ISP.

[0229] In an alternative embodiment, the device is further configured to: perform segmentation processing on the acquired original image to obtain a segmentation result; and determine the target image in the segmentation result as the first image.

[0230] In practical applications, the above-mentioned brightness transformation module 111 and statistics module 112 can be implemented by a processor located on an image processing device, specifically implemented by a CPU, a microprocessor (Microprocessor Unit, MPU), a digital signal processor (Digital Signal Processing, DSP), or a field programmable gate array (Field Programmable Gate Array, FPGA), etc.

[0231] An embodiment of the present application provides an ISP. Figure 12 As a schematic structural diagram of an optional ISP provided by an embodiment of the present application, as Figure 12 shown, an embodiment of the present application provides an ISP1200, and the ISP1200 includes:

[0232] A processor 121, configured to call and run a computer program from a memory, so that a device installed with the ISP1200 executes the method described in one or more of the above embodiments.

[0233] A transceiver 122, configured to receive and send information during the process of receiving and sending information between a device and the ISP1200.

[0234] Figure 13 As a schematic structural diagram of an optional electronic device provided by an embodiment of the present application Figure 1 , as Figure 13 shown, an embodiment of the present application provides an electronic device 1300, including:

[0235] The ISP1200, a processor 131, and a storage medium 132 storing executable instructions of the processor; the storage medium 132 depends on the processor 131 to execute operations through a communication bus 133.

[0236] Figure 14 As a schematic structural diagram of an optional electronic device provided by an embodiment of the present application Figure 2 , as Figure 14 shown, an embodiment of the present application provides an electronic device 1400, including:

[0237] A processor 141 and a storage medium 142 storing executable instructions of the processor; the storage medium 142 depends on the processor 141 to execute operations through a communication bus 143. When the instructions are executed by the processor, the image processing method executed on the processor side in one or more of the above embodiments is executed.

[0238] It should be noted that in actual application, each component in the computer device is coupled together through the communication bus 143. It can be understood that the communication bus 143 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 143 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 14 all kinds of buses are labeled as the communication bus 143.

[0239] The embodiment of the present application provides a computer storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the processors execute the image processing method described in the above one or more embodiments.

[0240] Among them, the computer-readable storage medium may be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.

[0241] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories and optical memories, etc.) containing computer-usable program codes.

[0242] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce a means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0243] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0244] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0245] As described above, it is only the preferred embodiment of the present application, and is not used to limit the protection scope of the present application.

Claims

1. A method for processing an image, characterized in that: include: According to a preset first brightness corresponding relationship, the brightness of the acquired first image is transformed to obtain a second image; Performing statistics on the first image to obtain a second brightness correspondence relationship; According to the second brightness correspondence, the brightness of the second image is transformed to obtain an output image.

2. The method according to claim 1, characterized in that: The performing statistics on the first image to obtain a second brightness correspondence relationship includes: determining a first brightness image of the first image; Statistics are performed on the first brightness image to obtain the second brightness corresponding relationship.

3. The method according to claim 2, characterized in that The performing statistics on the first brightness image to obtain the second brightness correspondence includes: Performing statistics on the first brightness image to obtain a first brightness value and a second brightness value; wherein the first brightness value is less than the second brightness value; The second brightness corresponding relationship is determined according to the first brightness value and the second brightness value.

4. The method according to claim 3, characterized in that The determining the second brightness corresponding relationship according to the first brightness value and the second brightness value includes: The first brightness value and the second brightness value are used as boundary values ​​of a preset piecewise function to obtain the second brightness corresponding relationship.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The second brightness correspondence is corrected to obtain the second brightness correspondence again.

6. The method according to claim 5, characterized in that The correcting the second brightness correspondence relationship to regain the second brightness correspondence relationship includes: determining a mask image of the first brightness image according to the second brightness correspondence relationship; The second brightness correspondence is corrected using the mask image to regain the second brightness correspondence.

7. The method according to claim 6, characterized in that The step of determining the mask image of the first brightness image according to the second brightness correspondence relationship includes: Determine, according to the second brightness correspondence, a second brightness image corresponding to the first brightness image; The second brightness image is determined as the mask image.

8. The method according to claim 6, characterized in that The correcting the second brightness correspondence relationship by using the mask image to obtain the second brightness correspondence relationship again includes: Determining, according to the target pixel value of the mask image, a first weight value of a target input parameter in the second brightness correspondence and a second weight value of a target output parameter in the second brightness correspondence; Using the first weight value and the second weight value, weighted sum is performed on the target input parameter and the target output parameter to regain the target output parameter in the second brightness correspondence relationship; Re-determining the correspondence between the target input parameter and the target output parameter as the second brightness correspondence; The target pixel value, the target input parameter and the target output parameter are different parameters corresponding one to one on the same image block.

9. The method according to any one of claims 1 to 4, characterized in that: The method is applied to ISP, and correspondingly, the brightness of the second image is transformed according to the second brightness correspondence to obtain an output image, including: In the brightness transformation module of the ISP, the brightness of the second image is transformed according to the second brightness correspondence to obtain the output image.

10. The method according to claim 5, characterized in that The correcting the second brightness correspondence relationship to regain the second brightness correspondence relationship includes: Determine, according to the second brightness correspondence, a second brightness image corresponding to the first brightness image; Determining a brightness correspondence relationship of each channel in the first image according to the second brightness image; The brightness correspondence of each channel in the first image is re-determined as the second brightness correspondence.

11. The method according to claim 10, characterized in that The step of determining the brightness correspondence of each channel in the first image according to the second brightness image includes: Determining the same pixel value for each channel in the first image; Determining, from the second brightness image, the brightness value corresponding to the same pixel value; The corresponding relationship between the same pixel value and the average value of the brightness value corresponding to the same pixel value is determined as the brightness corresponding relationship of each channel in the first image.

12. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determining a chromaticity-corrected image according to the second brightness correspondence relationship; The chromaticity of the output image is corrected using the chromaticity correction image.

13. The method according to claim 12, characterized in that The step of determining the chromaticity correction image according to the second brightness correspondence relationship includes: Determine, according to the second brightness correspondence, a third brightness image corresponding to the image of each channel in the first image; Determine, according to the second brightness correspondence, a second brightness image corresponding to the first brightness image of the first image; The chromaticity correction image is determined according to the first luminance image, the second luminance image, and the third luminance image.

14. The method according to claim 13, characterized in that The step of determining the chromaticity correction image according to the first luminance image, the second luminance image, and the third luminance image comprises: determining a ratio image of the second brightness image and the first brightness image; Using the ratio image, processing the third brightness image to obtain a fourth brightness image; Performing color gamut conversion on the third brightness image and the fourth brightness image to obtain a converted third brightness image and a converted fourth brightness image respectively; determining a difference image between the converted third brightness image and the converted fourth brightness image; The difference image is used to determine the chromaticity correction image.

15. The method according to claim 12, characterized in that The method is applied to ISP, and correspondingly, the chromaticity of the output image is corrected by using the chromaticity correction image, including: In the chromaticity correction module of the ISP, the chromaticity of the output image is corrected using the chromaticity correction image.

16. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Perform segmentation processing on the acquired original image to obtain a segmentation result; The target image in the segmentation result is determined as the first image.

17. An image processing device, characterized in that: include: A brightness conversion module, used to convert the brightness of the acquired first image according to a preset first brightness corresponding relationship to obtain a second image; A statistical module, used for performing statistics on the first image to obtain a second brightness correspondence relationship; The brightness conversion module is further used to convert the brightness of the second image according to the second brightness corresponding relationship to obtain an output image.

18. An ISP, characterized in that: include: A processor, configured to call and run a computer program from a memory so that a device equipped with the ISP executes the image processing method according to any one of claims 1 to 16; A transceiver is used to send and receive information between a device or an ISP.

19. An electronic device, characterized in that: include: The ISP, the processor, and the storage medium storing instructions executable by the processor as claimed in claim 18; The storage medium executes operations dependent on the processor via a communication bus.

20. An electronic device, characterized in that: include: A processor and a storage medium storing instructions executable by the processor; The storage medium relies on the processor to perform operations through a communication bus, and when the instructions are executed by the processor, the image processing method described in any one of claims 1 to 16 is executed.

21. A computer storage medium, characterized in that Executable instructions are stored, and when the executable instructions are executed by one or more processors, the processors execute the image processing method described in any one of claims 1 to 16.