Method and device for processing high dynamic range images

By acquiring the image information of the HDR image and calculating the reference maximum value, adjusting the dynamic range of the HDR image, the problems of loss of brightness levels and inconspicuous contrast in the prior art are solved, and a better display effect is achieved.

CN114342401BActive Publication Date: 2025-04-25HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080062583.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-10-18
Filing Date
2020-08-06
Publication Date
2025-04-25
Estimated Expiration
2040-08-06

Smart Images

  • Figure CN114342401B_ABST
    Figure CN114342401B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for processing a high dynamic range image, which can improve the display effect of the high dynamic range image. The method includes: obtaining image information of a high dynamic range HDR image to be processed, the HDR image includes multiple pixels, and the image information includes a maximum value of the RGB component of a first pixel corresponding to a first percentage and a maximum value of the RGB component of a second pixel corresponding to a second percentage; determining a reference maximum value of the HDR image according to the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage; determining a maximum brightness correction value of the HDR image according to the reference maximum value and multiple preset grading intervals, the maximum brightness correction value being used to correct the maximum value among the maximum values ​​of the RGB components of the multiple pixels included in the HDR image; and adjusting the dynamic range of the HDR image according to the maximum brightness correction value.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese patent application No. 201910995765.6, filed on October 18, 2019, and entitled “Method and Apparatus for Processing High Dynamic Range Images”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of image processing, and more specifically, to a method and device for processing high dynamic range images. Background Art

[0003] Dynamic Range (DR) is used in many fields to represent the ratio of the maximum and minimum values ​​of a variable. In digital images, the dynamic range represents the ratio between the maximum brightness and the minimum brightness within the displayable range of the image, that is, the number of grayscale levels from the "brightest" to the "darkest" of the image. Its unit is candela per square meter (cd / m2), which can also be expressed as nits. The larger the dynamic range of an image, the richer the brightness levels it can represent, and the more realistic the visual effect of the image. Since the dynamic range of natural scenes in the real world is between 10-3 and 106, the dynamic range is very large, so it is called High Dynamic Range (HDR). Compared with high dynamic range images, the dynamic range of ordinary images is low dynamic range (Low Dynamic Range, LDR).

[0004] At present, display devices with a dynamic range of less than 0.1 to 400 nits are generally called standard dynamic range (SDR) display devices; those with a dynamic range of more than 0.01 to 540 nits are called high dynamic range (HDR) display devices. Different high dynamic range display devices have different display dynamic ranges, such as 0.01 to 540 nits high dynamic range display devices, 0.005 to 1000 nits high dynamic range display devices, etc. In order to make HDR images adapt to HDR display devices with different dynamic ranges, it is necessary to adjust the dynamic range of HDR images (compress or stretch) to adjust the high dynamic range of HDR images to the display capability range of the display device for display.

[0005] In the prior art, the adjustment of the dynamic range of HDR images is only related to parameters such as the maximum brightness and minimum brightness of the image display content, the maximum brightness value and the minimum brightness value that the display device can display, etc. Using only these parameters will result in a large loss of brightness levels in the HDR image, unclear brightness contrast, and poor display effect of the adjusted HDR image on the display device. Summary of the invention

[0006] The embodiments of the present application provide a method and device for processing HDR images, which can improve the display effect of HDR images.

[0007] In a first aspect, an embodiment of the present application provides a method for processing a high dynamic range image, the method comprising:

[0008] Acquire image information of a high dynamic range HDR image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a first percentage, a maximum RGB component value of a first pixel corresponding to the first percentage, a second percentage, and a maximum RGB component value of a second pixel corresponding to the second percentage, the first percentage indicating the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel among the plurality of pixels, the second percentage indicating the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among the plurality of pixels, the maximum RGB component value indicating the maximum value among an R component, a G component, and a B component of a pixel, and the first percentage and the second percentage being both greater than 0 and less than 1;

[0009] Determine a reference maximum value of the HDR image according to the first percentage, the maximum value of the RGB components of the first pixel corresponding to the first percentage, the second percentage, and the maximum value of the RGB components of the second pixel corresponding to the second percentage;

[0010] Determine a corrected maximum value of the HDR image according to the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value, and the corrected maximum value is used to correct a maximum value among the maximum values ​​of the RGB components of the plurality of pixels included in the HDR image;

[0011] The dynamic range of the HDR image is adjusted according to the corrected maximum value of the HDR image.

[0012] In the method for processing an HDR image provided by the embodiment of the present application, since the maximum value of the RGB component of the first pixel and the maximum value of the RGB component of the second pixel are not the maximum brightness of the display content of the HDR image or the minimum brightness of the display content, the reference maximum values ​​obtained based on the above pixels are graded, and the corrected maximum value of the HDR image is calculated based on the reference maximum value, which can improve the grading accuracy of HDR images with different levels of dynamic range. Therefore, applying the corrected maximum value to the adjustment of the dynamic range of the HDR image can improve the display effect of the HDR image.

[0013] Optionally, the above method can be executed by an image processing device.

[0014] Optionally, the first percentage may be a first ratio, and the second percentage may be a second ratio.

[0015] As an optional embodiment, taking an HDR image including 4 pixels as an example, the maximum value of the RGB component of the first pixel is 80, the maximum value of the RGB component of the second pixel is 30, the maximum value of the RGB component of the third pixel is 60, and the maximum value of the fourth RGB component is 55, then 25% corresponds to the second pixel, 50% corresponds to the fourth pixel, 75% corresponds to the third pixel, and 100 corresponds to the first pixel.

[0016] That is to say, among the 4 pixels, the pixel whose maximum value of the RGB component is less than or equal to 30 (the 2nd pixel) accounts for 25% of the 4 pixels, the pixels whose maximum value of the RGB component is less than or equal to 55 (the 2nd and 4th pixels) account for 50% of the 4 pixels, the pixels whose maximum value of the RGB component is less than or equal to 60 (the 2nd, 4th and 3rd pixels) account for 75% of the 4 pixels, and the pixels whose maximum value of the RGB component is less than or equal to 80 (the 2nd, 4th, 3rd and 1st pixels) account for 100% of the 4 pixels.

[0017] It should be noted that the multiple pixels included in the above-mentioned HDR image can be understood as the multiple pixels included in the effective display area of ​​the HDR image, and the effective display area can be a partial area or the entire area of ​​the HDR image.

[0018] For example, the effective display area of ​​the HDR image may be a rectangular area determined by a display horizontal size and a display vertical size.

[0019] Optionally, the image processing device may obtain image information of the HDR image in a variety of ways, which is not limited in the embodiments of the present application.

[0020] In a possible implementation, the image processing device may calculate the HDR image using an existing method to obtain the image information.

[0021] In another possible implementation manner, the image processing device may obtain the image information through metadata carried by the HDR image.

[0022] Optionally, the image processing device may determine the reference maximum value of the HDR image in a variety of ways based on the first percentage, the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage, and the maximum value of the RGB component of the second pixel corresponding to the second percentage. This is not limited to the embodiments of the present application.

[0023] In a possible implementation, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and determining the reference maximum value of the HDR image based on the first percentage, the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage, and the maximum value of the RGB component of the second pixel corresponding to the second percentage includes: determining the reference maximum value based on the first percentage, the maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the RGB component maximum values ​​of the multiple pixels, and the average of the maximum values ​​of the RGB component of the multiple pixels.

[0024] In a possible implementation manner, the reference maximum value MAX may be determined by the following formula:

[0025]

[0026] in, The maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the average_maxrgb represents the average value among the maximum values ​​of the RGB components of the multiple pixels, the K1 represents the first percentage, and the represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, represents the maximum value of the RGB components of the second pixel, F() represents a preset function, B, K1 and K2 are preset values, 0 <B<1,K1-K2≥0.5,0<K1<1,0<K2<1。

[0027] Optionally, the above F() function may be a constant function or an increasing function, which is not limited in the embodiment of the present application.

[0028] For example, F(x) = x, or F(x) = x N , or F(x)=logx, or F(x)=ax+b, where a and b are constants.

[0029] In the method for processing an HDR image provided by an embodiment of the present application, maximum_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%, 2×average_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%, K1-K2≥0.5 is the maximum value of the RGB component of the pixel corresponding to more than 50%, and by setting different weights for these three dimensions, the final reference maximum value is obtained, and the maximum value of the maximum values ​​of the RGB components of the HDR image is finally adjusted according to the reference maximum value, which can avoid the situation in the prior art where the adjusted image is too dark when the maximum brightness adjustment is used.

[0030] In a possible implementation manner, the reference maximum value MAX may be determined by the following formula:

[0031]

[0032] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。

[0033] Using the method for processing HDR images provided in an embodiment of the present application, since the above-mentioned PK1 and PK2 are two pixels in the HDR image except for the maximum brightness and minimum brightness of the display content, the reference maximum value is calculated through these two pixels, and the maximum value of the RGB component maximum values ​​of the HDR image is finally adjusted according to the reference maximum value, which can avoid the situation in the prior art where the adjusted image is too dark when the maximum brightness adjustment is used.

[0034] In a possible implementation, each grading interval corresponds to an expression, and the expression is used to calculate the corrected maximum value of the HDR. Determining the corrected maximum value of the HDR image based on the reference maximum value and a plurality of preset grading intervals includes: determining a first grading interval to which the reference maximum value belongs from the plurality of grading intervals, the first grading interval corresponding to a first expression; and determining the corrected maximum value based on the first expression.

[0035] In a possible implementation, the modified maximum value maximum_maxrgb1 of the HDR image may be determined by the following formula:

[0036]

[0037] Wherein, the MaxRefDisplay represents the maximum display brightness of the display device for displaying the HDR image to be processed, the MIN represents a preset grading threshold, and the MAX represents the reference maximum value.

[0038] In a possible implementation, the corrected maximum value maximum_maxrgb1 of the HDR image can be determined by the following formula:

[0039]

[0040] Wherein, the maximux_maxrgb represents the maximum value among the RGB component maximum values of the multiple pixels, the MAX represents the reference maximum value, the A represents a preset grading threshold, min() represents the operation of taking the minimum value, and f() represents a non-linear function or a linear function.

[0041] In a possible implementation, the method further includes: verifying the accuracy of the corrected maximum value according to the third percentage, the RGB component maximum value of the third pixel corresponding to the third percentage in the HDR image, the GRB component maximum value of the fourth pixel corresponding to the third percentage in the processed image, the fourth percentage, the RGB component maximum value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the GRB component maximum value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, where the processed image is the image after the dynamic range of the HDR image is adjusted.

[0042] It should be noted that the accuracy of the corrected maximum value can also be understood as the grading accuracy of the HDR image.

[0043] In a possible implementation, the verifying the accuracy of the corrected maximum value according to the third percentage, the RGB component maximum value of the third pixel corresponding to the third percentage in the HDR image, the GRB component maximum value of the fourth pixel corresponding to the third percentage in the output image, the fourth percentage, the RGB component maximum value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the GRB component maximum value of the sixth pixel corresponding to the fourth percentage in the output HDR image includes:

