Image dynamic range processing method and device

By obtaining the interpolation point coordinate values ​​and functions of the cubic spline curve and adjusting the image brightness value, the problem of image brightness level loss in the existing technology is solved, and the image display effect is improved and the adaptability to multiple devices is achieved.

CN114467110BActive Publication Date: 2025-09-16HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180005691.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-05-08
Filing Date
2021-03-29
Publication Date
2025-09-16
Estimated Expiration
2041-03-29

AI Technical Summary

Technical Problem

In the prior art, when adjusting the dynamic range of an image, the mapping curve is not flexible enough, resulting in loss of image brightness levels and unclear brightness contrast, which affects the display effect.

Method used

The coordinate values ​​of the interpolation points related to the cubic spline curve are obtained, and the image brightness value is mapped by determining the function of the cubic spline curve, thereby adjusting the dynamic range of the image and enhancing the flexibility and robustness of the mapping curve.

Benefits of technology

It improves the image display effect, protects the brightness level of specific areas, increases the diversity and adaptability of the mapping curve, and adapts to the dynamic range requirements of different display devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114467110B_ABST
    Figure CN114467110B_ABST
Patent Text Reader

Abstract

The present application provides a method and apparatus for processing the dynamic range of an image, wherein the method includes: obtaining the first coordinate value of a first interpolation point and the first coordinate value of a third interpolation point associated with a first cubic spline curve; determining the first coordinate value of a second interpolation point associated with the first cubic spline curve based on histogram information of a first brightness interval of an image to be processed, wherein the first brightness interval is the interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, and the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine a function of the first cubic spline curve, wherein the function of the first cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed. The present application improves the display effect of the image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 8, 2020, with application number 202010383489.0 and application name “Image dynamic range processing method and device”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] Dynamic Range (DR) is used in many fields to express the ratio of the maximum and minimum values ​​of a variable. In digital images, dynamic range represents the ratio between the maximum brightness and the minimum brightness within the image display range, that is, the number of gray levels between the "brightest" and "darkest" of the image. 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 to 10 6 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 (LDR).

[0004] Currently, display devices with a dynamic range of less than 0.1 to 400 nits are generally referred to as Standard Dynamic Range (SDR) display devices; those with a dynamic range of more than 0.01 to 540 nits are referred to as High Dynamic Range (HDR) display devices. Different high dynamic range display devices display different dynamic ranges, such as 0.01 to 540 nits high dynamic range display devices and 0.005 to 1000 nits high dynamic range display devices. Similarly, different standard dynamic range display devices display different dynamic ranges. In order to adapt an image to display devices with different dynamic ranges (high dynamic range display devices and low dynamic range display devices), the image needs to be dynamically adjusted (compressed or stretched) to adjust the image's dynamic range to within the display capability of the display device for display.

[0005] In existing technologies, a mapping curve is used to map the brightness value of each pixel in an image to a target brightness value, thereby adjusting the image's dynamic range by changing the pixel's brightness value. However, due to the inflexibility of the existing mapping curve, brightness levels in some areas of the image are lost, brightness contrast is unclear, and the resulting image display after dynamic range adjustment is poor. Summary of the Invention

[0006] The present application provides a method and device for processing the dynamic range of an image, which can improve the display effect of the image.

[0007] In a first aspect, a method for processing an image dynamic range is provided, comprising: obtaining a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point associated with a first cubic spline curve, the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point being brightness values; determining a first coordinate value of a second interpolation point associated with the first cubic spline curve based on histogram information of a first brightness interval of an image to be processed, the first brightness interval being an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point being used to determine a function of the first cubic spline curve, the function of the first cubic spline curve being used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed.

[0008] By obtaining the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and the histogram of the first brightness range of the image to be processed, the first coordinate value of the second interpolation point can be determined. The method for determining the interpolation point is simple and easy to execute. In addition, by determining the first coordinate values ​​of the first interpolation point to the third interpolation point related to the first cubic spline curve, the function of the first cubic spline curve is determined according to the first coordinate values ​​of the first interpolation point to the third interpolation point, so that the brightness value of the pixel whose brightness value of the image to be processed is within the first brightness range is mapped to the first target pixel value according to the function of the first cubic spline curve, that is, the brightness values ​​of a part of the pixels in the image to be processed are mapped according to the function of the first cubic spline curve. The pixel values ​​in the first brightness range are protected by the row mapping, thereby improving the display effect of the image. In addition, compared with brightness mapping of the processed image only according to the basic mapping curve, the present application performs brightness mapping on some pixels through the function of the first cubic spline curve, and the brightness values ​​of the remaining pixels are mapped according to the basic mapping curve, which is equivalent to changing the original mapping relationship of a section of the curve in the basic mapping curve. In other words, the shape of the curve corresponding to the first brightness range in the basic mapping curve is changed, thereby realizing protection of a specific area and increasing the diversity, flexibility, robustness and universality of the shape of the basic mapping curve, thereby improving the display effect of the image after adjusting the dynamic range.

[0009] In one possible implementation, the function of the first cubic spline curve is obtained as follows: obtaining a function of a basic mapping curve; mapping the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determining the function of the first cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0010] In a possible implementation, determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point includes: determining the second coordinate value of the second interpolation point according to the following formula;

[0011]

[0012] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0013] In one possible implementation, the method further includes determining first coordinate values ​​of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point associated with a second cubic spline curve based on a first coordinate value of the third interpolation point and a maximum value of RGB components of a first pixel of the image to be processed; wherein the first pixel is a pixel having the largest maximum value of RGB components in the image to be processed, and the maximum value of RGB components of the pixel is a maximum value among R, G, and B components of the pixel; the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine a function of the second cubic spline curve, the function of the second cubic spline curve being used to map luminance values ​​of pixels in the image to be processed whose luminance values ​​are within a second luminance interval to a second target luminance value, thereby correcting the dynamic range of the image to be processed, where the second luminance interval is an interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and there is no overlapping area between the first luminance interval and the second luminance interval.

[0014] In one possible implementation, the method further includes: sending the function of the cubic spline curve and the data information of the image to be processed to a decoding end, so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, and the data information of the image to be processed is used to obtain the image to be processed.

[0015] In one possible implementation, obtaining the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point related to the first cubic spline curve includes: setting the first coordinate value of the first interpolation point to a first preset brightness value; setting the first coordinate value of the third interpolation point to a second preset brightness value.

[0016] In a possible implementation, the first coordinate value of the second interpolation point is determined according to the following formula:

[0017]

[0018] Wherein, TH2 is the first coordinate value of the second interpolation point, N frameis the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

[0019] In one possible implementation, determining the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point associated with the second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the to-be-processed image includes: determining the first coordinate value of the fourth interpolation point based on a first formula, wherein the first formula is:

[0020]

[0021] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:

[0022]

[0023] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;

[0024] Among them, TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value.

[0025] In a possible implementation, determining the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point associated with the second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed includes: determining an initial value of the first coordinate value of the fourth interpolation point based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel; setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB component of the first pixel; determining a first pixel number and a second pixel number based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first pixel number is the number of luminance values ​​in the image to be processed. The method further comprises: determining the number of pixels in a third brightness interval, wherein the third brightness interval is an interval between an initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and the second number of pixels is a total number of pixels in the image to be processed or in a brightness histogram of the image to be processed; determining the first coordinate value of the fourth interpolation point according to the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point; and determining the first coordinate value of the fifth interpolation point according to the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

[0026] In one possible implementation, the second brightness interval includes N subintervals, where N is a positive integer. The determining the first coordinate value of the fifth interpolation point based on the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point includes: determining an i-th subinterval from the N subintervals, the i-th subinterval being located in n subintervals of the N subintervals, the sequence numbers of the n subintervals being greater than or equal to N / 4, and the sequence numbers of the n subintervals being less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval being the minimum value among the n subintervals; and determining the first coordinate value of the fifth interpolation point based on the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i.

[0027] In a possible implementation, the value of N is 8.

[0028] In a possible implementation, determining the initial value of the first coordinate value of the fourth interpolation point according to the first coordinate value of the third interpolation point and the maximum value of the RGB components of the first pixel includes: determining the initial value of the first coordinate value of the fourth interpolation point according to the following:

[0029]

[0030] TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate value of the third interpolation point.

[0031] In one possible implementation, determining the first coordinate value of the fourth interpolation point based on the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point includes: determining a ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel; and determining the first coordinate value of the fourth interpolation point according to the following formula:

[0032]

[0033] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of the first pixels to the number of the second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and POW(x, j) refers to x raised to the power of j.

[0034] In a possible implementation, determining the first coordinate value of the fifth interpolation point according to the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i includes:

[0035] The first coordinate value of the fifth interpolation point is determined according to the following formula:

[0036]

[0037] TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

[0038] In a possible implementation, the method further includes: determining a third number of pixels and a fourth number of pixels based on a brightness histogram of the image to be processed, a first coordinate value of a fourth interpolation point, a first coordinate value of a fifth interpolation point, and a first coordinate value of a sixth interpolation point, wherein the third number of pixels is the number of pixels in the brightness histogram located between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point, and the fourth number of pixels is the number of pixels in the brightness histogram located between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point; and determining an adjustment strength of the second coordinate value of the fifth interpolation point based on the third number of pixels and the fourth number of pixels, wherein the adjustment strength is used to indicate a degree of offset of the second coordinate value of the fifth interpolation point relative to an initial value of the second coordinate value of the fifth interpolation point.

[0039] In a possible implementation, determining the adjustment strength of the second coordinate value of the fifth interpolation point according to the third number of pixels and the fourth number of pixels includes: determining the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula:

[0040]

[0041] TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels.

[0042] In a possible implementation, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:

[0043]

[0044] Among them, VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

[0045] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a third target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable. The brightness mapping function is as follows:

[0046]

[0047] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0048] In a second aspect, a method for processing an image dynamic range is provided, comprising: obtaining a maximum value of an RGB component of a first pixel of an image to be processed, wherein the first pixel is a pixel having the largest maximum value of the RGB component of pixels in the image to be processed, and the maximum value of the RGB component of the pixel is the maximum value of the R component, the G component, and the B component of the pixel; determining a first coordinate value of an interpolation point associated with at least one cubic spline curve based on the maximum value of the RGB component of the first pixel and a brightness histogram of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation point, a second interpolation point, and a third interpolation point, and the first coordinate value of the interpolation point is a brightness value. The first coordinate value of each interpolation point associated with the cubic spline curve is used to determine a corresponding function of the cubic spline curve, and each function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed, and the first brightness interval corresponding to the function of the cubic spline curve is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the cubic spline curve.

[0049] By obtaining the maximum value of the RGB component of the first pixel of the image to be processed, and determining the first coordinate value of at least one interpolation point related to the cubic spline curve according to the maximum value of the RGB component of the first pixel and the brightness histogram of the image to be processed, the method for determining the interpolation point is simple and easy to execute. In addition, by determining the first coordinate values ​​of the first interpolation point to the third interpolation point related to the cubic spline curve, the function of the cubic spline curve is determined according to the first coordinate values ​​of the first interpolation point to the third interpolation point, so that the brightness value of the pixel of the image to be processed whose brightness value is within the first brightness interval is mapped to the first target pixel value according to the function of the cubic spline curve, that is, the brightness values ​​of a part of the pixels in the image to be processed are mapped according to the cubic spline curve. The function of the curve is mapped to protect the pixels in the first brightness range, thereby improving the display effect of the image; in addition, compared with brightness mapping of the processed image only according to the basic mapping curve, the present application performs brightness mapping on some pixels through the function of the cubic spline curve, and the brightness values ​​of the remaining pixels are mapped according to the basic mapping curve, which is equivalent to changing the original mapping relationship of a section of the curve in the basic mapping curve. In other words, the shape of the curve corresponding to the first brightness range in the basic mapping curve is changed, thereby realizing protection of a specific area, and at the same time increasing the diversity, flexibility, robustness and universality of the shape of the basic mapping curve, thereby improving the display effect of the image after adjusting the dynamic range.

[0050] In a possible implementation, the number of the cubic spline curves is one; determining the first coordinate value of the interpolation point associated with the at least one cubic spline curve based on the maximum value of the RGB component of the first pixel and the brightness histogram of the image to be processed includes: determining the maximum value of the RGB component of the second pixel corresponding to a first percentage, the maximum value of the RGB component of the third pixel corresponding to a second percentage, and the maximum value of the RGB component of the fourth pixel corresponding to a third percentage based on the brightness histogram, wherein the first percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the second pixel, and the second percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the third pixel. The third percentage represents the percentage of pixels with maximum RGB component values ​​among the multiple pixels in the image to be processed, wherein the third percentage represents the percentage of pixels with maximum RGB component values ​​less than or equal to the maximum RGB component value of the fourth pixel among the multiple pixels in the image to be processed; determining the first coordinate value of the first interpolation point according to the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, and the maximum RGB component value of the fourth pixel corresponding to the third percentage; setting the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; and determining the first coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and the histogram information corresponding to the first brightness interval in the brightness histogram.

[0051] In a possible implementation, determining the first coordinate value of the first interpolation point based on the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage includes: determining a first value of the first coordinate value of the first interpolation point based on the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and a brightness threshold; and determining the first coordinate value of the first interpolation point based on the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value.

[0052] In a possible implementation, the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%; determining the first value of the first coordinate value of the first interpolation point based on the maximum value of the RGB component of the second pixel corresponding to the first percentage, the maximum value of the RGB component of the third pixel corresponding to the second percentage, and a brightness threshold includes: determining the first value of the first coordinate value of the first interpolation point according to the following formula:

[0053]

[0054] Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90% ratio, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95% ratio, and THRESOLD is the brightness threshold.

[0055] In a possible implementation, determining the first coordinate value of the first interpolation point based on the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value includes: determining a difference between twice the maximum RGB component value of the third pixel corresponding to the second percentage and the maximum RGB component value of the second pixel corresponding to the first percentage; determining whether the maximum RGB component value of the fourth pixel corresponding to the third percentage is greater than a sum of the obtained difference and a first preset value and whether the first value is greater than a first threshold; and if so, setting the first coordinate value of the first interpolation point to the first value.

[0056] In a possible implementation, determining the first coordinate value of the first interpolation point based on the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage includes: determining the maximum RGB component of the fifth pixel corresponding to the fourth percentage, the maximum RGB component of the sixth pixel corresponding to the fifth percentage, and the maximum RGB component of the seventh pixel corresponding to the sixth percentage based on the brightness histogram of the image to be processed, wherein the fourth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component is less than or equal to the maximum RGB component of the fifth pixel, the fifth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component is less than or equal to the maximum RGB component of the sixth pixel, and the sixth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component is less than or equal to the maximum RGB component of the seventh pixel. ratio; determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB component of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB component of the second pixel corresponding to the first percentage, and a brightness threshold; determining a second value of the first coordinate value of the first interpolation point according to the maximum value of the RGB component of the second pixel corresponding to the first percentage, the maximum value of the RGB component of the third pixel corresponding to the second percentage, and the brightness threshold; determining a third value of the first coordinate value of the first interpolation point according to the maximum value of the RGB component of the third pixel corresponding to the second percentage, the maximum value of the RGB component of the fourth pixel corresponding to the third percentage, and the brightness threshold; determining the first coordinate value of the first interpolation point according to the maximum value of the RGB component of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB component of the sixth pixel corresponding to the fifth percentage, the maximum value of the RGB component of the second pixel corresponding to the first percentage, the maximum value of the RGB component of the third pixel corresponding to the second percentage, the maximum value of the RGB component of the fourth pixel corresponding to the third percentage, the maximum value of the RGB component of the seventh pixel corresponding to the sixth percentage, and the first value to the third value.

