Image dynamic range processing method and device
By using the function of the three -sample curve to adjust the image to adjust the image, it solves the problem of brightness hierarchy caused by the lack of flexibility of the mapping curve in the existing technology, which significantly improves the display effect of the image.
Patent Information
- Application Number
- CN202010383489.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-08
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-05-08
AI Technical Summary
In the prior art, when adjusting the dynamic range of the image, due to the inflexible shape of the mapping curve, the brightness level of some areas of the image is lost, and the brightness ratio is not obvious, which affects the display effect.
By obtaining the coordinate value of the interpolation point related to the first or three sample curves, the function of the three -sample curve is determined, and the brightness value mapping of the pixel in the specific interval in the specific interval is the target value. scope.
The protection of a specific area of the image is realized, and the morphological diversity, flexibility, robustness and universality of the mapping curve are added, and the image display effect after adjusting the dynamic range is improved.
Smart Images

Figure CN113628106B_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] Dynamic Range (DR) is used in many fields to represent 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 displayable range of the image, that is, the number of gray levels from the "brightest" to the "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).
[0003] At present, display devices with a dynamic range of less than 0.1 to 400 nits are generally called standard dynamic range (SDR) display devices; those with a dynamic range of more than 0.01 to 540 nits are called high dynamic range (HDR) display devices. Different high dynamic range display devices display different dynamic ranges, such as 0.01 to 540 nits high dynamic range display devices, 0.005 to 1000 nits high dynamic range display devices, etc. Similarly, different standard dynamic range display devices display different dynamic ranges. In order to make the image adapt 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 dynamic range of the image to the display capability of the display device for display.
[0004] In the prior art, the brightness value of each pixel in the image is mapped to the target brightness value through a mapping curve, so as to adjust the dynamic range of the image by changing the brightness value of the pixel. However, since the shape of the existing mapping curve is not flexible enough, the brightness level of some areas in the image is lost, the brightness comparison is not obvious, and the display effect of the image after the dynamic range is adjusted is not good. Summary of the invention
[0005] The present application provides a method and device for processing an image dynamic range, which can improve the display effect of an image.
[0006] 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 according to 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 brightness values of pixels in the image to be processed whose brightness values are within the first brightness interval to first target brightness values, thereby correcting the dynamic range of the image to be processed.
[0007] 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 in 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 value of a part of the pixels in the image to be processed is mapped according to the function of the first cubic spline curve. The pixels in the first brightness range are protected by 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 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.
[0008] In a possible implementation, the function of the first cubic spline curve is obtained according to the following method: acquiring the 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.
[0009] 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;
[0010]
[0011] 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.
[0012] In a possible implementation, the method further includes: determining first coordinate values of a fourth interpolation point, a fifth interpolation point, and a sixth interpolation point related to the second cubic spline curve according to a first coordinate value of the third interpolation point and a maximum value of an RGB component of a first pixel of the image to be processed; wherein: the first pixel is a pixel having a maximum RGB component value in the image to be processed, and the maximum RGB component value of the pixel is a maximum value among an R component, a G component, and a 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 interval to a second target brightness value, thereby correcting the dynamic range of the image to be processed, the second brightness interval being 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 brightness interval and the second brightness interval.
[0013] In a 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.
[0014] In a 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.
[0015] In a possible implementation manner, the first coordinate value of the second interpolation point is determined according to the following formula:
[0016]
[0017] 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.
[0018] In a possible implementation, 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 includes: determining the first coordinate value of the fourth interpolation point according to a first formula, wherein the first formula is:
[0019]
[0020] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:
[0021]
[0022] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;
[0023] 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.
[0024] 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 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 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 according to 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 value of the brightness value in the image to be processed. The method comprises the steps of: 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 a 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.
[0025] In a possible implementation, the second brightness interval includes N sub-intervals, where N is a positive integer, 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 includes: determining an i-th sub-interval from the N sub-intervals, the i-th sub-interval is located in n sub-intervals of the N sub-intervals, the sequence number of the n sub-intervals is greater than or equal to N / 4, and the sequence number of the n sub-intervals is 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; and 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.
[0026] In a possible implementation, the value of N is 8.
[0027] 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 component of the first pixel includes: determining the initial value of the first coordinate value of the fourth interpolation point according to the following:
[0028]
[0029] Among them, 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.
[0030] In a possible implementation, 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 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:
[0031]
[0032] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB component 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 to the jth power.
[0033] In a possible implementation manner, 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:
[0034] The first coordinate value of the fifth interpolation point is determined according to the following formula:
[0035]
[0036] Among them, 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 the i.
[0037] In a possible implementation, the method further includes: determining a third number of pixels and a fourth number of pixels according to 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 an 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 an 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; and determining an 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, 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.
[0038] 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:
[0039]
[0040] Among them, 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 pixel number, and NUM2 is the fourth pixel number.
[0041] In a possible implementation manner, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:
[0042]
[0043] 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.
[0044] In a possible implementation, 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, and 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:
[0045]
[0046] 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.
[0047] 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 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 a maximum value among R, G and B components of the pixel; 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 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, and 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 value of a pixel in the image to be processed whose brightness value is 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.
[0048] 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 interpolation point determination method 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 whose brightness value of the image to be processed is located in 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 value of a part of the pixels in the image to be processed is mapped to the first target pixel value 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 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.
[0049] In a possible implementation, the number of the cubic spline curves is one; determining the first coordinate value of the 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 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 according to the brightness histogram, wherein the first percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among multiple pixels in the image to be processed, and the second percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among multiple pixels in the image to be processed. The third percentage represents the percentage of pixels with maximum RGB component values among 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 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; 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.
[0050] In a possible implementation, 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 includes: determining a first value of 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 a brightness threshold; 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value.
[0051] 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 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,
[0052]
[0053] 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%, and THRESOLD is the brightness threshold.
[0054] In a possible implementation, 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value includes: determining the 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; judging whether the maximum RGB component value 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, setting the first coordinate value of the first interpolation point to the first value.
[0055] In a possible implementation, 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 includes: determining 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 according to the brightness histogram of the image to be processed, wherein the fourth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among multiple pixels in the image to be processed. 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 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 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 a 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.
[0056] In a 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 a first value of the first coordinate value of the first interpolation point according to a first formula, wherein the first formula is:
[0057]
[0058] The 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:
[0059]
[0060] The determining of 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:
[0061]
[0062] 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 RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.
[0063] In a possible implementation manner, 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:
[0064]
[0065] 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:
[0066]
[0067] 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%.
[0068] In a possible implementation, the first brightness interval includes N sub-intervals, where N is a positive integer; 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 includes: determining an i-th sub-interval 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 in the n sub-intervals; 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.
[0069] In a possible implementation, the value of N is 8.
[0070] In a possible implementation manner, 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:
[0071] The first coordinate value of the second interpolation point is determined according to the following formula:
[0072]
[0073] Among them, 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 the i.
[0074] In a possible implementation, the function of the cubic spline curve is obtained according to the following method: acquiring the function of 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 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.
[0075] 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;
[0076]
[0077] 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.
[0078] In a possible implementation, 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, and 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:
[0079]
[0080] 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.
[0081] In a possible implementation, the method further includes: determining a first pixel number and a second pixel number 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 pixel number 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 pixel number 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; and determining an adjustment strength of the second coordinate value of the second interpolation point according to 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.
[0082] 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:
[0083]
[0084] 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.
[0085] In a possible implementation manner, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:
[0086]
[0087] 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.
[0088] In 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.
[0089] In a fourth aspect, an image dynamic range processing device is provided, comprising: 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, the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point being 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 according to 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.
[0090] In a possible implementation, the function of the first cubic spline curve is obtained according to the following method: the acquisition module 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.
[0091] In a possible implementation, the first determining module is used to determine the second coordinate value of the second interpolation point according to the following formula:
[0092]
[0093] 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.
[0094] In a possible implementation, the device further includes: a second determination 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 according to a first coordinate value of the third interpolation point and a maximum value of an RGB component of a first pixel of the image to be processed; wherein: the first pixel is a pixel having a maximum RGB component value in the image to be processed, and the maximum RGB component value of the pixel is a maximum value among an R component, a G component, and a 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 used to map 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 a dynamic range of the image to be processed, the second brightness interval being 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 brightness interval and the second brightness interval.
[0095] In a possible implementation, the device also includes: a sending module, used 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.
[0096] In a possible implementation manner, 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.
[0097] In a possible implementation manner, the first coordinate value of the second interpolation point is determined according to the following formula:
[0098]
[0099] 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.
[0100] In a possible implementation, the second determination 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:
[0101]
[0102] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:
[0103]
[0104] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;
[0105] 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.
[0106] In a possible implementation, the second determination module is used to determine the first coordinate values of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: determine 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; set the first coordinate value of the sixth interpolation point to the maximum value of the RGB component of the first pixel; determine the first pixel number and the second pixel number according to 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 whose brightness values in the image to be processed are in the third brightness interval, and the The third brightness interval is an interval between an initial value of the first coordinate value of the fourth interpolation point and a 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 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; the first coordinate value of the fifth interpolation point is determined 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.
[0107] In a possible implementation, the second brightness interval includes N sub-intervals, where N is a positive integer, and the second determination module is used to determine the first coordinate value of the fifth interpolation point in the following manner: determining an i-th sub-interval from the N sub-intervals, where the i-th sub-interval is located in n sub-intervals of the N sub-intervals, where the sequence numbers of the n sub-intervals are greater than or equal to N / 4, and where the sequence numbers of the n sub-intervals are less than or equal to 3N / 4, and where the number of pixels whose brightness values in the image to be processed are located in the i-th sub-interval is the minimum value in the n sub-intervals; and 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.
[0108] In a possible implementation, the value of N is 8.
[0109] In a possible implementation manner, the second determining module is used to determine an initial value of the first coordinate value of the fourth interpolation point in the following manner:
[0110]
[0111] Among them, 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.
[0112] In a possible implementation, the second determination module is used 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 component of the first pixel; determine the first coordinate value of the fourth interpolation point according to the following formula:
[0113]
[0114] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB component 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 to the jth power.
[0115] In a possible implementation manner, the second determining module is used to determine the first coordinate value of the fifth interpolation point in the following manner:
[0116]
[0117] Among them, 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 the i.
[0118] In a possible implementation manner, the device further includes:
[0119] The second determination module is further used to determine a third pixel number and a fourth pixel number 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, wherein the third pixel number 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 pixel number 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; and determine an adjustment strength of the second coordinate value of the fifth interpolation point according to the third pixel number and the fourth pixel number, 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.
[0120] 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:
[0121]
[0122] Among them, 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 pixel number, and NUM2 is the fourth pixel number.
[0123] In a possible implementation manner, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:
[0124]
[0125] 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.
[0126] In a possible implementation, 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, and 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:
[0127]
[0128] 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.
[0129] In a fifth aspect, the present application provides an image dynamic range processing device, comprising:
[0130] An acquisition module is used to acquire the maximum value of the RGB component 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 component of the 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; a first determination module is used to determine the first coordinate value of at least one interpolation point associated with 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, 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, and 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 the pixel whose brightness value is in the corresponding first brightness interval in the image to be processed to a first target brightness value, so as to correct 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.
[0131] In a possible implementation, the number of the cubic spline curve is one;
[0132] The first determination module is further used to determine, 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 indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among a plurality of pixels in the image to be processed, the second percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among a plurality of pixels in the image to be processed, and the third percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among a plurality of pixels in the image to be processed; determine a 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; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; 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.
[0133] In a possible implementation manner, the first determining module is configured to determine the first coordinate value of the first interpolation point in the following manner:
[0134] Determine a 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 a brightness threshold;
[0135] The first coordinate value of the first interpolation point is determined 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value.
[0136] In a possible implementation, the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%;
[0137] The determining module is used to determine a first value of the first coordinate value of the first interpolation point according to the following formula:
[0138]
[0139] 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%, and THRESOLD is the brightness threshold.
[0140] In a possible implementation, the first determination module is used to determine the first coordinate value of the first interpolation point in the following manner: determine the difference between the maximum value of the RGB component of the third pixel corresponding to twice the second percentage and the maximum value of the RGB component 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, set the first coordinate value of the first interpolation point to the first value.
[0141] In a possible implementation, the first determination module is used to determine the first coordinate value of the first interpolation point in the following manner: 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 according to the brightness histogram of the image to be processed, wherein the fourth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among the multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among the multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among the multiple pixels in the image to be processed; according to the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the first determination module determines the first coordinate value of the first interpolation point in the following manner: The first value of the first coordinate value of the first interpolation point is determined according to the maximum value of the RGB component 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 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; the third value of the first coordinate value of the first interpolation point is determined 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; the first coordinate value of the first interpolation point is determined 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.
[0142] In a 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 used 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:
[0143]
[0144] 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:
[0145]
[0146] 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:
[0147]
[0148] 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 RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.
[0149] 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:
[0150]
[0151] 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:
[0152]
[0153] 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%
[0154] In a possible implementation, the first brightness interval includes N sub-intervals, where N is a positive integer; the first determination module is used to determine the first coordinate value of the second interpolation point in the following manner: determine the i-th sub-interval 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 in the n sub-intervals; 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 i.
[0155] In a possible implementation, the value of N is 8.
[0156] 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:
[0157]
[0158] Among them, 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 the i.
[0159] In a possible implementation, the function of the cubic spline curve is obtained according to the following method: the acquisition module 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 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.
[0160] In a possible implementation, the first determining module is used to determine the second coordinate value of the second interpolation point according to the following formula:
[0161]
[0162] 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.
[0163] In a possible implementation, 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, and 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:
[0164]
[0165] 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.
[0166] In a possible implementation, the device further includes: a second determination module, configured to determine a first pixel number and a second pixel number 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 pixel number 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 pixel number 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; and determine an adjustment strength of the second coordinate value of the second interpolation point according to the first pixel number and the second pixel number, wherein the adjustment strength is used to indicate a degree of deviation 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.
[0167] 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:
[0168]
[0169] 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.
[0170] In a possible implementation manner, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:
[0171]
[0172] 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.
[0173] In a sixth aspect, a device for processing an image dynamic range is provided, comprising: a receiving module, used 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, 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.
[0174] 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 in the first aspect to the third aspect.
[0175] In an 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.
[0176] In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program includes methods for implementing any one of the first to third aspects above.
[0177] In a tenth aspect, a computer program product is provided, wherein the computer program product comprises instructions, and when the instructions are executed on a computer, the computer implements any one of the methods in the first to third aspects above. BRIEF DESCRIPTION OF THE DRAWINGS
[0178] Figure 1 is the image of the PQ photoelectric transfer function;
[0179] Figure 2 is the image of HLG photoelectric transfer function;
[0180] Figure 3 is the image of SLF photoelectric transfer function;
[0181] Figure 4 A schematic diagram of a mapping curve used in a conventional dynamic range adjustment scheme;
[0182] Figure 5 A schematic diagram of an end-to-end system structure for image dynamic range processing provided in an embodiment of the present application;
[0183] Figure 6 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 1 ;
[0184] Figure 7 It is a schematic diagram of the second cubic spline curve and the basic mapping curve;
[0185] Figure 8 A schematic diagram of a method for processing image dynamic range provided in an embodiment of the present application Figure 2 ;
[0186] Fig. 9 A schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 1 ;
[0187] Fig.10 A schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 2 ;
[0188] Fig.11 A schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 3 ;
[0189] Fig.12 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0190] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0191] First, a brief introduction is given to the relevant concepts and technologies involved in the embodiments of the present application.
[0192] Dynamic Range is used in many fields to express the ratio of the maximum value to the minimum value of a variable. In digital images, the dynamic range represents the ratio between the maximum brightness value and the minimum brightness value within the displayable range of the image. The dynamic range in nature is very large. For example, the brightness of a night scene under the starry sky is about 0.001cd / m 2 The sun itself has a brightness of 1,000,000,000 cd / m 2 Among them, cd / m 2 (Candela per square meter) is the SI derived unit for measuring brightness. Thus, the dynamic range of nature reaches 1000,000,000 / 0.001=10 13 order of magnitude.
[0193] However, in real scenes in nature, the brightness of the sun and the brightness of the stars are not obtained at the same time. For natural scenes in the real world, the dynamic range is 10-3 to 10 6 Since this is a very large dynamic range, we usually call it High Dynamic Range (HDR). Compared with the high dynamic range, the dynamic range on ordinary pictures is called Low Dynamic Range (LDR). From this, we can understand that the imaging process of a digital camera is actually a mapping from the high dynamic range of the real world to the low dynamic range of the photo.
[0194] The larger the dynamic range of an image, the more scene details the image displays, the richer the brightness levels, and the more realistic the visual effect. Traditional digital images generally use one byte, that is, 8 bits of space to store a pixel value, while high dynamic range uses floating point numbers with multiple bytes to store a pixel value, so it can represent the high dynamic range of natural scenes.
[0195] The process of optical digital imaging (for example, the imaging process of a digital camera) is to convert the light radiation of a real scene into an electrical signal through an image sensor and save it in the form of a digital image. The purpose of image display is to reproduce the real scene described by a digital image through a display device. The ultimate goal of both is to enable users to obtain the same visual perception as they directly observe the real scene.
[0196] The brightness level of the real scene that can be displayed by light radiation (light signal) is almost linear, so the light signal is also called a linear signal. However, in the process of converting light signals into electrical signals in optical digital imaging, not every light signal corresponds to an electrical signal, and the converted electrical signal is nonlinear. Therefore, the electrical signal is also called a nonlinear signal.
[0197] The Optical Electro Transfer Function (OETF) represents the conversion relationship between the linear signal and the nonlinear signal of an image pixel. The commonly used OETFs at this stage include the following three:
[0198] Perceptual Quantizer (PQ) photoelectric transfer function, Hybrid Log-Gamma (HLG) photoelectric transfer function and Scene Luminance Fidelity (SLF) photoelectric transfer function. These three photoelectric transfer functions are photoelectric transfer functions specified by the Audio Video Coding Standard (AVS).
[0199] The PQ photoelectric transfer function is a perceptual quantization photoelectric transfer function proposed based on the brightness perception model of the human eye. Figure 1 , Figure 1 This is the image of the PQ photoelectric transfer function.
[0200] 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):
[0201]
[0202] The calculation of each parameter in formula (1) is as follows:
[0203]
[0204] 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.
[0205] 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.
[0206] The HLG photoelectric transfer function uses the traditional Gamma curve in the low segment and supplements the log curve in the high segment. The HLG photoelectric transfer function represents the conversion relationship from the linear signal value of the image pixel to the nonlinear signal value of the HLG domain. The HLG photoelectric transfer function can be expressed as formula (2):
[0207]
[0208] Wherein, L represents the linear signal value, and its value range is [0, 12], L' represents the nonlinear signal value, and its value range is [0, 1], a, b, c are HLG photoelectric transfer coefficients, a = 0.17883277, b = 0.28466892, c = 0.55991073.
[0209] The SLF photoelectric transfer function is the optimal curve obtained based on the brightness distribution of the HDR scene while satisfying the optical characteristics of the human eye. Figure 3 , Figure 3 This is the image of the SLF photoelectric transfer function.
[0210] The SLF photoelectric transfer curve represents the conversion relationship between the linear signal value of the image pixel and the nonlinear signal value in the SLF domain. The conversion relationship between the linear signal value of the image pixel and the nonlinear signal value in the SLF domain is shown in formula (3):
[0211]
[0212] Among them, the SLF photoelectric transfer function can be expressed as formula (4):
[0213]
[0214] Wherein, L represents the linear signal value, and its value is normalized to [0,1]; L' represents the nonlinear signal value, and its value range is [0,1]; p, m, a, and b are SLF photoelectric transfer coefficients, p = 2.3, m = 0.14, a = 1.12762, and b = -0.12762.
[0215] Since different display devices have different display capabilities, a mapping curve is generally used to map the brightness value of each pixel in the image to a target brightness value according to the display capability of the display device, so as to adjust the dynamic range of the image by changing the brightness value of the pixel. In other words, the dynamic range of the image is adjusted to the dynamic range that the display device can display.
[0216] The dynamic range adjustment method is mainly used in the adaptation of the front-end illumination signal and the back-end terminal display device. For example, the illumination signal collected by the front-end is 4000nit, while the display capability of the back-end terminal display device (TV, IPAD) is only 500nit. Therefore, how to map the 4000nit signal to the 500nit device is a high-to-low mapping process. Another example is that the illumination signal collected by the front-end is 100nit, while the display capability of the back-end terminal display device is 2000nit. How to better display the 100nit signal on the 2000nit device is another low-to-high mapping process.
[0217] 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 whole mapping process is performed by a single data, that is, the mapping curve is usually the same, that is, each scene uses the same mapping curve. The dynamic dynamic range adjustment method is based on a specific area, each scene or each frame. Dynamic adjustment is performed according to the content of each scene or each frame. In other words, different mapping curves are processed according to a specific area, each scene or each frame. The dynamic dynamic range adjustment method needs to carry information for each frame and each scene.
[0218] In the static dynamic range adjustment method, it is necessary to transmit static metadata to the back-end display device, and the static metadata is used to guide the back-end display device to generate 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 the dynamic dynamic range adjustment method, it is necessary to transmit dynamic metadata to the back-end display device, and the dynamic metadata is used to guide the back-end display device to generate a mapping curve. Since the dynamic dynamic range adjustment method performs different mapping curve processing for each scene or each frame, different dynamic metadata is required for performing different mapping curve processing for each scene or each frame.
[0219] It should be noted that compared with the static dynamic range adjustment method, since the dynamic dynamic range adjustment method performs different mapping curve processing for each scene or each frame, the dynamic dynamic range adjustment method can adapt to more diverse scenes and has better display adaptation effect, thus becoming the current mainstream choice.
[0220] However, in the existing dynamic range adjustment methods, 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 adjusting the dynamic range poor. Figure 4 This is a schematic diagram of a mapping curve currently used in a dynamic range adjustment solution. From the figure, it can be seen 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.
[0221] 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 determining the function of the cubic spline curve according to the first coordinate value of the first interpolation point to the third interpolation point, so as to map the brightness value of the pixel whose brightness value in the image to be processed is in the first brightness interval 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.
[0222] Obviously, when the brightness values of pixels in the image to be processed are mapped 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, while pixels in the image to be processed whose medium brightness values are outside the first brightness interval are brightness mapped 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.
[0223] Figure 5 This is a schematic diagram of the end-to-end system structure of image dynamic range processing provided in the embodiment of the present application. Figure 5 The system comprises:
[0224] 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.
[0225] Specifically, the preprocessing module is used to receive an image to be processed, which may be a frame of an 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 a function of a cubic spline curve, or the dynamic metadata includes basic dynamic metadata and parameters of a function of a basic mapping curve and parameters of a function of a cubic spline curve. The image to be processed includes multiple pixels, so the basic dynamic metadata extracted from the image to be processed includes max_maxrgb, average_maxrgb, range_maxrgb, and minimum_maxrgb, wherein max_maxrgb is used to indicate the maximum brightness of the displayed content, for example, max_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 value of the maximum values of the RGB components of the multiple pixels of the image to be processed; range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, range_maxrgb is used to indicate the brightness variation range of the displayed content, for example, iance_maxrgb is the maximum value of the RGB components corresponding to the 90% quantile of the maximum values of the RGB components of multiple pixels in the image to be processed and the maximum value of the RGB components corresponding to the 10% quantile of the maximum values of the RGB components of multiple pixels in the image to be processed. 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 the value range of its independent variable, and the function of the basic mapping curve is used to map the brightness values of pixels in the image to be processed whose brightness values are outside the range of the independent variable of the function of the cubic spline curve, so as to adjust the dynamic range of the image to be processed.
[0226] The encoding module is used to encode dynamic metadata and embed the dynamic metadata into a bitstream, and to encode the image to be processed and embed the image to be processed into the bitstream, so as to send the dynamic metadata and the image to be processed to a decoding end through the bitstream.
[0227] The decoding module is used to decode the image to be processed and the dynamic metadata.
[0228] A dynamic range adjustment module is used for, if the dynamic metadata includes basic dynamic metadata and parameters of the function of a cubic spline curve, calculating the parameters of the function of a basic mapping curve according to the decoded image to be processed and the dynamic metadata and the peak brightness of a display device, constructing the function of a basic mapping curve according to the parameters of the function of the basic mapping curve and constructing the function of a cubic spline curve according to the parameters of the function of the cubic spline curve, and adjusting the dynamic range of the image to be processed by 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, constructing the function of the basic mapping curve according to the parameters of the function of the basic mapping curve, constructing the function of the cubic spline curve according to the parameters of the function of the cubic spline curve, and adjusting the dynamic range of the image to be processed by 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.
[0229] The encoding end and decoding end may be, for example, a mobile phone display device and a set-top box, a television display device, a network live broadcast or a video application conversion device, etc., and this application does not specifically limit this. Figure 5 The structural diagram of the end-to-end system in the embodiment is only exemplary and is not intended to limit the present application.
[0230] 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 the brightness mapping of the processed image is performed according to the function of the cubic spline curve and the function of the basic mapping curve, the brightness values of a part of the pixels are mapped according to the function of the cubic spline curve, and the brightness values of a part of the 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, the 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 realizing the protection of the 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.
[0231] 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:
[0232] 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.
[0233] Specifically, the first coordinate value of the first interpolation point is set to the first preset brightness value, and the first coordinate value of the third interpolation point is set to the second preset brightness value. The first preset brightness value may be, for example, the lower limit of brightness that can be perceived by the human eye, and the second preset brightness value may be, for example, the lower limit of brightness of human skin color. The embodiment of the present application does not specifically limit this. For example, the first preset brightness value and the second preset brightness value may also be set according to 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.
[0234] 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., and this application does not make any special limitation on this.
[0235] Step 602, determining the first coordinate value of the second interpolation point associated with the first cubic spline curve according to the histogram information of the first brightness interval of the image to be processed, the first brightness interval being 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 the first target brightness value, thereby correcting the dynamic range of the image to be processed.
[0236] Specifically, the first coordinate value of the second interpolation point can be determined according to the following formula:
[0237]
[0238] Where TH2 is the first coordinate value of the second interpolation point, N frame is the total number of pixels whose brightness values in the image to be processed are within the first brightness interval, i is the i-th pixel among the pixels whose brightness values in the image to be processed are within the first brightness interval, and f(i) is the brightness value of the i-th pixel.
[0239] 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. 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, gradually transitioning 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.
[0240] 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:
[0241]
[0242] 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.
[0243] In other embodiments of the present application, the first coordinate value of the second interpolation point may also be set to an average value of the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point.
[0244] The process of obtaining the function of the first cubic spline curve includes the following four steps, among which:
[0245] Step 1: Get the function of the basic mapping curve. 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 the independent variable and the third target brightness value as the dependent variable. For example, the brightness mapping function is as follows:
[0246]
[0247] 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.
[0248] It should be noted that the functions of the above basic mapping curves are only exemplary and are not intended to limit the present application.
[0249] 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 make any special restrictions on this.
[0250] Acquiring the function of the basic mapping curve includes: acquiring the values of the 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.
[0251] In the following, the process of obtaining the function of the basic mapping curve will be described by taking the function of the basic mapping curve as the above brightness mapping function as an example.
[0252] First, m is set to 2.4, n is set to 1, and b is set to the minimum brightness MinDisplay of the reference display device. The reference display device here can be a display device that displays the image to be processed, or a display device assumed in the current calculation.
[0253] The first value of p is calculated based on average_maxrgb(avgL) in the image to be processed and combined with the following formula:
[0254]
[0255] in, PvalueHo, PvalueLo, TPH0, TPL0 are all preset values, and the default values are: 3.5, 4, 0, 0.6, 0.3, respectively. g0() is y=x N , the default is y=x, p1 is the first value of p.
[0256] 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:
[0257]
[0258] Among them, PdeltaH1, PdeltaL1, TPH1, TPL1 are all preset values, and the default values are: 0.6, 0, 0.9, 0.75, respectively, and g1() is y=x N , the default is y=x.
[0259] Finally, H(L) is calculated based on b, p, m, n, K1, K2, and K3:
[0260]
[0261] Among them, K1, K2, and K3 are all preset values, and the default values are all 1.
[0262] The calculation formula of a is:
[0263] a=(MaxDisplay-MinDisplay) / (H(MaxSource)-H(MinSource))
[0264] 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.
[0265] Next, the process of determining the maximum brightness correction value max_lum of the image to be processed is described.
[0266] Specifically, obtain maximun_maxrgb, average_maxrgb, and value_maxrgb in the image to be processed. It should be noted that these three parameters have been described above, so they will not be repeated here.
[0267] The first value of the maximum brightness reference value max_lum of the image to be processed is determined according to the following formula:
[0268] MAX=B×max imun_maxrgb+A×(2×average_maxrgb)+(1-AB)×(2×variance_maxrgb)
[0269] 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.
[0270] 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:
[0271]
[0272] 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.
[0273] 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.
[0274] Specifically, the first coordinate value of the first interpolation point is substituted as an 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 an 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.
[0275] 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.
[0276] Step three: 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.
[0277] Specifically, the manner of determining the second coordinate value of the second interpolation point may include the following two methods:
[0278] The first method is to determine the second coordinate value of the second interpolation point according to the following formula:
[0279]
[0280] 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.
[0281] The second method is to determine the second coordinate value of the second interpolation point according to the following formula:
[0282]
[0283] 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, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, and 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, and is not specifically limited here. For example, TH_strength can be set to 0, and the calculation formula of the initial value of the second coordinate value of the second interpolation point is:
[0284] 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 the present application.
[0285] Step 4: 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.
[0286] The first cubic spline curve includes two partial curves, so the function of the first cubic spline curve also includes two piecewise functions, wherein the two piecewise functions correspond to the two partial curves one by one.
[0287] For example, the function of the first cubic spline curve includes two piecewise functions, namely:
[0288] F(L)=MD[1]×(L-TH1) 3 +MC[1]×(L-TH1) 2 +MB[1]×(L-TH1) 1 +MA[1]
[0289] 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.
[0290] F(L)=MD[2]×(L-TH2) 3 +MC[2]×(L-TH2) 2 +MB[2]×(L-TH2) 1 +MA[2]
[0291] Among them, 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.
[0292] 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 each parameter of the function of the first cubic spline curve.
[0293] Next, the process of determining the fourth to sixth interpolation points associated with the second cubic spline curve will be described.
[0294] The specific process is as follows:
[0295] 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 first coordinate values of the fourth interpolation point, the fifth interpolation point and the sixth interpolation point related to the second cubic spline curve are determined; wherein: 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 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, and the function of the second cubic spline curve is used to map the brightness value of the pixel whose brightness value is in the second brightness interval in the image to be processed to the second target brightness value, so as to correct the dynamic range of the image to be processed, and 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, and there is no overlapping area between the first brightness interval and the second brightness interval. 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.
[0296] 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:
[0297] Method 1: Determine the first coordinate value of the fourth interpolation point according to the first formula, wherein the first formula is:
[0298]
[0299] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:
[0300]
[0301] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;
[0302] 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 component 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, and is not specifically limited here. For example, the value of U is 6.
[0303] Method 2: It includes five steps, including:
[0304] 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.
[0305] The initial value of the first coordinate value of the fourth interpolation point may be determined as follows:
[0306]
[0307] Among them, 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, TH3 is the first coordinate value of the third interpolation point. U has been explained above, so it will not be repeated here.
[0308] Step 2: Set the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel.
[0309] Step three: Determine the first number of pixels and the second number of pixels according to 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 whose brightness values in the image to be processed 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.
[0310] 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.
[0311] Specifically, first, determine the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel;
[0312] Then, the first coordinate value of the fourth interpolation point is determined according to the following formula:
[0313]
[0314] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB component 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 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, POW(x, j) refers to the jth power of x, and the value of j can be 0.5.
[0315] Step 5: Determine 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.
[0316] 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.
[0317] The process of determining the first coordinate value of the fifth interpolation point includes:
[0318] 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 equally spaced parts to obtain N sub-intervals, and 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.
[0319] The value of N can be determined based on experience, and the sequence number of the subintervals in the N subintervals can start from zero or from 1, and there is no special limitation here. For example, if the value of N is 8, and the sequence number of the subintervals in the N subintervals starts from 1, then the sequence numbers of the n subintervals are 2, 3, 4, 5, and 6 respectively.
[0320] 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:
[0321]
[0322] Among them, 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.
[0323] The process of obtaining the function of the second cubic spline curve includes the following four steps, among which:
[0324] 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.
[0325] 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, so as to obtain the second coordinate value of the fourth interpolation point and the second coordinate value of the sixth interpolation point.
[0326] 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:
[0327] The first coordinate value of the fourth interpolation point is substituted as an 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 an 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.
[0328] 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.
[0329] Step three: determine the second coordinate value of the fifth interpolation point according to 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.
[0330] Specifically, the manners for determining the second coordinate value of the fifth interpolation point may include the following two methods:
[0331] The first method is to determine the second coordinate value of the fifth interpolation point according to the following formula:
[0332]
[0333] 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.
[0334] The second method is to determine the second coordinate value of the fifth interpolation point according to the following formula:
[0335]
[0336] 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 deviation 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 itself 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:
[0337] VA2_high1 is the initial value of the second coordinate value of the fifth interpolation point.
[0338] 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 the present application.
[0339] 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.
[0340] The second cubic spline curve includes two partial curves, so the function of the second cubic spline curve also includes two piecewise functions, wherein the two piecewise functions correspond to the two partial curves one by one.
[0341] 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 mentioned above, so it will not be repeated here.
[0342] On this basis, the adjustment strength of the second coordinate value of the fifth interpolation point is determined as follows:
[0343] 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 pixel number and the fourth pixel number are determined, the third pixel number being 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 pixel number being 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.
[0344] Then, the 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, and the adjustment strength is used to indicate the degree of deviation 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 of the second coordinate value of the fifth interpolation point can be determined according to the following formula:
[0345]
[0346] 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, NUM1 is the third number of pixels, and NUM2 is the fourth number of pixels. The value of the adjustment step can be set according to an empirical value, and can be a positive number, a negative number, or zero. This application does not make any special restrictions on this. For example, the adjustment step is 0.2.
[0347] 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 through the 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 digitized representation of the image to be processed.
[0348] The decoding end receives 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 sent by the encoding end, wherein the data information of the image to be processed is used to obtain the image to be processed, the function of the first cubic spline curve is used to map the brightness value of the pixel whose brightness value is in the first brightness interval in the image to be processed to the first target brightness value, and the function of the second cubic spline curve is used to map the brightness value of the pixel whose brightness value is in the second brightness interval in the image to be processed to the second target brightness value. Specifically, the decoding end decodes the code stream sent by the encoding end to obtain 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.
[0349] 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. As 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.
[0350] It should be noted that the parameters of the function of the basic mapping curve can be directly sent to the decoding end after being calculated at the encoding end, so that the decoding end can directly generate the function of the basic mapping curve according to the parameters of the function of the basic mapping curve. The parameters of the function of the basic mapping curve can also be calculated at the decoding end, so that the encoding end does not need to calculate the parameters of the function of the basic mapping curve, but the encoding end needs to send basic dynamic metadata and other information to the decoding end, so that the decoding end calculates the parameters of the function of the basic mapping curve according to the basic dynamic metadata and other information.
[0351] Figure 7 is a schematic diagram of the second cubic spline curve and the basic mapping curve. Figure 7 It can be seen that 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.
[0352] In summary, by acquiring the first coordinate value of the first interpolation point, the first coordinate value of the third interpolation point, 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, 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 function of the cubic spline curve maps the brightness values of pixels in the image to be processed whose brightness values are in the first brightness interval to the first target brightness value, and maps the brightness values of pixels in the image to be processed whose brightness values are in the second brightness interval to the second target brightness value according to the function of the second 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 functions of the first cubic spline curve and the second cubic spline curve, and the brightness values of the remaining pixels are mapped according to the function of 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 interval and the second brightness interval in the basic mapping curve is changed, so as to realize the protection of specific areas, and at the same time increase 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. In addition, since there are two functions of the cubic spline curve, two areas can be protected at the same time, which further improves the display effect of the image after adjusting the dynamic range.
[0353] 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:
[0354] Step 801, obtaining the maximum value of the RGB component 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 component of the pixel 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.
[0355] Step 802, determining a first coordinate value of at least one interpolation point associated with a cubic spline curve according to a maximum value of an RGB component of a first pixel and a brightness histogram of an 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 the function of each cubic spline curve is used to map the brightness value of a pixel whose brightness value in the image to be processed is within a corresponding first brightness interval to a first target brightness value, thereby correcting a 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 function of the cubic spline curve.
[0356] 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.
[0357] In the following, the 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:
[0358] 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 indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among multiple pixels in the image to be processed, the second percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among multiple pixels in the image to be processed, and the third percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among multiple pixels in the image to be processed.
[0359] 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., and the present application does not make any special limitation on this.
[0360] 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.
[0361] There are two ways to implement step 2:
[0362] The first method: First, determine 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. 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 value of the first interpolation point according to the following formula:
[0363]
[0364] Among them, TH1_used1 is the first value, g_maxRGBdistribution90 is the maximum RGB component value of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum RGB component value of the third pixel corresponding to 95%, and THRESOLD is the brightness threshold, where the brightness threshold value can be, for example, 1024, etc., and this application does not make any special limitation on this.
[0365] Then, the first coordinate value of the first interpolation point is determined 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value.
[0366] Specifically, determine the difference between the maximum RGB component value of the third pixel corresponding to twice the second percentage and the maximum RGB component value of the second pixel corresponding to the first percentage; determine whether the maximum RGB component value of the fourth pixel corresponding to the third percentage is greater than the sum of the obtained difference and the first preset value and whether the first value is greater than the first threshold; if so, set the first coordinate value of the first interpolation point to the first value. The first preset value and the first threshold value can be determined based on experience, and this application does not make special restrictions on this. For example, the first preset value is 100 and the first threshold value is 0.4.
[0367] 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.
[0368] 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 whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among the multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among the multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among the multiple pixels in the image to be processed.
[0369] 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.
[0370] Then, a second value of the first coordinate value of the first interpolation point is determined 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;
[0371] Next, a third value of the first coordinate value of the first interpolation point is determined 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;
[0372] Finally, the first coordinate value of the first interpolation point is determined according to 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.
[0373] Below, the process of determining the first coordinate value of the first interpolation point in the second method is explained 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.
[0374] 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:
[0375]
[0376] 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:
[0377]
[0378] 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:
[0379]
[0380] 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 RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to 10%, and THRESOLD is the brightness threshold.
[0381] The initial value of the first coordinate value of the first interpolation point is determined by the fourth formula:
[0382]
[0383] 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:
[0384]
[0385] 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%.
[0386] It should be noted that the process of determining the first coordinate value of the first interpolation point according to the initial value, the second value and the 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 a cubic spline curve function.
[0387] Step three: set the first coordinate value of the third interpolation point to the maximum value of the RGB components of the first pixel.
[0388] 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.
[0389] 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.
[0390] The process of determining the first coordinate value of the second interpolation point includes:
[0391] First, if the first brightness interval includes N sub-intervals, N is a positive integer, then 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 whose brightness values in the image to be processed are located in the i-th sub-interval is the minimum value among the n sub-intervals.
[0392] 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 sub-intervals are 2, 3, 4, 5, and 6 respectively.
[0393] 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:
[0394]
[0395] Among them, 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.
[0396] The process of obtaining the function of the cubic spline curve includes the following four steps:
[0397] Step 1: Obtain a function of a basic mapping curve. Since the basic mapping curve has been described above, it will not be described again.
[0398] Step 2: According to the function of the basic mapping curve, the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are mapped 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.
[0399] Step three: 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.
[0400] For example, the second coordinate value of the second interpolation point is determined according to the following formula;
[0401]
[0402] 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.
[0403] For another example, the second coordinate value of the second interpolation point is determined according to the following formula:
[0404]
[0405] 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, TH_strength is the adjustment strength of the second coordinate value of the second interpolation point, and 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, and is not specifically limited here. For example, TH_strength can be set to 0, and 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.
[0406] 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 the present application.
[0407] Step 4: 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.
[0408] 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 to the two partial curves one by one.
[0409] 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 mentioned above, so it will not be repeated here.
[0410] On this basis, the adjustment strength of the second coordinate value of the second interpolation point is determined as follows:
[0411] 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 pixel number and a second pixel number are determined, wherein the first pixel number 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 pixel number 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;
[0412] Then, according to the first number of pixels and the second number of pixels, the adjustment strength of the second coordinate value of the second interpolation point is determined, and the adjustment 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. Specifically, the adjustment strength of the second coordinate value of the second interpolation point is determined according to the following formula:
[0413]
[0414] Wherein, 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, NUM2 is the second pixel number. The value of the adjustment step can be positive, negative or 0.
[0415] After obtaining the function of the cubic spline curve, the encoder can send the function of the cubic spline curve and the data information of the image to be processed to the decoder. Specifically, the function of the cubic spline curve and the data information of the image to be processed can be encoded and then sent to the decoder through a code stream. It should be noted that the function of the cubic spline curve encoded here is the value of the parameter of the function of the 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.
[0416] The decoding end receives the function of the cubic spline curve and the data information of the image to be processed sent by the 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 value of the pixel whose brightness value is in the first brightness interval in the image to be processed to the first target brightness value. Specifically, the decoding end decodes the code stream sent by the encoding end to obtain the function of the cubic spline curve and the data information of the image to be processed.
[0417] 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. That is, the brightness values of the pixels in the image to be processed whose brightness values are within the first brightness interval 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 the pixels in the image to be processed whose brightness values are outside the first brightness interval are substituted into the function of the basic mapping curve to obtain the second target brightness value of the corresponding pixel, thereby realizing the adjustment of the dynamic range of the image to be processed.
[0418] It should be noted that the parameters of the function of the basic mapping curve can be directly sent to the decoding end after being calculated at the encoding end, so that the decoding end can directly generate the function of the basic mapping curve according to the parameters of the function of the basic mapping curve. The parameters of the function of the basic mapping curve can also be calculated at the decoding end, so that the encoding end does not need to calculate the parameters of the function of the basic mapping curve, but the encoding end needs to send basic dynamic metadata and other information to the decoding end, so that the decoding end calculates the parameters of the function of the basic mapping curve according to the basic dynamic metadata and other information.
[0419] 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, the first coordinate value of the third interpolation point, and the histogram of the first brightness interval 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 values of the pixels of the image to be processed whose brightness values are in the first brightness interval are mapped to the first target brightness 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 function of the cubic spline curve, and the brightness values of the remaining pixels are mapped according to the function of 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 interval in the basic mapping curve is changed, so as to achieve protection of the specific area, and at the same time increase 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.
[0420] It should be noted that the first coordinate value in the above text may be a coordinate value on the X-axis, and the second coordinate value may be a coordinate value on the Y-axis, or the first coordinate value in the above text may be a coordinate value on the Y-axis, and the second coordinate value may 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.
[0421] Fig. 9 A schematic diagram of the structure of the image dynamic range processing device provided in the embodiment of the present application Figure 1 The device 900 comprises:
[0422] An acquisition module 901 is used 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 902 is used to determine a first coordinate value of a second interpolation point associated with the first cubic spline curve according to histogram information of a first brightness interval of an image to be processed, wherein 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, and 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.
[0423] In a possible implementation, the function of the first cubic spline curve is obtained according to the following method:
[0424] 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;
[0425]
[0426] 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.
[0427] In a possible implementation, the device further includes: a second determination 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 according to a first coordinate value of the third interpolation point and a maximum value of an RGB component of a first pixel of the image to be processed; wherein: the first pixel is a pixel having a maximum RGB component value in the image to be processed, and the maximum RGB component value of the pixel is a maximum value among an R component, a G component, and a 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 used to map 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 a dynamic range of the image to be processed, the second brightness interval being 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 brightness interval and the second brightness interval.
[0428] In a possible implementation, the device also includes: a sending module, used 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.
[0429] In a possible implementation manner, 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.
[0430] In a possible implementation manner, the first coordinate value of the second interpolation point is determined according to the following formula:
[0431]
[0432] 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.
[0433] In a possible implementation, the second determination 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:
[0434]
[0435] The first coordinate value of the fifth interpolation point is determined according to a second formula, wherein the second formula is:
[0436]
[0437] Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel;
[0438] 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.
[0439] In a possible implementation, the second determination module is used to determine the first coordinate values of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: determine 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; set the first coordinate value of the sixth interpolation point to the maximum value of the RGB component of the first pixel; determine the first pixel number and the second pixel number according to 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 whose brightness values in the image to be processed are in the third brightness interval, and the The third brightness interval is an interval between an initial value of the first coordinate value of the fourth interpolation point and a 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 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; the first coordinate value of the fifth interpolation point is determined 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.
[0440] In a possible implementation, the second brightness interval includes N sub-intervals, where N is a positive integer, and the second determination module is used to determine the first coordinate value of the fifth interpolation point in the following manner: determining an i-th sub-interval from the N sub-intervals, where the i-th sub-interval is located in n sub-intervals of the N sub-intervals, where the sequence numbers of the n sub-intervals are greater than or equal to N / 4, and where the sequence numbers of the n sub-intervals are less than or equal to 3N / 4, and where the number of pixels whose brightness values in the image to be processed are located in the i-th sub-interval is the minimum value in the n sub-intervals; and 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.
[0441] In a possible implementation, the value of N is 8.
[0442] In a possible implementation manner, the second determining module is used to determine an initial value of the first coordinate value of the fourth interpolation point in the following manner:
[0443]
[0444] Among them, 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.
[0445] In a possible implementation manner, the second determining module is used to determine the first coordinate value of the fourth interpolation point in the following manner:
[0446] Determine the ratio of the length of the third brightness interval to the maximum value of the RGB component of the first pixel; and determine the first coordinate value of the fourth interpolation point according to the following formula:
[0447]
[0448] Wherein, TH1_high is the first coordinate value of the fourth interpolation point, the value of MaxSource is the maximum value of the RGB component 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 to the jth power.
[0449] In a possible implementation manner, the second determining module is used to determine the first coordinate value of the fifth interpolation point in the following manner:
[0450]
[0451] Among them, 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 the i.
[0452] In a possible implementation manner, the device further includes:
[0453] The second determination module is further used to determine a third pixel number and a fourth pixel number 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, wherein the third pixel number 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 pixel number 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; and determine an adjustment strength of the second coordinate value of the fifth interpolation point according to the third pixel number and the fourth pixel number, 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.
[0454] 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:
[0455]
[0456] Among them, 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 pixel number, and NUM2 is the fourth pixel number.
[0457] In a possible implementation manner, the initial value of the second coordinate value of the fifth interpolation point is obtained by the following formula:
[0458]
[0459] 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.
[0460] In a possible implementation, 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, and 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:
[0461]
[0462] 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.
[0463] Since the implementation principle and the effect achieved by the device 900 are the same as the implementation principle and the effect achieved by the corresponding method part in the above text, they will not be repeated here.
[0464] Fig.10 A 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 comprises: an acquisition module 1001, used to acquire the maximum value of the RGB component of the first pixel of the image to be processed, wherein: the first pixel is the pixel with the maximum value of the RGB component of the 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; a first determination module 1002, used to determine the first coordinate value of the 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, 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, 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, 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 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.
[0465] In a possible implementation, the number of the cubic spline curve is one;
[0466] The first determination module is further used to determine, 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 indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among a plurality of pixels in the image to be processed, the second percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among a plurality of pixels in the image to be processed, and the third percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among a plurality of pixels in the image to be processed; determine a 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; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; 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.
[0467] In a possible implementation, the first determination module is used to determine the first coordinate value of the first interpolation point in the following manner: determine a 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 a brightness threshold; determine 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, the maximum value of the RGB component of the fourth pixel corresponding to the third percentage, and the first value.
[0468] In a possible implementation, the first percentage is 90%, the second percentage is 95%, and the third percentage is 99%;
[0469] The determining module is used to determine a first value of the first coordinate value of the first interpolation point according to the following formula:
[0470]
[0471] 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%, and THRESOLD is the brightness threshold.
[0472] In a possible implementation, the first determination module is used to determine the first coordinate value of the first interpolation point in the following manner: determine the difference between the maximum value of the RGB component of the third pixel corresponding to twice the second percentage and the maximum value of the RGB component 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, set the first coordinate value of the first interpolation point to the first value.
[0473] In a possible implementation, the first determination module is used to determine the first coordinate value of the first interpolation point in the following manner: 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 according to the brightness histogram of the image to be processed, wherein the fourth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fifth pixel among the multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the sixth pixel among the multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the seventh pixel among the multiple pixels in the image to be processed; according to the maximum RGB component value of the fifth pixel corresponding to the fourth percentage, the first determination module determines the first coordinate value of the first interpolation point in the following manner: The first value of the first coordinate value of the first interpolation point is determined according to the maximum value of the RGB component 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 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; the third value of the first coordinate value of the first interpolation point is determined 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; the first coordinate value of the first interpolation point is determined 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.
[0474] In a 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 used 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:
[0475]
[0476] 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:
[0477]
[0478] 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:
[0479]
[0480] 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 RGB component of the second pixel corresponding to the 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to the 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to the 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to the 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to the 10%, and THRESOLD is the brightness threshold.
[0481] 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:
[0482]
[0483] 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:
[0484]
[0485] 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%
[0486] In a possible implementation, the first brightness interval includes N sub-intervals, where N is a positive integer; the first determination module is used to determine the first coordinate value of the second interpolation point in the following manner: determine the i-th sub-interval 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 in the n sub-intervals; 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 i.
[0487] In a possible implementation, the value of N is 8.
[0488] 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:
[0489]
[0490] Among them, 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 the i.
[0491] In a possible implementation, the function of the cubic spline curve is obtained according to the following method: the acquisition module 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 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.
[0492] In a possible implementation, the first determining module is used to determine the second coordinate value of the second interpolation point according to the following formula:
[0493]
[0494] 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.
[0495] In a possible implementation, 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, and 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:
[0496]
[0497] 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.
[0498] In a possible implementation, the device further includes: a second determination module, configured to determine a first pixel number and a second pixel number 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 pixel number 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 pixel number 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; and determine an adjustment strength of the second coordinate value of the second interpolation point according to 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.
[0499] 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:
[0500]
[0501] 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.
[0502] In a possible implementation manner, the initial value of the second coordinate value of the second interpolation point is obtained by the following formula:
[0503]
[0504] 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.
[0505] Since the implementation principle and the effect achieved by the device 1000 are the same as the implementation principle and the effect achieved by the corresponding method part in the above text, they will not be repeated here.
[0506] Fig.11 A 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, which is used 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 correcting module 1102, which 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.
[0507] Since the implementation principle and the effect achieved by the device 1100 are the same as the implementation principle and the effect achieved by the corresponding method part in the above text, they will not be repeated here.
[0508] Fig.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.
[0509] The processor 1210 may include one or more processors, for example, one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 1310 is used to execute any of the methods described in the above method embodiments.
[0510] 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, the transmitter is used to send data and / or signals, and the receiver is used to receive data and / or signals.
[0511] 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.
[0512] The memory 1230 is used to store program codes and data of the device, and may be a separate device or integrated in the processor 1310 .
[0513] Understandably, Fig.12 Only a simplified design of the device 1200 is shown. In practical applications, the device 1200 may also include other necessary components, including but not limited to any number of transceivers, processors, controllers, memories, etc., and all devices that can implement the present application are within the protection scope of the present application.
[0514] In a possible design, the device 1200 can be replaced by a chip device, for example, a communication chip that can be used in the device to implement the relevant functions of the processor in the device. The chip device can be a field programmable gate array, a dedicated integrated chip, a system chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, and a programmable controller or other integrated chip that implements the relevant functions. The chip can optionally include one or more memories for storing program codes, and when the code is executed, the processor implements the corresponding function.
[0515] The present application also provides a computer-readable storage medium, comprising a computer program, wherein when the computer program is executed on a computer, the computer executes the technical solution of the above method embodiment.
[0516] The present application also provides a computer program, which, when executed by a computer, is used to execute the technical solution of the above method embodiment.
[0517] 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.
[0518] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0519] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0520] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0521] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0522] 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.
[0523] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0524] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for processing an image dynamic range, characterized in that: include: 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, wherein the first coordinate value of the first interpolation point and the first coordinate value of the third interpolation point are brightness values; According to the histogram information of the first brightness interval of the image to be processed, the first coordinate value of the second interpolation point related to the first cubic spline curve is determined, 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, and 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 curve corresponding to the first brightness interval in the basic mapping curve.
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; A function of the first 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.
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: Determine 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; wherein: 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 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, and 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, and the second brightness 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 brightness interval and the second brightness interval.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The function of the cubic spline curve and the 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 data information of the image to be processed is used to obtain the image to be processed.
6. 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 comprises: 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.
7. 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.
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: 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.
9. 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: 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; Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; Determine a first pixel number and a second pixel number according to an 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 whose brightness values in the image to be processed are in a third brightness interval, the third brightness interval is 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 pixel number 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.
10. The method according to claim 9, characterized in that The second brightness interval includes N sub-intervals, where N is a positive integer, and the 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 includes: Determine an i-th subinterval from the N subintervals, 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 whose brightness values in the image to be processed are located in the i-th subinterval is the minimum value in 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.
11. The method according to claim 10, characterized in that The value of N is 8.
12. The method according to any one of claims 9 to 11, characterized in that: The 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 component of the first pixel comprises: The initial value of the first coordinate value of the fourth interpolation point is determined as follows: Among them, 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.
13. The method according to any one of claims 9 to 11, 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 comprises: Determine a ratio of the length of the third brightness interval to the maximum value of the 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 component 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 to the jth power.
14. The method according to claim 10 or 11, 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 comprises: The first coordinate value of the fifth interpolation point is determined according to the following formula: Among them, 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 the i.
15. The method according to claim 4, characterized in that The method further comprises: Determine a third number of pixels and a fourth number of pixels according to 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 an 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 an 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; An adjustment strength of the second coordinate value of the fifth interpolation point is determined according to the third pixel quantity and the fourth pixel quantity, wherein the adjustment strength is used to indicate a degree of deviation 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.
16. The method according to claim 15, 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: Among them, 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 pixel number, and NUM2 is the fourth pixel number.
17. The method according to claim 15 or 16, 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.
18. 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.
19. A method for processing image dynamic range, characterized in that: include: Obtaining the maximum value of the RGB component of the first pixel of the 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; Determine a first coordinate value of an interpolation point associated with at least one cubic spline curve according to 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. The function of each cubic spline curve is used to map the brightness value of a pixel whose brightness value in the image to be processed is within the corresponding first brightness interval to a first target brightness value, thereby correcting a curve in a basic mapping curve corresponding to the first brightness interval. 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 associated with the cubic spline curve and the first coordinate value of the third interpolation point.
20. The method according to claim 19, characterized in that The number of the cubic spline curve is one; Determining the first coordinate value of the 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: Determine, 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 whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among a plurality of pixels in the image to be processed, the second percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among a plurality of pixels in the image to be processed, and the third percentage represents the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among a plurality of pixels in the image to be processed; Determine a first coordinate value of the first interpolation point according to 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 maximum RGB component value of a 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.
21. The method according to claim 20, characterized in that 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 includes: Determine a 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 a brightness threshold; The first coordinate value of the first interpolation point is determined 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value.
22. The method according to claim 21, characterized in that The first percentage is 90%, the second percentage is 95%, and the third percentage is 99%; The 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 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 comprises: determining 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%, and THRESOLD is the brightness threshold.
23. The method according to claim 21, characterized in that The determining of 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value comprises: Determine a difference between a maximum value of an RGB component of a third pixel corresponding to twice the second percentage and a maximum value of an RGB component of a 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 the 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.
24. The method according to claim 20, characterized in that The 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 comprises: Determine, according to the brightness histogram of the image to be processed, 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, and the maximum value of the RGB component of the seventh pixel corresponding to the sixth percentage, wherein the fourth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the fifth pixel among the multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the sixth pixel among the multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the seventh pixel among the multiple pixels in the image to be processed; Determine 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; Determine 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 a brightness threshold; Determine 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 according to 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.
25. The method according to claim 24, 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 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: The 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: The determining of 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_used 1 is the first value, TH1_used 2 For the second value, TH1_used 3 is the third value, g_maxRGBdistribution90 is the maximum RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to 10%, and THRESOLD is the brightness threshold.
26. The method according to claim 25, 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%.
27. The method according to any one of claims 20 to 26, 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 the histogram information corresponding to the first brightness interval in the brightness histogram includes: Determine an i-th subinterval from the N subintervals, 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 whose brightness values in the image to be processed are located in the i-th subinterval is the minimum value in 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.
28. The method according to claim 27, characterized in that The value of N is 8.
29. The method according to claim 27, 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 comprises: The first coordinate value of the second interpolation point is determined according to the following formula: Among them, 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 the i.
30. The method according to claim 20, characterized in that 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.
31. The method according to claim 30, 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.
32. The method according to claim 30, 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.
33. The method according to claim 20, characterized in that The method further comprises: Determine a first pixel number and a second pixel number 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 pixel number 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 pixel number 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 pixel quantity and the second pixel quantity, wherein the adjustment strength is used to indicate a degree of deviation 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.
34. The method according to claim 33, 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.
35. The method according to claim 33 or 34, 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.
36. A method for processing image dynamic range, characterized in that: include: Receive a function of a cubic spline curve 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, 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 in an interval corresponding to the cubic spline curve to a target brightness value, thereby correcting the dynamic range of the image to be processed, and the cubic spline curve includes a first cubic spline curve, the first cubic spline curve is determined according to 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 first coordinate value is a brightness value, the first coordinate value of the second interpolation point is determined according to histogram information of a first brightness interval of the image to be processed, 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 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 in the 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 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.
37. An image dynamic range processing device, characterized in that: include: 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, 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 is used to determine the first coordinate value of the second interpolation point related to the first cubic spline curve according to the histogram information of the first brightness interval of the image to be processed, 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, and the function of the first cubic spline curve is used to map the brightness value of the pixel whose brightness value in the image to be processed is within the first brightness interval to a first target brightness value, thereby correcting the curve corresponding to the first brightness interval in the basic mapping curve.
38. The device according to claim 37, characterized in that The function of the first cubic spline curve is obtained as follows: The acquisition module is further used 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; 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.
39. The device according to claim 38, characterized in that The first determining module is used to 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.
40. The device according to any one of claims 37 to 39, characterized in that The device also includes: A second determination module is used to determine 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; wherein: 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 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, and 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, and the second brightness 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 brightness interval and the second brightness interval.
41. The device according to any one of claims 37 to 39, characterized in that The device also includes: The sending module is used to send the function of the cubic spline curve and the data information of the image to be processed to the 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.
42. The device according to any one of claims 37 to 39, characterized in that The acquisition module is specifically used 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.
43. The device according to any one of claims 37 to 39, 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.
44. The device according to claim 40, characterized in that The second determination 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.
45. The device according to claim 40, characterized in that The second determining module is used to determine the first coordinate values of the fourth interpolation point, the fifth interpolation point, and the sixth interpolation point in the following manner: 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; Setting the first coordinate value of the sixth interpolation point to the maximum value of the RGB components of the first pixel; Determine a first pixel number and a second pixel number according to an 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 whose brightness values in the image to be processed are in a third brightness interval, the third brightness interval is 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 pixel number 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.
46. The device according to claim 45, characterized in that The second brightness interval includes N sub-intervals, where N is a positive integer, and the second determination module is used to determine the first coordinate value of the fifth interpolation point in the following manner: Determine an i-th subinterval from the N subintervals, 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 whose brightness values in the image to be processed are located in the i-th subinterval is the minimum value in 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.
47. The device according to claim 46, characterized in that The value of N is 8.
48. The device according to any one of claims 45 to 47, characterized in that The second determining module is used to determine the initial value of the first coordinate value of the fourth interpolation point in the following manner: Among them, 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.
49. The device according to any one of claims 45 to 47, characterized in that The second determination module is used 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 component 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 component 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 to the jth power.
50. The device according to claim 46 or 47, characterized in that The second determining module is used to determine the first coordinate value of the fifth interpolation point in the following manner: Among them, 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 the i.
51. The device according to claim 40, characterized in that The device also includes: The second determination module is further used to determine a third pixel number and a fourth pixel number 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, wherein the third pixel number 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 pixel number 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; and determine an adjustment strength of the second coordinate value of the fifth interpolation point according to the third pixel number and the fourth pixel number, 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.
52. The device according to claim 51, characterized in that The second determination module is specifically configured to determine the adjustment strength of the second coordinate value of the fifth interpolation point according to the following formula: Among them, 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 pixel number, and NUM2 is the fourth pixel number.
53. The device according to claim 51 or 52, 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.
54. The device according to claim 38, 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.
55. An image dynamic range processing device, characterized in that: include: An acquisition module, used for acquiring the maximum value of the RGB component of the first pixel of the image to be processed, wherein: the first pixel is a pixel with the largest maximum value of the RGB component of the 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 is used to determine a first coordinate value of an interpolation point associated with at least one cubic spline curve according to 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 value of a pixel whose brightness value in the image to be processed is 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, 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 function of the cubic spline curve.
56. The device according to claim 55, characterized in that The number of the cubic spline curve is one; The first determination module is further used to determine, 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 indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the second pixel among a plurality of pixels in the image to be processed, the second percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the third pixel among a plurality of pixels in the image to be processed, and the third percentage indicates the percentage of pixels whose maximum RGB component value is less than or equal to the maximum RGB component value of the fourth pixel among a plurality of pixels in the image to be processed; determine a 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; set the first coordinate value of the third interpolation point to the maximum RGB component value of the first pixel; 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.
57. The device according to claim 56, characterized in that The first determining module is used to determine the first coordinate value of the first interpolation point in the following manner: Determine a 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 a brightness threshold; The first coordinate value of the first interpolation point is determined 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, the maximum RGB component value of the fourth pixel corresponding to the third percentage, and the first value.
58. The device according to claim 57, characterized in that The first percentage is 90%, the second percentage is 95%, and the third percentage is 99%; The determining module is used 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%, and THRESOLD is the brightness threshold.
59. The device according to claim 57, characterized in that The first determining module is used to determine the first coordinate value of the first interpolation point in the following manner: Determine a difference between a maximum value of an RGB component of a third pixel corresponding to twice the second percentage and a maximum value of an RGB component of a 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 the 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.
60. The device according to claim 56, characterized in that The first determining module is used to determine the first coordinate value of the first interpolation point in the following manner: Determine, according to the brightness histogram of the image to be processed, 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, and the maximum value of the RGB component of the seventh pixel corresponding to the sixth percentage, wherein the fourth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the fifth pixel among the multiple pixels in the image to be processed, the fifth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the sixth pixel among the multiple pixels in the image to be processed, and the sixth percentage represents the percentage of pixels whose maximum value of the RGB component is less than or equal to the maximum value of the RGB component of the seventh pixel among the multiple pixels in the image to be processed; Determine 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; Determine 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 a brightness threshold; Determine 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 a brightness threshold; The first coordinate value of the first interpolation point is determined according to 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.
61. The device according to claim 60, 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 determination module is used to determine a first value of a 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_used 1 is the first value, TH1_used 2 is the second value, TH1_used3 is the third value, g_maxRGBdistribution90 is the maximum RGB component of the second pixel corresponding to 90%, g_maxRGBdistribution95 is the maximum RGB component of the third pixel corresponding to 95%, g_maxRGBdistribution50 is the maximum RGB component of the fifth pixel corresponding to 50%, g_maxRGBdistribution99 is the maximum RGB component of the fourth pixel corresponding to 99%, g_maxRGBdistribution10 is the maximum RGB component of the sixth pixel corresponding to 10%, and THRESOLD is the brightness threshold.
62. The device according to claim 61, characterized in that The first determining module is used 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%.
63. The device according to any one of claims 56 to 62, characterized in that The first brightness interval includes N sub-intervals, where N is a positive integer; The first determining module is used to determine the first coordinate value of the second interpolation point in the following manner: Determine an i-th subinterval from the N subintervals, 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 whose brightness values in the image to be processed are located in the i-th subinterval is the minimum value in 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.
64. The device according to claim 63, characterized in that The value of N is 8.
65. The device according to claim 63, characterized in that The first determination module is used to determine the first coordinate value of the second interpolation point according to the following formula: Among them, 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 the i.
66. The device according to claim 56, characterized in that The function of the cubic spline curve is obtained as follows: The acquisition module is further used 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; 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.
67. The device according to claim 66, characterized in that The first determining module is used to 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.
68. The device according to claim 66, 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.
69. The device according to claim 56, characterized in that The device also includes: The second determination module is used to determine a first pixel number and a second pixel number 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 pixel number is the number of pixels in the 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 pixel number is the number of pixels in the 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; and determine an adjustment strength of the second coordinate value of the second interpolation point according to the first pixel number and the second pixel number, wherein the adjustment strength is used to indicate a degree of deviation 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.
70. The device according to claim 69, characterized in that The second determination module is used to determine 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.
71. The device according to claim 69 or 70, 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.
72. An image dynamic range processing device, characterized in that: include: a receiving module, configured to receive a function of a cubic spline curve 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, 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 the cubic spline curve includes a first cubic spline curve, the first cubic spline curve is determined according to 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 first coordinate value is a brightness value, the first coordinate value of the second interpolation point is determined according to histogram information of a first brightness interval of the image to be processed, 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 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 curve corresponding to the first brightness interval in the basic mapping curve; The 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.
73. An image processing device, characterized in that The device comprises a processor and a memory, wherein the processor and the memory are coupled, and the processor is used to cause the device to execute the method according to any one of claims 1 to 36.
74. A chip device comprising: An input interface, an output interface, at least one processor, and a memory, wherein the input interface, the output interface, the processor, and the memory communicate with each other via an internal connection path, and the processor is used to execute the code in the memory, wherein when the processor executes the code, the chip device implements the method described in any one of claims 1 to 36.
75. A computer-readable storage medium for storing a computer program, characterized in that: The computer program comprises means for implementing the method of any one of claims 1 to 36 above.
76. A computer program product, comprising instructions, characterized in that: When the instructions are executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 36.
Citation Information
Patent Citations
Image processing apparatus, luminance conversion curve correcting method and program
JP2010074222A
Cited By
Image dynamic range processing method and device
CN114467110A
Image dynamic range processing method and device
CN114467110B
Image dynamic range processing method and apparatus
EP4752825A2
Image dynamic range processing method and apparatus
US12518362B2