[0044] When And Then, it is determined that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, the K3 represents the third percentage, and the Represents the RGB component maximum value of the third pixel, represents the maximum value of the RGB component of the fourth pixel, K4 represents the fourth percentage, represents the maximum value of the RGB components of the fifth pixel, Represents the maximum value of the RGB components of the sixth pixel.

[0045] In a second aspect, an embodiment of the present application further provides an image processing method, the method comprising:

[0046] Acquire image information of an image to be processed, the image to be processed comprising a plurality of pixels, the image information comprising a first ratio, a first RGB component maximum value, a second ratio, and a second RGB component maximum value, the first ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the first RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the second ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the second RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the RGB component maximum value representing a maximum value of one of the R component, the G component, and the B component of a pixel;

[0047] Determine a reference maximum value of the image to be processed according to the first ratio, the maximum value of the first RGB component, the second ratio, and the maximum value of the second RGB component;

[0048] According to the reference maximum value and a plurality of preset grading intervals, adjusting the maximum value among the maximum values ​​of the RGB components of the plurality of pixels to determine a corrected maximum value of the image to be processed, wherein each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value;

[0049] The dynamic range of the image to be processed is adjusted according to the corrected maximum value of the image to be processed.

[0050] In a possible implementation, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and determining the reference maximum value of the image to be processed based on the first ratio, the first RGB component maximum value, the second ratio and the second RGB component maximum value includes: determining the reference maximum value based on the first ratio, the first RGB component maximum value, the second ratio and the second RGB component maximum value, the maximum value among the RGB component maximum values ​​of the multiple pixels, and the average of the RGB component maximum values ​​of the multiple pixels.

[0051] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0052]

[0053] in, The maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, the K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, represents the maximum value of the second RGB component, F() represents a preset function, B, K1 and K2 are preset values, 0 <B<1,K1-K2≥0.5,0<K1<1,0<K2<1。

[0054] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0055]

[0056] Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component. A, K1 and K2 are preset values. 0 <A<1,0<K1<1,0<K2<1。

[0057] In a possible implementation, each of the grading intervals corresponds to an expression, and the expression is used to calculate the corrected maximum value of the image to be processed. The corrected maximum value maximum_maxrgb1 of the image to be processed is determined by the following formula:

[0058]

[0059] Wherein, the MaxRefDisplay represents the maximum display brightness of the display device used to display the image to be processed, the MIN represents a preset grading threshold, and the MAX represents the reference maximum value.

[0060] In a possible implementation, the method further includes: verifying the accuracy of the corrected maximum value according to a third ratio, a third maximum RGB component value, a fourth maximum GRB component value, a fourth ratio, a fifth maximum RGB component value, and a sixth maximum GRB component value, where the third ratio represents the ratio of the number of pixels among the multiple pixels whose maximum RGB component value is less than or equal to the third maximum RGB component value to the number of the multiple pixels, the fourth maximum GRB component value satisfies that the ratio of the number of pixels among the pixels of the processed image whose maximum RGB component value is less than or equal to the fourth maximum RGB component value to the number of the pixels of the processed image is the third ratio, the fourth ratio represents the ratio of the number of pixels among the multiple pixels whose maximum RGB component value is less than or equal to the fifth maximum RGB component value to the number of the multiple pixels, the sixth maximum GRB component value satisfies that the ratio of the number of pixels among the pixels of the processed image whose maximum RGB component value is less than or equal to the sixth maximum RGB component value to the number of the pixels of the processed image is the fourth ratio, and the processed image is the image obtained by performing dynamic range adjustment on the image to be processed.

[0061] In a possible implementation, the verifying the accuracy of the corrected maximum value according to a third ratio, a third maximum RGB component value, a fourth maximum GRB component value, a fourth ratio, a fifth maximum RGB component value, and a sixth maximum GRB component value includes:

[0062] When and , it is determined that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third ratio, the represents the third maximum RGB component value, P′ K3 represents the fourth maximum RGB component value, K4 represents the fourth ratio, the represents the fifth maximum RGB component value, represents the sixth maximum GRB component value.

[0063] In a possible implementation, the method further includes at least one of the following steps:

[0064] Determining the first maximum RGB component value according to the first ratio and the multiple pixels;

[0065] Determining the second maximum RGB component value according to the second ratio and the multiple pixels;

[0066] Determining the third maximum RGB component value according to the third ratio and the multiple pixels;

[0067] Determining the maximum value of the fourth RGB component according to the third ratio and the pixels of the processed image;

[0068] Determine the maximum value of the fifth RGB component according to the fourth ratio and the plurality of pixels; or,

[0069] The sixth RGB component maximum value is determined according to the fourth ratio and the pixels of the processed image.

[0070] In a third aspect, an embodiment of the present application further provides a device for processing a high dynamic range image, the device comprising:

[0071] an acquisition unit, configured to acquire image information of a high dynamic range (HDR) image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a first percentage, a maximum RGB component value of a first pixel corresponding to the first percentage, a second percentage, and a maximum RGB component value of a second pixel corresponding to the second percentage, the first percentage indicating a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to a maximum RGB component value of the first pixel, the second percentage indicating a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to a maximum RGB component value of the second pixel, the maximum RGB component value indicating a maximum value among an R component, a G component, and a B component of a pixel, and the first percentage and the second percentage being both greater than 0 and less than 1;

[0072] a determining unit, configured to determine a reference maximum value of the HDR image according to the first percentage, a maximum value of the RGB components of a first pixel corresponding to the first percentage, the second percentage, and a maximum value of the RGB components of a second pixel corresponding to the second percentage; and to determine a corrected maximum value of the HDR image according to the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the corrected maximum value is used to correct a maximum value among the maximum values ​​of the RGB components of the plurality of pixels included in the HDR image;

[0073] An adjustment unit is used to adjust the dynamic range of the HDR image according to the corrected maximum value of the HDR image.

[0074] In a possible implementation, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and the determination unit is specifically used to determine the reference maximum value based on the first percentage, the maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the RGB component of the multiple pixels, and the average of the maximum values ​​of the RGB component of the multiple pixels.

[0075] In a possible implementation manner, the determining unit is specifically configured to: determine the reference maximum value MAX by using the following formula:

[0076]

[0077] in, The maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the average_maxrgb represents the average value among the maximum values ​​of the RGB components of the multiple pixels, the K1 represents the first percentage, and the represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, represents the maximum value of the RGB components of the second pixel, F() represents a preset function, B, K1 and K2 are preset values, 0 <B<1,K1-K2≥0.5,0<K1<1,0<K2<1。

[0078] In a possible implementation manner, the determining unit is specifically configured to: determine the reference maximum value MAX by using the following formula:

[0079]

[0080] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。

[0081] In a possible implementation, each grading interval corresponds to an expression, and the expression is used to calculate the corrected maximum value of the HDR. The determination unit is specifically used to: determine a first grading interval to which the reference maximum value belongs from the multiple grading intervals, and the first grading interval corresponds to a first expression; and determine the corrected maximum value according to the first expression.

[0082] In a possible implementation, the determining unit is specifically configured to: determine a corrected maximum value maximum_maxrgb1 of the HDR image through the following formula:

[0083]

[0084] wherein, the MaxRefDisplay represents the maximum display brightness of the display device for displaying the to-be-processed HDR image, the MIN represents a preset grading threshold, and the MAX represents the reference maximum value.

[0085] In a possible implementation, the apparatus further includes: a verification unit, configured to verify the accuracy of the corrected maximum value according to a third percentage, the maximum value of the RGB components of the third pixel corresponding to the third percentage in the HDR image, the maximum value of the GRB components of the fourth pixel corresponding to the third percentage in the output image, a fourth percentage, the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum value of the GRB components of the sixth pixel corresponding to the fourth percentage in the output HDR image, where the output image is an image obtained by performing dynamic range adjustment on the HDR image.

[0086] In a possible implementation, the verification unit is specifically configured to:

[0087] When and , determine that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, the represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, K4 represents the fourth percentage, the represents the maximum value of the RGB components of the fifth pixel, represents the maximum value of the RGB components of the sixth pixel.

[0088] Fourthly, an embodiment of the present application further provides an image processing apparatus, where the apparatus includes:

[0089] an acquisition unit, configured to acquire image information of an image to be processed, the image to be processed comprising a plurality of pixels, the image information comprising a first ratio, a first RGB component maximum value, a second ratio, and a second RGB component maximum value, the first ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the first RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the second ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the second RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the RGB component maximum value representing a maximum value of one of the R component, the G component, and the B component of a pixel;

[0090] a determining unit, configured to determine a reference maximum value of the image to be processed according to the first ratio, the first RGB component maximum value, the second ratio, and the second RGB component maximum value; and to adjust a maximum value among the RGB component maximum values ​​of the multiple pixels according to the reference maximum value and a plurality of preset grading intervals to determine a corrected maximum value of the image to be processed, wherein each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value;

[0091] An adjustment unit is used to adjust the dynamic range of the image to be processed according to the corrected maximum value of the image to be processed.

[0092] In a possible implementation, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and the determination unit is specifically used to determine the reference maximum value based on the first ratio, the first RGB component maximum value, the second ratio and the second RGB component maximum value, the maximum value among the RGB component maximum values ​​of the multiple pixels, and the average of the RGB component maximum values ​​of the multiple pixels.

[0093] In a possible implementation manner, the determining unit is specifically configured to determine the reference maximum value MAX by using the following formula:

[0094]

[0095] in, The maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, the K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, represents the maximum value of the second RGB component, F() represents a preset function, B, K1 and K2 are preset values, 0 <B<1,K1-K2≥0.5,0<K1<1,0<K2<1。

[0096] In a possible implementation manner, the determining unit is specifically configured to determine the reference maximum value MAX by using the following formula:

[0097]

[0098] Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component. A, K1 and K2 are preset values. 0 <A<1,0<K1<1,0<K2<1。

[0099] In a possible implementation, each of the grading intervals corresponds to an expression, and the expression is used to calculate the corrected maximum value of the image to be processed. The determination unit is specifically used to determine the corrected maximum value maximum_maxrgb1 of the image to be processed by the following formula:

[0100]

[0101] Wherein, the MaxRefDisplay represents the maximum display brightness of the display device used to display the image to be processed, the MIN represents a preset grading threshold, and the MAX represents the reference maximum value.

[0102] In a possible implementation, the device further includes a verification unit, and the verification unit is configured to: verify the accuracy of the corrected maximum value according to a third ratio, a third maximum RGB component value, a fourth maximum GRB component value, a fourth ratio, a fifth maximum RGB component value, and a sixth maximum GRB component value, where the third ratio represents the ratio of the number of pixels among the multiple pixels whose maximum RGB component value is less than or equal to the third maximum RGB component value to the number of the multiple pixels, the fourth maximum GRB component value satisfies that the ratio of the number of pixels among the pixels of the processed image whose maximum RGB component value is less than or equal to the fourth maximum RGB component value to the number of the pixels of the processed image is the third ratio, the fourth ratio represents the ratio of the number of pixels among the multiple pixels whose maximum RGB component value is less than or equal to the fifth maximum RGB component value to the number of the multiple pixels, the sixth maximum GRB component value satisfies that the ratio of the number of pixels among the pixels of the processed image whose maximum RGB component value is less than or equal to the sixth maximum RGB component value to the number of the pixels of the processed image is the fourth ratio, and the processed image is the image obtained by performing dynamic range adjustment on the image to be processed.