[0057] In one possible implementation, the first percentage is 90%, the second percentage is 95%, the third percentage is 99%, the fourth percentage is 50%, the fifth percentage is 10%, and the sixth percentage is 100%. Determining a first value of the first coordinate value of the first interpolation point includes: determining the first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is:

[0058]

[0059] Determining the second value of the first coordinate value of the first interpolation point includes: determining the second value of the first coordinate value of the first interpolation point according to a second formula, wherein the second formula is:

[0060]

[0061] Determining the third value of the first coordinate value of the first interpolation point includes: determining the third value of the first coordinate value of the first interpolation point according to a third formula, wherein the third formula is:

[0062]

[0063] Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.

[0064] In a possible implementation, determining the first coordinate value of the first interpolation point includes: determining an initial value of the first coordinate value of the first interpolation point by using a fourth formula:

[0065]

[0066] The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value of the first coordinate value of the first interpolation point, the second value, and the third value:

[0067]

[0068] Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to the 100%.

[0069] In a possible implementation, the first brightness interval includes N subintervals, where N is a positive integer; determining the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and the histogram information corresponding to the first brightness interval in the brightness histogram includes: determining an i-th subinterval from the N subintervals, the i-th subinterval being located in n subintervals of the N subintervals, the sequence numbers of the n subintervals being greater than or equal to N / 4, and the sequence numbers of the n subintervals being less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval being the minimum value in the n subintervals; and determining the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i.

[0070] In a possible implementation, the value of N is 8.

[0071] In a possible implementation, determining the first coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i includes:

[0072] The first coordinate value of the second interpolation point is determined according to the following formula:

[0073]

[0074] Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

[0075] In one possible implementation, the function of the cubic spline curve is obtained as follows: obtaining a function of a basic mapping curve; mapping the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determining the function of the cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0076] In a possible implementation, determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point includes: determining the second coordinate value of the second interpolation point according to the following formula;

[0077]

[0078] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0079] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a second target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the second target brightness value as a dependent variable. The brightness mapping function is as follows:

[0080]

[0081] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the second target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0082] In a possible implementation, the method further includes: determining a first pixel number and a second pixel number based on a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, wherein the first pixel number is the number of pixels in the brightness histogram located between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point, and the second pixel number is the number of pixels in the brightness histogram located between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point; and determining an adjustment strength of the second coordinate value of the second interpolation point based on the first pixel number and the second pixel number, wherein the adjustment strength is used to indicate a degree of offset of the second coordinate value of the second interpolation point relative to an initial value of the second coordinate value of the second interpolation point.

[0083] In a possible implementation, determining the adjustment strength of the second coordinate value of the second interpolation point according to the first number of pixels and the second number of pixels includes: determining the adjustment strength of the second coordinate value of the second interpolation point according to the following formula:

[0084]

[0085] Among them, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step, NUM1 is the first pixel number, and NUM2 is the second pixel number.

[0086] In a possible implementation, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:

[0087]

[0088] Among them, VA21 is the initial value of the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0089] According to a third aspect, a method for processing an image dynamic range is provided, comprising: receiving a function of a cubic spline curve and data information of the image to be processed sent by an encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, and the function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding interval to a target brightness value, thereby correcting the dynamic range of the image to be processed; and correcting the dynamic range of the image to be processed according to the function of the cubic spline curve and the data information of the image to be processed.

[0090] In a fourth aspect, an image dynamic range processing device is provided, including: an acquisition module, used to acquire a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point related to a first cubic spline curve, where the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values; a first determination module, used to determine the first coordinate value of a second interpolation point related to the first cubic spline curve based on histogram information of a first brightness interval of the image to be processed, where the first brightness interval is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, and the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine a function of the first cubic spline curve, where the function of the first cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed.

[0091] In a possible implementation, the function of the first cubic spline curve is obtained according to the following method: the acquisition module is further used to acquire the function of the basic mapping curve; the first determination module is further used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determine the function of the first cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0092] In a possible implementation, the first determining module is configured to determine the second coordinate value of the second interpolation point according to the following formula:

[0093]

[0094] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0095] In one possible implementation, the apparatus further includes: a second determining module configured to determine first coordinate values ​​of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point associated with a second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB components of a first pixel of the image to be processed; wherein the first pixel is a pixel having the maximum RGB component value in the image to be processed, and the maximum RGB component value of the pixel is the maximum value among the R component, the G component, and the B component of the pixel; the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine a function of the second cubic spline curve, the function of the second cubic spline curve being configured to map luminance values ​​of pixels in the image to be processed whose luminance values ​​are within a second luminance interval to a second target luminance value, thereby correcting the dynamic range of the image to be processed, wherein the second luminance interval is an interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and there is no overlapping area between the first luminance interval and the second luminance interval.

[0096] In one possible implementation, the device further includes: a sending module, configured to send the function of the cubic spline curve and the data information of the image to be processed to a decoding end, so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, and the data information of the image to be processed is used to obtain the image to be processed.

[0097] In a possible implementation, the acquisition module is specifically configured to set the first coordinate value of the first interpolation point as a first preset brightness value; and set the first coordinate value of the third interpolation point as a second preset brightness value.

[0098] In a possible implementation, the first coordinate value of the second interpolation point is determined according to the following formula:

[0099]

[0100] Wherein, TH2 is the first coordinate value of the second interpolation point, N frameis the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

[0101] In a possible implementation, the second determining module is specifically configured to determine the first coordinate value of the fourth interpolation point according to a first formula, wherein the first formula is:

[0102]

[0103] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:

[0104]

[0105] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;

[0106] Among them, TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value.

[0107] In a possible implementation, the second determination module is configured to determine the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: determining an initial value of the first coordinate value of the fourth interpolation point based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel; setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB component of the first pixel; determining the first pixel number and the second pixel number based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first pixel number is the number of pixels in the image to be processed whose brightness values ​​are within the third brightness interval, and the second pixel number is the number of pixels in the image to be processed whose brightness values ​​are within the third brightness interval. The third brightness interval is an interval between an initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and the second number of pixels is a total number of pixels in the image to be processed or in a brightness histogram of the image to be processed; the first coordinate value of the fourth interpolation point is determined based on the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point; and the first coordinate value of the fifth interpolation point is determined based on the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

[0108] In one possible implementation, the second brightness interval includes N subintervals, where N is a positive integer, and the second determination module is configured to determine the first coordinate value of the fifth interpolation point in the following manner: determining an i-th subinterval from the N subintervals, where the i-th subinterval is located in n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is the minimum value among the n subintervals; and determining the first coordinate value of the fifth interpolation point based on the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i.

[0109] In a possible implementation, the value of N is 8.

[0110] In a possible implementation, the second determining module is configured to determine an initial value of the first coordinate value of the fourth interpolation point in the following manner:

[0111]

[0112] TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate value of the third interpolation point.

[0113] In one possible implementation, the second determination module is configured to determine the first coordinate value of the fourth interpolation point by: determining a ratio of the length of the third brightness interval to the maximum value of the RGB components of the first pixel; and determining the first coordinate value of the fourth interpolation point according to the following formula:

[0114]

[0115] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of the first pixels to the number of the second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and POW(x, j) refers to x raised to the power of j.

[0116] In a possible implementation, the second determining module is configured to determine the first coordinate value of the fifth interpolation point in the following manner:

[0117]

[0118] TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

[0119] In a possible implementation, the apparatus further includes:

[0120] The second determination module is further configured to determine a third number of pixels and a fourth number of pixels based on a brightness histogram of the image to be processed, the first coordinate value of a fourth interpolation point, the first coordinate value of a fifth interpolation point, and the first coordinate value of a sixth interpolation point, where the third number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point, and the fourth number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point; and determine an adjustment strength of the second coordinate value of the fifth interpolation point based on the third number of pixels and the fourth number of pixels, where the adjustment strength indicates a degree of offset of the second coordinate value of the fifth interpolation point relative to an initial value of the second coordinate value of the fifth interpolation point.

[0121] In a possible implementation, the second determining module is specifically configured to determine the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula:

[0122]

[0123] TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels.

[0124] In a possible implementation, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:

[0125]

[0126] Among them, VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

[0127] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a third target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable. The brightness mapping function is as follows:

[0128]

[0129] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0130] In a fifth aspect, the present application provides an image dynamic range processing device, comprising:

[0131] An acquisition module is configured to acquire a maximum RGB component value of a first pixel of an image to be processed, wherein the first pixel is a pixel in the image to be processed having the largest RGB component value, and the maximum RGB component value of the pixel is the maximum value among the R component, the G component, and the B component of the pixel. A first determination module is configured to determine a first coordinate value of at least one interpolation point associated with a cubic spline curve based on the maximum RGB component value of the first pixel and a brightness histogram of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation point, a second interpolation point, and a third interpolation point, and the first coordinate value of the interpolation point is a brightness value. The first coordinate value of each interpolation point associated with the cubic spline curve is used to determine a corresponding function of the cubic spline curve, and each function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed. The first brightness interval corresponding to the function of the cubic spline curve is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the function of the cubic spline curve.

[0132] In a possible implementation, the number of the cubic spline curve is one;

[0133] The first determining module is further configured to determine, based on the brightness histogram, a maximum RGB component value of a second pixel corresponding to a first percentage, a maximum RGB component value of a third pixel corresponding to a second percentage, and a maximum RGB component value of a fourth pixel corresponding to a third percentage, wherein the first percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the second percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel, and the third percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel; determine a first coordinate value of the first interpolation point based on the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, and the maximum RGB component value of the fourth pixel corresponding to the third percentage; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; and determine the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and histogram information corresponding to the first brightness interval in the brightness histogram.

[0134] In a possible implementation, the first determining module is configured to determine the first coordinate value of the first interpolation point in the following manner:

[0135] determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and a brightness threshold;

[0136] The first coordinate value of the first interpolation point is determined according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value.

[0137] In one possible implementation, the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%;

[0138] The determining module is configured to determine a first value of the first coordinate value of the first interpolation point according to the following formula:

[0139]

[0140] Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90% ratio, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95% ratio, and THRESOLD is the brightness threshold.

[0141] In one possible implementation, the first determination module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining a difference between a maximum RGB component value of a third pixel corresponding to twice the second percentage and a maximum RGB component value of a second pixel corresponding to the first percentage; determining whether the maximum RGB component value of a fourth pixel corresponding to the third percentage is greater than a sum of the obtained difference and a first preset value and whether the first value is greater than a first threshold; and if so, setting the first coordinate value of the first interpolation point to the first value.

[0142] In a possible implementation, the first determination module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining, based on the brightness histogram of the image to be processed, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the maximum RGB component value of the sixth pixel corresponding to the fifth percentage, and the maximum RGB component value of the seventh pixel corresponding to the sixth percentage, wherein the fourth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel, the fifth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel, and the sixth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel; The first value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the second pixel corresponding to the first percentage and the brightness threshold; the second value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and the brightness threshold; the third value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, and the brightness threshold; the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB components of the sixth pixel corresponding to the fifth percentage, the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, the maximum value of the RGB components of the seventh pixel corresponding to the sixth percentage, and the first to third values.

[0143] In one possible implementation, the first percentage is 90%, the second percentage is 95%, the third percentage is 99%, the fourth percentage is 50%, the fifth percentage is 10%, and the sixth percentage is 100%. The first determination module is configured to determine a first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is:

[0144]

[0145] A second value of the first coordinate value of the first interpolation point is determined according to a second formula, wherein the second formula is:

[0146]

[0147] A third value of the first coordinate value of the first interpolation point is determined according to a third formula, wherein the third formula is:

[0148]

[0149] Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.

[0150] In a possible implementation, the first determining module is configured to determine an initial value of the first coordinate value of the first interpolation point by using a fourth formula:

[0151]

[0152] The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value of the first coordinate value of the first interpolation point, the second value, and the third value:

[0153]

[0154] Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to the 100%.

[0155] In one possible implementation, the first brightness interval includes N subintervals, where N is a positive integer; the first determination module is configured to determine the first coordinate value of the second interpolation point in the following manner: determining an i-th subinterval from the N subintervals, where the i-th subinterval is located among n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is the minimum value among the n subintervals; and determining the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i.

[0156] In a possible implementation, the value of N is 8.

[0157] In a possible implementation, the first determining module is configured to determine the first coordinate value of the second interpolation point according to the following formula:

[0158]

[0159] Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

[0160] In a possible implementation, the function of the cubic spline curve is obtained according to the following method: the acquisition module is further used to acquire the function of the basic mapping curve; the first determination module is further used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determine the function of the cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0161] In a possible implementation, the first determining module is configured to determine the second coordinate value of the second interpolation point according to the following formula:

[0162]

[0163] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0164] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a second target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the second target brightness value as a dependent variable. The brightness mapping function is as follows:

[0165]

[0166] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the second target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0167] In one possible implementation, the device further includes: a second determination module, configured to determine a first number of pixels and a second number of pixels based on a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, wherein the first number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point, and the second number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point; and determine an adjustment strength of the second coordinate value of the second interpolation point based on the first number of pixels and the second number of pixels, wherein the adjustment strength is used to indicate a degree of offset of the second coordinate value of the second interpolation point relative to an initial value of the second coordinate value of the second interpolation point.

[0168] In a possible implementation, the second determining module is configured to determine an adjustment strength of the second coordinate value of the second interpolation point according to the following formula:

[0169]

[0170] Among them, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step, NUM1 is the first pixel number, and NUM2 is the second pixel number.

[0171] In a possible implementation, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:

[0172]

[0173] Among them, VA21 is the initial value of the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0174] In a sixth aspect, an image dynamic range processing device is provided, comprising: a receiving module for receiving a function of a cubic spline curve and data information of the image to be processed sent by an encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, and the function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding interval to a target brightness value, thereby correcting the dynamic range of the image to be processed; and a correction module for correcting the dynamic range of the image to be processed according to the function of the cubic spline curve and the data information of the image to be processed.

[0175] In a seventh aspect, an image processing device is provided, comprising a processor and a memory, wherein the processor and the memory are coupled, and the processor is used to enable the device to execute any one of the methods described in the first to third aspects.

[0176] In the eighth aspect, a chip device is provided, 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 any one of the methods described in the first to third aspects above.

[0177] In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program includes a method for implementing any one of the above-mentioned first to third aspects.

[0178] In a tenth aspect, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed on a computer, the computer implements the method described in any one of the first to third aspects above. BRIEF DESCRIPTION OF THE DRAWINGS

[0179] Figure 1 is the image of the PQ photoelectric transfer function;

[0180] Figure 2 is the image of the HLG photoelectric transfer function;

[0181] Figure 3 is the image of the SLF photoelectric transfer function;

[0182] Figure 4 A schematic diagram of a mapping curve used in a conventional dynamic range adjustment solution;

[0183] Figure 5 A schematic diagram of the end-to-end system structure for image dynamic range processing provided in an embodiment of the present application;