[0103] In a possible implementation, the verification unit is specifically configured to:

[0104] When and then, it is determined that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third ratio, the represents the third maximum RGB component value, P′ K3 represents the fourth maximum RGB component value, K4 represents the fourth ratio, the represents the fifth maximum RGB component value, represents the sixth maximum RGB component value.

[0105] In a possible implementation, the determination unit is further configured to perform at least one of the following steps:

[0106] Determine the first maximum RGB component value according to the first ratio and the multiple pixels;

[0107] Determine the second maximum RGB component value according to the second ratio and the multiple pixels;

[0108] Determine the third maximum RGB component value according to the third ratio and the multiple pixels;

[0109] Determine the fourth maximum RGB component value according to the third ratio and the pixels of the processed image;

[0110] Determine the maximum value of the fifth RGB component according to the fourth ratio and the plurality of pixels; or,

[0111] The sixth RGB component maximum value is determined according to the fourth ratio and the pixels of the processed image.

[0112] In a fifth aspect, an embodiment of the present application further provides a method for processing a high dynamic range image, the method comprising: obtaining image information of a high dynamic range HDR image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a maximum RGB component value of a first pixel corresponding to a first percentage and a maximum RGB component value of a second pixel corresponding to a second percentage, the first percentage representing the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage representing the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the maximum RGB component value The value represents the maximum value among the R component, the G component and the B component of the pixel, and the first percentage and the second percentage are both greater than 0 and less than 1; according to the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage, a reference maximum value of the HDR image is determined; according to the reference maximum value and a plurality of preset grading intervals, a maximum brightness correction value of the HDR image is determined, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct the maximum value among the maximum values ​​of the RGB components of the plurality of pixels included in the HDR image;

[0113] The dynamic range of the HDR image is adjusted according to the maximum brightness correction value.

[0114] In a possible implementation, the first percentage is greater than the second percentage, and determining the reference maximum value of the HDR image according to the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage includes: determining the difference between the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage as the brightness variation range of the HDR image; and determining the reference maximum value according to the brightness variation range.

[0115] In a possible implementation, the brightness variation range variance_maxrgb is determined by the following formula:

[0116]

[0117] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB component of the second pixel, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。

[0118] In a possible implementation, the image information also includes a maximum value among the maximum values ​​of the RGB components of the multiple pixels and an average value of the maximum values ​​of the RGB components of the multiple pixels, and determining the reference maximum value based on the brightness variation range includes: determining the reference maximum value based on the brightness variation range, the maximum value among the maximum values ​​of the RGB components of the multiple pixels, and the average value of the maximum values ​​of the RGB components of the multiple pixels.

[0119] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0120] MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb,

[0121] in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

[0122] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0123]

[0124] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。

[0125] In a possible implementation, each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. Determining the maximum brightness correction value of the HDR image based on the reference maximum value and a plurality of preset grading intervals includes: determining a first grading interval to which the reference maximum value belongs from the plurality of grading intervals, the first grading interval corresponding to a first expression; and determining the maximum brightness correction value based on the first expression.

[0126] In a possible implementation, the maximum brightness correction value maximum_maxrgb1 of the HDR image is determined by the following formula:

[0127]

[0128] Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the HDR image is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

[0129] In a possible implementation, the method further includes: if the maximum brightness correction value is less than the maximum display brightness of the current display device applicable after the dynamic range of the HDR image is adjusted, updating the maximum brightness correction value maximum_maxrgb1 to the maximum display brightness of the current display device.

[0130] In a possible implementation, the method further includes: verifying the accuracy of the maximum brightness correction value based on the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum GRB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum GRB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, the processed image being an image after the dynamic range of the HDR image is adjusted.

[0131] In a possible implementation, verifying the accuracy of the corrected maximum value according to the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum GRB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum GRB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, includes: when and When it is determined that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, and K4 represents the fourth percentage, represents the maximum value of the RGB components of the fifth pixel, represents the maximum value of the RGB components of the sixth pixel.

[0132] In a sixth aspect, an embodiment of the present application further provides an image processing method. The method includes: obtaining image information of an image to be processed, where the image to be processed includes multiple pixels, and the image information includes a first maximum value of RGB components corresponding to a first ratio and a second maximum value of RGB components corresponding to a second ratio. The first ratio represents the ratio of the number of pixels among the multiple pixels whose maximum value of RGB components is less than or equal to the first maximum value of RGB components to the number of the multiple pixels, and the second ratio represents the ratio of the number of pixels among the multiple pixels whose maximum value of RGB components is less than or equal to the second maximum value of RGB components to the number of the multiple pixels. The maximum value of the RGB components represents the maximum value among the R component, G component, and B component of a pixel; determining a reference maximum value of the image to be processed according to the first maximum value of RGB components corresponding to the first ratio and the second maximum value of RGB components corresponding to the second ratio; adjusting the maximum value among the maximum values of the RGB components of the multiple pixels according to the reference maximum value and a preset plurality of grading intervals to determine a maximum brightness correction value of the image to be processed, where each grading interval among the plurality of grading intervals corresponds to a value range of the reference maximum value; and adjusting the dynamic range of the image to be processed according to the maximum brightness correction value.

[0133] In a possible implementation manner, the first ratio is greater than the second ratio. The determining the reference maximum value of the image to be processed according to the first maximum value of RGB components corresponding to the first ratio and the second maximum value of RGB components corresponding to the second ratio includes: determining the difference between the first maximum value of RGB components corresponding to the first ratio and the second maximum value of RGB components corresponding to the second ratio as the brightness change range of the image to be processed; and determining the reference maximum value according to the brightness change range.

[0134] In a possible implementation manner, the brightness change range variance_maxrgb is determined by the following formula:

[0135]

[0136] Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。

[0137] In a possible implementation, the image information also includes a maximum value among the maximum values ​​of the RGB components of the multiple pixels and an average value of the maximum values ​​of the RGB components of the multiple pixels, and determining the reference maximum value based on the brightness variation range includes: determining the reference maximum value based on the brightness variation range, the maximum value among the maximum values ​​of the RGB components of the multiple pixels, and the average value of the maximum values ​​of the RGB components of the multiple pixels.

[0138] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0139] MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb,

[0140] in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

[0141] In a possible implementation manner, the reference maximum value MAX is determined by the following formula:

[0142]

[0143] Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component. A, K1 and K2 are preset values. 0 <A<1,0<K1<1,0<K2<1。

[0144] In a possible implementation, each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. The maximum brightness correction value maximum_maxrgb1 is determined by the following formula:

[0145]

[0146] Wherein, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range adjustment of the image to be processed, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

[0147] In a possible implementation, the method further includes: when the maximum brightness correction value is less than the maximum display brightness of the current display device applicable after the dynamic range adjustment of the image to be processed, changing the maximum brightness correction value maximum_maxrgb1 to the maximum display brightness of the current display device.

[0148] In a possible implementation, the method further includes: verifying the accuracy of the maximum brightness correction value according to the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth GRB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio, and the maximum value of the sixth GRB component corresponding to the fourth ratio, where the third ratio represents the ratio of the number of pixels in the plurality of pixels whose maximum RGB component value is less than or equal to the maximum value of the third RGB component to the number of the plurality of pixels, the maximum value of the fourth GRB component satisfies that the ratio of the number of pixels in the processed image whose maximum RGB component value is less than or equal to the maximum value of the fourth RGB component to the number of pixels in the processed image is the third ratio, the fourth ratio represents the ratio of the number of pixels in the plurality of pixels whose maximum RGB component value is less than or equal to the maximum value of the fifth RGB component to the number of the plurality of pixels, the maximum value of the sixth GRB component satisfies that the ratio of the number of pixels in the processed image whose maximum RGB component value is less than or equal to the maximum value of the sixth RGB component to the number of pixels in the processed image is the fourth ratio, and the processed image is the image obtained by adjusting the dynamic range of the image to be processed.

[0149] In a possible implementation, the verifying the accuracy of the maximum brightness correction value according to the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth GRB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio, and the maximum value of the sixth GRB component corresponding to the fourth ratio includes:

[0150] When And At this time, it is determined that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third ratio, Represents the maximum value of the third RGB component, P′ K3 Represents the maximum value of the fourth RGB component, K4 represents the fourth ratio, represents the maximum value of the fifth RGB component, Indicates the maximum value of the sixth RGB component.

[0151] In a possible implementation, the method further includes at least one of the following steps: determining the maximum value of the first RGB component based on the first ratio and the multiple pixels; determining the maximum value of the second RGB component based on the second ratio and the multiple pixels; determining the maximum value of the third RGB component based on the third ratio and the multiple pixels; determining the maximum value of the fourth RGB component based on the third ratio and the pixels of the processed image; determining the maximum value of the fifth RGB component based on the fourth ratio and the multiple pixels; or determining the maximum value of the sixth RGB component based on the fourth ratio and the pixels of the processed image.

[0152] In a seventh aspect, an embodiment of the present application further provides an image processing device, the device being used to execute the method described in the fifth aspect or various possible implementations of the fifth aspect. Optionally, the device may include a unit for executing the method described in the fifth aspect or various possible implementations of the fifth aspect.

[0153] In an eighth aspect, an embodiment of the present application further provides an image processing device, the device being used to execute the method described in the sixth aspect or various possible implementations of the sixth aspect. Optionally, the device may include a unit for executing the method described in the sixth aspect or various possible implementations of the sixth aspect.

[0154] In a ninth aspect, an embodiment of the present application further provides an image processing device, the device comprising a processor and a memory, the processor and the memory being coupled, the processor being used to enable the device to execute the methods described in the above aspects or various possible implementation methods of each aspect.

[0155] In the tenth aspect, an embodiment of the present application also provides a chip device, comprising: an input interface, an output interface, at least one processor, and a memory, wherein the input interface, the output interface, the processor, and the memory communicate with each other through an internal connection path, and the processor is used to execute the code in the memory. It is characterized in that when the processor executes the code, the chip device implements the methods described in the above aspects or various possible implementation methods of each aspect.

[0156] In an eleventh aspect, the present application provides a computer-readable storage medium for storing a computer program, characterized in that the computer program includes instructions for implementing the methods described in the above aspects or various possible implementation methods of each aspect.

[0157] In a twelfth aspect, the present application provides a computer program product, which includes instructions, characterized in that when the instructions are executed on a computer, the computer implements the methods described in the above aspects or various possible implementations of the aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0158] Figure 1 This is the image of the PQ photoelectric transfer function.

[0159] Figure 2 This is the image of the HLG photoelectric transfer function.

[0160] Figure 3 This is the image of the SLF photoelectric transfer function.

[0161] Figure 4 A schematic diagram of a dynamic range adjustment curve for a high dynamic range image provided in an embodiment of the present application.

[0162] Figure 5 This is an application scenario of image processing provided in the embodiments of the present application.

[0163] Figure 6 A schematic diagram of a method 100 for processing a high dynamic range image provided in an embodiment of the present application.

[0164] Figure 7 A schematic diagram of an image processing device 200 provided in an embodiment of the present application.

[0165] Figure 8 A schematic diagram of an image processing device 300 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0166] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0167] First, a brief introduction is given to the relevant concepts and technologies involved in the embodiments of the present application.

[0168] Dynamic Range is used in many fields to express the ratio of the maximum value to the minimum value of a variable. In digital images, the dynamic range represents the ratio between the maximum brightness value and the minimum brightness value within the displayable range of the image. The dynamic range in nature is very large. For example, the brightness of a night scene under the starry sky is about 0.001cd / m 2 The sun itself has a brightness of 1,000,000,000 cd / m 2 Among them, cd / m 2 (Candela per square meter) is the SI derived unit for measuring brightness. Thus, the dynamic range of nature reaches 1000,000,000 / 0.001=1013 order of magnitude.

[0169] However, in real scenes in nature, the brightness of the sun and the brightness of the stars are not obtained at the same time. For natural scenes in the real world, the dynamic range is 10 -3 to 10 6 Since this is a very large dynamic range, we usually call it High Dynamic Range (HDR). Compared with the high dynamic range, the dynamic range on ordinary pictures is called Low Dynamic Range (LDR). From this, we can understand that the imaging process of a digital camera is actually a mapping from the high dynamic range of the real world to the low dynamic range of the photo.

[0170] The larger the dynamic range of an image, the more scene details the image displays, the richer the brightness levels, and the more realistic the visual effect. Traditional digital images generally use one byte, that is, 8 bits of space to store a pixel value, while high dynamic range uses floating point numbers with multiple bytes to store a pixel value, so it can represent the high dynamic range of natural scenes.

[0171] The process of optical digital imaging (for example, the imaging process of a digital camera) is to convert the light radiation of a real scene into an electrical signal through an image sensor and save it in the form of a digital image. The purpose of image display is to reproduce the real scene described by a digital image through a display device. The ultimate goal of both is to enable users to obtain the same visual perception as they directly observe the real scene.

[0172] The brightness level of the real scene that can be displayed by light radiation (light signal) is almost linear, so the light signal is also called a linear signal. However, in the process of converting light signals into electrical signals in optical digital imaging, not every light signal corresponds to an electrical signal, and the converted electrical signal is nonlinear. Therefore, the electrical signal is also called a nonlinear signal.

[0173] Optical Electro Transfer Function (OETF) represents the conversion relationship between linear signals and nonlinear signals of image pixels. With the continuous upgrading of display devices, the dynamic range that can be displayed by current display devices is increasing compared with traditional display devices. The existing consumer-grade HDR display can reach 600cd / m 2 , high-end HDR displays can reach 2000cd / m 2, which has far exceeded the display range of traditional SDR display devices. Therefore, the optoelectronic transfer function adapted to traditional SDR display devices in the International Telecommunications Union-RadioCommunications Sector (ITU-R) BT.1886 standard protocol can no longer well express the display performance of current HDR display devices. Therefore, it is necessary to improve the optoelectronic transfer function to adapt to the upgrade of HDR display devices.

[0174] In the embodiment of the present application, there are mainly three types of HDR optoelectronic transfer functions OETF: Perceptual Quantizer (PQ) optoelectronic transfer function, Hybrid Log-Gamma (HLG) optoelectronic transfer function and Scene Luminance Fidelity (SLF) optoelectronic transfer function. These three optoelectronic transfer functions are optoelectronic transfer functions specified by the Audio Video Coding Standard (AVS).

[0175] The PQ photoelectric transfer function is a perceptual quantization photoelectric transfer function proposed based on the brightness perception model of the human eye. Figure 1 , Figure 1 This is the image of the PQ photoelectric transfer function.

[0176] The PQ photoelectric transfer function represents the conversion relationship between the linear signal value of the image pixel and the nonlinear signal value in the PQ domain. The PQ photoelectric transfer function can be expressed as formula (1):

[0177]

[0178] The calculation of each parameter in formula (1) is as follows:

[0179]

[0180] Wherein, L represents the linear signal value, and its value is normalized to [0, 1]; L' represents the nonlinear signal value, and its value range is [0, 1]; m1, m2, c1, c2, and c3 are PQ photoelectric transfer coefficients.

[0181] The HLG photoelectric transfer function is improved based on the traditional Gamma curve. Figure 2 , Figure 2 This is the image of the HLG photoelectric transfer function.

[0182] The HLG photoelectric transfer function uses the traditional Gamma curve in the low segment and supplements the log curve in the high segment. The HLG photoelectric transfer function represents the conversion relationship from the linear signal value of the image pixel to the nonlinear signal value of the HLG domain. The HLG photoelectric transfer function can be expressed as formula (2):

[0183]

[0184] Wherein, L represents the linear signal value, and its value range is [0, 12], L' represents the nonlinear signal value, and its value range is [0, 1], a, b, c are HLG photoelectric transfer coefficients, a = 0.17883277, b = 0.28466892, c = 0.55991073.

[0185] The SLF photoelectric transfer function is the optimal curve obtained based on the brightness distribution of the HDR scene while satisfying the optical characteristics of the human eye. Figure 3 , Figure 3 This is the image of the SLF photoelectric transfer function.

[0186] The SLF photoelectric transfer curve represents the conversion relationship between the linear signal value of the image pixel and the nonlinear signal value in the SLF domain. The conversion relationship between the linear signal value of the image pixel and the nonlinear signal value in the SLF domain is shown in formula (3):

[0187]

[0188] Among them, the SLF photoelectric transfer function can be expressed as formula (4):

[0189]

[0190] Wherein, L represents the linear signal value, and its value is normalized to [0,1]; L' represents the nonlinear signal value, and its value range is [0,1]; p, m, a, and b are SLF photoelectric transfer coefficients, p = 2.3, m = 0.14, a = 1.12762, and b = -0.12762.

[0191] Since the dynamic range that existing display devices can display is limited, it is impossible to directly display a high dynamic range image (such as: the maximum brightness reaches 1000nits or 10000nits, etc.). In addition, different display devices have different display capabilities. Therefore, a dynamic range adjustment algorithm is generally used to adjust the dynamic range of a high dynamic range image according to the display capability of the display device.

[0192] In other words, the dynamic range of the HDR image is adjusted to the dynamic range that the display device can display, or the dynamic range of the HDR image is adjusted from the dynamic range that one display device (such as the reference display device) can display to the dynamic range that another display device (such as the current display device) can display. Here, nits is the unit of brightness, which is equivalent to candela per square meter (cd / m 2 ).

[0193] However, the prior art only uses parameters such as the maximum value of image content statistics, the minimum value of image content statistics, and the maximum and minimum brightness values ​​that the display device can display. The brightness levels of the HDR image adjusted in this way will be lost, resulting in poor display effects after adjustment.

[0194] To this end, the present application provides a method for processing an HDR image, calculating a corrected maximum value of the HDR image based on image information of the HDR image, wherein the image information includes a maximum value of an RGB component of a first pixel corresponding to a first percentage and a maximum value of an RGB component of a second pixel corresponding to a second percentage, the first percentage and the second percentage are greater than 0 and less than 1, the corrected maximum value is used to correct a maximum value among maximum values ​​of RGB components of multiple pixels included in the HDR image, and then adjusting the dynamic range of the HDR image based on the corrected maximum value, thereby improving the display effect of the HDR image.

[0195] It should be noted that the HDR image described in the embodiment of the present application may be an optical signal or an electrical signal, and the embodiment of the present application is not limited to this.

[0196] It should also be noted that when the HDR image is a light signal, the light signal can be converted into an electrical signal through the above three photoelectric conversion functions.

[0197] In one possible implementation, Figure 4 A schematic diagram of a dynamic range adjustment curve of an HDR image when an HDR image that can be displayed by a reference display device is displayed by a current display device. Figure 4, the horizontal axis in the figure represents the brightness of the HDR image before dynamic range adjustment, and the vertical axis represents the brightness of the image after dynamic range adjustment. Curves 1 to 5 are examples of several different adjustment curves, and the shapes of these curves are all "S"-shaped, with the slope of the curve rising first and then falling. Use a smooth "S" curve to connect the two endpoints (L1, L'1) and (L2, L'2). Use such a curve to adjust the dynamic range of the HDR image, and adjust the HDR image from the dynamic range [L1, L2] that the reference display device can display to the dynamic range [L'1, L'2] that the current display device can display, where L1 generally uses the maximum brightness of the image display content, which is the true maximum value obtained by statistically analyzing the image content of the HDR image, such as OETF (10000 nits). L2 generally uses the minimum brightness of the image display content, which is the minimum value obtained by statistically analyzing the image content of the HDR image, such as 0. L'1 is the maximum value that the display device can display, such as OETF (100 nits). L'2 is the minimum value that the display device can display, such as OETF (0.005 nits).

[0198] For example, taking curve 5 as an example, the two endpoints (L1, L'1) and (L2, L'2) are specifically A (x1, y1) and B (x2, y2). After C (x3, y3) and D (x4, y4) are connected by a smooth S-shaped curve, this curve (i.e., curve 5) represents the adjustment of the dynamic range of the HDR image from 0 to 10000 (nits) to 0.005 (nits) to 100 (nits). Thus, the display device corresponding to the brightness range can display the compressed image with a dynamic range of 0.005 (nits) to 100 (nits).

[0199] From the above-described process of adjusting the dynamic range of the HDR image, it can be seen that the dynamic range of the HDR image is adjusted using the maximum brightness L1 of the display content of the HDR image. In many natural scenes, if only a few pixels, such as noise points, have brightness close to or equal to L1, and the brightness of most of the remaining pixels is significantly different from L1, the adjusted image will be displayed on the display device as a whole, resulting in poor visual effects.

[0200] To address this issue, an embodiment of the present application further provides a method for calculating a corrected maximum value of an HDR image, where the corrected maximum value is used to correct the maximum value among the maximum values ​​of RGB components of multiple pixels in the HDR image, and the corrected maximum value of the HDR image calculated according to the method is applied to the dynamic range adjustment of the HDR image, which can further enhance the visual effect of the HDR image displayed on a display device.

[0201] Figure 5This is an application scenario of the method for processing HDR images provided in the embodiment of the present application. Figure 5 After the image processing device obtains the HDR image to be processed, it adjusts the dynamic range of the HDR image to be processed and outputs the adjusted HDR image.