[0184] Figure 6 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 1 ;

[0185] Figure 7 Schematic diagram of the second cubic spline curve and the basic mapping curve;

[0186] Figure 8 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 2 ;

[0187] Figure 9 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 1 ;

[0188] Figure 10 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 2 ;

[0189] Figure 11 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 3 ;

[0190] Figure 12 A structural schematic diagram of an image processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0191] The technical solution in this application will be described below with reference to the accompanying drawings.

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

[0193] Dynamic range is used in many fields to express the ratio of the maximum to minimum values ​​of a variable. In digital images, dynamic range represents the ratio between the maximum and minimum brightness values ​​within the image's displayable range. The dynamic range in nature is very large. For example, the brightness of a night scene under a starry sky is approximately 0.001 cd / 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 of measurement for brightness. Thus, the dynamic range of nature reaches 1000,000,000 / 0.001=10 13 order of magnitude.

[0194] However, in real scenes in nature, the brightness of the sun and the brightness of the stars are not obtained at the same time.-3 to 10 6 Because this is a very large dynamic range, we usually refer to it as High Dynamic Range (HDR). In contrast to High Dynamic Range, the dynamic range of ordinary images 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 a photograph.

[0195] The greater the dynamic range of an image, the more scene detail it displays, the richer the brightness levels, and the more realistic the visual effect. Traditional digital images typically use one byte, or 8 bits, to store a pixel value. High dynamic range, however, uses multiple bytes of floating-point numbers to store a pixel value, thus enabling the representation of a high dynamic range in natural scenes.

[0196] The process of optical digital imaging (for example, the imaging process of a digital camera) converts the light radiation of a real scene into electrical signals through an image sensor and stores them as digital images. The purpose of image display, on the other hand, is to reproduce the real scene depicted by a digital image through a display device. The ultimate goal of both is to provide users with the same visual perception as if they were directly observing the real scene.

[0197] The brightness levels of real scenes displayed by optical radiation (light signals) are almost linear, so optical signals are also called linear signals. However, in the process of converting optical signals into electrical signals in optical digital imaging, not every optical signal corresponds to an electrical signal. The converted electrical signals are nonlinear, so they are also called nonlinear signals.

[0198] The Optical Electro Transfer Function (OETF) represents the conversion relationship between linear signals and nonlinear signals of image pixels. Currently, the commonly used OETFs include the following three:

[0199] The three OTFs are Perceptual Quantizer (PQ), Hybrid Log-Gamma (HLG), and Scene Luminance Fidelity (SLF). These three OTFs are specified by the Audio Video Coding Standard (AVS).

[0200] 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 is the image of the PQ photoelectric transfer function.

[0201] 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):

[0202]

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

[0204]

[0205] 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.

[0206]

[0207] 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.

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

[0209]

[0210] 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, and c are HLG photoelectric transfer coefficients, a=0.17883277, b=0.28466892, and c=0.55991073.

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

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

[0213]

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

[0215]

[0216] Where L represents the linear signal value, which is normalized to [0, 1]. L′ represents the nonlinear signal value, which ranges from [0, 1]. p, m, a, and b are the SLF photoelectric transfer coefficients, where p = 2.3, m = 0.14, a = 1.12762, and b = -0.12762.

[0217] Because different display devices have varying display capabilities, a mapping curve is typically used to map the brightness of each pixel in an image to a target brightness value based on the device's capabilities. This allows the image's dynamic range to be adjusted by changing the pixel's brightness. In other words, the image's dynamic range is adjusted to fit within the display device's display capabilities.

[0218] Dynamic range adjustment methods are primarily used to adapt front-end illumination signals to back-end display devices. For example, if the illumination signal collected by the front-end is 4000 nits, while the back-end display device (TV, iPad) has a display capability of only 500 nits, how to map the 4000 nit signal to the 500 nit device is a high-to-low mapping process. Alternatively, if the illumination signal collected by the front-end is 100 nits, while the back-end display device has a display capability of 2000 nits, how to better display the 100 nit signal on the 2000 nit device is another low-to-high mapping process.

[0219] This dynamic range adjustment method can be divided into static and dynamic. The static dynamic range adjustment method is based on the same video content or the same hard disk content, and the entire mapping process is performed using a single data. In other words, the mapping curve is usually the same, that is, the same mapping curve is used for each scene. The dynamic dynamic range adjustment method is based on the content of a specific area, each scene, or each frame. In other words, different mapping curves are used for each specific area, each scene, or each frame. The dynamic dynamic range adjustment method requires carrying information for each frame and each scene.

[0220] In a static dynamic range adjustment method, static metadata needs to be transmitted to a back-end display device to guide the back-end display device in generating a mapping curve. Since the static dynamic range adjustment method uses the same mapping curve for the same video content or the same hard disk content, the static metadata remains unchanged for the same video content or the same hard disk content. In a dynamic dynamic range adjustment method, dynamic metadata needs to be transmitted to the back-end display device to guide the back-end display device in generating a mapping curve. Since the dynamic dynamic range adjustment method performs different mapping curve processing for each scene or each frame, the dynamic metadata required for performing different mapping curve processing for each scene or each frame is different.

[0221] It should be noted that compared with the static dynamic range adjustment method, the dynamic dynamic range adjustment method performs different mapping curve processing for each scene or each frame. Therefore, the dynamic dynamic range adjustment method can adapt to more diverse scenes and display better adaptation effects, thus becoming the current mainstream choice.

[0222] However, in the existing dynamic range adjustment method, the shape of the mapping curve used is not flexible enough, resulting in the loss of brightness levels in some areas of the image and unclear brightness contrast, which makes the display effect of the image after dynamic range adjustment poor. Figure 4 This is a diagram of the mapping curve currently used in the dynamic range adjustment scheme. From the figure, we can see that the mapping curve has only C-type, inverted S-type and inverted C-type. If the image is a scene with strong contrast between light and dark, a positive S-type mapping curve is required. However, through Figure 4 When the mapping curve in the image is used to adjust the dynamic range, since there is no positive S-shape in the shape of the mapping curve, Figure 4 After the image is dynamically mapped using the mapping curve in , the brightness level of the image will be lost and the brightness contrast will not be obvious, resulting in poor display effect of the image after adjusting the dynamic range.

[0223] To this end, the present application provides an image dynamic range processing method, by determining the first coordinate value of the first interpolation point to the third interpolation point related to the cubic spline curve, the first coordinate value of the interpolation point is the brightness value, and the function of the cubic spline curve is determined according to the first coordinate value of the first interpolation point to the third interpolation point, so that the brightness value of the pixel whose brightness value in the image to be processed is within the first brightness interval is mapped to the first target pixel value according to the function of the cubic spline curve, thereby correcting the dynamic range of the image to be processed, wherein the first brightness interval is the interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point.

[0224] Obviously, when mapping the brightness values ​​of pixels in the image to be processed through the basic mapping curve, the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval are mapped to the first target pixel values ​​through the function of the cubic spline curve determined according to the first coordinate values ​​from the first interpolation point to the third interpolation point, that is, brightness mapping is performed on some pixels in the image to be processed according to the function of the cubic spline curve, and brightness mapping is performed on pixels in the image to be processed whose brightness values ​​are outside the first brightness interval according to the basic mapping curve, which changes the original mapping relationship of the brightness values ​​of some pixels in the image to be processed, that is, changes the shape of the curve corresponding to the first brightness interval in the basic mapping curve, increases the diversity and flexibility of the shape of the basic mapping curve, and improves the display effect of the image after adjusting the dynamic range.

[0225] Figure 5 This is a schematic diagram of the end-to-end system structure for image dynamic range processing provided by the embodiment of the present application. Figure 5 , the system comprises:

[0226] The encoding end and the decoding end include a preprocessing module and an encoding module; the decoding end includes a decoding module and a dynamic range adjustment module.

[0227] Specifically, the preprocessing module is used to receive the image to be processed, which can be a frame image in a video or an independent picture, and extract dynamic metadata from the image to be processed. It should be noted that the dynamic metadata includes basic dynamic metadata and parameters of the function of the cubic spline curve, or the dynamic metadata includes basic dynamic metadata and parameters of the function of the basic mapping curve and parameters of the function of the cubic spline curve. The image to be processed includes multiple pixels, so the basic dynamic metadata extracted from the image to be processed include maximun_maxrgb, average_maxrgb, variance_maxrgb, and minimum_maxrgb, where maximun_maxrgb is used to indicate the maximum brightness of the displayed content, for example, maximun_maxrgb is the maximum value of the RGB component of the pixel with the largest maximum value of the RGB component among the multiple pixels of the image to be processed; minimum_maxrgb is used to indicate the minimum brightness of the displayed content, for example, minimum_maxrgb is the maximum value of the RGB component of the pixel with the smallest maximum value of the RGB component among the multiple pixels of the image to be processed; average_maxrgb is used to indicate the average brightness of the displayed content, for example, average_maxrgb is the average of the maximum values ​​of the RGB components of the multiple pixels of the image to be processed; variance_maxrgb is used to indicate the brightness variation range of the displayed content, for example, variance_maxrgb is used to indicate the brightness variation range of the displayed content. iance_maxrgb represents the maximum value of the RGB components corresponding to the 90th percentile and the 10th percentile of the maximum value of the RGB components of multiple pixels in the processed image. The cubic spline function is used to map the brightness values ​​of pixels in the processed image whose brightness values ​​are within the range of its independent variable. The base mapping curve function is used to map the brightness values ​​of pixels in the processed image whose brightness values ​​are outside the range of the cubic spline function's independent variable, thereby adjusting the dynamic range of the processed image.

[0228] The encoding module is used to encode dynamic metadata and embed the dynamic metadata into the code stream, and to encode the image to be processed and embed the image to be processed into the code stream, so as to send the dynamic metadata and the image to be processed to the decoding end through the code stream.

[0229] The decoding module is used to decode the image to be processed and dynamic metadata.

[0230] A dynamic range adjustment module is configured to calculate the parameters of the function of the basic mapping curve based on the decoded image to be processed and the dynamic metadata and the peak brightness of the display device, if the dynamic metadata includes basic dynamic metadata and parameters of the function of the cubic spline curve, construct the function of the basic mapping curve based on the parameters of the function of the basic mapping curve, and construct the function of the cubic spline curve based on the parameters of the function of the cubic spline curve, and adjust the dynamic range of the image to be processed through the function of the basic mapping curve and the function of the cubic spline curve; if the dynamic metadata includes basic dynamic metadata and parameters of the function of the basic mapping curve and parameters of the function of the cubic spline curve, construct the function of the basic mapping curve based on the parameters of the function of the basic mapping curve, construct the function of the cubic spline curve based on the parameters of the function of the cubic spline curve, and adjust the dynamic range of the image to be processed through the function of the basic mapping curve and the function of the cubic spline curve, without calculating the parameters of the function of the basic mapping curve.

[0231] The encoding end and decoding end can be, for example, a mobile phone display device and a set-top box, a TV display device, a network live broadcast or a video application conversion device, etc., and this application does not make any special restrictions on this. Figure 5 The end-to-end system structure diagram is only exemplary and is not intended to limit this application.

[0232] according to Figure 5 From the working principle of the system shown in , it can be seen that by determining the function of the cubic spline curve and the function of the basic mapping curve, and combining the functions of the cubic spline curve and the function of the basic mapping curve, it can be seen that when brightness mapping is performed on the processed image according to the function of the cubic spline curve and the function of the basic mapping curve, the brightness values ​​of some pixels are mapped according to the function of the cubic spline curve, and the brightness values ​​of some pixels are mapped according to the function of the basic mapping curve. Compared with the existing method of simply mapping the brightness values ​​of all pixels according to the function of the basic mapping curve, this system maps the brightness values ​​of some pixels through the function of the cubic spline curve, which is equivalent to changing the original mapping relationship of a section of the curve in the basic mapping curve, that is, changing the shape of the curve corresponding to the first brightness interval in the basic mapping curve, thereby achieving protection of specific areas, and also increasing the diversity, flexibility, robustness and universality of the shape of the basic mapping curve, thereby improving the display effect of the image after adjusting the dynamic range.

[0233] Figure 6 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 1 The execution subject of the image dynamic range processing method is, for example, Figure 5 The encoding end in this application does not make any special restrictions on this. Figure 6 As shown, the image dynamic range processing method includes the following steps:

[0234] Step 601: Obtain a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point related to a first cubic spline curve, wherein the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values.

[0235] Specifically, the first coordinate value of the first interpolation point is set to a first preset brightness value, and the first coordinate value of the third interpolation point is set to a second preset brightness value. The first preset brightness value can be, for example, the lower limit of brightness that can be perceived by the human eye, and the second preset brightness value can be, for example, the lower limit of brightness of human skin color. This embodiment of the present application is not particularly limited to this. For example, the first preset brightness value and the second preset brightness value can also be set based on empirical values. For example, the first coordinate value of the first interpolation point is 0.15, and the first coordinate value of the third interpolation point is 0.35.

[0236] The brightness value set here can be the maximum value among the R component, G component and B component of the pixel, or the average value of the R component, G component and B component of the pixel, etc. This application does not impose any special restrictions on this.

[0237] Step 602: Determine the first coordinate value of the second interpolation point associated with the first cubic spline curve based on the histogram information of the first brightness interval of the image to be processed, where the first brightness interval is the interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point. The first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine the function of the first cubic spline curve. The function of the first cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed.

[0238] Specifically, the first coordinate value of the second interpolation point can be determined according to the following formula:

[0239]

[0240] Where TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

[0241] The histogram information of the first brightness interval is a histogram of the interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point in the brightness histogram of the image to be processed. frameThe value is the total number of pixels included in the histogram information of the first brightness interval. The horizontal axis of the brightness histogram of the image to be processed represents the brightness of the pixels in the image to be processed, which gradually transitions from full black to full white from left to right, and the vertical axis represents the relative number of pixels in the image to be processed that are in this brightness range. It should be noted that when constructing the brightness histogram of the image to be processed, the maximum value of the R component, G component and B component of the pixel can be used as the brightness value of the pixel, or the average value of the R component, G component and B component of the pixel can be used as the brightness value of the pixel, etc. This application does not make any special restrictions on this.

[0242] In other implementations of the present application, the first coordinate value of the second interpolation point may also be determined according to the following formula:

[0243]

[0244] Where TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

[0245] In other embodiments of the present application, the first coordinate value of the second interpolation point may also be set to the average value of the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point.

[0246] The process of obtaining the function of the first cubic spline curve includes the following four steps:

[0247] Step 1: Obtain a function of a base mapping curve. The function of the base mapping curve is used to map the brightness value of a pixel in the image to be processed to a third target brightness value. The function of the base mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable. For example, the brightness mapping function is as follows:

[0248]

[0249] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0250] It should be noted that the functions of the above basic mapping curves are merely exemplary and are not intended to limit the present application.

[0251] The brightness value represented by the independent variable and dependent variable of the function of the basic mapping curve can be the maximum value of the R component, G component and B component of the pixel, or the average value of the R component, G component and B component of the pixel, etc. This application does not impose any special restrictions on this.

[0252] Acquiring the function of the basic mapping curve includes: acquiring values ​​of parameters of the function of the basic mapping curve, and then constructing the basic mapping curve according to the values ​​of the parameters of the function of the basic mapping curve.