[0202] Figure 6 A schematic flow chart of a method 100 for processing an HDR image provided in an embodiment of the present application, wherein the method 100 is applicable to Figure 5 The application scenarios provided in and by e.g. Figure 5 The image processing apparatus shown in FIG. Figure 6 , method 100 includes the following S110~S140.

[0203] S110, obtaining image information of an HDR image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a first percentage, a maximum RGB component value of a first pixel corresponding to the first percentage, a second percentage, and a maximum RGB component value of a second pixel corresponding to the second percentage. The first percentage indicates the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage indicates the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the maximum RGB component value indicates the maximum value among the R component, the G component, and the B component of a pixel, and the first percentage and the second percentage are both greater than 0 and less than 1.

[0204] Optionally, the first percentage may be a first ratio, and the second percentage may be a second ratio.

[0205] Among them, the first percentage represents the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, and the second percentage represents the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, and the maximum RGB component value represents the maximum value among the R component, the G component and the B component of a pixel, and the first percentage and the second percentage are both greater than 0 and less than 1.

[0206] For example, taking an HDR image consisting of 4 pixels, the maximum value of the RGB component of the first pixel is 80, the maximum value of the RGB component of the second pixel is 30, the maximum value of the RGB component of the third pixel is 60, and the maximum value of the fourth pixel is 55. Then, 25% corresponds to the second pixel, 50% corresponds to the fourth pixel, 75% corresponds to the third pixel, and 100 corresponds to the first pixel.

[0207] That is to say, among the 4 pixels, the pixel whose maximum value of the RGB component is less than or equal to 30 (the 2nd pixel) accounts for 25% of the 4 pixels, the pixels whose maximum value of the RGB component is less than or equal to 55 (the 2nd and 4th pixels) account for 50% of the 4 pixels, the pixels whose maximum value of the RGB component is less than or equal to 60 (the 2nd, 4th and 3rd pixels) account for 75% of the 4 pixels, and the pixels whose maximum value of the RGB component is less than or equal to 80 (the 2nd, 4th, 3rd and 1st pixels) account for 100% of the 4 pixels.

[0208] It should be noted that the multiple pixels included in the above-mentioned HDR image can be understood as the multiple pixels included in the effective display area of ​​the HDR image, and the effective display area can be a partial area or the entire area of ​​the HDR image.

[0209] For example, the effective display area of ​​the HDR image may be a rectangular area determined by a display horizontal size and a display vertical size.

[0210] Optionally, in S110, the image processing device may obtain image information of the HDR image in a variety of ways, which is not limited in this embodiment of the present application.

[0211] In a possible implementation, the image processing device may calculate the HDR image using an existing method to obtain the image information.

[0212] In another possible implementation manner, the image processing device may obtain the image information through metadata carried by the HDR image.

[0213] Optionally, S110 may also be: obtaining image information of a high dynamic range HDR image to be processed, the HDR image comprising multiple pixels, the image information comprising a maximum RGB component value of a first pixel corresponding to a first percentage and a maximum RGB component value of a second pixel corresponding to a second percentage, the first percentage representing the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage representing the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the RGB component maximum value represents the maximum value among the R component, the G component and the B component of a pixel, and the first percentage and the second percentage are both greater than 0 and less than 1.

[0214] Optionally, the first percentage may be understood as a first proportion or a first ratio, and the second percentage may be understood as a second proportion or a second ratio.

[0215] Optionally, the image processing device may obtain the RGB maximum value of the first pixel corresponding to the first percentage and the RGB maximum value of the second pixel corresponding to the second percentage in a variety of ways, which is not limited in this embodiment of the present application.

[0216] In a possible implementation, the image processing device may determine the R component value, the G component value, and the B component value of each pixel among the multiple pixels included in the HDR image; determine the maximum value among the R component value, the G component value, and the B component value of each pixel as the maximum value of the RGB component of each pixel; and determine the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage based on the maximum value of the RGB component of each pixel among the multiple pixels, wherein the percentage of the number of pixels among the multiple pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the first pixel to the multiple pixels is the first percentage, and the percentage of the number of pixels among the multiple pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the second pixel to the multiple pixels is the second percentage.

[0217] S120. Determine a reference maximum value of the HDR image according to the first percentage, the maximum value of the RGB components of the first pixel corresponding to the first percentage, the second percentage, and the maximum value of the RGB components of the second pixel corresponding to the second percentage.

[0218] Optionally, the image processing device may determine the reference maximum value of the HDR image in a variety of ways based on the first percentage, the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage, and the maximum value of the RGB component of the second pixel corresponding to the second percentage. This is not limited to the embodiments of the present application.

[0219] In a possible implementation, the image processing device may determine the reference maximum value MAX by the following formula (5):

[0220]

[0221] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。

[0222] Using the method for processing HDR images provided in the embodiment of the present application, due to the above and These are two pixels in the HDR image except for the maximum brightness and minimum brightness of the displayed content. The reference maximum value is calculated through these two pixels, and the maximum value of the RGB component maximum values ​​of the HDR image is finally adjusted according to the reference maximum value. This can avoid the situation in the prior art where the adjusted image is too dark when the maximum brightness adjustment is used.

[0223] Optionally, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and the image processing device can determine the reference maximum value based on the first percentage, the maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the RGB component of the multiple pixels, and the average of the maximum values ​​of the RGB component of the multiple pixels.

[0224] In another possible implementation, the image processing device may determine the reference maximum value MAX by the following formula (6):

[0225]

[0226] in, The maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the average_maxrgb represents the average value among the maximum values ​​of the RGB components of the multiple pixels, the K1 represents the first percentage, and the represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, represents the maximum value of the RGB components of the second pixel, F() represents a preset function, B, K1 and K2 are preset values, 0 <B<1,K1-K2≥0.5,0<K1<1,0<K2<1。

[0227] Optionally, S120 may also be: determining a reference maximum value of the HDR image according to a maximum value of an RGB component of the first pixel corresponding to the first percentage and a maximum value of an RGB component of the second pixel corresponding to the second percentage.

[0228] Optionally, the image processing device may determine the difference between the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage as the brightness variation range of the HDR image; and determine the reference maximum value based on the brightness variation range.

[0229] In a possible implementation, the image processing device may determine the brightness variation range variance_maxrgb by the following formula (7):

[0230]

[0231] Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB component of the second pixel, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。

[0232] Optionally, the image information also includes the maximum value among the RGB component maximum values ​​of the multiple pixels and the average value of the RGB component maximum values ​​of the multiple pixels. The image processing device can determine the reference maximum value based on the brightness variation range, the maximum value among the RGB component maximum values ​​of the multiple pixels and the average value of the RGB component maximum values ​​of the multiple pixels.

[0233] In another possible implementation, the image processing device may determine the reference maximum value MAX by the following formula (8):

[0234] MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb(8)

[0235] in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

[0236] Optionally, the F() function in the above formula (6) and formula (8) may be a constant function or an increasing function, which is not limited in the embodiment of the present application.

[0237] For example, F(x) = x, or F(x) = x N , or F(x)=logx, or F(x)=ax+b, where a and b are constants.

[0238] For another example, in formula (6) and formula (8), B can be set to 1 / 3.

[0239] In the method for processing an HDR image provided by an embodiment of the present application, maximum_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%, 2×average_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%, K1-K2≥0.5 is the maximum value of the RGB component of the pixel corresponding to more than 50%, and by setting different weights for these three dimensions, the final reference maximum value is obtained, and the maximum value of the maximum values ​​of the RGB components of the HDR image is finally adjusted according to the reference maximum value, which can avoid the situation in the prior art where the adjusted image is too dark when the maximum brightness adjustment is used.

[0240] S130. Determine a corrected maximum value of the HDR image based on the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the corrected maximum value is used to correct the maximum value among the RGB component maximum values ​​of the plurality of pixels included in the HDR image.

[0241] It should be noted that grading a parameter (e.g., a reference maximum value) (also referred to as parameter grading) means dividing the parameter into different levels according to different value ranges. Different values ​​of the parameter may fall within different value ranges, and values ​​falling within different value ranges are said to belong to different levels (or grades). The concept of parameter grading can also be referred to in the prior art, and will not be described in detail here.

[0242] Optionally, each grading interval corresponds to an expression, and the expression is used to calculate the corrected maximum value of the HDR. S130 may be: the image processing device determines a first grading interval to which the reference maximum value belongs from the multiple grading intervals, and the first grading interval corresponds to a first expression; and determines the corrected maximum value according to the first expression.

[0243] Optionally, the multiple grading intervals and the expressions corresponding to each grading interval may be set in a variety of ways, which are not limited in the embodiments of the present application.

[0244] In a possible implementation, when the multiple classification intervals include three classification intervals, the modified maximum value maximum_maxrgb1 can be determined by the following formula (9):

[0245]

[0246] Among them, the MaxRefDisplay represents the maximum display brightness of the display device used to display the HDR image to be processed, the MIN represents a preset grading threshold, and the MAX represents the reference maximum value.

[0247] Optionally, the MaxRefDisplay may be obtained through metadata carried by the HDR image.

[0248] In another possible implementation, when the multiple classification intervals include two classification intervals, the modified maximum value maximum_maxrgb1 may be determined by the following formula (10):

[0249]

[0250] Among them, the maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, the MAX represents the reference maximum value, the A represents a preset grading threshold, min() represents the operation of taking the minimum value, and f() represents a nonlinear function or a linear function.

[0251] For example, the preset grading threshold may be the maximum display brightness of the display device.

[0252] It should be noted that formula (9) and formula (10) only exemplify the case where the reference maximum value is divided into 2 classification intervals and 3 classification intervals, and the corresponding relationship between each classification and the expression. The embodiment of the present application can also classify the reference maximum value into other number of classification intervals, and set an expression corresponding to each classification interval, which is not limited in the embodiment of the present application.

[0253] Therefore, based on the image information of the HDR image to be processed, the reference maximum value of the HDR image is calculated, and based on the grading interval to which the reference maximum value belongs, the corrected maximum value of the HDR image is calculated, and the corrected maximum value is used as the maximum value of the RGB component maximum values ​​when adjusting the dynamic range of the HDR image to be processed.

[0254] Optionally, the corrected maximum value described in the embodiment of the present application may also be referred to as a maximum brightness correction value.

[0255] Optionally, S130 may also be: determining the maximum brightness correction value of the HDR image based on the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct the maximum value among the RGB component maximum values ​​of the plurality of pixels included in the HDR image.

[0256] Optionally, each grading interval corresponds to an expression, and the expression is used to calculate the corrected maximum value of the HDR. S130 may include: the image processing device determines the first grading interval to which the reference maximum value belongs from the multiple grading intervals, and the first grading interval corresponds to a first expression; according to the first expression, the maximum brightness correction value is determined.

[0257] Optionally, the multiple grading intervals and the expressions corresponding to each grading interval may be set in a variety of ways, which are not limited in the embodiments of the present application.

[0258] In a possible implementation, when the multiple classification intervals include three classification intervals, the modified maximum value maximum_maxrgb1 can be determined by the following formula (11):