[0253] Below, the process of obtaining the function of the basic mapping curve will be described by taking the brightness mapping function as an example.

[0254] First, set m to 2.4, n to 1, and b to the minimum brightness MinDisplay of the reference display device. The reference display device here can be the display device displaying the image to be processed or a display device assumed in the current calculation.

[0255] The first value of p is calculated based on average_maxrgb(avgL) in the image to be processed and the following formula:

[0256]

[0257] in, PvalueHo, PvalueLo, TPH0, and TPL0 are all preset values, and the default values ​​are: 3.5, 4, 0, 0.6, and 0.3 respectively. g0() is y=xN, the default is y=x, and p1 is the first value of p.

[0258] Then, the value of p is determined according to the maximum brightness correction value max_lum and p1 of the image to be processed. The specific process is as follows:

[0259]

[0260] Among them, PdeltaH1, PdeltaL1, TPH1, and TPL1 are all preset values, and the default values ​​are: 0.6, 0, 0.9, and 0.75 respectively. g1() is y=x N , the default is y=x.

[0261] Finally, calculate H(L) based on b, p, m, n, K1, K2, and K3:

[0262]

[0263] Among them, K1, K2, and K3 are all preset values, and the default values ​​are all 1.

[0264] The calculation formula for a is:

[0265] a=(MaxDisplay-MinDisplay) / (H(MaxSource)-H(MinSource))

[0266] Among them, MaxDisplay is the maximum brightness of the reference display device, MinDisplay is the minimum brightness of the reference display device, MaxSource is the maximum brightness correction value max_lum of the image to be processed, and MinSource is the minimum brightness value of the image to be processed.

[0267] Next, the process of determining the maximum brightness correction value max_lum of the image to be processed is described.

[0268] Specifically, the maximum_maxrgb, average_maxrgb, and variation_maxrgb of the image to be processed are obtained. It should be noted that these three parameters have been explained above, so they will not be repeated here.

[0269] The first value of the maximum luminance reference value max_lum of the image to be processed is determined according to the following formula:

[0270] MAX=B×max imun_maxrgb+A×(2×average_maxrgb)+(1-AB)×(2×variance_maxrgb)

[0271] Among them, MAX is the first value of the maximum brightness reference value max_lum, A and B are weight coefficients, F() is a constant function.

[0272] The maximum brightness correction value max_lum of the image to be processed is determined according to the following formula and the first value of max_lum:

[0273]

[0274] Among them, max_lum is the maximum brightness correction value, MaxRefDisplay is the maximum display brightness value of the display device, MIN is the preset minimum display brightness value, and MAX is the first value of the maximum brightness reference value max_lum.

[0275] Step 2: Map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point.

[0276] Specifically, the first coordinate value of the first interpolation point is substituted as the independent variable into the function of the basic mapping curve, and the obtained value is determined as the second coordinate value of the first interpolation point. Similarly, the first coordinate value of the third interpolation point is substituted as the independent variable into the function of the basic mapping curve, and the obtained value is determined as the second coordinate value of the third interpolation point.

[0277] It should be noted that the above-mentioned method of calculating the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point is only exemplary and is not used to limit the present application. For example, the second coordinate value of the first interpolation point can also be determined based on the first coordinate value of the first interpolation point. It should be noted that no matter which method is used to calculate the second coordinate value of the first interpolation point, the calculated second coordinate value of the first interpolation point needs to be the same as the second coordinate value of the first interpolation point obtained by substituting the function of the basic mapping curve.

[0278] Step 3: Determine the second coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point.

[0279] Specifically, the second coordinate value of the second interpolation point may be determined in the following two ways:

[0280] The first method is to determine the second coordinate value of the second interpolation point according to the following formula:

[0281]

[0282] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0283] The second method is to determine the second coordinate value of the second interpolation point according to the following formula:

[0284]

[0285] Wherein, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and TH_strength is the adjustment strength of the second coordinate value of the second interpolation point. TH_strength is used to indicate the degree of deviation of the second coordinate value of the second interpolation point relative to the initial value of the second coordinate value of the second interpolation point. The specific value of TH_strength can be set by itself or obtained by calculation. It is not specifically limited here. For example, TH_strength can be set to 0. The calculation formula of the initial value of the second coordinate value of the second interpolation point is:

[0286] It should be noted that the method of determining the second coordinate value of the second interpolation point here is only exemplary and is not intended to limit this application.

[0287] Step 4: Determine the function of the first cubic spline curve based on the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0288] The first cubic spline curve includes two partial curves. Therefore, the function of the first cubic spline curve also includes two piecewise functions, wherein the two piecewise functions correspond to the two partial curves in a one-to-one manner.

[0289] For example, the function of the first cubic spline curve includes two piecewise functions, namely:

[0290] F(L)=MD[1]×(L-TH1) 3 +MC[1]×(L-TH1) 2 +MB[1]×(L-TH1) 1 +MA[1]

[0291] Wherein, L is the brightness value of the pixel whose brightness value is in the interval [TH1, TH2], and F(L) is the first target brightness.

[0292] F(L)=MD[2]×(L-TH2) 3 +MC[2]×(L-TH2) 2 +MB[2]×(L-TH2) 1 +MA[2]

[0293] Wherein, L is the brightness value of the pixel in the interval [TH2, TH3], F(L) is the first target brightness, MD[1], MD[2], MC[1], MC[2], MB[1], MB[2], MA[1], MA[2] are all parameters of the function of the first cubic spline curve.

[0294] The process of determining the function of the first cubic spline curve includes: calculating the values ​​of each parameter of the function of the first cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point, and then determining the function of the first cubic spline curve according to the values ​​of the each parameter of the function of the first cubic spline curve.

[0295] Next, the process of determining the fourth to sixth interpolation points related to the second cubic spline curve will be described. The specific process is as follows:

[0296] The first coordinate values ​​of the fourth, fifth, and sixth interpolation points associated with the second cubic spline curve are determined based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed. The first coordinate value of the fourth, fifth, and sixth interpolation points associated with the second cubic spline curve are determined based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed. The first coordinate value of the first pixel is the pixel with the largest maximum value of the RGB component in the image to be processed, and the maximum value of the RGB component of the pixel is the maximum value among the R component, the G component, and the B component of the pixel. The first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine a function of the second cubic spline curve. The function of the second cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a second brightness range to a second target brightness value, thereby correcting the dynamic range of the image to be processed. The second brightness range is the range between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point. There is no overlapping area between the first brightness range and the second brightness range. It should be noted that the size relationship between the first coordinate values ​​of the first interpolation point to the sixth interpolation point can be: the first coordinate value of the first interpolation point < the first coordinate value of the second interpolation point < the first coordinate value of the third interpolation point < the first coordinate value of the fourth interpolation point < the first coordinate value of the fifth interpolation point < the first coordinate value of the sixth interpolation point.

[0297] In the embodiment of the present application, the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point can be determined by the following two methods, wherein:

[0298] Method 1: Determine the first coordinate value of the fourth interpolation point according to the first formula, where the first formula is:

[0299]

[0300] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:

[0301]

[0302] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;

[0303] Where TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value. It should be noted that the value of U can be any positive integer greater than 2, without any special limitation. For example, the value of U is 6.

[0304] Method 2: It includes five steps, including:

[0305] Step 1: Determine an initial value of the first coordinate value of the fourth interpolation point according to the first coordinate value of the third interpolation point and the maximum value of the RGB components of the first pixel.

[0306] The initial value of the first coordinate value of the fourth interpolation point can be determined as follows:

[0307]

[0308] Where TH1_high1 is the initial value of the first coordinate of the fourth interpolation point, MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate of the third interpolation point. U has been explained above and will not be repeated here.

[0309] Step 2: Set the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel.

[0310] Step 3: Determine the first number of pixels and the second number of pixels based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first number of pixels is the number of pixels in the image to be processed whose brightness values ​​are in the third brightness interval, the third brightness interval is the interval between the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and the second number of pixels is the total number of pixels in the image to be processed or in the brightness histogram of the image to be processed.

[0311] Step 4: Determine the first coordinate value of the fourth interpolation point according to the first pixel number, the second pixel number, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

[0312] Specifically, first, determining the ratio of the length of the third brightness interval to the maximum value of the RGB components of the first pixel;

[0313] Then, the first coordinate value of the fourth interpolation point is determined according to the following formula:

[0314]

[0315] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of first pixels to the number of second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB components of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, POW(x, j) refers to x raised to the power of j, and the value of j can be 0.5.

[0316] Step 5: Determine the first coordinate value of the fifth interpolation point based on the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

[0317] In the embodiment of the present application, the histogram information of the second brightness interval is a histogram of an interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point in the brightness histogram of the image to be processed.

[0318] The process of determining the first coordinate value of the fifth interpolation point includes:

[0319] First, if the second brightness interval includes N sub-intervals, N is a positive integer, for example, the second brightness interval can be divided into N sub-intervals at equal intervals to obtain N sub-intervals, then the i-th sub-interval is determined from the N sub-intervals, the i-th sub-interval is located in the n sub-intervals of the N sub-intervals, the serial numbers of the n sub-intervals are greater than or equal to N / 4, and the serial numbers of the n sub-intervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th sub-interval is the minimum value in the n sub-intervals.

[0320] The value of N can be determined empirically. The subintervals within the N subintervals can be numbered starting from 0 or 1, without any specific restrictions. For example, if N is 8 and the subintervals within the N subintervals are numbered starting from 1, then the n subintervals are numbered 2, 3, 4, 5, and 6, respectively.

[0321] Then, the first coordinate value of the fifth interpolation point is determined according to the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i. For example, the first coordinate value of the fifth interpolation point can be determined according to the following formula:

[0322]

[0323] Wherein, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

[0324] The process of obtaining the function of the second cubic spline curve includes the following four steps:

[0325] Step 1: Obtain the function of the basic mapping curve. Since the principle of this process has been explained above, it will not be explained here again.

[0326] Step 2: Map the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the fourth interpolation point and the second coordinate value of the sixth interpolation point.

[0327] Specifically, the process of determining the second coordinate value of the fourth interpolation point and the second coordinate value of the sixth interpolation point is as follows:

[0328] The first coordinate value of the fourth interpolation point is substituted as the independent variable into the function of the basic mapping curve, and the obtained value is determined as the second coordinate value of the fourth interpolation point. Similarly, the first coordinate value of the sixth interpolation point is substituted as the independent variable into the function of the basic mapping curve, and the obtained value is determined as the second coordinate value of the sixth interpolation point.

[0329] It should be noted that the above method of calculating the second coordinate value of the fourth interpolation point and the second interpolation point of the sixth interpolation point is only exemplary and is not intended to limit the present application.

[0330] Step 3: Determine the second coordinate value of the fifth interpolation point based on the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, the first coordinate value of the sixth interpolation point, the second coordinate value of the fourth interpolation point, and the second coordinate value of the sixth interpolation point.

[0331] Specifically, the manner of determining the second coordinate value of the fifth interpolation point may include the following two methods:

[0332] The first method is to determine the second coordinate value of the fifth interpolation point according to the following formula:

[0333]

[0334] Among them, VA2_high is the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

[0335] The second method is to determine the second coordinate value of the fifth interpolation point according to the following formula:

[0336]

[0337] Among them, VA2_high is the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point; TH_strength_high is the adjustment strength of the second coordinate value of the fifth interpolation point, and TH_strength_high is used to indicate the degree of offset of the second coordinate value of the fifth interpolation point relative to the initial value of the second coordinate value of the fifth interpolation point. The specific value of TH_strength_high can be set by yourself or obtained by calculation. It is not specially limited here. For example, TH_strength_high can be set to 0. The calculation formula for the initial value of the second coordinate value of the fifth interpolation point is:

[0338] VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point.

[0339] It should be noted that the method of determining the second coordinate value of the fifth interpolation point here is only exemplary and is not intended to limit this application.

[0340] Step 4: Determine the function of the cubic spline curve based on the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, the first coordinate value of the sixth interpolation point, the second coordinate value of the fourth interpolation point, the second coordinate value of the fifth interpolation point, and the second coordinate value of the sixth interpolation point.

[0341] The second cubic spline curve includes two partial curves. Therefore, the function of the second cubic spline curve also includes two piecewise functions, wherein the two piecewise functions correspond to the two partial curves in a one-to-one manner.

[0342] It should be noted that the construction principle of the two piecewise functions included in the function of the second cubic spline curve here is the same as the construction principle of the two piecewise functions included in the function of the first cubic spline curve above, so it will not be repeated here.

[0343] On this basis, the adjustment strength of the second coordinate value of the fifth interpolation point is determined as follows:

[0344] First, according to the brightness histogram of the image to be processed, the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point, the third number of pixels and the fourth number of pixels are determined, where the third number of pixels is the number of pixels in the interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point in the brightness histogram, and the fourth number of pixels is the number of pixels in the interval between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point in the brightness histogram.

[0345] Then, an adjustment strength for the second coordinate value of the fifth interpolation point is determined based on the third number of pixels and the fourth number of pixels. The adjustment strength indicates the degree of offset of the second coordinate value of the fifth interpolation point relative to the initial value of the second coordinate value of the fifth interpolation point. Specifically, the adjustment strength for the second coordinate value of the fifth interpolation point can be determined according to the following formula:

[0346]

[0347] Wherein, TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step size, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels. The value of the adjustment step size can be set based on empirical values ​​and can be a positive number, a negative number, or zero. This application does not impose any special restrictions on this. For example, the adjustment step size is 0.2.

[0348] After obtaining the function of the first cubic spline curve and the function of the second cubic spline curve, the encoding end can send the function of the first cubic spline curve, the function of the second cubic spline curve, and the data information of the image to be processed to the decoding end. Specifically, the function of the first cubic spline curve, the function of the second cubic spline curve, and the data information of the image to be processed can be encoded and then sent to the decoding end via a code stream. It should be noted that the function of the first cubic spline curve encoded here is the value of the parameter of the function of the first cubic spline curve. Similarly, the function of the second cubic spline curve encoded here is the value of the parameter of the function of the second cubic spline curve. The data information of the image to be processed can be understood as a digital representation of the image to be processed.

[0349] The decoder receives a first cubic spline curve function, a second cubic spline curve function, and data information of an image to be processed, sent by the encoder. The data information of the image to be processed is used to obtain the image to be processed, the first cubic spline curve function is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a first brightness range to a first target brightness value, and the second cubic spline curve function is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a second brightness range to a second target brightness value. Specifically, the decoder decodes the bitstream sent by the encoder to obtain the first cubic spline curve function, the second cubic spline curve function, and the data information of the image to be processed.

[0350] The decoding end maps the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to the first target brightness value according to the function of the first cubic spline curve, and maps the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the second brightness interval to the second target brightness value according to the function of the second cubic spline curve. For pixels in the image to be processed whose brightness values ​​are outside the first brightness interval and the second brightness interval, the brightness values ​​of the pixels are mapped to the third target brightness value through the function of the basic mapping curve, thereby realizing the correction and adjustment of the dynamic range of the image to be processed.

[0351] It should be noted that the parameters of the basic mapping curve function can be calculated at the encoder and sent directly to the decoder. In this way, the decoder can directly generate the basic mapping curve function based on the parameters of the basic mapping curve function. The parameters of the basic mapping curve function can also be calculated at the decoder, so that the encoder does not need to calculate the parameters of the basic mapping curve function. However, the encoder needs to send information such as basic dynamic metadata to the decoder so that the decoder can calculate the parameters of the basic mapping curve function based on the basic dynamic metadata and other information.

[0352] Figure 7 This is a schematic diagram of the second cubic spline curve and the basic mapping curve. Figure 7 As can be seen from the figure, the shape of the basic mapping curve can be adjusted by the second cubic spline curve, the shape of the curve corresponding to the second brightness range in the basic mapping curve is changed, and the diversity and flexibility of the shape of the basic mapping curve are improved.

[0353] In summary, by obtaining the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and determining the first coordinate value of the second interpolation point according to the histogram information of the first brightness interval of the image to be processed, and determining the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point related to the second cubic spline curve according to the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed, the method for determining the interpolation point is simple and easy to execute. In addition, by determining the first coordinate values ​​of the first interpolation point to the third interpolation point related to the first cubic spline curve, and the first coordinate values ​​of the fourth interpolation point to the sixth interpolation point related to the second cubic spline curve, the function of the first cubic spline curve is determined according to the first coordinate values ​​of the first interpolation point to the third interpolation point, and the function of the second cubic spline curve is determined according to the first coordinate values ​​of the fourth interpolation point to the sixth interpolation point, thereby determining the function of the first cubic spline curve according to the first coordinate values ​​of the first interpolation point to the third interpolation point. The cubic spline function maps the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a first brightness interval to a first target brightness value, and maps the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a second brightness interval to a second target brightness value according to the function of the second cubic spline curve. That is, the brightness values ​​of a portion of the pixels in the image to be processed are mapped according to the functions of the first cubic spline curve and the second cubic spline curve, while the brightness values ​​of the remaining pixels are mapped according to the function of the basic mapping curve. This is equivalent to changing the original mapping relationship of a section of the basic mapping curve. In other words, the shape of the curve corresponding to the first brightness interval and the second brightness interval in the basic mapping curve is changed, thereby achieving protection of specific areas and increasing the diversity, flexibility, robustness and universality of the shape of the basic mapping curve, thereby improving the display effect of the image after the dynamic range is adjusted. In addition, due to the existence of two cubic spline functions, two areas can be protected at the same time, further improving the display effect of the image after the dynamic range is adjusted.

[0354] Figure 8 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 2 The execution subject of the image dynamic range processing method is, for example, Figure 5 The encoding end in this application does not make any special restrictions on this. Figure 8 As shown, the image dynamic range processing method includes the following steps:

[0355] Step 801: Obtain the maximum value of the RGB components of the first pixel of the image to be processed, wherein: the first pixel is the pixel with the largest maximum value of the RGB components in the image to be processed, and the maximum value of the RGB components of the pixel is the maximum value of the R component, G component, and B component of the pixel.

[0356] Step 802: Determine a first coordinate value of at least one interpolation point associated with a cubic spline curve based on a maximum value of the RGB components of the first pixel and a brightness histogram of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation point, a second interpolation point, and a third interpolation point, and the first coordinate value of the interpolation point is a brightness value. The first coordinate value of each interpolation point associated with the cubic spline curve is used to determine a corresponding function of the cubic spline curve. The function of each cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed. The first brightness interval corresponding to the function of the cubic spline curve is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the function of the cubic spline curve.

[0357] The horizontal axis of the brightness histogram of the image to be processed represents the brightness of the pixels in the image to be processed, gradually transitioning from completely black to completely white from left to right, and the vertical axis represents the relative number of pixels in the image to be processed that fall within this brightness range. It should be noted that when constructing the brightness histogram of the image to be processed, the maximum value of the R component, G component, and B component of the pixel can be used as the brightness value of the pixel, or the average value of the R component, G component, and B component of the pixel can be used as the brightness value of the pixel, etc. This application does not impose any special restrictions on this.

[0358] In the following, step 802 is described by taking the case where the number of functions of the cubic spline curve is one, that is, the number of the cubic spline curve is one as an example. Specifically, the step 802 may include the following five steps, wherein:

[0359] Step 1: Determine, based on the brightness histogram, the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, and the maximum RGB component value of the fourth pixel corresponding to the third percentage, wherein the first percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the second percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel, and the third percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel.

[0360] In an embodiment of the present application, the values ​​of the first percentage, the second percentage and the third percentage can be set according to empirical values. For example, the first percentage is 90%, the second percentage is 95%, the third percentage is 99%, etc. This application does not impose any special limitations on this.

[0361] Step 2: Determine the first coordinate value of the first interpolation point according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage.

[0362] There are two ways to implement step 2:

[0363] Method 1: First, determine the first value of the first coordinate of the first interpolation point based on the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the brightness threshold. For example, if the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%, then determine the first value of the first coordinate of the first interpolation point based on the following formula:

[0364]

[0365] Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to 95%, and THRESOLD is the brightness threshold. The brightness threshold here can be, for example, 1024, etc., and this application does not make any special limitations on this.

[0366] Then, the first coordinate value of the first interpolation point is determined according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value.

[0367] Specifically, the method determines the difference between the maximum RGB component of the third pixel corresponding to twice the second percentage and the maximum RGB component of the second pixel corresponding to the first percentage; determines whether the maximum RGB component of the fourth pixel corresponding to the third percentage is greater than the sum of the obtained difference and a first preset value, and whether the first value is greater than a first threshold; if so, sets the first coordinate value of the first interpolation point to the first value. The first preset value and the first threshold can be determined based on experience and are not specifically limited in this application. For example, the first preset value is 100 and the first threshold is 0.4.

[0368] It should be noted that if the maximum value of the RGB component of the fourth pixel corresponding to the third percentage is not greater than the sum of the obtained difference and the first preset value or the first value is not greater than the first threshold, the cubic spline curve function is not generated.

[0369] The second method: First, according to the brightness histogram of the image to be processed, determine the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the maximum RGB component value of the sixth pixel corresponding to the fifth percentage, and the maximum RGB component value of the seventh pixel corresponding to the sixth percentage, wherein the fourth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel, the fifth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel, and the sixth percentage represents the percentage of pixels in the multiple pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel.

[0370] Then, a first value of the first coordinate value of the first interpolation point is determined according to the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the maximum RGB component value of the second pixel corresponding to the first percentage, and the brightness threshold.

[0371] Then, determining a second value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and the brightness threshold;

[0372] Next, determining a third value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, and the brightness threshold;

[0373] Finally, the first coordinate value of the first interpolation point is determined based on the maximum RGB component of the fifth pixel corresponding to the fourth percentage, the maximum RGB component of the sixth pixel corresponding to the fifth percentage, the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, the maximum RGB component of the seventh pixel corresponding to the sixth percentage, and the first value to the third value.

[0374] Below, the process of determining the first coordinate value of the first interpolation point in the second method is described by taking the first percentage as 90%, the second percentage as 95%, the third percentage as 99%, the fourth percentage as 50%, the fifth percentage as 10%, and the sixth percentage as 100% as an example.

[0375] First, a first value of a first coordinate value of a first interpolation point is determined according to a first formula, wherein the first formula is:

[0376]

[0377] The second value of the first coordinate value of the first interpolation point is determined according to the second formula, wherein the second formula is:

[0378]

[0379] The third value of the first coordinate value of the first interpolation point is determined according to the third formula, wherein the third formula is:

[0380]

[0381] Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to 10%, and THRESOLD is the brightness threshold.

[0382] The initial value of the first coordinate value of the first interpolation point is determined by the fourth formula:

[0383]

[0384] The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value, the second value, and the third value of the first coordinate value of the first interpolation point:

[0385]

[0386] Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to 100%.

[0387] It should be noted that the process of determining the first coordinate value of the first interpolation point based on the initial value, second value and third value of the first coordinate value of the first interpolation point is: judging whether the initial value of the first coordinate value of the first interpolation point is greater than or equal to 0.35; if the initial value of the first coordinate value of the first interpolation point is greater than or equal to 0.35, setting the first coordinate value of the first interpolation point to the initial value of the first coordinate value of the first interpolation point; if the initial value of the first coordinate value of the first interpolation point is less than 0.35, judging whether the second value is greater than 0.35; if the second value is greater than 0.35, setting the first coordinate value of the first interpolation point to the second value; if the second value is not greater than 0.35, judging whether the third value is greater than 0.35; if the third value is greater than 0.35, setting the first coordinate value of the first interpolation point to the third value; if the third value is not greater than 0.35, not generating the cubic spline curve function.

[0388] Step three: set the first coordinate value of the third interpolation point to the maximum value of the RGB components of the first pixel.

[0389] Step 4: Determine the first coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and the histogram information corresponding to the first brightness interval in the brightness histogram.

[0390] In the embodiment of the present application, the histogram information of the first brightness interval is a histogram of an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point in the brightness histogram of the image to be processed.

[0391] The process of determining the first coordinate value of the second interpolation point includes:

[0392] First, if the first brightness interval includes N sub-intervals, where N is a positive integer, the i-th sub-interval is determined from the N sub-intervals, the i-th sub-interval is located in n sub-intervals of the N sub-intervals, the sequence numbers of the n sub-intervals are greater than or equal to N / 4, and the sequence numbers of the n sub-intervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th sub-interval is the minimum value among the n sub-intervals.

[0393] The value of N can be determined based on experience. For example, if the value of N is 8, the serial numbers of the n subintervals are 2, 3, 4, 5, and 6 respectively.

[0394] Then, the first coordinate value of the second interpolation point is determined according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i. For example, the first coordinate value of the second interpolation point can be determined according to the following formula:

[0395]

[0396] Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

[0397] The process of obtaining the function of the cubic spline curve includes the following four steps:

[0398] Step 1: Obtain a function of a basic mapping curve. Since the basic mapping curve has been described above, it will not be repeated here.

[0399] Step 2: Map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point. Since the principle of this step has been explained above, it will not be repeated here.

[0400] Step 3: Determine the second coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point.

[0401] For example, the second coordinate value of the second interpolation point is determined according to the following formula:

[0402]

[0403] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0404] For another example, the second coordinate value of the second interpolation point is determined according to the following formula:

[0405]

[0406] Wherein, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and TH_strength is the adjustment strength of the second coordinate value of the second interpolation point. TH_strength is used to indicate the degree of deviation of the second coordinate value of the second interpolation point relative to the initial value of the second coordinate value of the second interpolation point. The specific value of TH_strength can be set by itself or obtained by calculation. It is not specifically limited here. For example, TH_strength can be set to 0. The calculation formula of the initial value of the second coordinate value of the second interpolation point is: VA21 is the initial value of the second coordinate value of the second interpolation point.

[0407] It should be noted that the method of determining the second coordinate value of the second interpolation point here is only exemplary and is not intended to limit this application.

[0408] Step 4: Determine a function of the cubic spline curve based on the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0409] The cubic spline curve includes two partial curves, so the function of the cubic spline curve also includes two piecewise functions, wherein the two piecewise functions correspond one-to-one to the two partial curves.

[0410] It should be noted that the construction principle of the two piecewise functions included in the function of the cubic spline curve here is the same as the construction principle of the two piecewise functions included in the function of the first cubic spline curve above, so it will not be repeated here.

[0411] On this basis, the adjustment strength of the second coordinate value of the second interpolation point is determined as follows:

[0412] First, according to a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, a first number of pixels and a second number of pixels are determined, where the first number of pixels is the number of pixels in the brightness histogram that are located between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point, and the second number of pixels is the number of pixels in the brightness histogram that are located between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point;

[0413] Then, an adjustment strength of the second coordinate value of the second interpolation point is determined based on the first number of pixels and the second number of pixels. The adjustment strength indicates the degree of offset of the second coordinate value of the second interpolation point relative to the initial value of the second coordinate value of the second interpolation point. Specifically, the adjustment strength of the second coordinate value of the second interpolation point is determined according to the following formula:

[0414]

[0415] Where TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step size, NUM1 is the number of first pixels, and NUM2 is the number of second pixels. The adjustment step size can be a positive number, a negative number, or 0.

[0416] After obtaining the cubic spline function, the encoder can send the cubic spline function and the image data to be processed to the decoder. Specifically, the cubic spline function and the image data can be encoded and then sent to the decoder via a bitstream. It should be noted that the cubic spline function encoded here refers to the parameter values ​​of the cubic spline function. The image data can be understood as a digital representation of the image to be processed.

[0417] The decoder receives the cubic spline curve function and the data information of the image to be processed sent by the encoder, wherein the data information of the image to be processed is used to obtain the image to be processed, and the cubic spline curve function is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a first brightness range to a first target brightness value. Specifically, the decoder decodes the bitstream sent by the encoder to obtain the cubic spline curve function and the data information of the image to be processed.

[0418] The decoding end corrects the dynamic range of the image to be processed based on the function of the cubic spline curve and the data information of the image to be processed. Specifically, the brightness values ​​of pixels in the image to be processed whose brightness values ​​fall within the first brightness range are substituted into the function of the cubic spline curve to obtain the first target brightness value of the corresponding pixel. It should be noted that the brightness values ​​of pixels in the image to be processed whose brightness values ​​fall outside the first brightness range are substituted into the function of the base mapping curve to obtain the second target brightness value of the corresponding pixel, thereby adjusting the dynamic range of the image to be processed.

[0419] It should be noted that the parameters of the basic mapping curve function can be calculated at the encoder and sent directly to the decoder. In this way, the decoder can directly generate the basic mapping curve function based on the parameters of the basic mapping curve function. The parameters of the basic mapping curve function can also be calculated at the decoder, so that the encoder does not need to calculate the parameters of the basic mapping curve function. However, the encoder needs to send information such as basic dynamic metadata to the decoder so that the decoder can calculate the parameters of the basic mapping curve function based on the basic dynamic metadata and other information.

[0420] In summary, the first coordinate value of the second interpolation point can be determined by obtaining the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, and based on the histogram of the first brightness range of the image to be processed. The method for determining the interpolation point is simple and easy to execute. In addition, by determining the first coordinate values ​​of the first interpolation point to the third interpolation point associated with the cubic spline curve, the function of the cubic spline curve is determined based on the first coordinate values ​​of the first interpolation point to the third interpolation point. Thus, according to the function of the cubic spline curve, the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness range are mapped to the first target brightness value. That is, the brightness values ​​of a portion of the pixels in the image to be processed are mapped according to the function of the cubic spline curve, while the brightness values ​​of the remaining pixels are mapped according to the function of the base mapping curve. This is equivalent to changing the original mapping relationship of a section of the base mapping curve. In other words, the shape of the curve in the base mapping curve corresponding to the first brightness range is changed, thereby achieving protection of a specific area. At the same time, the shape of the base mapping curve is increased. Diversity, flexibility, robustness, and universality of the base mapping curve are increased, thereby improving the display effect of the image after dynamic range adjustment.

[0421] It should be noted that the first coordinate value mentioned above can be a coordinate value on the X-axis, and the second coordinate value can be a coordinate value on the Y-axis, or the first coordinate value mentioned above can be a coordinate value on the Y-axis, and the second coordinate value can be a coordinate value on the X-axis. The data used in the calculation process of this application and the various data obtained from the image to be processed are, for example, values ​​in the PQ domain, etc., and the embodiments of this application do not specifically limit this. It should be noted that the value in the PQ domain refers to the value after conversion by the PQ photoelectric transfer function.