[0259]

[0260] Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the HDR image is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

[0261] Optionally, the MaxRefDisplay may be obtained through metadata carried by the HDR image.

[0262] In another possible implementation, when the multiple classification intervals include two classification intervals, the modified maximum value maximum_maxrgb1 may be determined by the following formula (12):

[0263]

[0264] Among them, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, MAX represents the reference maximum value, A represents a preset grading threshold, min() represents the operation of taking the minimum value, and f() represents a nonlinear function or a linear function.

[0265] For example, the preset grading threshold may be the maximum display brightness of a reference display device applicable before the dynamic range of the HDR image is adjusted.

[0266] It should be noted that formula (11) and formula (12) only exemplify the case where the reference maximum value is divided into 2 classification intervals and 3 classification intervals, and the corresponding relationship between each classification and the expression. The embodiment of the present application can also classify the reference maximum value into other number of classification intervals, and set an expression corresponding to each classification interval, which is not limited in the embodiment of the present application.

[0267] Therefore, based on the image information of the HDR image to be processed, the reference maximum value of the HDR image is calculated, and based on the grading interval to which the reference maximum value belongs, the maximum brightness correction value of the HDR image is calculated, and the maximum brightness correction value is used as the maximum value of the RGB component maximum values ​​when adjusting the dynamic range of the HDR image to be processed.

[0268] In addition, if the maximum brightness correction value is less than the maximum display brightness of the current display device applicable to the dynamic range of the HDR image after adjustment, the maximum brightness correction value maximum_maxrgb1 is updated to the maximum display brightness of the current display device.

[0269] S140: Adjust the dynamic range of the HDR image according to the corrected maximum value.

[0270] It should be noted that the specific process of adjusting the dynamic range of the HDR image according to the modified maximum value can be found in the previous article. Figure 4 To avoid repetition, the descriptions made in will not be repeated here.

[0271] The method for processing HDR images provided in the embodiment of the present application can improve the grading accuracy of HDR images with different levels of dynamic ranges by grading the reference maximum value and calculating the corrected maximum value of the HDR image based on the reference maximum value. Therefore, applying the corrected maximum value to the adjustment of the dynamic range of the HDR image can improve the display effect of the HDR image.

[0272] Optionally, the embodiment of the present application also provides a method for verifying the accuracy of the corrected maximum value of the HDR image.

[0273] It should be noted that the accuracy of the corrected maximum value can also be understood as the grading accuracy of the HDR image.

[0274] Optionally, the method for verifying the corrected maximum value includes: the image processing device verifies the accuracy of the corrected maximum value according to the third percentage, the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum GRB component value of the fourth pixel corresponding to the third percentage in the output image, the fourth percentage, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum RGB component value of the sixth pixel corresponding to the fourth percentage in the output HDR image. The output image is the image obtained by adjusting the dynamic range of the HDR image.

[0275] In a possible implementation, when and the image processing device can determine that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, the represents the maximum RGB component value of the third pixel, represents the maximum RGB component value of the fourth pixel, K4 represents the fourth percentage, the represents the maximum RGB component value of the fifth pixel, represents the maximum RGB component value of the sixth pixel.

[0276] For example, taking K3 = 100% and K4 = 99% as an example, in the HDR image before adjustment, P 100 ≠P 99 , indicating that the pixel corresponding to K3 is not equal to the pixel corresponding to K4; then in the adjusted HDR image, the pixel corresponding to K3 should also not be equal to the pixel corresponding to K4, that is, P' 100 -P' 99 >T.

[0277] Correspondingly, when and the image processing device can determine that the corrected maximum value is inaccurate.

[0278] Optionally, the image processing device can calibrate the corrected maximum value according to the following formula (13) to obtain the calibrated corrected maximum value maximum_maxrgb1':

[0279]

[0280] Wherein, the maximum_maxrgb1 is the corrected maximum value, the offset is a preset offset value, and 0 < offset < 1.

[0281] Optionally, S140 may also be: adjusting the dynamic range of the HDR image according to the maximum brightness correction value.

[0282] It should be noted that for the specific process of adjusting the dynamic range of the HDR image according to the maximum brightness correction value, reference can be made to the description Figure 4 made above. To avoid repetition, it will not be elaborated here.

[0283] The method for processing an HDR image provided by the embodiment of the present application can improve the classification accuracy of HDR images with different levels of dynamic range by grading the reference maximum value and calculating the maximum brightness correction value of the HDR image according to the reference maximum value. Therefore, applying this maximum brightness correction value to adjust the dynamic range of the HDR image can improve the display effect of the HDR image.

[0284] Optionally, the embodiment of the present application also provides a method for verifying the accuracy of the maximum brightness correction value of the HDR image.

[0285] It should be noted that the accuracy of the maximum brightness correction value can also be understood as the classification accuracy of the HDR image.

[0286] Optionally, the method for verifying the maximum brightness correction value may include: the image processing device verifies the accuracy of the maximum brightness correction value according to the maximum value of the RGB components of the third pixel corresponding to the third percentage in the HDR image, the maximum value of the GRB components of the fourth pixel corresponding to the third percentage in the processed image, the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum value of the GRB components of the sixth pixel corresponding to the fourth percentage in the processed HDR image, where the processed image is the image obtained by adjusting the dynamic range of the HDR image.

[0287] In a possible implementation, when and , it is determined that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, K4 represents the fourth percentage, represents the maximum value of the RGB components of the fifth pixel, Represents the maximum value of the RGB components of the sixth pixel.

[0288] For example, taking K3 = 100% and K4 = 99% as an example, the P 100 ≠P 99 , indicating that the pixel corresponding to K3 is not equal to the pixel corresponding to K4; then the pixel corresponding to K3 in the adjusted HDR image should also not be equal to the pixel corresponding to K4, that is, P′ 100 -P′ 99 >T.

[0289] Accordingly, when and When the maximum brightness correction value is inaccurate, the image processing device may determine that the maximum brightness correction value is inaccurate.

[0290] Optionally, the image processing device may calibrate the maximum brightness correction value according to the following formula (14) to obtain a calibrated maximum brightness correction value maximum_maxrgb1':

[0291]

[0292] Wherein, maximum_maxrgb1' is the maximum brightness correction value after calibration, the offset is the preset offset value, and 0 <offset<1。

[0293] Combined with the above Figures 1 to 6 The method for processing HDR images provided in the embodiment of the present application is introduced. Figure 7 and Figure 8 An image processing apparatus and an image processing device provided in an embodiment of the present application are introduced.

[0294] Figure 7 A schematic block diagram of a device 200 for processing an HDR image provided by an embodiment of the present application is shown. The device 200 includes:

[0295] An acquisition unit 210 is used to acquire image information of a high dynamic range (HDR) image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a first percentage, a maximum RGB component value of a first pixel corresponding to the first percentage, a second percentage, and a maximum RGB component value of a second pixel corresponding to the second percentage, the first percentage representing the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage representing the percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the maximum RGB component value representing the maximum value among an R component, a G component, and a B component of a pixel, the first percentage and the second percentage being greater than 0 and less than 1.

[0296] That is, the acquisition unit 210 can be used to acquire image information of a high dynamic range HDR image to be processed, the HDR image including multiple pixels, and the image information including a maximum RGB component value of a first pixel corresponding to a first percentage and a maximum RGB component value of a second pixel corresponding to a second percentage, the first percentage indicating the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage indicating the percentage of at least one pixel among the multiple pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the maximum RGB component value indicates the maximum value among the R component, the G component and the B component of a pixel, and the first percentage and the second percentage are both greater than 0 and less than 1.

[0297] The determination unit 220 is used to determine a reference maximum value of the HDR image based on the first percentage, the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage; and determine a corrected maximum value of the HDR image based on the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the corrected maximum value is used to correct the maximum value among the RGB component maximum values ​​of the plurality of pixels included in the HDR image.

[0298] That is to say, the determination unit 220 can be used to determine a reference maximum value of the HDR image based on the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage; determine the maximum brightness correction value of the HDR image based on the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct the maximum value among the RGB component maximum values ​​of the plurality of pixels included in the HDR image.

[0299] The adjustment unit 230 is configured to adjust the dynamic range of the HDR image according to the corrected maximum value of the HDR image.

[0300] That is, the adjustment unit 230 may be configured to adjust the dynamic range of the HDR image according to the maximum brightness correction value.

[0301] In a possible implementation, the image information also includes an average of the maximum values ​​of the RGB components of the multiple pixels, and the determination unit 220 is specifically used to determine the reference maximum value based on the first percentage, the maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the RGB component of the multiple pixels, and the average of the maximum values ​​of the RGB component of the multiple pixels.

[0302] In a possible implementation manner, the determining unit 220 is specifically configured to: determine the reference maximum value MAX by using the above formula (6).

[0303] In a possible implementation manner, the determining unit 220 is specifically configured to determine the reference maximum value MAX by using the above formula (5).

[0304] In a possible implementation, each grading interval corresponds to an expression, and the expression is used to calculate the corrected maximum value of the HDR. The determination unit 220 is specifically used to: determine the first grading interval to which the reference maximum value belongs from the multiple grading intervals, and the first grading interval corresponds to a first expression; and determine the corrected maximum value according to the first expression.

[0305] In a possible implementation manner, the determining unit 220 is specifically configured to determine the corrected maximum value maximum_maxrgb1 of the HDR image by using the above formula (9).

[0306] In a possible implementation, the apparatus further includes: a verification unit 240, configured to verify the accuracy of the corrected maximum value according to a third percentage, the maximum value of the RGB components of the third pixel corresponding to the third percentage in the HDR image, the maximum value of the GRB components of the fourth pixel corresponding to the third percentage in the output image, a fourth percentage, the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum value of the GRB components of the sixth pixel corresponding to the fourth percentage in the output HDR image, where the output image is an image obtained by adjusting the dynamic range of the HDR image.

[0307] In a possible implementation, the verification unit 240 is specifically configured to: when and , determine that the corrected maximum value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, the represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, K4 represents the fourth percentage, the represents the maximum value of the RGB components of the fifth pixel, represents the maximum value of the RGB components of the sixth pixel.

[0308] In a possible implementation, the determination unit 220 is specifically configured to: determine the difference between the maximum value of the RGB components of the first pixel corresponding to the first percentage and the maximum value of the RGB components of the second pixel corresponding to the second percentage as the brightness change range of the HDR image; and determine the reference maximum value according to the brightness change range.

[0309] In a possible implementation, the determination unit 220 is specifically configured to determine the brightness change range variance_maxrgb through the above formula (7).

[0310] In a possible implementation, the image information further includes the maximum value among the maximum values of the RGB components of the multiple pixels and the average value of the maximum values of the RGB components of the multiple pixels. The determination unit 220 is specifically configured to: determine the reference maximum value according to the brightness change range, the maximum value among the maximum values of the RGB components of the multiple pixels, and the average value of the maximum values of the RGB components of the multiple pixels.