[0422] Figure 9 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 1 The apparatus 900 comprises:

[0423] An acquisition module 901 is configured to acquire a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point associated with a first cubic spline curve, where the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values. A first determination module 902 is configured to determine a first coordinate value of a second interpolation point associated with the first cubic spline curve based on histogram information of a first brightness interval of an image to be processed, where the first brightness interval is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point. The first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine a function of the first cubic spline curve, where the function of the first cubic spline curve is configured to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed.

[0424] In a possible implementation, the function of the first cubic spline curve is obtained as follows:

[0425] The acquisition module 901 is also used to acquire the function of the basic mapping curve; the first determination module is also used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determine the function of the first cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point. In a possible implementation, the first determination module is used to determine the second coordinate value of the second interpolation point according to the following formula;

[0426]

[0427] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0428] In one possible implementation, the apparatus further includes: a second determining module configured to determine first coordinate values ​​of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point associated with a second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB components of a first pixel of the image to be processed; wherein the first pixel is a pixel having the maximum RGB component value in the image to be processed, and the maximum RGB component value of the pixel is the maximum value among the R component, the G component, and the B component of the pixel; the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine a function of the second cubic spline curve, the function of the second cubic spline curve being configured to map luminance values ​​of pixels in the image to be processed whose luminance values ​​are within a second luminance interval to a second target luminance value, thereby correcting the dynamic range of the image to be processed, wherein the second luminance interval is an interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and there is no overlapping area between the first luminance interval and the second luminance interval.

[0429] In one possible implementation, the device further includes: a sending module, configured to send the function of the cubic spline curve and the data information of the image to be processed to a decoding end, so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, and the data information of the image to be processed is used to obtain the image to be processed.

[0430] In a possible implementation, the acquisition module is specifically configured to set the first coordinate value of the first interpolation point as a first preset brightness value; and set the first coordinate value of the third interpolation point as a second preset brightness value.

[0431] In a possible implementation, the first coordinate value of the second interpolation point is determined according to the following formula:

[0432]

[0433] Wherein, TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

[0434] In a possible implementation, the second determining module is specifically configured to determine the first coordinate value of the fourth interpolation point according to a first formula, wherein the first formula is:

[0435]

[0436] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:

[0437]

[0438] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;

[0439] Among them, TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value.

[0440] In a possible implementation, the second determination module is configured to determine the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: determining an initial value of the first coordinate value of the fourth interpolation point based on the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel; setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB component of the first pixel; determining the first pixel number and the second pixel number based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first pixel number is the number of pixels in the image to be processed whose brightness values ​​are within the third brightness interval, and the second pixel number is the number of pixels in the image to be processed whose brightness values ​​are within the third brightness interval. The third brightness interval is an interval between an initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point, and the second number of pixels is a total number of pixels in the image to be processed or in a brightness histogram of the image to be processed; the first coordinate value of the fourth interpolation point is determined based on the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point; and the first coordinate value of the fifth interpolation point is determined based on the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

[0441] In one possible implementation, the second brightness interval includes N subintervals, where N is a positive integer, and the second determination module is configured to determine the first coordinate value of the fifth interpolation point in the following manner: determining an i-th subinterval from the N subintervals, where the i-th subinterval is located in n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is the minimum value among the n subintervals; and determining the first coordinate value of the fifth interpolation point based on the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i.

[0442] In a possible implementation, the value of N is 8.

[0443] In a possible implementation, the second determining module is configured to determine an initial value of the first coordinate value of the fourth interpolation point in the following manner:

[0444]

[0445] TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate value of the third interpolation point.

[0446] In a possible implementation, the second determining module is configured to determine the first coordinate value of the fourth interpolation point in the following manner:

[0447] Determine the ratio of the length of the third brightness interval to the maximum value of the RGB components of the first pixel; and determine the first coordinate value of the fourth interpolation point according to the following formula:

[0448]

[0449] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of the first pixels to the number of the second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and POW(x, j) refers to x raised to the power of j.

[0450] In a possible implementation, the second determining module is configured to determine the first coordinate value of the fifth interpolation point in the following manner:

[0451]

[0452] TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

[0453] In a possible implementation, the apparatus further includes:

[0454] The second determination module is further configured to determine a third number of pixels and a fourth number of pixels based on a brightness histogram of the image to be processed, the first coordinate value of a fourth interpolation point, the first coordinate value of a fifth interpolation point, and the first coordinate value of a sixth interpolation point, where the third number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point, and the fourth number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point; and determine an adjustment strength of the second coordinate value of the fifth interpolation point based on the third number of pixels and the fourth number of pixels, where the adjustment strength indicates a degree of offset of the second coordinate value of the fifth interpolation point relative to an initial value of the second coordinate value of the fifth interpolation point.

[0455] In a possible implementation, the second determining module is specifically configured to determine the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula:

[0456]

[0457] TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels.

[0458] In a possible implementation, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:

[0459]

[0460] Among them, VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

[0461] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a third target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable. The brightness mapping function is as follows:

[0462]

[0463] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0464] Since the implementation principle and the effects achieved by the device 900 are the same as those of the corresponding method part above, they will not be described in detail here.

[0465] Figure 10 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 2 The device 1000 includes: an acquisition module 1001, configured to acquire the maximum value of the RGB component of a first pixel of an image to be processed, wherein: the first pixel is a pixel with the largest maximum value of the RGB component of pixels in the image to be processed, and the maximum value of the RGB component of the pixel is the maximum value among the R component, the G component, and the B component of the pixel; a first determination module 1002, configured to determine the first coordinate value of an interpolation point associated with at least one cubic spline curve according to the maximum value of the RGB component of the first pixel and a brightness histogram of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation value. point, a second interpolation point, and a third interpolation point, wherein the first coordinate value of the interpolation point is a brightness value, the first coordinate value of each interpolation point associated with the cubic spline curve is used to determine the corresponding function of the cubic spline curve, and each function of the cubic spline curve is used to map the brightness value of a pixel in the image to be processed whose brightness value is within the corresponding first brightness interval to a first target brightness value, thereby correcting the dynamic range of the image to be processed, and the first brightness interval corresponding to the function of the cubic spline curve is the interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the function of the cubic spline curve.

[0466] In a possible implementation, the number of the cubic spline curve is one;

[0467] The first determining module is further configured to determine, based on the brightness histogram, a maximum RGB component value of a second pixel corresponding to a first percentage, a maximum RGB component value of a third pixel corresponding to a second percentage, and a maximum RGB component value of a fourth pixel corresponding to a third percentage, wherein the first percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the second percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel, and the third percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel; determine a first coordinate value of the first interpolation point based on the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, and the maximum RGB component value of the fourth pixel corresponding to the third percentage; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; and determine the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and histogram information corresponding to the first brightness interval in the brightness histogram.

[0468] In one possible implementation, the first determination module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining a first value of the first coordinate value of the first interpolation point based on a maximum RGB component value of a second pixel corresponding to the first percentage, a maximum RGB component value of a third pixel corresponding to the second percentage, and a brightness threshold; and determining the first coordinate value of the first interpolation point based on a maximum RGB component value of the second pixel corresponding to the first percentage, a maximum RGB component value of the third pixel corresponding to the second percentage, a maximum RGB component value of a fourth pixel corresponding to the third percentage, and the first value.

[0469] In one possible implementation, the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%;

[0470] The determining module is configured to determine a first value of the first coordinate value of the first interpolation point according to the following formula:

[0471]

[0472] Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90% ratio, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95% ratio, and THRESOLD is the brightness threshold.

[0473] In one possible implementation, the first determination module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining a difference between a maximum RGB component value of a third pixel corresponding to twice the second percentage and a maximum RGB component value of a second pixel corresponding to the first percentage; determining whether the maximum RGB component value of a fourth pixel corresponding to the third percentage is greater than a sum of the obtained difference and a first preset value and whether the first value is greater than a first threshold; and if so, setting the first coordinate value of the first interpolation point to the first value.

[0474] In a possible implementation, the first determination module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining, based on the brightness histogram of the image to be processed, the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the maximum RGB component value of the sixth pixel corresponding to the fifth percentage, and the maximum RGB component value of the seventh pixel corresponding to the sixth percentage, wherein the fourth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel, the fifth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel, and the sixth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel; The first value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the second pixel corresponding to the first percentage and the brightness threshold; the second value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and the brightness threshold; the third value of the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, and the brightness threshold; the first coordinate value of the first interpolation point is determined based on the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB components of the sixth pixel corresponding to the fifth percentage, the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, the maximum value of the RGB components of the seventh pixel corresponding to the sixth percentage, and the first to third values.

[0475] In one possible implementation, the first percentage is 90%, the second percentage is 95%, the third percentage is 99%, the fourth percentage is 50%, the fifth percentage is 10%, and the sixth percentage is 100%. The first determination module is configured to determine a first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is:

[0476]

[0477] A second value of the first coordinate value of the first interpolation point is determined according to a second formula, wherein the second formula is:

[0478]

[0479] A third value of the first coordinate value of the first interpolation point is determined according to a third formula, wherein the third formula is:

[0480]

[0481] Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.

[0482] In a possible implementation, the first determining module is configured to determine an initial value of the first coordinate value of the first interpolation point by using a fourth formula:

[0483]

[0484] The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value of the first coordinate value of the first interpolation point, the second value, and the third value:

[0485]

[0486] Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to the 100%.

[0487] In one possible implementation, the first brightness interval includes N subintervals, where N is a positive integer; the first determination module is configured to determine the first coordinate value of the second interpolation point in the following manner: determining an i-th subinterval from the N subintervals, where the i-th subinterval is located among n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is the minimum value among the n subintervals; and determining the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i.

[0488] In a possible implementation, the value of N is 8.

[0489] In a possible implementation, the first determining module is configured to determine the first coordinate value of the second interpolation point according to the following formula:

[0490]

[0491] Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

[0492] In a possible implementation, the function of the cubic spline curve is obtained according to the following method: the acquisition module is further used to acquire the function of the basic mapping curve; the first determination module is further used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; determine the function of the cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

[0493] In a possible implementation, the first determining module is configured to determine the second coordinate value of the second interpolation point according to the following formula:

[0494]

[0495] Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0496] In one possible implementation, the function of the basic mapping curve is used to map the brightness value of a pixel in the image to be processed to a second target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the second target brightness value as a dependent variable. The brightness mapping function is as follows:

[0497]

[0498] The parameters of the brightness mapping function include: a, b, p, m, n, L′ is the second target brightness value, and L is the brightness value of the pixel in the image to be processed.

[0499] In one possible implementation, the device further includes: a second determination module, configured to determine a first number of pixels and a second number of pixels based on a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, wherein the first number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point, and the second number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point; and determine an adjustment strength of the second coordinate value of the second interpolation point based on the first number of pixels and the second number of pixels, wherein the adjustment strength is used to indicate a degree of offset of the second coordinate value of the second interpolation point relative to an initial value of the second coordinate value of the second interpolation point.

[0500] In a possible implementation, the second determining module is configured to determine an adjustment strength of the second coordinate value of the second interpolation point according to the following formula:

[0501]

[0502] Among them, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step, NUM1 is the first pixel number, and NUM2 is the second pixel number.

[0503] In a possible implementation, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:

[0504]

[0505] Among them, VA21 is the initial value of the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

[0506] Since the implementation principle and the effects achieved by the device 1000 are the same as those of the corresponding method part above, they will not be described in detail here.

[0507] Figure 11 Schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 3The device 1100 includes: a receiving module 1101, configured to receive a function of a cubic spline curve and data information of the image to be processed sent by an encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, and the function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding interval to a target brightness value, thereby correcting the dynamic range of the image to be processed; and a correction module 1102, configured to correct the dynamic range of the image to be processed according to the function of the cubic spline curve and the data information of the image to be processed.

[0508] Since the implementation principle and the effects achieved by the device 1100 are the same as those of the corresponding method part above, they will not be described in detail here.

[0509] Figure 12 An image processing device 1200 provided in an embodiment of the present application is shown. The device 1200 may include a processor 1210, a transceiver 1220 and a memory 1230. The processor 1210, the transceiver 1220 and the memory 1230 communicate with each other through an internal connection path.

[0510] The processor 1210 may include one or more processors, such as one or more central processing units (CPUs). In the case where the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 1310 is configured to execute any of the methods described in the above method embodiments.

[0511] The transceiver 1220 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, wherein the transmitter is used to send data and / or signals and the receiver is used to receive data and / or signals.

[0512] The memory 1230 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 1230 is used to store relevant instructions and data.

[0513] The memory 1230 is used to store program codes and data of the device and may be a separate device or integrated into the processor 1310 .

[0514] It is understandable that Figure 12 Only a simplified design of the device 1200 is shown. In actual applications, the device 1200 may further 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 scope of protection of the present application.

[0515] In one possible design, device 1200 can be replaced with a chip device, such as 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, an application-specific integrated circuit, a system-on-chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, or a programmable controller or other integrated chip that implements the relevant functions. The chip device can optionally include one or more memories for storing program code. When the code is executed, the processor implements the corresponding function.

[0516] The present application also provides a computer-readable storage medium, comprising a computer program, which, when executed on a computer, enables the computer to execute the technical solution of the above method embodiment.

[0517] The present application also provides a computer program, which, when executed by a computer, is used to implement the technical solution of the above method embodiment.

[0518] 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.

[0519] Those skilled 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 beyond the scope of this application.

[0520] Those skilled in the art will 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.

[0521] In the several embodiments provided in this 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 merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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.

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

[0523] 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.

[0524] 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, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment 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.

[0525] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for processing an image dynamic range, characterized in that: include: Obtaining a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point related to a first cubic spline curve, wherein the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values; Determining, based on histogram information of a first brightness interval of the image to be processed, a first coordinate value of a second interpolation point associated with the first cubic spline curve, where the first brightness interval is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, and the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine a function of the first cubic spline curve, the function of the first cubic spline curve being used to map brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting a curve in the basic mapping curve corresponding to the first brightness interval; Dynamic metadata and data information of the image to be processed are sent to a decoding end so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, the dynamic metadata including the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point, and the data information of the image to be processed is used to obtain the image to be processed.

2. The method according to claim 1, characterized in that The function of the first cubic spline curve is obtained as follows: A function for obtaining the basic mapping curve; Mapping the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determining a second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; Determine a function of the first cubic spline curve based on the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

3. The method according to claim 2, characterized in that The determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point includes: Determine the second coordinate value of the second interpolation point according to the following formula; Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: determining first coordinate values ​​of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point associated with the second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB components of the first pixel of the image to be processed; wherein: the first pixel is the pixel with the largest maximum value of the RGB components in the image to be processed, and the maximum value of the RGB components of the pixel is the maximum value among the R component, the G component, and the B component of the pixel; The first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine the function of the second cubic spline curve. The function of the second cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a second brightness interval to a second target brightness value, thereby correcting the dynamic range of the image to be processed. The second brightness interval is the interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point. There is no overlapping area between the first brightness interval and the second brightness interval.

5. The method according to any one of claims 1 to 3, characterized in that The obtaining of the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point related to the first cubic spline curve includes: Setting the first coordinate value of the first interpolation point to a first preset brightness value; The first coordinate value of the third interpolation point is set as the second preset brightness value.

6. The method according to any one of claims 1 to 3, characterized in that The first coordinate value of the second interpolation point is determined according to the following formula: Wherein, TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

7. The method according to claim 4, characterized in that Determining the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point associated with the second cubic spline curve according to the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed includes: The first coordinate value of the fourth interpolation point is determined according to a first formula, wherein the first formula is: The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is: Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; Among them, TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value.

8. The method according to claim 4, characterized in that Determining the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point associated with the second cubic spline curve according to the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel of the image to be processed includes: determining an initial value of the first coordinate value of the fourth interpolation point according to the first coordinate value of the third interpolation point and a maximum value of the RGB components of the first pixel; Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; determining a first number of pixels and a second number of pixels based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first number of pixels is the number of pixels in the image to be processed whose brightness values ​​are within a third brightness interval, the third brightness interval being an interval between the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; and the second number of pixels is the total number of pixels in the image to be processed or in a brightness histogram of the image to be processed; determining a first coordinate value of the fourth interpolation point according to the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, an initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point; The first coordinate value of the fifth interpolation point is determined according to the histogram information of the second brightness range of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

9. The method according to claim 8, characterized in that The second brightness interval includes N subintervals, where N is a positive integer. The determining the first coordinate value of the fifth interpolation point based on the histogram information of the second brightness interval of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point includes: Determining an i-th subinterval from the N subintervals, where the i-th subinterval is located in n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is a minimum value among the n subintervals; The first coordinate value of the fifth interpolation point is determined according to the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i.

10. The method according to claim 9, characterized in that The value of N is 8.

11. The method according to any one of claims 8 to 10, characterized in that The determining of the initial value of the first coordinate value of the fourth interpolation point according to the first coordinate value of the third interpolation point and the maximum value of the RGB component of the first pixel includes: The initial value of the first coordinate value of the fourth interpolation point is determined as follows: TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate value of the third interpolation point.

12. The method according to any one of claims 8 to 10, characterized in that Determining the first coordinate value of the fourth interpolation point according to the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, the initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point includes: determining a ratio of a length of the third brightness interval to a maximum value of RGB components of the first pixel; The first coordinate value of the fourth interpolation point is determined according to the following formula: Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of the first pixels to the number of the second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and POW(x, j) refers to x raised to the power of j.

13. The method according to claim 9 or 10, characterized in that The determining the first coordinate value of the fifth interpolation point according to the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i includes: The first coordinate value of the fifth interpolation point is determined according to the following formula: TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

14. The method according to claim 4, characterized in that The method further comprises: determining a third number of pixels and a fourth number of pixels based on a brightness histogram of the image to be processed, the first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point, wherein the third number of pixels is the number of pixels in the brightness histogram that are located between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point, and the fourth number of pixels is the number of pixels in the brightness histogram that are located between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point; An adjustment strength of the second coordinate value of the fifth interpolation point is determined according to the third number of pixels and the fourth number of pixels, wherein the adjustment strength indicates a degree of offset of the second coordinate value of the fifth interpolation point relative to an initial value of the second coordinate value of the fifth interpolation point.

15. The method according to claim 14, characterized in that Determining the adjustment strength of the second coordinate value of the fifth interpolation point according to the third number of pixels and the fourth number of pixels includes: determining the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula: TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels.

16. The method according to claim 14 or 15, characterized in that The initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula: Among them, VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

17. The method according to claim 2, characterized in that The function of the basic mapping curve is used to map the brightness value of the pixel in the image to be processed to the third target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable, wherein the brightness mapping function is as follows: The parameters of the brightness mapping function include: a, b, p, m, n, L' is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

18. A method for processing image dynamic range, characterized in that: include: Obtaining a maximum value of the RGB components of a first pixel of the image to be processed, wherein: the first pixel is a pixel in the image to be processed having the largest maximum value of the RGB components, and the maximum value of the RGB components of the pixel is a maximum value among the R component, the G component, and the B component of the pixel; Determining a first coordinate value of at least one interpolation point associated with a cubic spline curve based on a maximum value of an RGB component of the first pixel and a brightness histogram of a first brightness interval of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation point, a second interpolation point, and a third interpolation point, and the first coordinate value of the interpolation point is a brightness value. The first coordinate value of each interpolation point associated with the cubic spline curve is used to determine a corresponding function of the cubic spline curve. Each function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the corresponding first brightness interval to a first target brightness value, thereby correcting the curve corresponding to the first brightness interval in the basic mapping curve. The first brightness interval corresponding to the function of the cubic spline curve is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the cubic spline curve. Dynamic metadata and data information of the image to be processed are sent to a decoding end so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, the dynamic metadata including the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point, and the data information of the image to be processed is used to obtain the image to be processed.

19. The method according to claim 18, characterized in that The number of the cubic spline curve is one; Determining a first coordinate value of an interpolation point associated with at least one cubic spline curve according to the maximum value of the RGB component of the first pixel and the brightness histogram of the image to be processed includes: determining, according to the brightness histogram, a maximum RGB component value of a second pixel corresponding to a first percentage, a maximum RGB component value of a third pixel corresponding to a second percentage, and a maximum RGB component value of a fourth pixel corresponding to a third percentage, wherein the first percentage represents the percentage of pixels in the to-be-processed image 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 second percentage represents the percentage of pixels in the to-be-processed image whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among the plurality of pixels, and the third percentage represents the percentage of pixels in the to-be-processed image whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among the plurality of pixels; determining a first coordinate value of the first interpolation point according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage; Setting the first coordinate value of the third interpolation point to the maximum value of the RGB components of the first pixel; The first coordinate value of the second interpolation point is determined according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and histogram information corresponding to the first brightness interval in the brightness histogram.

20. The method according to claim 19, characterized in that Determining the first coordinate value of the first interpolation point according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage includes: determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and a brightness threshold; The first coordinate value of the first interpolation point is determined according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value.

21. The method according to claim 20, characterized in that The first percentage is 90%, the second percentage is 95%, and the third percentage is 99%; Determining the first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB component of the second pixel corresponding to the first percentage, the maximum value of the RGB component of the third pixel corresponding to the second percentage, and the brightness threshold includes: determining the first value of the first coordinate value of the first interpolation point according to the following formula: Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90% ratio, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95% ratio, and THRESOLD is the brightness threshold.

22. The method according to claim 20, characterized in that The determining of the first coordinate value of the first interpolation point according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value includes: determining a difference between a maximum value of RGB components of a third pixel corresponding to twice the second percentage and a maximum value of RGB components of the second pixel corresponding to the first percentage; Determine whether the maximum value of the RGB component of the fourth pixel corresponding to the third percentage is greater than the sum of the obtained difference and a first preset value and whether the first value is greater than a first threshold; If so, the first coordinate value of the first interpolation point is set to the first value.

23. The method according to claim 19, wherein The determining of the first coordinate value of the first interpolation point according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, and the maximum RGB component of the fourth pixel corresponding to the third percentage includes: determining, according to the brightness histogram of the image to be processed, a maximum RGB component value of a fifth pixel corresponding to a fourth percentage, a maximum RGB component value of a sixth pixel corresponding to a fifth percentage, and a maximum RGB component value of a seventh pixel corresponding to a sixth percentage, wherein the fourth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among the multiple pixels, the fifth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among the multiple pixels, and the sixth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among the multiple pixels; determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB components of the second pixel corresponding to the first percentage, and a brightness threshold; determining a second value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and a brightness threshold; determining a third value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, and a brightness threshold; The first coordinate value of the first interpolation point is determined based on the maximum RGB component of the fifth pixel corresponding to the fourth percentage, the maximum RGB component of the sixth pixel corresponding to the fifth percentage, the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, the maximum RGB component of the seventh pixel corresponding to the sixth percentage, and the first value to the third value.

24. The method according to claim 23, wherein The first percentage is 90%, the second percentage is 95%, the third percentage is 99%, the fourth percentage is 50%, the fifth percentage is 10%, and the sixth percentage is 100%; Determining a first value of the first coordinate value of the first interpolation point includes: determining a first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is: Determining the second value of the first coordinate value of the first interpolation point includes: determining the second value of the first coordinate value of the first interpolation point according to a second formula, wherein the second formula is: Determining the third value of the first coordinate value of the first interpolation point includes: determining the third value of the first coordinate value of the first interpolation point according to a third formula, wherein the third formula is: Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.

25. The method according to claim 24, characterized in that Determining the first coordinate value of the first interpolation point includes: The initial value of the first coordinate value of the first interpolation point is determined by the fourth formula: The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value of the first coordinate value of the first interpolation point, the second value, and the third value: Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to the 100%.

26. The method according to any one of claims 19 to 25, characterized in that The first brightness interval includes N sub-intervals, where N is a positive integer; The determining the first coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and histogram information corresponding to the first brightness interval in the brightness histogram includes: Determining an i-th subinterval from the N subintervals, the i-th subinterval being located in n subintervals of the N subintervals, the sequence numbers of the n subintervals being greater than or equal to N / 4, and the sequence numbers of the n subintervals being less than or equal to 3N / 4, and the number of pixels in the to-be-processed image whose brightness values ​​are located in the i-th subinterval being the minimum value among the n subintervals; The first coordinate value of the second interpolation point is determined according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i.

27. The method according to claim 26, characterized in that The value of N is 8.

28. The method according to claim 26, characterized in that The determining the first coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i includes: The first coordinate value of the second interpolation point is determined according to the following formula: Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

29. The method according to claim 19, wherein The function of the cubic spline curve is obtained as follows: A function for obtaining the basic mapping curve; Mapping the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determining a second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; The function of the cubic spline curve is determined according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

30. The method according to claim 29, wherein The determining the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point includes: Determine the second coordinate value of the second interpolation point according to the following formula; Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

31. The method according to claim 29, wherein The function of the basic mapping curve is used to map the brightness value of the pixel in the image to be processed to the second target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the second target brightness value as a dependent variable, wherein the brightness mapping function is as follows: The parameters of the brightness mapping function include: a, b, p, m, n, L' is the second target brightness value, and L is the brightness value of the pixel in the image to be processed.

32. The method according to claim 19, wherein The method further comprises: determining a first number of pixels and a second number of pixels according to a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, wherein the first number of pixels is the number of pixels in an interval between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point in the brightness histogram, and the second number of pixels is the number of pixels in an interval between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point in the brightness histogram; An adjustment strength of the second coordinate value of the second interpolation point is determined according to the first number of pixels and the second number of pixels, wherein the adjustment strength indicates a degree of offset of the second coordinate value of the second interpolation point relative to an initial value of the second coordinate value of the second interpolation point.

33. The method according to claim 32, characterized in that Determining the adjustment strength of the second coordinate value of the second interpolation point according to the first number of pixels and the second number of pixels includes: determining the adjustment strength of the second coordinate value of the second interpolation point according to the following formula: Among them, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step, NUM1 is the first pixel number, and NUM2 is the second pixel number.

34. The method according to claim 32 or 33, characterized in that The initial value of the second coordinate value of the second interpolation point is obtained by the following formula: Among them, VA21 is the initial value of the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

35. A method for processing image dynamic range, characterized in that: include: Receive dynamic metadata and data information of an image to be processed sent by an encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, the dynamic metadata includes parameters of a function of a cubic spline curve, the parameters of the function of the cubic spline curve include a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, the function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding interval to a target brightness value, thereby correcting the dynamic range of the image to be processed, the cubic spline curve includes a first cubic spline curve, and the first cubic spline curve is determined based on a first coordinate value of the first interpolation point, a first coordinate value of the second interpolation point, and a first coordinate value of the third interpolation point, where the first coordinate value is a luminance value, the first coordinate value of the second interpolation point is determined based on histogram information of a first luminance interval of the image to be processed, the first luminance interval being an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, the function of the first cubic spline curve being used to map luminance values ​​of pixels in the image to be processed whose luminance values ​​are within the first luminance interval to a first target luminance value, thereby correcting a curve in the basic mapping curve corresponding to the first luminance interval; The dynamic range of the image to be processed is corrected according to the function of the cubic spline curve and the data information of the image to be processed.

36. An image dynamic range processing device, characterized in that: include: an acquisition module, configured to acquire a first coordinate value of a first interpolation point and a first coordinate value of a third interpolation point associated with a first cubic spline curve, wherein the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values; a first determination module, configured to determine, based on histogram information of a first brightness interval of the image to be processed, a first coordinate value of a second interpolation point associated with the first cubic spline curve, where the first brightness interval is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point; the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, and the first coordinate value of the third interpolation point are used to determine a function of the first cubic spline curve, where the function of the first cubic spline curve is used to map brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting a curve in a basic mapping curve corresponding to the first brightness interval; A sending module is configured to send dynamic metadata and data information of the image to be processed to a decoding end, so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, wherein the dynamic metadata includes a first coordinate value of the first interpolation point, a first coordinate value of the second interpolation point, and a first coordinate value of the third interpolation point, and the data information of the image to be processed is used to obtain the image to be processed.

37. The device according to claim 36, characterized in that The function of the first cubic spline curve is obtained as follows: The acquisition module is further configured to acquire a function of the basic mapping curve; The first determination module is further used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; and determine the function of the first cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

38. The device according to claim 37, characterized in that The first determining module is configured to determine a second coordinate value of the second interpolation point according to the following formula; Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

39. The device according to any one of claims 36 to 38, characterized in that The device further comprises: a second determining module, configured to determine first coordinate values ​​of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point associated with the second cubic spline curve based on the first coordinate value of the third interpolation point and the maximum value of the RGB components of the first pixel of the image to be processed; wherein: the first pixel is the pixel with the largest maximum value of the RGB components in the image to be processed, and the maximum value of the RGB components of the pixel is the maximum value of the R component, the G component, and the B component of the pixel; The first coordinate value of the fourth interpolation point, the first coordinate value of the fifth interpolation point, and the first coordinate value of the sixth interpolation point are used to determine the function of the second cubic spline curve. The function of the second cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a second brightness interval to a second target brightness value, thereby correcting the dynamic range of the image to be processed. The second brightness interval is the interval between the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point. There is no overlapping area between the first brightness interval and the second brightness interval.

40. The device according to any one of claims 36 to 38, characterized in that The acquisition module is specifically configured to set the first coordinate value of the first interpolation point to a first preset brightness value; and set the first coordinate value of the third interpolation point to a second preset brightness value.

41. The device according to any one of claims 36 to 38, characterized in that The first coordinate value of the second interpolation point is determined according to the following formula: Wherein, TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels in the image to be processed whose brightness values ​​are within the first brightness interval, i is the i-th pixel among the pixels in the image to be processed whose brightness values ​​are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.

42. The device according to claim 39, characterized in that The second determining module is specifically configured to determine the first coordinate value of the fourth interpolation point according to a first formula, wherein the first formula is: The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is: Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; Among them, TH1_high is the first coordinate value of the fourth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, TH3 is the first coordinate value of the third interpolation point, and U is a preset value.