[0311] In a possible implementation, the determination unit 220 is specifically configured to determine the reference maximum value MAX through the above formula (8).

[0312] In a possible implementation, each of the hierarchical intervals corresponds to an expression for calculating the maximum brightness correction value. The determining unit 220 is specifically configured to: determine a first hierarchical interval to which the reference maximum value belongs from the multiple hierarchical intervals, where the first hierarchical interval corresponds to a first expression; and determine the maximum brightness correction value according to the first expression.

[0313] In a possible implementation, the determining unit 220 is specifically configured to determine the maximum brightness correction value maximum_maxrgb1 through the above formula (11).

[0314] In a possible implementation, the determining unit 220 is further configured to: when the maximum brightness correction value is less than the maximum display brightness of the current display device applicable after the dynamic range of the HDR image is adjusted, update the maximum brightness correction value maximum_maxrgb1 to the maximum display brightness of the current display device.

[0315] In a possible implementation, the device further includes a verification unit 240. The verification unit 240 is configured to verify the accuracy of the maximum brightness correction value according to the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum GRB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum GRB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image. The processed image is the HDR image after the dynamic range is adjusted.

[0316] In a possible implementation, the verification unit 240 is specifically configured to: when and determine that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, represents the maximum RGB component value of the third pixel, represents the maximum RGB component value of the fourth pixel, K4 represents the fourth percentage, represents the maximum RGB component value of the fifth pixel, represents the maximum RGB component value of the sixth pixel.

[0317] It should be understood that the device 200 here is embodied in the form of a functional unit. The term "unit" here may refer to an ASIC, an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art may understand that the device 200 may be specifically an image processing device in the above-mentioned method 100 embodiment, and the device 200 may be used to execute the various processes and / or steps corresponding to the image processing device in the above-mentioned method 100 embodiment, and to avoid repetition, it will not be repeated here.

[0318] Figure 8 The image processing device 300 provided in the embodiment of the present application is shown. The device 300 may include Figure 7 The apparatus 200 described in, or the device 300 may be Figure 7 The device 200 described in the embodiment of the present invention can be used as follows: Figure 8 The hardware architecture shown in FIG. 300 may include a processor 310 , a transceiver 320 , and a memory 330 , wherein the processor 310 , the transceiver 320 , and the memory 330 communicate with each other via an internal connection path. Figure 7 The related functions implemented by the determination unit 220, the adjustment unit 230 and the verification unit 240 can be implemented by the processor 310, and the related functions implemented by the acquisition unit 210 can be implemented by the processor 310 controlling the transceiver 320.

[0319] The processor 310 may include one or more processors, for example, one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU.

[0320] The transceiver 320 is used to send and receive data and / or information, and receive data and / or information. The transceiver may include a transmitter and a receiver, the transmitter is used to send data and / or signals, and the receiver is used to receive data and / or signals.

[0321] The memory 330 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable readonly memory (EPROM), and compact disc read-only memory (CD-ROM). The memory 330 is used to store relevant instructions and data.

[0322] The memory 330 is used to store program codes and data of the device, and may be a separate device or integrated in the processor 310 .

[0323] Specifically, the processor 310 is used to control the transceiver to communicate with the device or equipment that generates or sends the HDR image. For details, please refer to the description in the method embodiment, which will not be repeated here.

[0324] Understandably, Figure 8 Only a simplified design of the device 300 is shown. In practical applications, the device 300 may also include other necessary components, including but not limited to any number of transceivers, processors, controllers, memories, etc., and all devices that can implement the present application are within the protection scope of the present application.

[0325] In a possible design, the device 300 can be replaced by a chip device, for example, a communication chip that can be used in the device to implement the relevant functions of the processor in the device. The chip device can be a field programmable gate array, a dedicated integrated chip, a system chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, and a programmable controller or other integrated chip that implements the relevant functions. The chip can optionally include one or more memories for storing program codes, and when the code is executed, the processor implements the corresponding function.

[0326] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0327] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0328] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0329] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0330] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0331] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0332] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[0333] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing a high dynamic range image, characterized in that: The method comprises: Acquire image information of a high dynamic range HDR image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a maximum RGB component value of a first pixel corresponding to a first percentage and a maximum RGB component value of a second pixel corresponding to a second percentage, the first percentage representing a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the first pixel, the second percentage representing a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the maximum RGB component value representing a maximum value among an R component, a G component, and a B component of a pixel, and both the first percentage and the second percentage being greater than 0 and less than 1; determining a reference maximum value of the HDR image according to a maximum value of the RGB components of the first pixel corresponding to the first percentage and a maximum value of the RGB components of the second pixel corresponding to the second percentage; Determine a maximum brightness correction value of the HDR image according to the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct a maximum value among the maximum values ​​of the RGB components of the plurality of pixels included in the HDR image; The dynamic range of the HDR image is adjusted according to the maximum brightness correction value.

2. The method according to claim 1, characterized in that The first percentage is greater than the second percentage, and determining the reference maximum value of the HDR image according to the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage includes: Determine a difference between a maximum value of the RGB component of the first pixel corresponding to the first percentage and a maximum value of the RGB component of the second pixel corresponding to the second percentage as a brightness variation range of the HDR image; The reference maximum value is determined according to the brightness variation range.

3. The method according to claim 2, characterized in that The brightness variation range variance_maxrgb is determined by the following formula: Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB component of the second pixel, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。 4. The method according to claim 2, characterized in that: The image information further includes a maximum value among the maximum values ​​of the RGB components of the plurality of pixels and an average value of the maximum values ​​of the RGB components of the plurality of pixels, and determining the reference maximum value according to the brightness variation range includes: The reference maximum value is determined according to the brightness variation range, a maximum value among the RGB component maximum values ​​of the plurality of pixels, and an average value of the RGB component maximum values ​​of the plurality of pixels.

5. The method according to claim 4, characterized in that The reference maximum value MAX is determined by the following formula: MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb, in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

6. The method according to claim 1, characterized in that The reference maximum value MAX is determined by the following formula: Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。 7. The method according to any one of claims 1 to 6, characterized in that Each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. The maximum brightness correction value of the HDR image is determined according to the reference maximum value and the preset multiple grading intervals, including: Determine a first classification interval to which the reference maximum value belongs from the multiple classification intervals, wherein the first classification interval corresponds to a first expression; The maximum brightness correction value is determined according to the first expression.

8. The method according to any one of claims 1 to 6, characterized in that The maximum brightness correction value maximum_maxrgb1 of the HDR image is determined by the following formula: Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the HDR image is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

9. The method according to claim 8, characterized in that The method further comprises: If the maximum brightness correction value is less than the maximum display brightness of the current display device applicable to the dynamic range of the HDR image after adjustment, the maximum brightness correction value maximum_maxrgb1 is updated to the maximum display brightness of the current display device.

10. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The accuracy of the maximum brightness correction value is verified according to the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum RGB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum RGB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, and the processed image is an image after the dynamic range of the HDR image is adjusted.

11. The method according to claim 10, characterized in that The verifying the accuracy of the maximum brightness correction value according to the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum RGB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum RGB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, comprises: When and At this time, it is determined that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, K4 represents the fourth percentage, represents the maximum value of the RGB components of the fifth pixel, represents the maximum value of the RGB components of the sixth pixel.

12. An image processing method, characterized in that: The method comprises: Acquire image information of an image to be processed, the image to be processed comprising a plurality of pixels, the image information comprising a first RGB component maximum value corresponding to a first ratio and a second RGB component maximum value corresponding to a second ratio, the first ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the first RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the second ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the second RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the RGB component maximum value representing a maximum value of one of an R component, a G component and a B component of a pixel; determining a reference maximum value of the image to be processed according to a maximum value of the first RGB component corresponding to the first ratio and a maximum value of the second RGB component corresponding to the second ratio; According to the reference maximum value and a plurality of preset grading intervals, adjusting the maximum value among the maximum values ​​of the RGB components of the plurality of pixels to determine the maximum brightness correction value of the image to be processed, wherein each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value; According to the maximum brightness correction value, the dynamic range of the image to be processed is adjusted.

13. The method according to claim 12, characterized in that The first ratio is greater than the second ratio, and determining the reference maximum value of the image to be processed according to the maximum value of the first RGB component corresponding to the first ratio and the maximum value of the second RGB component corresponding to the second ratio, comprises: determining a difference between a maximum value of the first RGB component corresponding to the first ratio and a maximum value of the second RGB component corresponding to the second ratio as a brightness variation range of the image to be processed; The reference maximum value is determined according to the brightness variation range.

14. The method according to claim 13, characterized in that The brightness variation range variance_maxrgb is determined by the following formula: Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。 15. The method according to claim 13, characterized in that The image information further includes a maximum value among the maximum values ​​of the RGB components of the plurality of pixels and an average value of the maximum values ​​of the RGB components of the plurality of pixels, and determining the reference maximum value according to the brightness variation range includes: The reference maximum value is determined according to the brightness variation range, a maximum value among the RGB component maximum values ​​of the plurality of pixels, and an average value of the RGB component maximum values ​​of the plurality of pixels.

16. The method according to claim 15, characterized in that The reference maximum value MAX is determined by the following formula: MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb, in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

17. The method according to claim 12, characterized in that The reference maximum value MAX is determined by the following formula: Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component. A, K1 and K2 are preset values. 0 <A<1,0<K1<1,0<K2<1。 18. The method according to any one of claims 12 to 17, characterized in that Each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. The maximum brightness correction value maximum_maxrgb1 is determined by the following formula: Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the image to be processed is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

19. The method according to claim 18, characterized in that The method further comprises: If the maximum brightness correction value is less than the maximum display brightness of the current display device applicable to the dynamic range of the image to be processed after adjustment, the maximum brightness correction value maximum_maxrgb1 is changed to the maximum display brightness of the current display device.

20. The method according to any one of claims 12 to 17, characterized in that The method further comprises: The accuracy of the maximum brightness correction value is verified according to the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth RGB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio, and the maximum value of the sixth RGB component corresponding to the fourth ratio, wherein the third ratio represents the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the third RGB component among the multiple pixels to the number of pixels of the multiple pixels, the fourth RGB component maximum value satisfies the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the fourth RGB component among the pixels of the processed image to the number of pixels of the processed image is the third ratio, the fourth ratio represents the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the fifth RGB component among the multiple pixels to the number of pixels, the sixth RGB component maximum value satisfies the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the sixth RGB component among the pixels of the processed image to the number of pixels of the processed image is the fourth ratio, and the processed image is the image after the dynamic range of the image to be processed is adjusted.

21. The method according to claim 20, characterized in that Verifying the accuracy of the maximum brightness correction value based on the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth RGB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio, and the maximum value of the sixth RGB component corresponding to the fourth ratio, includes: when and it is determined that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third ratio, represents the maximum value of the third RGB component, P′ K3 represents the maximum value of the fourth RGB component, K4 represents the fourth ratio, represents the maximum value of the fifth RGB component, represents the maximum value of the sixth RGB component.