43. The device according to claim 39, characterized in that The second determining module is configured to determine the first coordinate values ​​of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: determining an initial value of the first coordinate value of the fourth interpolation point according to the first coordinate value of the third interpolation point and a maximum value of the RGB components of the first pixel; Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; determining a first number of pixels and a second number of pixels based on the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; wherein the first number of pixels is the number of pixels in the image to be processed whose brightness values ​​are within a third brightness interval, the third brightness interval being an interval between the initial value of the first coordinate value of the fourth interpolation point and the first coordinate value of the sixth interpolation point; and the second number of pixels is the total number of pixels in the image to be processed or in a brightness histogram of the image to be processed; determining a first coordinate value of the fourth interpolation point according to the first number of pixels, the second number of pixels, the first coordinate value of the third interpolation point, an initial value of the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point; The first coordinate value of the fifth interpolation point is determined according to the histogram information of the second brightness range of the image to be processed, the first coordinate value of the fourth interpolation point, and the first coordinate value of the sixth interpolation point.

44. The device according to claim 43, characterized in that The second brightness interval includes N sub-intervals, where N is a positive integer. The second determination module is configured to determine the first coordinate value of the fifth interpolation point in the following manner: Determining an i-th subinterval from the N subintervals, where the i-th subinterval is located in n subintervals of the N subintervals, the sequence numbers of the n subintervals are greater than or equal to N / 4, and the sequence numbers of the n subintervals are less than or equal to 3N / 4, and the number of pixels in the image to be processed whose brightness values ​​are located in the i-th subinterval is a minimum value among the n subintervals; The first coordinate value of the fifth interpolation point is determined according to the first coordinate value of the fourth interpolation point, the first coordinate value of the sixth interpolation point, and i.

45. The device according to claim 44, characterized in that The value of N is 8.

46. ​​The device according to any one of claims 43 to 45, characterized in that The second determining module is configured to determine an initial value of the first coordinate value of the fourth interpolation point in the following manner: TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, and TH3 is the first coordinate value of the third interpolation point.

47. The device according to any one of claims 43 to 45, characterized in that The second determining module is configured to determine the first coordinate value of the fourth interpolation point in the following manner: Determine the ratio of the length of the third brightness interval to the maximum value of the RGB components of the first pixel; and determine the first coordinate value of the fourth interpolation point according to the following formula: Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB components of the first pixel, U is a preset value, TH3 is the first coordinate value of the third interpolation point, highRatio is the ratio of the number of the first pixels to the number of the second pixels, wholeratio is the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel, TH1_high1 is the initial value of the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and POW(x, j) refers to x raised to the power of j.

48. The device according to claim 44 or 45, characterized in that The second determining module is configured to determine the first coordinate value of the fifth interpolation point in the following manner: TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, TH3_high is the first coordinate value of the sixth interpolation point, and n_min is i.

49. The device according to claim 39, characterized in that The device further comprises: The second determination module is further configured to determine a third number of pixels and a fourth number of pixels based on a brightness histogram of the image to be processed, the first coordinate value of a fourth interpolation point, the first coordinate value of a fifth interpolation point, and the first coordinate value of a sixth interpolation point, where the third number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fourth interpolation point and the first coordinate value of the fifth interpolation point, and the fourth number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the fifth interpolation point and the first coordinate value of the sixth interpolation point; and determine an adjustment strength of the second coordinate value of the fifth interpolation point based on the third number of pixels and the fourth number of pixels, where the adjustment strength indicates a degree of offset of the second coordinate value of the fifth interpolation point relative to an initial value of the second coordinate value of the fifth interpolation point.

50. The device according to claim 49, characterized in that The second determining module is specifically configured to determine the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula: TH_high_strength is the adjustment strength of the second coordinate value of the fifth interpolation point, TH_high_strength1 is the default value of the adjustment strength of the second coordinate value of the fifth interpolation point, Δ is the adjustment step, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels.

51. The device according to claim 49 or 50, characterized in that The initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula: Among them, VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point, VA1_high is the second coordinate value of the fourth interpolation point, VA3_high is the second coordinate value of the sixth interpolation point, TH2_high is the first coordinate value of the fifth interpolation point, TH1_high is the first coordinate value of the fourth interpolation point, and TH3_high is the first coordinate value of the sixth interpolation point.

52. The device according to claim 37, characterized in that The function of the basic mapping curve is used to map the brightness value of the pixel in the image to be processed to the third target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the third target brightness value as a dependent variable, wherein the brightness mapping function is as follows: The parameters of the brightness mapping function include: a, b, p, m, n, L' is the third target brightness value, and L is the brightness value of the pixel in the image to be processed.

53. An image dynamic range processing device, characterized in that: include: an acquisition module, configured to acquire a maximum value of RGB components of a first pixel of an image to be processed, wherein the first pixel is a pixel in the image to be processed having the largest maximum value of RGB components, and the maximum value of RGB components of the pixel is a maximum value among R, G, and B components of the pixel; a first determination module, configured to determine a first coordinate value of at least one interpolation point associated with a cubic spline curve based on a maximum value of an RGB component of the first pixel and a brightness histogram of a first brightness interval of the image to be processed, wherein each interpolation point associated with the cubic spline curve includes a first interpolation point, a second interpolation point, and a third interpolation point, and the first coordinate value of the interpolation point is a brightness value. The first coordinate value of each interpolation point associated with the cubic spline curve is used to determine a corresponding function of the cubic spline curve, and each function of the cubic spline curve is used to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the corresponding first brightness interval to a first target brightness value, thereby correcting the curve corresponding to the first brightness interval in the basic mapping curve. The first brightness interval corresponding to the function of the cubic spline curve is an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point associated with the function of the cubic spline curve; A sending module is configured to send dynamic metadata and data information of the image to be processed to a decoding end, so that the decoding end corrects the dynamic range of the image to be processed according to the function of the cubic spline curve, wherein the dynamic metadata includes a first coordinate value of the first interpolation point, a first coordinate value of the second interpolation point, and a first coordinate value of the third interpolation point, and the data information of the image to be processed is used to obtain the image to be processed.

54. The device according to claim 53, characterized in that The number of the cubic spline curve is one; The first determining module is further configured to determine, based on the brightness histogram, a maximum RGB component value of a second pixel corresponding to a first percentage, a maximum RGB component value of a third pixel corresponding to a second percentage, and a maximum RGB component value of a fourth pixel corresponding to a third percentage, wherein the first percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel, the second percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel, and the third percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel; determine a first coordinate value of the first interpolation point based on the maximum RGB component value of the second pixel corresponding to the first percentage, the maximum RGB component value of the third pixel corresponding to the second percentage, and the maximum RGB component value of the fourth pixel corresponding to the third percentage; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; and determine the first coordinate value of the second interpolation point based on the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and histogram information corresponding to the first brightness interval in the brightness histogram.

55. The device according to claim 54, characterized in that The first determining module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and a brightness threshold; The first coordinate value of the first interpolation point is determined according to the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, and the first value.

56. The device according to claim 55, characterized in that The first percentage is 90%, the second percentage is 95%, and the third percentage is 99%; The determining module is configured to determine a first value of the first coordinate value of the first interpolation point according to the following formula: Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90% ratio, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95% ratio, and THRESOLD is the brightness threshold.

57. The device according to claim 55, characterized in that The first determining module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining a difference between a maximum value of RGB components of a third pixel corresponding to twice the second percentage and a maximum value of RGB components of the second pixel corresponding to the first percentage; Determine whether the maximum value of the RGB component of the fourth pixel corresponding to the third percentage is greater than the sum of the obtained difference and a first preset value and whether the first value is greater than a first threshold; If so, the first coordinate value of the first interpolation point is set to the first value.

58. The device according to claim 54, characterized in that The first determining module is configured to determine the first coordinate value of the first interpolation point in the following manner: determining, according to the brightness histogram of the image to be processed, a maximum RGB component value of a fifth pixel corresponding to a fourth percentage, a maximum RGB component value of a sixth pixel corresponding to a fifth percentage, and a maximum RGB component value of a seventh pixel corresponding to a sixth percentage, wherein the fourth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among the multiple pixels, the fifth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among the multiple pixels, and the sixth percentage represents the percentage of pixels in the image to be processed whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among the multiple pixels; determining a first value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the fifth pixel corresponding to the fourth percentage, the maximum value of the RGB components of the second pixel corresponding to the first percentage, and a brightness threshold; determining a second value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the second pixel corresponding to the first percentage, the maximum value of the RGB components of the third pixel corresponding to the second percentage, and a brightness threshold; determining a third value of the first coordinate value of the first interpolation point according to the maximum value of the RGB components of the third pixel corresponding to the second percentage, the maximum value of the RGB components of the fourth pixel corresponding to the third percentage, and a brightness threshold; The first coordinate value of the first interpolation point is determined based on the maximum RGB component of the fifth pixel corresponding to the fourth percentage, the maximum RGB component of the sixth pixel corresponding to the fifth percentage, the maximum RGB component of the second pixel corresponding to the first percentage, the maximum RGB component of the third pixel corresponding to the second percentage, the maximum RGB component of the fourth pixel corresponding to the third percentage, the maximum RGB component of the seventh pixel corresponding to the sixth percentage, and the first value to the third value.

59. The device according to claim 58, characterized in that The first percentage is 90%, the second percentage is 95%, the third percentage is 99%, the fourth percentage is 50%, the fifth percentage is 10%, and the sixth percentage is 100%; The first determining module is configured to determine a first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is: A second value of the first coordinate value of the first interpolation point is determined according to a second formula, wherein the second formula is: A third value of the first coordinate value of the first interpolation point is determined according to a third formula, wherein the third formula is: Among them, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.

60. The device according to claim 59, characterized in that The first determining module is configured to determine an initial value of the first coordinate value of the first interpolation point by using a fourth formula: The first coordinate value of the first interpolation point is determined by the fifth formula in combination with the initial value of the first coordinate value of the first interpolation point, the second value, and the third value: Among them, TH1 is the first coordinate value of the first interpolation point, TH1_used is the initial value of the first coordinate value of the first interpolation point, TH1_used1 is the first value, TH1_used2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum value of the RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum value of the RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum value of the RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum value of the RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum value of the RGB component of the sixth pixel corresponding to the 10%, and g_maxRGBdistribution100 is the maximum value of the RGB component of the seventh pixel corresponding to the 100%.

61. The device according to any one of claims 54 to 60, characterized in that The first brightness interval includes N sub-intervals, where N is a positive integer; The first determining module is configured to determine the first coordinate value of the second interpolation point in the following manner: Determining an i-th subinterval from the N subintervals, the i-th subinterval being located in n subintervals of the N subintervals, the sequence numbers of the n subintervals being greater than or equal to N / 4, and the sequence numbers of the n subintervals being less than or equal to 3N / 4, and the number of pixels in the to-be-processed image whose brightness values ​​are located in the i-th subinterval being the minimum value among the n subintervals; The first coordinate value of the second interpolation point is determined according to the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, and i.

62. The device according to claim 61, characterized in that The value of N is 8.

63. The device according to claim 62, characterized in that The first determining module is configured to determine the first coordinate value of the second interpolation point according to the following formula: Wherein, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, TH3 is the first coordinate value of the third interpolation point, and n_min is i.

64. The device according to claim 54, characterized in that The function of the cubic spline curve is obtained as follows: The acquisition module is further configured to acquire a function of the basic mapping curve; The first determination module is further used to map the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point according to the function of the basic mapping curve to obtain the second coordinate value of the first interpolation point and the second coordinate value of the third interpolation point; determine the second coordinate value of the second interpolation point according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, and the second coordinate value of the third interpolation point; and determine the function of the cubic spline curve according to the first coordinate value of the first interpolation point, the first coordinate value of the second interpolation point, the first coordinate value of the third interpolation point, the second coordinate value of the first interpolation point, the second coordinate value of the third interpolation point, and the second coordinate value of the second interpolation point.

65. The device according to claim 64, characterized in that The first determining module is configured to determine a second coordinate value of the second interpolation point according to the following formula; Among them, VA2 is the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

66. The device according to claim 64, characterized in that The function of the basic mapping curve is used to map the brightness value of the pixel in the image to be processed to the second target brightness value. The function of the basic mapping curve is a brightness mapping function with the brightness value of the pixel in the image to be processed as an independent variable and the second target brightness value as a dependent variable, wherein the brightness mapping function is as follows: The parameters of the brightness mapping function include: a, b, p, m, n, L' is the second target brightness value, and L is the brightness value of the pixel in the image to be processed.

67. The device according to claim 54, characterized in that The device further comprises: A second determination module is configured to determine a first number of pixels and a second number of pixels based on a brightness histogram of the image to be processed, a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, wherein the first number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the first interpolation point and the first coordinate value of the second interpolation point, and the second number of pixels is the number of pixels in the brightness histogram between the first coordinate value of the second interpolation point and the first coordinate value of the third interpolation point; and determine an adjustment strength of the second coordinate value of the second interpolation point based on the first number of pixels and the second number of pixels, wherein the adjustment strength is used to indicate a degree of offset of the second coordinate value of the second interpolation point relative to an initial value of the second coordinate value of the second interpolation point.

68. The device according to claim 67, characterized in that The second determining module is configured to determine an adjustment strength of the second coordinate value of the second interpolation point according to the following formula: Among them, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, TH_strength1 is the default value of the adjustment strength of the second coordinate value of the second interpolation point, Δ is the adjustment step, NUM1 is the first pixel number, and NUM2 is the second pixel number.

69. The device according to claim 67 or 68, characterized in that The initial value of the second coordinate value of the second interpolation point is obtained by the following formula: Among them, VA21 is the initial value of the second coordinate value of the second interpolation point, VA1 is the second coordinate value of the first interpolation point, VA3 is the second coordinate value of the third interpolation point, TH2 is the first coordinate value of the second interpolation point, TH1 is the first coordinate value of the first interpolation point, and TH3 is the first coordinate value of the third interpolation point.

70. An image dynamic range processing device, characterized in that: include: A receiving module is configured to receive dynamic metadata and data information of an image to be processed sent by an encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, the dynamic metadata includes parameters of a function of a cubic spline curve, the parameters of the function of the cubic spline curve include a first coordinate value of a first interpolation point, a first coordinate value of a second interpolation point, and a first coordinate value of a third interpolation point, the function of the cubic spline curve is configured to map the brightness values ​​of pixels in the image to be processed whose brightness values ​​are within a corresponding interval to a target brightness value, thereby correcting the dynamic range of the image to be processed, the cubic spline curve includes a first cubic spline curve, and the first cubic spline curve includes a second cubic spline curve. a curve determined based on a first coordinate value of the first interpolation point, a first coordinate value of the second interpolation point, and a first coordinate value of the third interpolation point, the first coordinate value being a brightness value, the first coordinate value of the second interpolation point being determined based on histogram information of a first brightness interval of the image to be processed, the first brightness interval being an interval between the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point, the function of the first cubic spline curve being used to map brightness values ​​of pixels in the image to be processed whose brightness values ​​are within the first brightness interval to a first target brightness value, thereby correcting a curve in the basic mapping curve corresponding to the first brightness interval; A correction module is used to correct the dynamic range of the image to be processed according to the function of the cubic spline curve and the data information of the image to be processed.

71. 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 configured to cause the device to execute the method according to any one of claims 1 to 35.

72. 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, the processor is used to execute the code in the memory, and is characterized in that when the processor executes the code, the chip device implements the method described in any one of claims 1 to 35.

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

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

Citation Information

Patent Citations

  • Image dynamic range processing method and device

    CN113628106B

  • Image processing apparatus, luminance conversion curve correcting method and program

    JP2010074222A