22. The method according to claim 20, characterized in that The method further comprises at least one of the following steps: Determine a maximum value of the first RGB component according to the first ratio and the plurality of pixels; Determine a maximum value of the second RGB component according to the second ratio and the plurality of pixels; Determine the third RGB component maximum value according to the third ratio and the plurality of pixels; Determining the maximum value of the fourth RGB component according to the third ratio and the pixels of the processed image; Determine the maximum value of the fifth RGB component according to the fourth ratio and the plurality of pixels; or, The sixth RGB component maximum value is determined according to the fourth ratio and the pixels of the processed image.

23. A device for processing high dynamic range images, characterized in that: include: an acquisition unit, configured to acquire image information of a high dynamic range (HDR) image to be processed, the HDR image comprising a plurality of pixels, the image information comprising a maximum RGB component value of a first pixel corresponding to a first percentage and a maximum RGB component value of a second pixel corresponding to a second percentage, the first percentage representing a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to a maximum RGB component value of the first pixel, the second percentage representing a percentage of at least one pixel among the plurality of pixels whose maximum RGB component value is less than or equal to a maximum RGB component value of the second pixel, the maximum RGB component value representing a maximum value among an R component, a G component, and a B component of a pixel, and both the first percentage and the second percentage being greater than 0 and less than 1; a determination unit, configured to determine a reference maximum value of the HDR image according to a maximum value of the RGB components of the first pixel corresponding to the first percentage and a maximum value of the RGB components of the second pixel corresponding to the second percentage; and to determine a maximum brightness correction value of the HDR image according to the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to grade the reference maximum value, each of the plurality of grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct a maximum value among the maximum values ​​of the RGB components of the plurality of pixels included in the HDR image; An adjustment unit is used to adjust the dynamic range of the HDR image according to the maximum brightness correction value.

24. The device according to claim 23, characterized in that The determining unit is specifically used for: Determine a difference between a maximum value of the RGB component of the first pixel corresponding to the first percentage and a maximum value of the RGB component of the second pixel corresponding to the second percentage as a brightness variation range of the HDR image; The reference maximum value is determined according to the brightness variation range.

25. The device according to claim 24, characterized in that The determining unit is specifically configured to determine the brightness variation range variance_maxrgb by the following formula: Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB component of the second pixel, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。 26. The device according to claim 24, characterized in that The image information further includes a maximum value among the maximum values ​​of the RGB components of the multiple pixels and an average value of the maximum values ​​of the RGB components of the multiple pixels, and the determining unit is specifically configured to: The reference maximum value is determined according to the brightness variation range, a maximum value among the RGB component maximum values ​​of the plurality of pixels, and an average value of the RGB component maximum values ​​of the plurality of pixels.

27. The device according to claim 26, characterized in that The determining unit is specifically configured to determine the reference maximum value MAX by the following formula: MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb, in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

28. The device according to claim 23, characterized in that The determining unit is specifically configured to determine the reference maximum value MAX by the following formula: Wherein, K1 represents the first percentage, represents the maximum value of the RGB components of the first pixel, K2 represents the second percentage, Indicates the maximum value of the RGB components of the second pixel, A, K1 and K2 are preset values, 0 <A<1,0<K1<1,0<K2<1。 29. The device according to any one of claims 23 to 28, characterized in that Each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. The determination unit is specifically used to: Determine a first classification interval to which the reference maximum value belongs from the multiple classification intervals, wherein the first classification interval corresponds to a first expression; The maximum brightness correction value is determined according to the first expression.

30. The device according to any one of claims 23 to 28, characterized in that The determining unit is specifically used to determine the maximum brightness correction value maximum_maxrgb1 by the following formula: Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the HDR image is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

31. The device according to claim 30, characterized in that The determining unit is further configured to: If the maximum brightness correction value is less than the maximum display brightness of the current display device applicable to the dynamic range of the HDR image after adjustment, the maximum brightness correction value maximum_maxrgb1 is updated to the maximum display brightness of the current display device.

32. The device according to any one of claims 23 to 28, characterized in that The device further comprises: a verification unit, The verification unit is used to verify the accuracy of the maximum brightness correction value according to the maximum RGB component value of the third pixel corresponding to the third percentage in the HDR image, the maximum RGB component value of the fourth pixel corresponding to the third percentage in the processed image, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage in the HDR image, and the maximum RGB component value of the sixth pixel corresponding to the fourth percentage in the processed HDR image, and the processed image is an image after the dynamic range of the HDR image is adjusted.

33. The device according to claim 32, characterized in that The verification unit is specifically configured to: when and hold, determine that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third percentage, represents the maximum value of the RGB components of the third pixel, represents the maximum value of the RGB components of the fourth pixel, K4 represents the fourth percentage, represents the maximum value of the RGB components of the fifth pixel, represents the maximum value of the RGB components of the sixth pixel.

34. An image processing device, characterized in that: include: an acquisition unit, configured to acquire image information of an image to be processed, the image to be processed comprising a plurality of pixels, the image information comprising a first RGB component maximum value corresponding to a first ratio and a second RGB component maximum value corresponding to a second ratio, the first ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the first RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the second ratio representing a ratio of the number of pixels whose RGB component maximum value is less than or equal to the second RGB component maximum value among the plurality of pixels to the number of the plurality of pixels, the RGB component maximum value representing a maximum value of one of an R component, a G component and a B component of a pixel; a determining unit, configured to determine a reference maximum value of the image to be processed according to a maximum value of the first RGB component corresponding to the first ratio and a maximum value of the second RGB component corresponding to the second ratio; and to adjust a maximum value among the maximum values ​​of the RGB components of the multiple pixels according to the reference maximum value and a plurality of preset grading intervals to determine a maximum brightness correction value of the image to be processed, wherein each grading interval in the plurality of grading intervals corresponds to a value range of the reference maximum value; An adjustment unit is used to adjust the dynamic range of the image to be processed according to the maximum brightness correction value.

35. The device according to claim 34, characterized in that The determining unit is specifically used for: determining a difference between a maximum value of the first RGB component corresponding to the first ratio and a maximum value of the second RGB component corresponding to the second ratio as a brightness variation range of the image to be processed; The reference maximum value is determined according to the brightness variation range.

36. The device according to claim 35, characterized in that The determining unit is specifically configured to determine the brightness variation range variance_maxrgb by the following formula: Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component, K1 and K2 are preset values, K1-K2≥0.5, 0 <K1<1,0<K2<1。 37. The device according to claim 35, characterized in that The image information further includes a maximum value among the maximum values ​​of the RGB components of the multiple pixels and an average value of the maximum values ​​of the RGB components of the multiple pixels, and the determining unit is specifically configured to: The reference maximum value is determined according to the brightness variation range, a maximum value among the RGB component maximum values ​​of the plurality of pixels, and an average value of the RGB component maximum values ​​of the plurality of pixels.

38. The device according to claim 37, characterized in that The determining unit is specifically configured to determine the reference maximum value MAX by the following formula: MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-AB)×variance_maxrgb, in, maximum_maxrgb represents the maximum value among the maximum values ​​of the RGB components of the multiple pixels, average_maxrgb represents the average value of the maximum values ​​of the RGB components of the multiple pixels, variance_maxrgb represents the brightness variation range, F() represents a preset function, and B is a preset value.

39. The device according to claim 34, characterized in that The determining unit is specifically configured to determine the reference maximum value MAX by the following formula: Wherein, K1 represents the first ratio, represents the maximum value of the first RGB component, K2 represents the second ratio, Indicates the maximum value of the second RGB component. A, K1 and K2 are preset values. 0 <A<1,0<K1<1,0<K2<1。 40. The device according to any one of claims 34 to 39, characterized in that Each grading interval corresponds to an expression, and the expression is used to calculate the maximum brightness correction value. The determination unit is specifically used to determine the maximum brightness correction value maximum_maxrgb1 by the following formula: Among them, MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the image to be processed is adjusted, MIN represents a preset grading threshold, and MAX represents the reference maximum value.

41. The device according to any one of claims 34 to 39, characterized in that The determining unit is further configured to: If the maximum brightness correction value is less than the maximum display brightness of the current display device applicable to the dynamic range of the image to be processed after adjustment, the maximum brightness correction value maximum_maxrgb1 is changed to the maximum display brightness of the current display device.

42. The device according to any one of claims 34 to 39, characterized in that The device further comprises a verification unit, wherein the verification unit is used to: The accuracy of the maximum brightness correction value is verified according to the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth RGB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio, and the maximum value of the sixth RGB component corresponding to the fourth ratio, wherein the third ratio represents the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the third RGB component among the multiple pixels to the number of pixels of the multiple pixels, the fourth RGB component maximum value satisfies the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the fourth RGB component among the pixels of the processed image to the number of pixels of the processed image is the third ratio, the fourth ratio represents the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the fifth RGB component among the multiple pixels to the number of pixels, the sixth RGB component maximum value satisfies the ratio of the number of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the sixth RGB component among the pixels of the processed image to the number of pixels of the processed image is the fourth ratio, and the processed image is the image after the dynamic range of the image to be processed is adjusted.

43. The device according to claim 42, characterized in that The verification unit is specifically configured to: when and hold, determine that the maximum brightness correction value is accurate, where K3 - K4 < M, M is a preset first threshold, T is a preset second threshold, 0 < T < 2, K3 represents the third ratio, represents the maximum value of the third RGB component, P' K3 represents the maximum value of the fourth RGB component, K4 represents the fourth ratio, represents the maximum value of the fifth RGB component, represents the maximum value of the sixth RGB component.

44. The device according to claim 42, characterized in that The determining unit is further configured to perform at least one of the following steps: Determine a maximum value of the first RGB component according to the first ratio and the plurality of pixels; Determine a maximum value of the second RGB component according to the second ratio and the plurality of pixels; Determine the third RGB component maximum value according to the third ratio and the plurality of pixels; Determining the maximum value of the fourth RGB component according to the third ratio and the pixels of the processed image; Determine the maximum value of the fifth RGB component according to the fourth ratio and the plurality of pixels; or, The sixth RGB component maximum value is determined according to the fourth ratio and the pixels of the processed image.

45. An image processing device, characterized in that: The device comprises a processor and a memory, wherein the processor and the memory are coupled, and the processor is used to cause the device to execute the method according to any one of claims 1 to 22.

46. ​​A chip device comprising: An input interface, an output interface, at least one processor, and a memory, wherein the input interface, the output interface, the processor, and the memory communicate with each other via an internal connection path, and the processor is used to execute the code in the memory, wherein when the processor executes the code, the chip device implements the method described in any one of claims 1 to 22.

47. A computer-readable storage medium for storing a computer program, characterized in that: The computer program comprises instructions for implementing the method of any one of claims 1 to 22 above.

48. A computer program product, comprising instructions, characterized in that: When the instructions are executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 22.

Citation Information

Patent Citations

  • Encoding and decoding HDR videos

    CN108781290A

  • Encoding and decoding HDR videos

    CN109219961A