WO2021218924A1 - 动态范围映射的方法和装置 - Google Patents

动态范围映射的方法和装置 Download PDF

Info

Publication number
WO2021218924A1
WO2021218924A1 PCT/CN2021/089981 CN2021089981W WO2021218924A1 WO 2021218924 A1 WO2021218924 A1 WO 2021218924A1 CN 2021089981 W CN2021089981 W CN 2021089981W WO 2021218924 A1 WO2021218924 A1 WO 2021218924A1
Authority
WO
WIPO (PCT)
Prior art keywords
parameter
curve
value
brightness
tone mapping
Prior art date
Application number
PCT/CN2021/089981
Other languages
English (en)
French (fr)
Inventor
徐巍炜
余全合
陈虎
王弋川
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21796388.3A priority Critical patent/EP4135316A4/en
Priority to KR1020227041352A priority patent/KR20230003066A/ko
Priority to JP2022566031A priority patent/JP7462072B2/ja
Publication of WO2021218924A1 publication Critical patent/WO2021218924A1/zh
Priority to US17/975,893 priority patent/US20230054046A1/en

Links

Images

Classifications

    • G06T5/92
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/68Circuits for processing colour signals for controlling the amplitude of colour signals, e.g. automatic chroma control circuits
    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/60Extraction of image or video features relating to illumination properties, e.g. using a reflectance or lighting model
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/3406Control of illumination source
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/77Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0626Adjustment of display parameters for control of overall brightness

Definitions

  • the present application relates to the field of display technology, and more specifically, to a method and device for dynamic range mapping.
  • Dynamic range is used in many fields to express the ratio of the maximum value and the minimum value of a variable.
  • the dynamic range represents the ratio between the maximum brightness and the minimum brightness within the displayable range of the image, that is, the number of grayscale divisions of the image from "brightest” to “darkest", and its unit Candela per square meter (cd/m2), can also be expressed as nits (nits).
  • the greater the dynamic range of an image the richer the brightness levels it can represent, and the more realistic the visual effect of the image. Because of the dynamic range in the real world of natural scenes between 10-3 to 106, the dynamic range is very large, so called high dynamic range (high dynamic range, HDR).
  • the dynamic range of an ordinary image is a standard dynamic range (standard dynamic range, SDR) or a low dynamic range (low dynamic range, SDR).
  • Display devices at the current stage generally call SDR display devices with a dynamic range of less than 0.1 to 400 nits; and HDR display devices with a dynamic range of more than 0.01 to 540 nits.
  • Different high dynamic range display devices have different display dynamic ranges, such as 0.01 to 540nits HDR display devices, 0.005 to 1000nits HDR display devices, and so on.
  • the dynamic range mapping method is mainly applied in the adaptation process of the front-end HDR signal and the back-end HDR display device, including a high-to-low tone-mapping process and a low-to-high tone mapping process.
  • the front end is the collected 4000nit illumination signal, while the HDR display capability of the back-end display device is only 500nit.
  • mapping the 4000nit illumination signal to the 500nit display device is a high-to-low mapping process.
  • the front end is the 100nit SDR illumination signal collected, and the HDR display capability of the back-end display device is 2000nit. Therefore, mapping the 100nit illumination signal to the 2000nit display device is a mapping process from low to high.
  • a dynamic range mapping algorithm based on the "S" curve can be used to adjust the high dynamic range image to the dynamic range that the display device can display. Display within the range.
  • the maximum brightness of the image is close to the maximum display brightness of the display device, if the above scheme is still used, it will cause the abnormal phenomenon that the brightness of the pixels of the display device after the mapping is brighter than the original image, which affects the user Experience.
  • This application provides a method and device for dynamic range mapping, which helps to prevent the pixel brightness of the terminal device after mapping from being brighter than the original image when the maximum display brightness of the image is close to the maximum display brightness of the display device. The anomaly.
  • a dynamic range mapping method including:
  • the second parameter of the second tone mapping curve is obtained according to the first parameter, the display parameter of the terminal device, and the feature information of the image data, wherein the second tone mapping curve
  • the output brightness at the first point above is not higher than the input brightness at the first point on the second tone mapping curve
  • the parameters of the first tone mapping curve are further adjusted, so that the adjusted curve parameter (ie, the second parameter) corresponds to a certain point on the tone mapping curve (ie, the second tone mapping curve).
  • the output brightness is not higher than the input brightness corresponding to this point, which helps to avoid the pixel brightness of the terminal device after the mapping is brighter than the original image when the maximum display brightness of the image is close to the maximum display brightness of the display device. The anomaly.
  • the embodiments of the present application may be applied to a terminal device, and the terminal device is, for example, a display terminal device.
  • the product form of the display device can be set-top boxes, TV display devices, mobile phone display devices, and electronic devices such as webcasting and video application conversion devices.
  • the solution provided by the embodiment of the application can be implemented in the form of a hardware chip.
  • the solution provided by the embodiment of the application is mainly a software program
  • the form of the code is realized, but the embodiment of the present application is not limited to this.
  • the image data may be an HDR source or an SDR source, for example, such as pixel data in the image, such as brightness and color data of each pixel.
  • the feature information of the image data may be obtained from the metadata M of the image data
  • the metadata M may include the curve parameter M curve corresponding to the image data, the target system display actual peak brightness M TPL (targeted system display actual peak luminance), the maximum value of the brightness of the content of the image data MaxSource (the maximum value of the Y component of all pixels, or the maximum value of the maximum value of the RGB component of all pixels), the minimum value MinSource (the minimum of the Y component of all pixels, or all The minimum value of the maximum value of the pixel RGB component), the average value (the average value of the Y component of all pixels, or the average value of the maximum value of all the pixel RGB components), the variation range of the display content, etc., this embodiment of the application does not make this limited.
  • the feature information of the image data can also be obtained from the pixel information of the image data V; or the feature information value of the image data with a preset value is used, which is not limited in the embodiment of the present application.
  • the display parameter M TPL of the terminal device may include the maximum display brightness MaxDisplay and/or the minimum display brightness MinDisplay of the terminal device, or other parameters, which are not limited in the embodiment of the present application.
  • the preset condition when any one of the following conditions is met, the preset condition is established:
  • the output brightness at the second point on the first tone mapping curve is higher than the input brightness at the second point on the first tone mapping curve
  • the parameter p P1 in the first parameter is greater than a first value Tp, where the first value Tp is obtained according to a P1 in the first parameter and a preset correspondence between a P1 and p P1 , Where Tp represents the threshold of the curve parameter p.
  • Tp represents the threshold of the curve parameter p.
  • the parameter a P1 in the first parameter is greater than the second value Ta, where the second value Ta is obtained according to the p P1 in the first parameter and the preset correspondence between a P1 and p P1 Among them, Ta represents the threshold of the curve parameter a, when the first parameter a P1 exceeds Ta, it is possible that the output brightness at a certain point on the second tone mapping curve is higher than the input brightness; or
  • the product of parameters a P1 parameter p P1 of the first parameter is greater than a third value Tap, wherein the third value is a preset rational number Tap, when the first parameter is a P1 parameter of the parameter p P1 When the product exceeds the Tap, it is possible that the output brightness at a certain point on the second tone mapping curve is higher than the input brightness.
  • the third value Tap may be a rational number between 3 and 4, such as 3.2 or 3.4, which is not limited in the embodiment of the present application.
  • the embodiment of the present application can satisfy the above-mentioned preset condition, that is, performing tone mapping on the image data according to the first tone mapping curve, which will cause the output brightness of a certain point on the first tone mapping curve to be higher than that of the first tone mapping curve.
  • the process of generating the second parameter of the second tone mapping curve described above is performed.
  • the second parameter includes a first-order spline parameter
  • the first-order spline parameter includes the second tone mapping curve.
  • the slope MB[0][0] of the first primary spline and/or the maximum value of the brightness value of the pixel points in the first primary spline TH3[0] and/or the first primary spline The base_offset of the intersection of the spline and the ordinate axis.
  • the straight line portion (that is, the first spline) can be used for tone mapping in the dark area of the image data, so that the brightness gain can be controlled.
  • it is more convenient to control the second parameter to gradually change from a straight line to a straight line with y x.
  • the content is not easy to cause flickering.
  • the first parameter includes a second-order spline curve parameter
  • the second-order spline curve parameter includes the first tone mapping curve.
  • the display parameter includes the terminal
  • the feature information includes the maximum brightness correction value max_lum of the image data
  • the acquiring the second parameter of the second tone mapping curve according to the first parameter, the display parameter, and the characteristic information includes:
  • the curve parameters MB_mid[0][0] and TH3_mid[0] are adjusted to obtain the curve parameters MB[0][0] and TH3 [0].
  • the embodiment of the present application can be based on the slope MB_mid[0][0] of the second primary spline in the first tone mapping curve and the maximum value of the brightness value TH3_mid[ 0], and the maximum display brightness MaxDisplay of the terminal device and the maximum brightness correction value max_lum of the image data to obtain the slope MB[0][0] and the first time of the first spline of the second tone mapping curve The maximum value of the brightness value of the pixel point in the interval of the spline TH3[0].
  • the curve parameters MB_mid[0][0] and TH3_mid[0] Satisfies the following formula:
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the G(L) values N1 and N2 corresponding to the input variable L are rational numbers
  • max(a, b) means to find the larger value of a and b
  • min(a, b) means finding the smaller of a and b
  • H(L) is
  • the first parameter includes a second-order spline curve parameter
  • the second-order spline curve parameter includes the first tone mapping curve.
  • the display parameter includes the maximum display brightness MaxDisplay of the terminal device
  • the characteristic information includes the maximum brightness correction value max_lum of the image data
  • the acquiring the second parameter of the second tone mapping curve according to the first parameter, the display parameter, and the characteristic information includes:
  • the curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid are adjusted to obtain the curve parameters MB[0][ 0], TH3[0] and/or base_offset.
  • the curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid, and the curve parameters MB[0][0], TH3[0] and/or base_offset satisfy the following formula:
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the G(L) values N1, N2, and N3 corresponding to the input variable L are rational numbers
  • max(a,b) means to find the larger value of a and b
  • min( a, b) means finding the smaller of a and b
  • H(L) is
  • the second parameter includes a cubic spline parameter
  • the cubic spline parameter includes an interpolation of a cubic spline on the second tone mapping curve.
  • TH3[1] represents the value of the pixel point in the second interval of the cubic spline
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second one in the first parameter.
  • the sub-spline curve parameter TH3[0] and the cubic spline interpolation value TH1[1], TH2[1], TH3[1] are calculated from the preset offset values of the relevant values, as shown below:
  • TH3[1] TH2[1]+C*TH2[1]-D*TH1[1];
  • B, C, and D are the interpolation points TH1[1], TH2[1], TH3[1] of the cubic spline, and the preset value for calculating the correlation value
  • B is the brightness value of the pixel point in the dark transition area
  • C and D are preset weighting coefficients corresponding to the brightness values of pixels in the bright area.
  • the second degree spline curve parameter and the cubic spline interpolation point value TH1[1], TH2[1], TH3[1] of the first parameter are preset for calculating related values. Offset value, the interpolation point values TH1[1], TH2[1], TH3[1] of the cubic spline in the second parameter can be obtained.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second one in the first parameter.
  • the sub-spline curve parameters TH3[0] and the cubic spline interpolation point values TH1[1], TH2[1], TH3[1] are calculated from the relevant values, as shown below:
  • TH1[1] 3Spline_TH[i][0][w];
  • TH2[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
  • TH3[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
  • 3Spline_TH_Delta1[i][1][w] 3Spline_TH_Delta1[i][2][w] are the interpolation points TH1[ 1], TH2[1], TH3[1] calculate the relevant value.
  • the interpolation point value TH1[1], TH2[1], TH3[1] of the cubic spline extracted from the metadata and the second cubic spline curve parameter in the first parameter is used.
  • the interpolation point values TH1[1], TH2[1], TH3[1] of the cubic spline in the second parameter can be obtained.
  • the Y coordinate of the first spline in the second tone mapping curve at TH3[0] is the same as the cubic spline in the second tone mapping curve
  • the Y coordinate at TH1[1] is the same
  • the first derivative of the first-order spline at TH3[0] is the same as the first-order derivative of the cubic spline at TH1[1].
  • the Y coordinate of the first cubic spline in the second tone mapping curve at TH2[1] is the same as that in the second tone mapping curve.
  • the Y coordinate of the second cubic spline at TH2[1] is the same, and the first derivative of the first cubic spline at TH2[1] is the same as the second cubic spline at TH2[1]
  • the first derivative at is the same.
  • the first cubic spline curve and the second cubic spline curve in the second tone mapping curve can be continuous at TH[2].
  • the Y coordinate of the second cubic spline in the second tone mapping curve at TH3[1] is the same as that of the second cubic spline in the second tone mapping curve.
  • the Y coordinate of the third tone mapping function at TH3[1] is the same, and the first derivative of the second cubic spline at TH3[1] is the same as that of the third tone mapping function at TH3[1] The first derivative is the same.
  • the second cubic spline curve in the second tone mapping curve and the curve of the third tone mapping function can be continuous at TH[3].
  • the acquiring the first parameter of the first tone mapping curve of the image data includes:
  • the display terminal device may use the average value average_maxrgb of the brightness of the content of the image data V in the metadata M, and/or the maximum brightness MaxSource, and/or the minimum brightness MinSource, and/or the maximum brightness of the display device.
  • the display brightness MaxDisplay, and/or the minimum display brightness MinDisplay of the display device, and/or the curve parameter M curve ( p1 ,p2,...), and/or other data, to obtain the first parameter of the first tone mapping curve the The first parameter can be expressed as P1 curve (X, p1, p2,...), for example.
  • X is the input brightness value
  • p1, p2,... are the curve parameter values.
  • the second parameter further includes a first-order spline parameter, and the first-order spline parameter includes the first first order in the second tone mapping curve.
  • the straight line portion (that is, the first spline) can be used for tone mapping in the dark area of the image data, so that the brightness gain can be controlled.
  • it is more convenient to control the second parameter to gradually change from a straight line to a straight line with y x.
  • some implementations of the first aspect further include:
  • the slope Dark is determined.
  • the obtaining the maximum value TH3C0 of the brightness value of the pixel point in the initial interval of the first primary spline includes:
  • the preset value is for example the decomposition of scotopic vision and photopic vision, that is, the brightness of human eye cone cells and rod cells that change in intensity. , Such as 1nit; or
  • the maximum value TH3C0 of the brightness value of the pixels in the initial interval is determined, wherein the metadata includes characteristic data of the number of pixels in the dark area of the histogram.
  • the acquiring the initial slope Dark0 of the first primary spline includes:
  • the initial slope Dark0 is determined according to the slope value of the preset input value of the first tone mapping curve between 0 and the maximum value TH3C of the brightness value of the pixel point in the interval.
  • the maximum value TH3C0 of the brightness value of the pixel point in the initial interval, the maximum value TH3C of the brightness value of the pixel point in the interval, the initial slope Dark0, and the slope Dark satisfies the following formula:
  • TH3C TH3C0+(MaxSource-TH3C0)*(WA) N2 ,
  • TH3C is greater than TH3C0 and less than MaxSource
  • TH3C0 is less than MaxSource
  • N1 and N2 are rational numbers greater than 0
  • H(L) is the tone mapping curve
  • G(L) is the inverse function of H(L).
  • the maximum value TH3C0 of the brightness value of the pixel point in the initial interval, the maximum value TH3C of the brightness value of the pixel point in the interval, the initial slope Dark0, and the slope Dark satisfies the following formula:
  • TH3C TH3C0+(MaxLum-TH3C0)*(WA) N2 ,
  • MaxLum is the adjustment value of the maximum brightness of the image data
  • TH3C is greater than TH3C0 and less than MaxSource
  • TH3C0 is less than MaxSource
  • N1 and N2 are rational numbers greater than 0
  • H(L) is the tone mapping curve function
  • G(L) is said The inverse function of H(L).
  • the second parameter further includes a cubic spline curve parameter, and the cubic spline curve parameter includes the first cubic spline curve of the second tone mapping curve.
  • the method also includes:
  • the second parameter further includes a cubic spline curve parameter, and the cubic spline curve parameter includes the first cubic spline curve of the second tone mapping curve.
  • the method also includes:
  • the maximum value TH2D of the brightness value of the pixel point in the first interval is determined.
  • the maximum value TH2D of the brightness value of the pixel point in the first interval is determined according to the minimum value TH1D of the brightness value of the pixel point in the first interval, include:
  • the maximum value of the brightness value TH2D of the pixel point in the first interval is determined.
  • the minimum value of the brightness value TH1D of the pixel point in the first interval of the first cubic spline of the second tone mapping curve is The maximum value TH3C of the brightness value of the pixel points in the interval of the spline is the same, the output value of the first spline in the second tone mapping curve and the first cubic spline at TH1D are the same, and the second tone The first-order spline in the curve and the first-order derivative of the first cubic spline at TH1D are the same.
  • the cubic spline curve parameter further includes the maximum brightness value of the pixel point in the second interval of the second cubic spline of the second tone mapping curve. Value TH3D;
  • the method also includes:
  • the maximum value TH3D of the brightness value of the pixel point in the second interval is determined according to the minimum value TH1D of the brightness value of the pixel point in the first interval and the maximum value TH2D of the brightness value of the pixel point in the first interval.
  • the determination is made according to the minimum value TH1D of the brightness value of the pixel point in the first interval and the maximum value TH2D of the brightness value of the pixel point in the first interval
  • the maximum value TH3D of the brightness value of the pixel point in the second interval includes:
  • the third maximum input brightness TH3D is determined according to the minimum value TH1D of the brightness value of the pixel point in the first interval, the maximum value TH2D of the brightness value of the pixel point in the first interval, and the metadata of the image data.
  • the minimum value of the brightness value of the pixel point in the second interval of the second cubic spline is the same as the pixel in the first interval of the first cubic spline.
  • the maximum value TH2D of the brightness value of the points is the same, the output value of the first cubic spline and the second cubic spline at the maximum value TH2D of the brightness value of the interval pixel point is the same, and the first cubic spline and the second cubic spline have the same output value at the maximum value TH2D of the brightness value of the pixel
  • the first derivative of the first cubic spline and the second cubic spline at the maximum value TH2D of the brightness value of the pixel point in the interval is the same.
  • the first cubic spline curve and the second cubic spline curve in the second tone mapping curve can be continuous at TH2D.
  • the second parameter further includes a curve parameter of a tone mapping sub-function of the second tone mapping curve, and a third interval pixel of the tone mapping sub-function
  • the minimum value of the brightness value of a point is the same as the maximum value TH3D of the pixel point in the second interval, and the second cubic spline and the tone mapping sub-function have the brightness value of the pixel point in the second interval
  • the output value at the maximum value TH3D of is the same, and the first derivative of the second cubic spline and the tone mapping sub-function at the maximum value of the brightness value TH3D of the pixel point in the second interval is the same.
  • the second cubic spline curve in the second tone mapping curve and the curve of the tone mapping sub-function can be made continuous at TH3D.
  • the first parameter includes a P1 and p P1 , and the first parameter is obtained according to the first parameter, the display parameter, and the characteristic information.
  • the second parameter of the two tone mapping curve includes:
  • the first parameter includes a P1 and p P1 , and the first parameter is obtained according to the first parameter, the display parameter, and the characteristic information.
  • the second parameter of the two tone mapping curve includes:
  • the first parameter includes a P1 and p P1 , and the first parameter is obtained according to the first parameter, the display parameter, and the characteristic information.
  • the second parameter of the two tone mapping curve includes:
  • the first parameter p P1 replace Tap / a P1, or replaced with the Tap / p P1 of the first parameter is a P1;
  • p P1 of the first parameter by replacing a Tap / a P1, or to replace the first parameter is a P1 Tap / p P1
  • the first parameter and the second parameter after the replacement is capable of It helps to make the output brightness at the first point on the second tone mapping curve not higher than the input brightness at the first point on the second tone mapping curve.
  • a device for dynamic range mapping which includes an acquisition unit, a processing unit, and a mapping unit.
  • the acquiring unit is used to acquire the display parameters of the terminal device
  • the acquiring unit is also used to acquire characteristic information of the image data
  • the acquiring unit is further configured to acquire the first parameter of the first tone mapping curve of the image data
  • the processing unit is configured to obtain the second parameter of the second tone mapping curve according to the first parameter, the display parameter of the terminal device, and the characteristic information of the image data when the preset condition is established, wherein the The output brightness at the first point on the second tone mapping curve is not higher than the input brightness at the first point on the second tone mapping curve;
  • the mapping unit is configured to perform dynamic range mapping on the image data according to the second parameter of the second tone mapping curve.
  • the preset condition when any one of the following conditions is met, the preset condition is established:
  • the output brightness at the second point on the first tone mapping curve is higher than the input brightness at the second point on the first tone mapping curve
  • the parameter p P1 in the first parameter is greater than a first value Tp, where the first value Tp is obtained according to a P1 in the first parameter and a preset correspondence between a P1 and p P1 ;or
  • the parameter a P1 in the first parameter is greater than the second value Ta, where the second value Ta is obtained according to the p P1 in the first parameter and the preset correspondence between a P1 and p P1 ;or
  • the product of the parameter a P1 and the parameter p P1 in the first parameter is greater than a third value Tap, where the third value Tap is a preset rational number.
  • the second parameter includes a first-order spline curve parameter
  • the first-order spline curve parameter includes the second tone mapping curve.
  • the slope MB[0][0] of the first primary spline and/or the maximum value of the brightness value of the pixel points in the first primary spline TH3[0] and/or the first primary spline The base_offset of the intersection of the spline and the ordinate axis.
  • the first parameter includes a second-order spline curve parameter
  • the second-order spline curve parameter includes the first tone mapping curve.
  • the display parameter includes the terminal
  • the feature information includes the maximum brightness correction value max_lum of the image data
  • the processing unit is specifically used for:
  • the curve parameters MB_mid[0][0] and TH3_mid[0] are adjusted to obtain the curve parameters MB[0][0] and TH3 [0].
  • the curve parameters MB_mid[0][0] and TH3_mid[0] Satisfies the following formula:
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the G(L) values N1 and N2 corresponding to the input variable L are rational numbers
  • max(a, b) means to find the larger value of a and b
  • min(a, b) means finding the smaller of a and b
  • H(L) is
  • the first parameter includes a second-order spline parameter
  • the second-order spline parameter includes the first tone mapping curve.
  • the display parameter includes the maximum display brightness MaxDisplay of the terminal device
  • the characteristic information includes the maximum brightness correction value max_lum of the image data
  • the processing unit is specifically used for:
  • the curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid are adjusted to obtain the curve parameters MB[0][ 0], TH3[0] and/or base_offset.
  • the curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid, and the curve parameters MB[0][0], TH3[0] and/or base_offset satisfy the following formula:
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the G(L) values N1, N2, and N3 corresponding to the input variable L are rational numbers
  • max(a,b) means to find the larger value of a and b
  • min( a, b) means finding the smaller of a and b
  • H(L) is
  • the second parameter includes a cubic spline parameter
  • the cubic spline parameter includes an interpolation of a cubic spline on the second tone mapping curve.
  • TH3[1] represents the value of the pixel point in the second interval of the cubic spline
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second one in the first parameter.
  • the sub-spline curve parameter TH3[0], the interpolation point values TH1[1], TH2[1], TH3[1] are obtained from the preset offset values, as shown below:
  • TH3[1] TH2[1]+C*TH2[1]-D*TH1[1];
  • B, C, and D are the interpolation points TH1[1], TH2[1], TH3[1] of the cubic spline, and the preset value for calculating the correlation value
  • B is the brightness value of the pixel point in the dark transition area
  • C and D are preset weighting coefficients corresponding to the brightness values of pixels in the bright area.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second one in the first parameter.
  • the sub-spline curve parameter TH3[0], the interpolation point values TH1[1], TH2[1], TH3[1] are calculated by calculating the relevant values, as shown below:
  • TH1[1] 3Spline_TH[i][0][w];
  • TH2[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
  • TH3[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
  • 3Spline_TH_Delta1[i][1][w] are the interpolation point values TH1[1] extracted from the metadata , TH2[1], TH3[1] calculation related values.
  • the Y coordinate of the first spline in the second tone mapping curve at TH3[0] is the same as the cubic spline in the second tone mapping curve
  • the Y coordinate at TH1[1] is the same
  • the first derivative of the first-order spline at TH3[0] is the same as the first-order derivative of the cubic spline at TH1[1].
  • the Y coordinate of the first cubic spline in the second tone mapping curve at TH2[1] is the same as that in the second tone mapping curve.
  • the Y coordinate of the second cubic spline at TH2[1] is the same, and the first derivative of the first cubic spline at TH2[1] is the same as the second cubic spline at TH2[1]
  • the first derivative at is the same.
  • the Y coordinate of the second cubic spline in the second tone mapping curve at TH3[1] is the same as that in the second tone mapping curve.
  • the Y coordinate of the third tone mapping function at TH3[1] is the same, and the first derivative of the second cubic spline at TH3[1] is the same as that of the third tone mapping function at TH3[1]
  • the first derivative is the same.
  • the acquiring unit is specifically configured to:
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the method described in the first aspect.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the method described in the first aspect.
  • an electronic device including the apparatus for processing media data described in the second aspect.
  • beneficial effects achieved by the second to fifth aspects of the application and the corresponding implementation manners can refer to the beneficial effects achieved by the first aspect of the application and the corresponding implementation manners, and will not be repeated here.
  • Figure 1 is an image of the PQ photoelectric transfer function.
  • Figure 2 is an image of the HLG photoelectric transfer function.
  • Figure 3 is an image of the SLF photoelectric transfer function.
  • FIG. 4 is a schematic diagram of a dynamic range adjustment curve of a high dynamic range image provided by an embodiment of the application.
  • Figure 5 shows a schematic diagram of the sigmoid curve.
  • Fig. 6 shows a schematic diagram of a Bezier curve.
  • FIG. 7 is an example of a mapping curve when the maximum brightness of the image is the same as the maximum display brightness of the display device.
  • Fig. 8 shows a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 9 shows a schematic flowchart of a method for dynamic range mapping provided by an embodiment of the present application.
  • FIG. 10 shows a schematic block diagram of a device for dynamic range mapping provided by an embodiment of the present application.
  • FIG. 11 shows a schematic block diagram of another device for dynamic range mapping provided by an embodiment of the present application.
  • Dynamic range is used in many fields to express the ratio of the maximum value to the minimum value of a variable.
  • 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 of nature is very large. For example, the brightness of the night scene under the starry sky is about 0.001 cd/m 2 , and the brightness of the sun itself is as high as 1000,000,000 cd/m 2 .
  • cd/m 2 candela per square meter
  • FIG. 1 shows an example of mapping from the high dynamic range of the real world to the low dynamic range of the display device.
  • optical digital imaging for example, the imaging process of a digital camera
  • the process of optical digital imaging is to convert the light radiation of a real scene into an electrical signal through an image sensor, and save it as a digital image.
  • image display is to reproduce the real scene described by a digital image through the display device. The ultimate goal of both is to enable users to obtain the same visual perception as they directly observe the real scene.
  • the light radiation can display the brightness level in the real scene is almost linear, so the light signal is also called a linear signal.
  • the light signal is also called a linear signal.
  • the electrical signal is also called a non-linear signal.
  • the optical electro transfer function represents the conversion relationship between the linear signal of the image pixel and the nonlinear signal.
  • the image quantized into 8 bits through the above conversion is a traditional SDR image.
  • the SDR image and the transfer function in the above formula (1) perform well on traditional display devices (illuminance is about 100cd/m 2 ).
  • the dynamic range that can be displayed by display devices at this stage is continuously increasing.
  • Existing consumer-grade HDR displays can reach 600cd/m 2
  • high-end HDR displays can reach 2000cd/m 2 , far beyond the display range of traditional SDR display devices. Therefore, in the ITU-R BT.1886 standard protocol, the photoelectric transfer function that is compatible with traditional SDR display devices can no longer well express the display performance of HDR display devices at this stage. Therefore, the photoelectric transfer function needs to be improved to adapt to the upgrade of HDR display devices.
  • HDR photoelectric transfer function OETF mainly has the following three types: perceptual quantizer (PQ) photoelectric transfer function, hybrid log-Gamma (HLG) photoelectric transfer function, and scene luminance fidelity (SLF) ) Photoelectric transfer function. These three types of photoelectric transfer functions are the photoelectric transfer functions specified by the audio video coding standard (AVS) standard.
  • PQ perceptual quantizer
  • HLG hybrid log-Gamma
  • SMF scene luminance fidelity
  • the PQ photoelectric transfer function is a perceptually quantified photoelectric transfer function proposed based on the brightness perception model of the human eye. See Figure 2, which is an image of the PQ photoelectric transfer function.
  • the PQ photoelectric transfer function represents the conversion relationship from the linear signal value of the image pixel to the non-linear signal value of the PQ domain.
  • the PQ photoelectric transfer function can be expressed as formula (2):
  • L represents the linear signal value, and its value is normalized to [0, 1]
  • L' represents the non-linear signal value, and its value range is [0, 1], m 1 , m 2 , c 1 , c 2.
  • c 3 is the PQ photoelectric transfer coefficient
  • the HLG photoelectric transfer function is improved on the basis of the traditional Gamma curve. See Figure 3, which is an image of the HLG photoelectric transfer function.
  • the HLG photoelectric transfer function uses the traditional Gamma curve in the low section and supplements the log curve in the high section.
  • the HLG photoelectric transfer function represents the conversion relationship from the linear signal value of the image pixel to the non-linear signal value of the HLG domain.
  • the HLG photoelectric transfer function can be expressed as formula (3):
  • the SLF photoelectric transfer function is an optimal curve obtained according to the brightness distribution of an HDR scene under the premise of satisfying the optical characteristics of the human eye. See Figure 4, which is an image of the SLF photoelectric transfer function.
  • the SLF photoelectric transfer curve represents the conversion relationship from the linear signal value of the image pixel to the non-linear signal value of the SLF domain.
  • the conversion relationship from the linear signal value of the image pixel to the non-linear signal value of the SLF domain is shown in formula (4):
  • the SLF photoelectric transfer function can be expressed as formula (5):
  • the dynamic range mapping method is mainly used in the adaptation process of front-end HDR signals and back-end HDR display devices, including tone-mapping from high to low, and tone-mapping from low to high process.
  • the front end is the collected 4000nit illumination signal, while the HDR display capability of the back-end display device (such as TV series, tablet computer, etc.) is only 500nit. Therefore, mapping the 4000nit illumination signal to the 500nit display device is a high To the low tone-mapping process.
  • the front end is the collected 100nit SDR illumination signal, and the HDR display capability of the back-end display device is 2000nit. Therefore, mapping the 100nit illumination signal to the 2000nit display device is a kind of tone-mapping from low to high. process.
  • Dynamic range mapping methods can be divided into static dynamic range mapping and dynamic dynamic range mapping.
  • the static dynamic range mapping method is based on the same video content or the same hard disk content, and the overall tone mapping process is performed from a single data, that is, the processing curve of the same video content or hard disk content is usually the same.
  • the advantage of this method is that it carries less information and the processing flow is relatively simple.
  • the disadvantage of this method is that each scene uses the same curve for tone mapping, which may cause loss of information in some scenes. For example, if the curve focuses on protecting the bright area, some details will be lost in some extremely dark scenes, or it will be invisible at all, which will affect the user experience.
  • the dynamic mapping method is dynamically adjusted according to a specific area, each scene or according to the content of each frame.
  • the advantage of this method is that different curve processing can be performed according to a specific area, each scene or each frame, so that the processed image display result will be better.
  • the disadvantage is that each frame or each scene needs to carry relevant scene information, and the amount of information carried is relatively large.
  • the five tone-mapping technologies are described below.
  • the first technique is the tone-mapping process based on the sigmoid curve proposed by Dolby.
  • Figure 5 shows a schematic diagram of the sigmoid curve.
  • the abscissa represents the input brightness, that is, the brightness of the HDR image before the dynamic range adjustment
  • the ordinate represents the output brightness, that is, the brightness of the image after the dynamic range adjustment.
  • the shape of the sigmoid curve is "S", and the slope of the curve first rises and then falls.
  • a source adaptation level with a brightness of about 300 cd/m 2 can be mapped to a target adjustment level with a brightness of about 30 cd/m 2 ( target adaptation level).
  • the second technique is the tone-mapping process based on Bezier curves.
  • Fig. 6 shows a schematic diagram of a Bezier curve.
  • the abscissa in FIG. 6 represents the input brightness, that is, the brightness of the HDR image before the dynamic range adjustment
  • the ordinate represents the output brightness, that is, the brightness of the image after the dynamic range adjustment.
  • the Bezier curve is a linear mapping process in the range of input brightness from 0 to K s
  • the range of input brightness from K s to 1 is an "S" curve, and the slope of the curve first rises and then falls.
  • the third technique is a tone-mapping process based on the S-curve perceived by the human eye.
  • the form of the curve is shown in the following formula (6):
  • L and L′ represent normalized electrical or optical signals, the value of a ranges from 0.0 to 1.0, the value of b ranges from 0.0 to 1.0, and the values of p, n, and m
  • the range is between 0.1 and N, N is a rational number greater than 0.1, L'is a rational number in the range of 0.0 to 1.0, L is a rational number in the range of 0.0 to 1.0, and k1, k2, and k3 are rational numbers. .
  • the fourth technique is a tone-mapping process that combines cubic splines and straight S-shaped curves. Among them, the form of part of the curve is shown in the following formula (7):
  • L and L' are normalized electrical or optical signals.
  • the value of a ranges from 0.0 to 1.0
  • the value of b ranges from 0.0 to 1.0
  • the value of p, n, and m ranges from 0.1 to N
  • N is a rational number greater than 0.1.
  • L' is a rational number in the range of 0.0 to 1.0
  • L is a rational number in the range of 0.0 to 1.0
  • k1, k2, and k3 are rational numbers
  • k1 and k2 are not 0 at the same time
  • K3 is not 0.
  • TH1[i], TH2[i], and TH3[i] are rational numbers ranging from 0.0 to 1.0.
  • Technique 5 is another tone-mapping process that combines cubic splines and straight S-shaped curves. Among them, the form of part of the curve is shown in the following formula (8):
  • L and L' are normalized electrical or optical signals.
  • the value of a ranges from 0.0 to 1.0
  • the value of b ranges from 0.0 to 1.0
  • the value of p, n, and m ranges from 0.1 to N
  • N is a rational number greater than 0.1.
  • L' is a rational number in the range of 0.0 to 1.0
  • L is a rational number in the range of 0.0 to 1.0
  • k1, k2, and k3 are rational numbers.
  • LT is the default rational number, and the range is 0.0 ⁇ 1.0.
  • TH1[i], TH2[i], and TH3[i] are rational numbers ranging from 0.0 to 1.0.
  • Metadata related to curve parameters will be sent in the dynamic metadata.
  • the dynamic metadata definition related to St2094-40 includes histogram information (distribution MaxRGB), and also includes Bezier curve parameters (Bezier curve anchors) for direct curve generation.
  • the metadata includes the target system display actual peak luminance.
  • Metadata can transmit information such as maximum, minimum, and average values, as well as curve parameters such as p, m, a, b, n, K1, K2, and K3.
  • the dynamic range mapping algorithm of the above technique 1 to technique 5 can be used to adjust the high dynamic range image to be displayed within the dynamic range that the display device can display.
  • the maximum brightness of the image is close to the maximum display brightness of the display device, if the dynamic range mapping algorithm of the above techniques 1 to 5 is still used, the brightness of the pixels of the display device after the mapping will be higher than that of the original image. An abnormal phenomenon that is still bright.
  • FIG. 7 shows an example of a tone-mapping curve when the maximum brightness of the image is the same as the maximum display brightness of the display device (for example, both are 500 cd/m 2 ).
  • this application provides a dynamic range mapping method.
  • the parameters of the original tone mapping curve are adjusted so that the adjusted parameters correspond to
  • the output brightness of the tone mapping curve is not higher than its input brightness, which helps to avoid the abnormal phenomenon that the brightness of the pixels of the display device after the mapping is brighter than the original image.
  • the original tone mapping curve may be a fixed curve that is adjusted to display the actual peak brightness according to the target system in the metadata of the image data, for example, the tone mapping curve of the above-mentioned technique one to the five techniques.
  • FIG. 8 shows a schematic diagram of a system architecture of a method for dynamic range mapping provided by an embodiment of the present application.
  • the front end can obtain HDR content through collection and production, and send the HDR content and the metadata of the HDR content to the display end via the transport layer.
  • the display end may include an HDR display device and then an SDR display device.
  • the display terminal includes an HDR display device
  • the HDR content can be mapped to the HDR display device
  • the display terminal includes an SDR display device
  • the HDR content can be mapped to the SDR display device.
  • the product form of the display terminal may be a set-top box, a TV display device, a mobile phone display device, and electronic devices such as webcasting and video application conversion devices.
  • the solution provided by the embodiment of the application can be implemented in the form of a hardware chip.
  • the solution provided by the embodiment of the application is mainly a software program The form of the code is realized, but the embodiment of the present application is not limited to this.
  • the embodiment of the present application only uses the application scenario in FIG. 7 as an example for description, but the system architecture applied to the embodiment of the present application is not limited to this.
  • the front end can also obtain SDR content.
  • the display end includes an HDR display device
  • the SDR content can be mapped to the HDR display device.
  • FIG. 9 is a schematic flowchart of a method 900 for dynamic range mapping provided by an embodiment of the application.
  • the method 900 is suitable for the application scenario provided in FIG. 8, for example, executed by the display terminal shown in FIG. 8.
  • the method 900 includes the following steps 910 to 940.
  • the image data (which can be expressed as V) may be HDR image data or SDR image data, which is not limited in the embodiment of the present application.
  • the display terminal device may receive a video source from the front end, which mainly contains image data V, such as pixel data.
  • image data V such as pixel data.
  • a 4K video source it may include the brightness and color data of 3840*2160 pixels.
  • the embodiment of the present application does not limit the format of the image data V.
  • the image data V may be image data in Y (luminance) UV (chrominance) space, or image data in RGB pixel space.
  • the image data V may have a bit width of 8 bits, or 10 bits, or 12 bits.
  • the characteristic information of the image data can also be acquired, for example, from metadata M.
  • the metadata M of the image data V is used to represent the data characteristics of the image data, for example, it may include the format of the image data, or the curve parameter M curve corresponding to the image data V, and the target system display actual peak brightness M TPL (targeted system display actual peak luminance), the maximum value of the brightness of the content of the image data MaxSource (the maximum value of the Y component of all pixels, or the maximum value of the maximum value of the RGB component of all pixels), the minimum value MinSource (the minimum value of the Y component of all pixels, Or the minimum value of the maximum value of the RGB components of all pixels), the average value (the average value of the Y components of all pixels, or the average value of the maximum value of all pixels RGB components), the variation range of the display content, etc., the embodiments of the present application There is no restriction on this.
  • the feature information of the image data can also be obtained from the pixel information of the image data V; or the feature information value of the image data with a preset value is used, which is not limited in the embodiment of the present application.
  • the embodiment of the present application does not limit the format of the curve parameter M curve.
  • the curve parameter M curve included in the metadata may be p, m, a, b, n, K1, K2, K3, and so on.
  • the metadata includes dynamic metadata and static metadata.
  • dynamic metadata for color volume transform or related standards for static metadata (static metadata).
  • static metadata static metadata
  • the metadata can be packaged together with the image, for example, it contains SEI packages of different file formats and different encoding standards, including some package structures related to the HDMI of the hardware.
  • the display terminal device may also obtain the display parameter M TPL (also referred to as the display brightness parameter) of the display terminal device (that is, the actual terminal device P, or the local display device).
  • the display parameter M TPL may include the maximum display brightness MaxDisplay of the display terminal device and the minimum display brightness MinDisplay of the display terminal device, or other parameters, which are not limited in the embodiment of the present application.
  • the display terminal device may obtain the first parameter of the first tone mapping curve of the image data V according to the metadata M of the image data V and the display parameter M TPL of the display terminal device.
  • the display parameter M TPL the display terminal device may obtain the first parameter of the first tone mapping curve of the image data V according to the metadata M of the image data V and the display parameter M TPL of the display terminal device.
  • the average brightness average_maxrgb of the content of the image data V in the metadata M and/or the maximum brightness MaxSource, and/or the minimum brightness MinSource, and/or the maximum display brightness MaxDisplay of the display terminal device
  • And/or the minimum display brightness MinDisplay of the display device, and/or the curve parameter M curve (p1,p2,...) and/or other data to obtain the first parameter of the first tone mapping curve, which can be expressed as P1 curve ( X, p1, p2,).
  • X is the input brightness value
  • p1, p2,... are the curve parameter values.
  • the form of the first parameter P1 curve of the first tone mapping curve is not limited in the embodiment of the present application.
  • examples of the data used in generating the first parameter P1 curve embodiment of the present application, or to generate the first algorithm is not limited in parameter P1 curve.
  • the data for generating the first parameter P1 curve may be metadata, and/or display parameters of the display terminal device, or other preset data.
  • the curve parameter M curve includes parameter values (p, m, a, b, n, K1, K2, K3) and (TH1[i], TH2[i ], TH3[i], MB0),
  • the first parameter P1 curve of the first tone mapping curve can be obtained according to the curve parameter M curve , for example (p P1 , m P1 , a P1 , b P1 , n P1 , K1 P1 , K2 P1 , K3 P1 , TH1[i], TH2[i], TH3[i], MD1[i], MC1[i], MB1[i], MA1[i], MD2[i], MC2[i ], MB2[i], MA2[i], MB3).
  • the curve parameter M curve includes parameter values (p, m, a, b, n, K1, K2, K3) and (TH1[i], TH2[ i], TH3 [i], MB0), a first tone mapping curve may be obtained based on the first parameter m curve curve parameters P1 curve, for example, (p P1, m P1, a P1, b P1, n P1, K1 P1 , K2 P1 , K3 P1 , TH1[i], TH2[i], TH3[i], MD1[i], MC1[i], MB1[i], MA1[i], MD2[i], MC2[ i], MB2[i], MA2[i]).
  • the first tone mapping curve in the embodiment of the present application is an example of the above-mentioned original tone mapping curve, including but not limited to the tone mapping curve used in technique 1, technique 2, technique 3, technique 4, and technique 5.
  • the first parameter of the first mapping curve in this application includes but is not limited to the parameters related to the tone mapping curve used in technique one, technique two, technique three, technique four, and technique five.
  • the output brightness at the first point on the second tone mapping curve is not higher than the input brightness at the first point on the second tone mapping curve. That is, within the input brightness range of the second tone mapping curve, the output brightness obtained by mapping any input brightness according to the second tone mapping curve is not higher than the input brightness.
  • the second parameter is used to perform dynamic range mapping on the image data, and can be expressed as R curve .
  • the input brightness of the tone mapping curve can be linear light, it can also be a non-linear value, and it may also be a value after the linear relationship is normalized (for example, 10000 is regarded as 1, or the maximum luminance of the content is regarded as 1).
  • This application The embodiment does not limit this.
  • the second parameter R curve of the second tone mapping curve can be based on the first parameter P1 curve , and the average value average_maxrgb of the brightness of the content of the image data V, and/or the maximum value of the brightness MaxSource, and/or the minimum value of the brightness MinSource, and/or the value of the display device.
  • the maximum display brightness MaxDisplay, and/or the minimum display brightness MinDisplay of the display terminal device, and/or other data are used to obtain the second parameter R curve of the second tone mapping curve.
  • the second parameter R curve may have the form shown in the following formula (9):
  • L and L' are normalized electrical or optical signals, and Dark, TH3C, TH2D, TH3D, MD1D, MC1D, MB1D, MA1D, MD2D, MC2D, MB2D, and MA2D are rational numbers.
  • the preset condition such as performing tone mapping on the image data according to the first tone mapping curve, will cause the output brightness of a certain point on the first tone mapping curve to be higher than that on the first tone mapping curve. The input brightness at this point.
  • the output brightness of the tone mapping curve differs from the input brightness within the first range, it can be considered that the output brightness and the input brightness are basically the same.
  • the part of the tone mapping curve where the output brightness is higher than the input brightness is within the first range, it can be considered that the two are basically the same.
  • the part of the tone mapping curve where the output brightness is higher than the input brightness exceeds the first range, it can be considered that the output brightness is higher than the input brightness.
  • the tone mapping of the image data according to the first parameter will cause the output brightness of the first tone mapping curve to be higher than the input brightness of the first tone mapping curve
  • the first step of generating the second tone mapping curve is executed. The process of two-parameter R curve.
  • the foregoing preset condition may be that the parameter p P1 in the first parameter is greater than the first value Tp, where the first value Tp is based on a P1 in the first parameter and the preset condition Suppose the corresponding relationship between a P1 and p P1 is obtained.
  • Tp represents the threshold value of the curve parameter p in technology three or technology four or technology five.
  • the first parameter P1 curve includes parameters such as a P1 and p P1 .
  • a P1 can be taken as Ta, and the corresponding first value Tp can be obtained by looking up the table Tpa(Tp, Ta).
  • the table Tpa(Tp, Ta) is an example of the preset correspondence between a P1 and p P1.
  • Ta represents the threshold value of the curve parameter a in technology three or technology four or technology five.
  • p P1 in the first parameter P1 curve can be replaced with the first value Tp obtained by looking up the table.
  • the replaced first parameter P1 curve can be the aforementioned second parameter R curve .
  • the foregoing preset condition may be that the parameter a P1 in the first parameter is greater than the second value Ta, where the second value Ta is based on the p P1 in the first parameter, and The preset correspondence between a P1 and p P1 is obtained.
  • the first parameter a P1 exceeds Ta, it is possible that the output brightness at a certain point on the second tone mapping curve is higher than the input brightness.
  • the first parameter P1 curve includes parameters such as a P1 and p P1 .
  • p P1 can be used as Tp
  • the corresponding second value Ta can be obtained by looking up the table Tpa(Tp, Ta).
  • the table Tpa(Tp, Ta) is an example of the preset correspondence between a P1 and p P1.
  • a P1 in the first parameter P1 curve can be replaced with the second value Ta obtained by looking up the table.
  • the above-mentioned second parameter R curve can be regarded as the first parameter after replacement.
  • the table Tpa(Tp, Ta) is a preset combination of rational numbers, such as (3.5, 0.879), (4.5, 0.777), etc. It should be noted that for values that do not appear in the table, the value can be generated using linear difference, adjacent values, or weighted average values of adjacent values.
  • the embodiment of the present application does not limit the specific form of the table Tpa(Tp, Ta).
  • the table Tpa(Tp, Ta) can also be expressed as a functional relationship between Tp and Ta.
  • the foregoing preset condition is that the product of the parameter a P1 and the parameter p P1 in the first parameter is greater than the third value Tap, where the third value Tap is a preset rational number.
  • the third value Tap may be a rational number between 3 and 4, such as 3.2 or 3.4, which is not limited in the embodiment of the present application.
  • the first parameter P1 curve includes parameters such as a P1 and p P1 .
  • the parameter may determine whether the product of a P1 parameter p P1 of a P1 * p P1 greater than a predetermined value Tap.
  • a P1 *p P1 is greater than Tap
  • the preset condition is satisfied.
  • it may be a first parameter p P1 P1 curve is replaced Tap / a P1, or replacing the first parameter is a P1 Tap / p P1.
  • the above-mentioned second parameter R curve can be regarded as the first parameter after replacement.
  • the first parameter P1 curve corresponding to the first tone mapping curve can also be converted to absolute brightness space, such as linear space, or non-linear space such as PQ and HLG.
  • absolute brightness space such as linear space, or non-linear space such as PQ and HLG.
  • the parameters of the first tone mapping curve are further adjusted, so that the adjusted curve parameter (ie, the second parameter) corresponds to a certain point on the tone mapping curve (ie, the second tone mapping curve).
  • the output brightness is not higher than the input brightness corresponding to this point, which helps to avoid the pixel brightness of the terminal device after the mapping is brighter than the original image when the maximum display brightness of the image is close to the maximum display brightness of the display device. The anomaly.
  • the above-mentioned second parameter further includes a first-order spline parameter
  • the first-order spline parameter includes a first-order spline in the second tone mapping curve (may be recorded as a first-order spline)
  • the maximum value TH3C of the brightness value of the pixel point in the interval also referred to as the first maximum input brightness TH3C
  • the slope of the first primary spline Dark is, for example, a tone mapping curve in which the input brightness in the above formula (9) is less than TH3C, that is, Dark ⁇ L, L ⁇ TH3C.
  • L ⁇ TH3C is the interval pixel point of the first spline.
  • the display terminal device may obtain the maximum value TH3C0 (also referred to as the initial first maximum input brightness TH3C0) of the brightness value of the pixel point in the initial interval of the first spline, and the initial slope Dark0, and then according to this
  • the initial first maximum input brightness TH3C0, the above-mentioned first maximum input brightness TH3C is determined, and the slope Dark is determined according to the initial slope Dark0.
  • the display terminal device may determine the aforementioned initial first maximum input brightness TH3C0 according to the first parameter P1 curve.
  • a first-order spline in the first tone mapping curve which can be recorded as a second-order spline, such as the above technique two, technique four or technique five
  • it can be determined that the initial first maximum input brightness TH3C0 is The maximum value of the brightness value of the pixel point in the interval of the second spline.
  • the display terminal device determines the initial first maximum input brightness TH3C0 according to the preset value.
  • the preset value may be the decomposition of scotopic vision and photopic vision, that is, the brightness of the human eye cone cells and rod cells corresponding to the corresponding strength, such as 1 nit.
  • the display terminal device determines the initial first maximum input brightness TH3C0 according to the metadata M of the image data V.
  • the metadata M includes characteristic data of the number of pixels in the dark area of the histogram, such as the characteristic brightness position of the number of pixels in the dark area of the histogram, or the brightness of the dark area pixels from dark to bright pixels/accumulated pixels, or from The cumulative number of pixels from 0 to characteristic brightness accounts for more than a preset ratio of total pixels.
  • the display terminal device may determine the initial slope Dark0 according to the first parameter P1 curve.
  • the initial slope Dark0 can be determined to be the slope of the second-order spline, such as MB0 in technique four or technique five. .
  • the display terminal device may determine the initial slope Dark0 according to the ratio of the fourth value to the first maximum input brightness TH3C, where the fourth value is the value of the first tone mapping curve at the first maximum input brightness TH3C.
  • the display terminal device may determine the initial slope Dark0 according to the slope value of the preset input value of the first tone mapping curve between 0 and the first maximum input brightness TH3C. For example, it may be the average value, the maximum value, or the intermediate value of the slope values between 0 and the first maximum input brightness TH3C, which is not limited in this application.
  • the above method of obtaining the initial maximum input brightness TH3C0, or the initial slope Dark0 is only an example, and does not limit the embodiment of the present application, for example, in a manner similar to the above method, or through conventional means of the above method.
  • the method of replacing the obtained initial maximum input brightness TH3C0 or the initial slope Dark0 is also within the protection scope of the embodiments of the present application.
  • the above-mentioned first maximum input brightness TH3C and slope Dark can be determined according to the following formulas (10) and (11), that is, the first initial maximum input brightness TH3C0, the first maximum input brightness TH3C, the initial slope Dark0 and the slope Dark satisfy the following formula ( 10) and (11).
  • TH3C TH3C0+(MaxSource-TH3C0)*(WA) N2 (10)
  • N1 and N2 are rational numbers greater than 0
  • H(L) is the tone mapping curve
  • G(L) is the inverse function of H(L).
  • the first maximum input brightness TH3C and the slope Dark can be determined according to the following formulas (12) and (13), that is, the first initial maximum input brightness TH3C0, the first maximum input brightness TH3C, the initial slope Dark0 and the slope Dark satisfy the following formula (12 ) And (13).
  • TH3C TH3C0+(MaxLum-TH3C0)*(WA) N2 (12)
  • MaxLum is the adjustment value of the maximum brightness MaxSource of the image data
  • H(L) is the tone mapping curve function
  • G(L) is the inverse function of the H(L). It should be noted that the embodiment of the application does not limit the adjustment method from MaxSource to MaxLum.
  • the straight line portion when the image data is subjected to dynamic range mapping according to the second parameter, the straight line portion can be used for tone mapping in the dark area of the image data, so that the brightness gain can be controlled, and it is more convenient to control the second parameter from
  • the above-mentioned second tone mapping curve further includes a cubic spline curve
  • the second parameter R curve further includes the first interval of pixel points of the first cubic spline of the second tone mapping curve.
  • the display terminal device can determine the first cubic spline of the first cubic spline according to the maximum value TH3C of the brightness value of the pixel point in the first spline interval in the second tone mapping curve, that is, the first maximum input brightness TH3C.
  • the tone mapping curve corresponding to the first cubic spline may be the tone mapping curve whose input brightness range is greater than or equal to TH3C and less than TH2D in the above formula (9), that is, MD1D ⁇ (L-TH1D) 3 +MC1D ⁇ (L-TH1D) 2 +MB1D ⁇ (L-TH1D)+MA1D, TH1D ⁇ L ⁇ TH2D, where TH1D ⁇ L ⁇ TH2D are the pixels in the first interval.
  • the second parameter R curve also includes the maximum value TH2D of the brightness value of the pixel point in the first interval of the first cubic spline, which may also be referred to as the second maximum input brightness TH2D.
  • the second maximum input brightness TH2D may be determined according to the maximum value TH1D of the brightness value of the pixel point in the first interval above.
  • the second parameter R curve further includes the maximum value TH3D of the brightness value of the pixel point in the second interval of the second cubic spline of the second tone mapping curve, which may also be referred to as the third maximum value.
  • Input brightness TH3D the minimum value of the brightness value of the pixel point in the second interval may be the foregoing TH2D.
  • the tone mapping curve corresponding to the second cubic spline can be a tone mapping curve whose brightness range is greater than or equal to TH2D and less than TH3D in the above formula (9), that is, MD2D ⁇ (L-TH2D) 3 +MC2D ⁇ (L-TH2D) 2 +MB2D ⁇ (L-TH2D)+MA2D, TH2D ⁇ L ⁇ TH3D, where TH2D ⁇ L ⁇ TH3D are pixels in the second interval.
  • the display terminal device may determine the third maximum input brightness TH3D according to the maximum value TH1D of the brightness values of the pixel points in the first interval and the second maximum input brightness TH2D.
  • the display device may use the maximum value TH1D of the brightness value of the pixel in the first interval and the TH1[0], TH2[0], and TH3[0] in the first parameter (or the parameter contained in the metadata M).
  • TH1[0], TH2[0], TH3[0]) determine the second maximum input brightness TH2D.
  • TH2D and TH3D may satisfy the following formula (16-1) and formula (17-1), respectively:
  • TH2D TH1D+TH2[0]-TH1[0] (16-1)
  • TH3D TH2D+TH3[0]-TH2[0] (17-1)
  • the display-end device may use the maximum value TH1D of the brightness value of the pixel point in the first interval and the deltaTH2[0], deltaTH3[0] in the first parameter (or the parameter deltaTH2[0], deltaTH3[0]) to determine the second maximum input brightness TH2D.
  • TH2D and TH3D may satisfy the following formula (16-2) and formula (17-2), respectively:
  • TH2D TH1D+deltaTH2[0] (16-2)
  • TH3D TH2D+deltaTH3[0] (17-2)
  • the display device can determine TH2D and TH3D according to TH1D and preset values.
  • TH2D and TH3D may satisfy the following formula (18) and formula (19), respectively:
  • TH3D TH2D+C*TH2D-D*TH1D (19)
  • B is a rational number greater than 0, for example, it can be the offset value corresponding to the brightness value of the pixel in the dark transition zone, the default value can be 0.15; C and D are rational numbers greater than 0, for example, the brightness of the pixel in the bright zone The weighting coefficient corresponding to the value, the default value can be 0.5.
  • MD1D, MC1D, MB1D, MA1D, MD2D, MC2D, MB2D, MA2D and other parameters in the second parameter R curve can be determined.
  • these parameters can be determined according to the following formulas (14) to (19).
  • the minimum value TH1D of the brightness of the pixel points in the first interval of the first cubic spline of the second tone mapping curve and the first maximum input brightness TH3C (that is, the interval pixel of the first order spline)
  • the maximum value of the brightness value of the dots (TH3C) is the same.
  • the pixel points in the first interval of the first cubic spline of the second tone mapping curve can be made continuous.
  • the output values of the first degree spline and the first cubic spline in the second tone mapping curve are the same at TH1D, and the first degree spline and the first cubic spline in the second tone curve have the same output value at TH1D.
  • the first derivative of the bars at TH1D is the same, that is, the second tone mapping curve is continuous at TH1D.
  • the maximum value of the brightness value of the pixel point in the second interval of the second cubic spline and the maximum value TH2D of the brightness value of the pixel point in the first interval of the first cubic spline that is, the second maximum
  • the input brightness TH2D is the same, and the output values of the second cubic spline and the first cubic spline at TH2D are the same.
  • the pixel points of the first interval of the first cubic spline of the second tone mapping curve can be made continuous with the pixel points of the second interval of the second cubic spline.
  • the first derivative of the second cubic spline and the first cubic spline at TH2D is the same, that is, the second tone mapping curve is continuous at TH2D.
  • the second parameter further includes a curve parameter of a tone mapping sub-function of the second tone mapping curve.
  • the maximum value TH3D of the brightness value of the pixel points in the second interval that is, the third maximum input brightness TH3D is the same.
  • the second interval pixel points of the second cubic spline of the second tone mapping curve can be made continuous with the second interval pixel points corresponding to the tone mapping sub-function.
  • the second cubic spline and the tone mapping sub-function have the same output value at TH3D
  • the second cubic spline and the tone mapping sub-function have the same first derivative at TH3D, that is, the second hue The mapping curve is continuous at TH3D.
  • the values at TH2D of the above two segments of cubic splines can be obtained according to a preset strategy.
  • the value of the two cubic splines at TH2D may be the value of the middle point of the line connecting the two points of TH1D and TH3D on the second tone mapping curve with the input brightness.
  • the cubic spline curve in the second tone mapping curve can smoothly connect the primary spline curve and the base curve on the one hand, and on the other hand can help to facilitate the control of the gain of the portion adjacent to the straight portion.
  • the second tone mapping curve may be acquired, which is used to perform dynamic range mapping on the image data.
  • the mapping relationship from the normalized HDR/SDR source data to the normalized HDR/SDR display data can be obtained.
  • the mapping value L' can be reversely normalized to between the maximum display capacity and the minimum display capacity of the display terminal device.
  • the above reverse normalization calculation can be a non-linear space of PQ, or a linear space of normalization 0 to 1.
  • the reverse normalization can be 0-10000nit, or 0.0001-10000nit, and so on.
  • the embodiment of the present application does not limit the scope and process of the reverse normalization of the HDR/SDR mapping data L′.
  • the subsequent display adaptation process not only includes tone-mapping, but it can also be further adjusted to adjust its saturation and/or color before display. Domain transformation processing, and/or denoising processing, and/or sharpening processing, etc., are not limited in the embodiment of the present application.
  • the maximum display capability of the display device can be obtained according to the parameters of the device or the information of the manufacturer.
  • the minimum display capability of the display device is usually 0nit, or 1nit, which is not limited in the embodiment of the present application.
  • the embodiment of the present application further adjusts the parameters of the tone mapping curve, so that the output brightness of the tone mapping curve corresponding to the adjusted curve parameter is not higher than the input brightness of the tone mapping curve, thereby helping to improve the image quality.
  • the maximum display brightness is close to the maximum display brightness of the display device, the abnormal phenomenon that the brightness of the pixels of the display device after the mapping is brighter than the original image is avoided. Therefore, the embodiments of the present application can provide greater flexibility for terminal display devices of different brightness, so as to achieve a better presentation effect under the condition of reasonably adjusting the parameters.
  • the first-order spline parameter in the second parameter may include the first-order spline parameter in the second tone mapping curve.
  • the slope of the spline for example, it can be expressed as MB[0][0]
  • the maximum value of the brightness value of the pixel point in the interval of the first spline for example, it can be expressed as TH3[0]).
  • the first-order spline parameter in the second parameter may include the first-order spline parameter in the second tone mapping curve.
  • the slope of the spline for example, it can be expressed as MB[0][0]
  • the maximum value of the brightness value of the pixel point in the interval of the first spline for example, it can be expressed as TH3[0]
  • the first one The base_offset of the intersection of the secondary spline and the ordinate axis.
  • the first-order spline parameter (which can be recorded as the second-order spline parameter) included in the above-mentioned first parameter may include the second-order spline parameter in the first tone mapping curve.
  • the slope for example, it can be expressed as MB_mid[0][0]
  • the maximum value of the brightness value of the pixel points in the interval of the second primary spline for example, it can be expressed as TH3_mid[0]).
  • an implementation manner of obtaining the second parameter of the second tone mapping curve may be: according to the maximum display brightness MaxDisplay , The maximum brightness correction value max_lum, adjust the curve parameters MB_mid[0][0] and TH3_mid[0] to obtain the curve parameters MB[0][0] and TH3[0].
  • Tm_ap can be obtained according to the preset mapping relationship between m_p_T and m_a_T, for example, obtained by looking up the table (m_p_T, m_a_T), m_p corresponds to the tone mapping curve parameter p, and the preset value Tm_ap(m_p) of m_a obtained according to m_p is m_a_T .
  • the input may be the highest display brightness MaxDisplay (the value of the PQ domain) of the display brightness range of the display device, and the value of the frame to be processed Maximum brightness correction value max_lum, targeted_system_display_maximum_luminance in metadata (if targeted_system_display_maximum_luminance does not exist in metadata, targeted_system_display_maximum_luminance is equal to MaxDisplay); the original primary spline curve (i.e., the primary spline curve in the first tone mapping curve) parameter, MB[0 ][0], TH3[0]; color signal mapping curve parameter Ptone_mapping, including m_p, m_m, m_n, m_a, m_b, k1, k2, k3.
  • the output can be the primary spline curve (that is, the primary spline of the second tone mapping curve) parameters,
  • the curve parameters MB_mid[0][0] and TH3_mid[0] satisfy the following formulas (26) and (27):
  • TH3[0] TH3_mid[0]+(MaxSource-TH3_mid[0])*(WA) N2 (26)
  • N1 and N2 are rational numbers greater than 0, and G(L) is the inverse function of the mapping curve parameter T curve.
  • the curve parameters MB_mid[0][0] and TH3_mid[0] satisfy the following formulas (28) and (29) :
  • MaxLum is the maximum brightness correction value (adjustment value of MaxSource)
  • G(L) is the inverse function of the mapping curve parameter T curve.
  • the curve parameters MB_mid[0][0] and TH3_mid[0] satisfy the following formulas (30) and (31) :
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents When the parameter M_a of G(L) takes the value of m_a_T, the value of G(L) corresponding to variable L is input.
  • H(L, m_a_T) is the same.
  • N1 and N2 are rational numbers. For example, the default value of N1 and N2 can be 0.
  • max(a,b) means finding the larger value of a and b
  • min(a,b) means finding the smaller value of a and b.
  • k1 and k2 are not 0 at the same time, and K3 is not 0.
  • H(L) is the following examples:
  • the above-mentioned first parameter may include a second-order spline parameter
  • the second-order spline parameter includes a second-order spline in the first tone mapping curve.
  • the display parameter includes the maximum display brightness MaxDisplay of the terminal device
  • the characteristic information includes the maximum brightness correction value max_lum of the image data.
  • obtaining the second parameter of the second tone mapping curve according to the first parameter, the display parameter, and the characteristic information includes: according to the maximum display brightness MaxDisplay and the maximum brightness correction value max_lum,
  • the curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid are adjusted to obtain the curve parameters MB[0][0], TH3[0] and/or base_offset.
  • curve parameters MB_mid[0][0], TH3_mid[0] and/or base_offset_mid, and curve parameters MB[0][0], TH3[0] and/or base_offset satisfy the following formula :
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the G(L) values N1, N2, and N3 corresponding to the input variable L are rational numbers
  • max(a,b) means to find the larger value of a and b
  • min( a, b) means finding the smaller of a and b
  • H(L) is
  • the second parameter includes a cubic spline curve parameter
  • the cubic spline curve parameter includes an interpolation point value TH1 of a cubic spline on the second tone mapping curve [1], TH2[1], TH3[1], where TH1[1] represents the minimum brightness value of the pixel points in the first interval of the cubic spline, and TH2[1] represents the pixels in the first interval of the cubic spline
  • the maximum value of the brightness value of the point and the minimum value of the brightness value of the pixel point in the second interval of the cubic spline, TH3[1] represents the maximum value of the brightness value of the pixel point in the second interval of the cubic spline.
  • TH1[1] may be an example of TH1D
  • TH2[1] may be an example of TH2D
  • TH3[1] may be an example of TH3D.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline can be based on the second cubic spline curve parameter TH3[0] in the first parameter.
  • the interpolation point values TH1[1], TH2[1], TH3[1] of the cubic spline are calculated as the preset offset values of the relevant values.
  • TH1[1], TH2[1], and TH3[1] satisfy the following formulas (32) to (34):
  • B, C, and D are the interpolation points TH1[1], TH2[1], TH3[1] of the cubic spline, and the preset value for calculating the correlation value
  • B is the brightness value of the pixel point in the dark transition area
  • C and D are preset weighting coefficients corresponding to the brightness values of pixels in the bright area.
  • the default value of B may be 0.15
  • the default value of C and D may be 0.5.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline can be based on the second cubic spline curve parameter TH3[0 ] And the calculated correlation values of the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline.
  • TH1[1], TH2[1], and TH3[1] satisfy the following formulas (35) to (37):
  • TH3[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w]
  • 3Spline_TH_Delta1[i][1][w] 3Spline_TH_Delta1[i][2][w] are the interpolation points TH1[ 1], TH2[1], TH3[1] calculate the relevant value.
  • the coordinates (such as Y coordinates) corresponding to TH1[1], TH2[1], and TH3[1] in the second tone mapping curve may be obtained, for example, they may be expressed as VA1, VA2, and VA2, respectively.
  • VA3 the Y coordinate of the primary spline in the second tone mapping curve at TH3[0] is the same as the Y coordinate of the cubic spline in the second tone mapping curve at TH1[1]
  • the The first derivative of the primary spline at TH3[0] is the same as the first derivative of the cubic spline at TH1[1].
  • the Y coordinate of the first cubic spline in the second tone mapping curve at TH2[1] is the same as that of the second cubic spline in the second tone mapping curve.
  • the Y coordinate at TH2[1] is the same, and the first derivative of the first cubic spline at TH2[1] is the same as the first derivative of the second cubic spline at TH2[1].
  • the Y coordinate of the second cubic spline in the second tone mapping curve at TH3[1] is the same as the third tone in the second tone mapping curve.
  • the Y coordinate of the mapping function at TH3[1] is the same, and the first derivative of the second cubic spline at TH3[1] is the same as the first derivative of the third tone mapping function at TH3[1] same.
  • the formula (38) can be obtained according to the first-order spline in the above-mentioned second tone mapping curve:
  • GD3 m_a ⁇ m_m ⁇ m_p ⁇ K3 ⁇ m_n ⁇ TH3[1] m_m-1 ⁇ DGD3(L) (43)
  • DTH2 (TH2[1]-TH1[1])
  • DTH3 (TH3[1]-TH2[1]).
  • the MC[0][1], MD[0][1], MB[1][1], MC[1][1], MD[1] in the second parameter can be obtained [1] and other parameters.
  • the parameters of the first tone mapping curve are further adjusted, so that the adjusted curve parameter (ie, the second parameter) corresponds to a certain point on the tone mapping curve (ie, the second tone mapping curve).
  • the output brightness is not higher than the input brightness corresponding to this point, which helps to avoid the pixel brightness of the terminal device after the mapping is brighter than the original image when the maximum display brightness of the image is close to the maximum display brightness of the display device. The anomaly.
  • the dynamic range mapping method of the embodiment of the present application is described in detail above with reference to FIG. 9.
  • the following describes the dynamic range mapping apparatus of the embodiment of the present application with reference to FIG. 10 and FIG. 11.
  • the described device for dynamic range mapping can execute the steps of the method for dynamic range mapping shown in FIG. 9.
  • the above definition of each step in FIG. 9 also applies to the devices shown in FIG. 10 and FIG.
  • repeated descriptions are appropriately omitted for the sake of brevity.
  • FIG. 10 is a schematic block diagram of an apparatus 1000 for dynamic range mapping according to an embodiment of the present application.
  • the device 1000 includes an acquisition unit 1010, a processing unit 1020, and a mapping unit 1030.
  • the obtaining unit 1010 is used to obtain display parameters of the terminal device.
  • the acquiring unit 1010 is also used to acquire characteristic information of the image data.
  • the acquiring unit 1010 is further configured to acquire the first parameter of the first tone mapping curve of the image data.
  • the processing unit 1020 is configured to obtain the second parameter of the second tone mapping curve according to the first parameter, the display parameter of the terminal device, and the characteristic information of the image data when the preset condition is established.
  • the output brightness at the first point on the second tone mapping curve is not higher than the input brightness at the first point on the second tone mapping curve.
  • the mapping unit 1030 is configured to perform dynamic range mapping on the image data according to the second parameter of the second tone mapping curve.
  • the preset condition is established:
  • the output brightness at the second point on the first tone mapping curve is higher than the input brightness at the second point on the first tone mapping curve
  • the parameter pP1 in the first parameter is greater than the first value Tp, where the first value Tp is obtained according to the aP1 in the first parameter and the preset correspondence between aP1 and pP1; or
  • the parameter aP1 in the first parameter is greater than the second value Ta, wherein the second value Ta is obtained according to the pP1 in the first parameter and the preset correspondence between aP1 and pP1; or
  • the product of the parameter aP1 and the parameter pP1 in the first parameter is greater than a third value Tap, where the third value Tap is a preset rational number.
  • the second parameter includes a first-order spline parameter
  • the first-order spline parameter includes a first-order spline in the second tone mapping curve.
  • the first parameter includes a second-order spline parameter
  • the second-order spline parameter includes a second-order spline in the first tone mapping curve
  • the display parameter includes the maximum display brightness MaxDisplay of the terminal device
  • the feature information includes the maximum brightness correction value max_lum of the image data
  • the processing unit 1020 is specifically used for:
  • the curve parameters MB_mid[0][0] and TH3_mid[0] are adjusted to obtain the curve parameters MB[0][0] and TH3 [0].
  • the curve parameters MB_mid[0][0] and TH3_mid[0] satisfy the following formula:
  • L is the input signal
  • G(L) is the inverse function of the function H(L) corresponding to the tone mapping curve
  • m_a, m_b, m_m, m_n, k1, k2, k3 are the curve parameters
  • G(L, m_a_T) represents
  • M_a of G(L) takes the value of m_a_T
  • the value of G(L) corresponding to the input variable L is the same as H(L, m_a_T)
  • N1 and N2 are rational numbers
  • max(a, b) means the calculation of a and b
  • min(a,b) means to find the smaller value of a and b
  • H(L) is
  • the second parameter includes a cubic spline curve parameter
  • the cubic spline curve parameter includes an interpolation point value TH1 of a cubic spline on the second tone mapping curve [1], TH2[1], TH3[1], where TH1[1] represents the minimum brightness value of the pixel points in the first interval of the cubic spline, and TH2[1] represents the pixels in the first interval of the cubic spline
  • the maximum value of the brightness value of the point and the minimum value of the brightness value of the pixel point in the second interval of the cubic spline, TH3[1] represents the maximum value of the brightness value of the pixel point in the second interval of the cubic spline.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second cubic spline curve parameter TH3[ 0], the interpolation point values TH1[1], TH2[1], TH3[1] are obtained from the preset offset values, as shown below:
  • TH3[1] TH2[1]+C*TH2[1]-D*TH1[1];
  • B, C, and D are the interpolation points TH1[1], TH2[1], TH3[1] of the cubic spline, and the preset value for calculating the correlation value
  • B is the brightness value of the pixel point in the dark transition area
  • C and D are preset weighting coefficients corresponding to the brightness values of pixels in the bright area.
  • the interpolation point values TH1[1], TH2[1], and TH3[1] of the cubic spline are based on the second cubic spline curve parameter TH3[ 0], the interpolation point values TH1[1], TH2[1], TH3[1] are calculated by calculating the relevant values, as shown below:
  • TH1[1] 3Spline_TH[i][0][w];
  • TH2[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
  • TH3[1] 3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
  • 3Spline_TH_Delta1[i][1][w] are the interpolation point values TH1[1] extracted from the metadata , TH2[1], TH3[1] calculation related values.
  • the Y coordinate of the first-order spline in the second tone mapping curve at TH3[0] and the Y-coordinate of the third-order spline in the second tone mapping curve at TH1[1] are The Y coordinate is the same, and the first derivative of the first-order spline at TH3[0] is the same as the first-order derivative of the cubic spline at TH1[1].
  • the Y coordinate of the first cubic spline in the second tone mapping curve at TH2[1] and the second cubic spline in the second tone mapping curve are at The Y coordinate at TH2[1] is the same, and the first derivative of the first cubic spline at TH2[1] is the same as the first derivative of the second cubic spline at TH2[1].
  • the Y coordinate of the second cubic spline in the second tone mapping curve at TH3[1] and the third tone mapping function in the second tone mapping curve at TH3 The Y coordinate at [1] is the same, and the first derivative of the second cubic spline at TH3[1] is the same as the first derivative of the third tone mapping function at TH3[1].
  • the acquiring unit 1010 is specifically configured to:
  • FIG. 11 is a schematic diagram of the hardware structure of an apparatus 1100 for dynamic range mapping according to an embodiment of the present application.
  • the apparatus 1100 shown in FIG. 11 can be regarded as a kind of computer equipment.
  • the apparatus 1100 can be used as an implementation of the dynamic range mapping apparatus in the embodiment of the present application, and can also be used as the dynamic range mapping method in the embodiment of the present application.
  • the device 1100 includes a processor 1101, a memory 1102, an input/output interface 1103, and a bus 1105, and may also include a communication interface 1104.
  • the processor 1101, the memory 1102, the input/output interface 1103, and the communication interface 1104 realize the communication connection between each other through the bus 1105.
  • the processor 1101 may adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs to Realize the functions required by the modules in the media data processing apparatus of the embodiment of the present application, or execute the media data processing method of the method embodiment of the present application.
  • the processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 701 or instructions in the form of software.
  • the above-mentioned processor 1101 may be a general-purpose processor, a digital signal processing (digital signal processing, DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, Discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 1102, and the processor 1101 reads the information in the memory 1102, and combines its hardware to complete the functions required by the modules included in the apparatus for processing media data in the embodiments of the present application, or perform the functions of the method embodiments of the present application. The method of processing media data.
  • the memory 1102 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 1102 may store an operating system and other application programs.
  • software or firmware is used to implement the functions required by the modules included in the device for processing media data in the embodiments of the present application, or to execute the method for processing media data in the method embodiments of the present application, it is used to implement the methods provided in the embodiments of the present application.
  • the program code of the technical solution is stored in the memory 1102, and the processor 1101 executes operations required by the modules included in the apparatus for processing media data, or executes the method for processing media data provided by the method embodiment of the present application.
  • the input/output interface 1103 is used to receive input data and information, and output data such as operation results.
  • the communication interface 1104 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 1100 and other devices or a communication network. It can be used as an acquisition module or a sending module in the processing device.
  • a transceiver device such as but not limited to a transceiver to implement communication between the device 1100 and other devices or a communication network. It can be used as an acquisition module or a sending module in the processing device.
  • the bus 1105 may include a path for transferring information between various components of the device 1100 (for example, the processor 1101, the memory 1102, the input/output interface 1103, and the communication interface 1104).
  • the device 1100 shown in FIG. 11 only shows the processor 1101, the memory 1102, the input/output interface 1103, the communication interface 1104, and the bus 1105, those skilled in the art should understand that in the specific implementation process, The device 1100 also includes other devices necessary for normal operation, for example, it may also include a display for displaying the video data to be played. At the same time, according to specific needs, those skilled in the art should understand that the device 1100 may also include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the device 1100 may also only include the components necessary to implement the embodiments of the present application, and not necessarily include all the components shown in FIG. 11.
  • An embodiment of the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the above-mentioned dynamic range mapping method.
  • the embodiment of the present application also provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the above-mentioned dynamic range mapping method.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)

Abstract

本申请提供了动态范围映射的方法和装置,有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的终端设备的像素的亮度比原始的图像还要亮的异常现象。该动态范围映射的方法,包括:获取终端设备的显示参数,获取图像数据的特征信息(910);获取图像数据的第一色调映射曲线的第一参数(920);在预设条件成立时,根据第一参数、终端设备的显示参数和图像数据的特征信息,得到第二色调映射曲线的第二参数(930),其中,第二色调映射曲线上第一点处的输出亮度不高于第二色调映射曲线上的第一点的输入亮度;根据第二色调映射曲线的第二参数对图像数据进行动态范围映射(940)。

Description

动态范围映射的方法和装置
本申请要求于2020年4月30日提交中国专利局、申请号为202010365696.3、申请名称为“动态范围映射的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及显示技术领域,并且更具体地,涉及一种动态范围映射的方法和装置。
背景技术
动态范围(dynamic range,DR)在很多领域用来表示某个变量的最大值和最小值的比率。在数字图像中,动态范围表征了在图像可显示范围内的最大亮度与最小亮度之间的比率,也就是图像从“最亮”到“最暗”之间灰度划分的等级数,其单位为坎德拉每平方米(cd/m2),也可以表示为尼特(nits)。一个图像的动态范围越大,它所能表示的亮度层次越丰富,图像的视觉效果越逼真。由于真实世界中自然场景的动态范围在10 -3到10 6之间,动态范围非常大,因此称之为高动态范围(high dynamic range,HDR)。相对于高动态范围图像,普通图像的动态范围为标准动态范围(standard dynamic range,SDR)或低动态范围(low dynamic range,SDR)。
现阶段的显示设备,一般把动态范围不足0.1到400nits的称为SDR显示设备;把动态范围超过0.01到540nits的称为HDR显示设备。不同的高动态范围显示设备显示动态范围也不同,如0.01到540nits的HDR显示设备,0.005到1000nits的HDR显示设备等。动态范围的映射的方法主要应用在前端HDR信号和后端HDR的显示设备的适配过程中,包括从高到低的色调映射(tone-mapping)过程,以及从低到高的色调映射过程。例如,前端是采集到的4000nit的光照信号,而后端显示设备的HDR显示能力只有500nit,因此将4000nit的光照信号映射到500nit的显示设备上,是一种从高到低的映射过程。又例如,前端是采集到的100nit的SDR光照信号,而后端显示设备的HDR显示能力为2000nit,因此将100nit的光照信号映射到2000nit的显示设备上,是一种从低到高的映射过程。
现有技术中,在图像的最大亮度小于显示设备的最大显示亮度的情况下,可以采用基于“S”型曲线的动态范围的映射算法,将高动态范围图像调整到显示设备所能显示的动态范围内进行显示。但是,在图像的最大亮度与显示设备的最大显示亮度接近的情况下,若果仍然使用上述方案,会导致映射之后的显示设备的像素的亮度比原始的图像还要亮的异常现象,影响用户体验。
发明内容
本申请提供一种动态范围映射的方法和装置,有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的终端设备的像素的亮度比原始的图像还要亮的异常现象。
第一方面,提供了一种动态范围映射的方法,包括:
获取终端设备的显示参数;
获取图像数据的特征信息;
获取所述图像数据的第一色调映射曲线的第一参数;
在预设条件成立时,根据所述第一参数、所述终端设备的显示参数和所述图像数据的特征信息,得到第二色调映射曲线的第二参数,其中,所述第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的所述第一点的输入亮度;
根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。
因此,本申请实施例通过对第一色调映射曲线的参数进行进一步的调整,使得调整后的曲线参数(即第二参数)对应的色调映射曲线(即第二色调映射曲线)上的某一点的输出亮度不高于该点对应的输入亮度,从而有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的终端设备的像素的亮度比原始的图像还要亮的异常现象。
本申请实施例可以应用于终端设备,该终端设备例如为显示端设备。显示端设备的产品形态可以为机顶盒、电视显示设备、手机显示设备,以及网络直播、视频应用的转换设备等电子设备。作为示例,在机顶盒、电视显示设备或手机显示设备上,本申请实施例提供的方案可以以硬件芯片的形态实现,在网络直播或视频播放设备上,本申请实施例提供的方案主要以软件程序代码的形态实现,但是本申请实施例并不限于此。
示例性的,图像数据,例如可以为HDR源或SDR源等,例如为图像中的像素数据,比如每个像素点的亮度和颜色数据等。
示例性的,图像数据的特征信息例如可以从图像数据的元数据M中获取,元数据M例如可以包括该图像数据对应的曲线参数M curve、目标系统显示实际峰值亮度M TPL(targeted system display actual peak luminance)、图像数据的内容的亮度的最大值MaxSource(所有像素的Y分量的最大、或者所有像素RGB分量的最大值的最大值)、最小值MinSource(所有像素的Y分量的最小、或者所有像素RGB分量的最大值的最小值)、平均值(所有像素的Y分量的平均值、或者所有像素RGB分量的最大值的平均值)、显示内容的变化范围等,本申请实施例对此不作限定。
一些实施例中,还可以从图像数据V的像素信息中获取该图像数据的特征信息;或者使用预设值的图像数据的特征信息值,本申请实施例对此不作限定。
示例性的,终端设备的显示参数M TPL可以包括终端设备的最大显示亮度MaxDisplay和/或最小显示亮度MinDisplay,或者其他参数,本申请实施例对此不作限定。
结合第一方面,在第一方面的某些实现方式中,符合下列任意之一的条件时,则所述预设条件成立:
根据所述第一参数对于图像数据进行色调映射时,所述第一色调映射曲线上第二点处的输出亮度高于所述第一色调映射曲线上的所述第二点处的输入亮度;或者
所述第一参数中的参数p P1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的a P1,以及预设的a P1与p P1的对应关系获得的,其中,Tp表示曲线参数p的阈值。当第一参数p P1超过了Tp时,就有可能出现第二色调映射曲线上的某一点处输出亮度高于输入亮度的现象;或者
所述第一参数中的参数a P1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的p P1,以及预设的a P1与p P1的对应关系获得的其中,Ta表示曲线参数a的阈值,当第一参数a P1超过了Ta时,就有可能出现第二色调映射曲线上的某一点处输出亮度高于输入亮度的现象;或者
所述第一参数中的参数a P1与参数p P1的乘积大于第三值Tap,其中,所述第三值Tap为预设的有理数,当第一参数中的参数a P1与参数p P1的乘积超过了Tap时,就有可能出现第二色调映射曲线上的某一点处输出亮度高于输入亮度的现象。示例性的,该第三值Tap可以为3~4之间的有理数,例如3.2或3.4,本申请实施例对此不作限定。
因此,本申请实施例能够在上述预设条件成立,即按照第一色调映射曲线对于图像数据进行色调映射,会造成第一色调映射曲线上的某一点的输出亮度高于该第一色调映射曲线上的该点的输入亮度时,执行生成上述第二色调映射曲线的第二参数的过程。
结合第一方面,在第一方面的某些实现方式中,所述第二参数包括第一一次样条曲线参数,所述第一一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的斜率MB[0][0]和/或所述第一一次样条的区间像素点的亮度值的最大值TH3[0]和/或所述第一一次样条与纵坐标轴交点base_offset。
本申请实施例中,在根据第二参数对图像数据进行动态范围映射时,在图像数据的暗区可以使用该直线部分(即第一一次样条)进行色调映射,这样可以控制亮度的增益,同时更方便控制第二参数从直线逐渐变化到y=x的直线,其中y=x的直线相当于色调映射曲线上的任一点的输出亮度等于输入亮度,因此本申请实施例对于亮度渐变的内容不容易引起闪烁的现象。
结合第一方面,在第一方面的某些实现方式中,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
其中,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取所述曲线参数MB[0][0]和TH3[0]。
因此,本申请实施例可以根据第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和该第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],以及终端设备的最大显示亮度MaxDisplay和图像数据的最大亮度校正值max_lum,来获取该第二色调映射曲线的第一一次样条的斜率MB[0][0]和第一一次样条的区间像素点的亮度值的最大值TH3[0]。
结合第一方面,在第一方面的某些实现方式中,所述曲线参数MB_mid[0][0]和TH3_mid[0],以及所述曲线参数MB[0][0]和TH3[0],满足以下公式:
Figure PCTCN2021089981-appb-000001
Figure PCTCN2021089981-appb-000002
其中,
Figure PCTCN2021089981-appb-000003
或者,
Figure PCTCN2021089981-appb-000004
其中
Figure PCTCN2021089981-appb-000005
或者
Figure PCTCN2021089981-appb-000006
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000007
或者,
Figure PCTCN2021089981-appb-000008
结合第一方面,在第一方面的某些实现方式中,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0]和/或所述第一一次样条与纵坐标轴交点base_offset_mid,所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
其中,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid进行调整,获取所述曲线参数MB[0][0]、TH3[0]和/或base_offset。
结合第一方面,在第一方面的某些实现方式中,所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid,以及所述曲线参数MB[0][0]、TH3[0]和/或base_offset,满足以下公式:
Figure PCTCN2021089981-appb-000009
Figure PCTCN2021089981-appb-000010
Figure PCTCN2021089981-appb-000011
其中,
Figure PCTCN2021089981-appb-000012
Figure PCTCN2021089981-appb-000013
或者
Figure PCTCN2021089981-appb-000014
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2、N3为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000015
或者,
Figure PCTCN2021089981-appb-000016
结合第一方面,在第一方面的某些实现方式中,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。
结合第一方面,在第一方面的某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]和三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值的预设偏移值得到的,如下所示:
TH1[1]=TH3[0];
TH2[1]=TH1[1]+B;
TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1];
其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。
因此,本申请实施例根据该第一参数中的第二一次样条曲线参数和三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值的预设偏移值,可以得到第二参数中的三次样条的插点值TH1[1]、TH2[1]、TH3[1]。
结合第一方面,在第一方面的某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]和三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值得到的,如下所示:
TH1[1]=3Spline_TH[i][0][w];
TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值。
因此,本申请实施例根据该第一参数中的第二一次样条曲线参数和从元数据中提取的该三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值,可以得到第二参数中的三次样条的插点值TH1[1]、TH2[1]、TH3[1]。
结合第一方面,在第一方面的某些实现方式中,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
这样,能够使得第二色调映射曲线中的一次样条曲线与第二色调映射曲线中的三次样条曲线在TH[1]处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
这样,能够使得第二色调映射曲线中的第一三次样条曲线与第二三次样条曲线在TH[2]处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
这样,能够使得第二色调映射曲线中的第二三次样条曲线与第三色调映射函数的曲线在TH[3]处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述获取所述图像数据的第一色调映射曲线的第一参数,包括:
获取所述图像数据的元数据;
根据所述元数据以及所述显示参数,确定所述第一色调映射曲线的第一参数。
例如,显示端设备可以根据元数据M中的图像数据V的内容的亮度的平均值average_maxrgb,和/或亮度的最大值MaxSource,和/或亮度的最小值MinSource,和/或显示端设备的最大显示亮度MaxDisplay,和/或显示端设备的最小显示亮度MinDisplay,和/或曲线参数M curve( p1,p2,…),和/或其他数据,获得该第一色调映射曲线的第一参数,该 第一参数例如可表示为P1 curve(X,p1,p2,…)。其中,X为输入亮度值,p1,p2,…为曲线参数值。
结合第一方面,在第一方面的某些实现方式中,所述第二参数还包括一次样条曲线参数,所述一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的区间像素点的亮度值的最大值TH3C,以及所述第一一次样条的斜率Dark。
本申请实施例中,在根据第二参数对图像数据进行动态范围映射时,在图像数据的暗区可以使用该直线部分(即第一一次样条)进行色调映射,这样可以控制亮度的增益,同时更方便控制第二参数从直线逐渐变化到y=x的直线,其中y=x的直线相当于色调映射曲线上的任一点的输出亮度等于输入亮度,因此本身实施例对于亮度渐变的内容不容易引起闪烁的现象。
结合第一方面,在第一方面的某些实现方式中,还包括:
获取所述第一一次样条的初始区间像素点的亮度值的最大值TH3C0;
获取所述第一一次样条的初始斜率Dark0;
根据所述初始区间像素点的亮度值的最大值TH3C0,确定所述区间像素点的亮度值的最大值TH3C;
根据所述初始斜率Dark0,确定所述斜率Dark。
结合第一方面,在第一方面的某些实现方式中,所述获取所述第一一次样条的初始区间像素点的亮度值的最大值TH3C0,包括:
根据第一参数,确定所述初始区间像素点的亮度值的最大值TH3C0,其中,所述第一参数包括所述第一色调映射曲线中的第二一次样条的区间像素点的亮度值的最大值TH3[0];或者
根据预设值,确定所述初始区间像素点的亮度值的最大值TH3C0,该预设值例如暗视觉与亮视觉的分解,即人眼视锥细胞与视杆细胞相应强弱发生变化的亮度,比如1nit;或者
根据所述图像数据的元数据,确定所述初始区间像素点的亮度值的最大值TH3C0,其中,所述元数据包括直方图暗区像素数量的特征数据。
结合第一方面,在第一方面的某些实现方式中,所述获取所述第一一次样条的初始斜率Dark0,包括:
根据第一参数,确定所述初始斜率Dark0,其中,所述第一参数包括所述第一色调映射曲线中的第二一次样条的斜率MB[0][0];或者
根据第四值和所述区间像素点的亮度值的最大值TH3C的比值,确定所述初始斜率Dark0,其中所述第四值为所述第一色调映射曲线在所述区间像素点的亮度值的最大值TH3C处的输出值;或者
根据所述第一色调映射曲线在0至所述区间像素点的亮度值的最大值TH3C之间预设输入值的斜率值,确定所述初始斜率Dark0。
结合第一方面,在第一方面的某些实现方式中,所述初始区间像素点的亮度值的最大值TH3C0、所述区间像素点的亮度值的最大值TH3C、初始斜率Dark0和所述斜率Dark满足以下公式:
TH3C=TH3C0+(MaxSource-TH3C0)*(WA) N2
Dark=Dark0+(1-Dark0)*(WA) N1
Figure PCTCN2021089981-appb-000017
Figure PCTCN2021089981-appb-000018
其中,TH3C大于TH3C0,且小于MaxSource,TH3C0小于MaxSource,N1和N2为大于0的有理数,H(L)为色调映射曲线、G(L)为所述H(L)的逆函数。
结合第一方面,在第一方面的某些实现方式中,所述初始区间像素点的亮度值的最大值TH3C0、所述区间像素点的亮度值的最大值TH3C、初始斜率Dark0和所述斜率Dark满足以下公式:
TH3C=TH3C0+(MaxLum-TH3C0)*(WA) N2
DARK=DARK0+(1-DARK0)*(WA) N1
Figure PCTCN2021089981-appb-000019
Figure PCTCN2021089981-appb-000020
其中,MaxLum为图像数据最大亮度的调整值,TH3C大于TH3C0,且小于MaxSource,TH3C0小于MaxSource,N1和N2为大于0的有理数,H(L)为色调映射曲线函数、G(L)为所述H(L)的逆函数。
结合第一方面,在第一方面的某些实现方式中,所述第二参数还包括三次样条曲线参数,所述三次样条曲线参数中包括所述第二色调映射曲线的第一三次样条的第一区间像素点的亮度值的最小值TH1D;
所述方法还包括:
根据所述第二色调映射曲线中的第一一次样条的区间像素点的亮度值的最大值TH3C,确定所述第一区间像素点的亮度值的最小值TH1D。
结合第一方面,在第一方面的某些实现方式中,所述第二参数还包括三次样条曲线参数,所述三次样条曲线参数中包括所述第二色调映射曲线的第一三次样条的第一区间像素点的亮度值的最大值TH2D;
所述方法还包括:
根据所述第一区间像素点的亮度值的最小值TH1D,确定所述第一区间像素点的亮度值的最大值TH2D。
结合第一方面,在第一方面的某些实现方式中,所述根据所述第一区间像素点的亮度值的最小值TH1D,确定所述第一区间像素点的亮度值的最大值TH2D,包括:
根据所述第一区间像素点的亮度值的最小值TH1D和所述第一参数,确定所述第一区间像素点的亮度值的最大值TH2D;或者
根据所述第一区间像素点的亮度值的最小值TH1D和预设有理数值,确定所述第一区间像素点的亮度值的最大值TH2D;或者
根据所述第一区间像素点的亮度值的最小值TH1D和所述图像数据的元数据,确定所述第一区间像素点的亮度值的最大值TH2D。
结合第一方面,在第一方面的某些实现方式中,所述第二色调映射曲线的第一三次样条的第一区间像素点的亮度值的最小值TH1D与所述第一一次样条的区间像素点的亮度值的最大值TH3C相同,所述第二色调映射曲线中的一次样条和所述第一三次样条在TH1D处的输出值相同,且所述第二色调曲线中的一次样条和所述第一三次样条在TH1D处的一阶导数相同。
这样,能够使得第二色调映射曲线中的一次样条曲线与第二色调映射曲线中的三次样条曲线在TH1D处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述三次样条曲线参数还包括所述第二色调映射曲线的第二三次样条的第二区间像素点的亮度值的最大值TH3D;
所述方法还包括:
根据所述第一区间像素点的亮度值的最小值TH1D和所述第一区间像素点的亮度值的最大值TH2D,确定所述第二区间像素点的亮度值的最大值TH3D。
结合第一方面,在第一方面的某些实现方式中,所述根据所述第一区间像素点的亮度值的最小值TH1D和所述第一区间像素点的亮度值的最大值TH2D,确定所述第二区间像素点的亮度值的最大值TH3D,包括:
根据所述第一区间像素点的亮度值的最小值TH1D、所述第一区间像素点的亮度值的最大值TH2D和所述第一参数,确定所述第三最大输入亮度TH3D;或者
根据所述第一区间像素点的亮度值的最小值TH1D、所述第一区间像素点的亮度值的最大值TH2D和预设有理数,确定所述第三最大输入亮度TH3D;或者
根据所述第一区间像素点的亮度值的最小值TH1D、所述第一区间像素点的亮度值的最大值TH2D和所述图像数据的元数据,确定所述第三最大输入亮度TH3D。
结合第一方面,在第一方面的某些实现方式中,所述第二三次样条的第二区间像素点的亮度值的最小值与所述第一三次样条的第一区间像素点的亮度值的最大值TH2D相同,所述第一三次样条和所述第二三次样条在所述区间像素点的亮度值的最大值TH2D处的输出值相同,且所述第一三次样条和所述第二三次样条在所述区间像素点的亮度值的最大值TH2D处的一阶导数相同。
这样,能够使得第二色调映射曲线中的第一三次样条曲线与第二三次样条曲线在TH2D处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述第二参数还包括所述第二色调映 射曲线的色调映射子函数的曲线参数,所述色调映射子函数的第三区间像素点的亮度值的最小值与所述第二区间像素点的亮度值的最大值TH3D相同,所述第二三次样条和所述色调映射子函数在所述第二区间像素点的亮度值的最大值TH3D处的输出值相同,且所述第二三次样条和所述色调映射子函数在所述第二区间像素点的亮度值的最大值TH3D处的一阶导数相同。
这样,能够使得第二色调映射曲线中的第二三次样条曲线与色调映射子函数的曲线在TH3D处是连续的。
结合第一方面,在第一方面的某些实现方式中,所述第一参数中包括a P1、p P1,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
根据a P1以及预设的a P1与p P1的对应关系,获得第一值Tp;
如果p P1大于Tp,则将所述第一参数中的p P1替换为Tp;
将替换后的所述第一参数作为所述第二参数。
因此,通过将第一参数中的p P1替换为Tp,并将替换后的该第一参数作为第二参数,能够有助于使得第二色调映射曲线上第一点处的输出亮度不高于第二色调映射曲线上的该第一点的输入亮度。
结合第一方面,在第一方面的某些实现方式中,所述第一参数中包括a P1、p P1,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
根据p P1以及预设的a P1与p P1的对应关系获得第二值Ta;
如果a P1大于Ta,则将所述第一参数中的a P1替换为Ta;
将替换后的所述第一参数作为所述第二参数。
因此,通过将第一参数中的a P1替换为Ta,并将替换后的该第一参数作为第二参数,能够有助于使得第二色调映射曲线上第一点处的输出亮度不高于第二色调映射曲线上的该第一点的输入亮度。
结合第一方面,在第一方面的某些实现方式中,所述第一参数中包括a P1、p P1,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
如果a P1*p P1大于第三值Tap,则将所述第一参数中的p P1替换为Tap/a P1,或者将所述第一参数中的a P1替换为Tap/p P1
将替换后的所述第一参数作为所述第二参数。
因此,通过将第一参数中的p P1替换为Tap/a P1,或者将第一参数中的a P1替换为Tap/p P1,并将替换后的该第一参数作为第二参数,能够有助于使得第二色调映射曲线上第一点处的输出亮度不高于第二色调映射曲线上的该第一点的输入亮度。
第二方面,提供了一种动态范围映射的装置,包括获取单元,处理单元和映射单元。
获取单元,用于获取终端设备的显示参数;
所述获取单元还用于获取图像数据的特征信息;
所述获取单元还用于获取所述图像数据的第一色调映射曲线的第一参数;
处理单元,用于在预设条件成立时,根据所述第一参数、所述终端设备的显示参数和 所述图像数据的特征信息,得到第二色调映射曲线的第二参数,其中,所述第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的所述第一点的输入亮度;
映射单元,用于根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。
结合第二方面,在第二方面的某些实现方式中,符合下列任意之一的条件时,则所述预设条件成立:
根据所述第一参数对于图像数据进行色调映射时,所述第一色调映射曲线上第二点处的输出亮度高于所述第一色调映射曲线上的所述第二点处的输入亮度;或者
所述第一参数中的参数p P1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的a P1,以及预设的a P1与p P1的对应关系获得的;或者
所述第一参数中的参数a P1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的p P1,以及预设的a P1与p P1的对应关系获得的;或者
所述第一参数中的参数a P1与参数p P1的乘积大于第三值Tap,其中,所述第三值Tap为预设的有理数。
结合第二方面,在第二方面的某些实现方式中,所述第二参数包括第一一次样条曲线参数,所述第一一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的斜率MB[0][0]和/或所述第一一次样条的区间像素点的亮度值的最大值TH3[0]和/或所述第一一次样条与纵坐标轴交点base_offset。
结合第二方面,在第二方面的某些实现方式中,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
其中,处理单元具体用于:
根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取所述曲线参数MB[0][0]和TH3[0]。
结合第二方面,在第二方面的某些实现方式中,所述曲线参数MB_mid[0][0]和TH3_mid[0],以及所述曲线参数MB[0][0]和TH3[0],满足以下公式:
Figure PCTCN2021089981-appb-000021
Figure PCTCN2021089981-appb-000022
其中,
Figure PCTCN2021089981-appb-000023
或者
Figure PCTCN2021089981-appb-000024
Figure PCTCN2021089981-appb-000025
或者
Figure PCTCN2021089981-appb-000026
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000027
或者,
Figure PCTCN2021089981-appb-000028
结合第二方面,在第二方面的某些实现方式中,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0]和/或所述第一一次样条与纵坐标轴交点base_offset_mid,所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
其中,处理单元具体用于:
根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid进行调整,获取所述曲线参数MB[0][0]、TH3[0]和/或base_offset。
结合第二方面,在第二方面的某些实现方式中,所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid,以及所述曲线参数MB[0][0]、TH3[0]和/或base_offset,满足以下公式:
Figure PCTCN2021089981-appb-000029
Figure PCTCN2021089981-appb-000030
Figure PCTCN2021089981-appb-000031
其中,
Figure PCTCN2021089981-appb-000032
Figure PCTCN2021089981-appb-000033
或者
Figure PCTCN2021089981-appb-000034
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2、N3为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000035
或者,
Figure PCTCN2021089981-appb-000036
结合第二方面,在第二方面的某些实现方式中,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。
结合第二方面,在第二方面的某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的预设偏移值得到的,如下所示:
TH1[1]=TH3[0];
TH2[1]=TH1[1]+B;
TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1];
其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。
结合第二方面,在第二方面的某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值计算得到的,如下所示:
TH1[1]=3Spline_TH[i][0][w];
TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值。
结合第二方面,在第二方面的某些实现方式中,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
结合第二方面,在第二方面的某些实现方式中,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
结合第二方面,在第二方面的某些实现方式中,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
结合第二方面,在第二方面的某些实现方式中,所述获取单元具体用于:
获取所述图像数据的元数据;
根据所述元数据以及所述显示参数,确定所述第一色调映射曲线的第一参数。
第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
第四方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
第五方面,提供了一种电子设备,包括上述第二方面所述的处理媒体数据的装置。
应理解,本申请的第二至第五方面及对应的实现方式所取得的有益效果参见本申请的第一方面及对应的实现方式所取得的有益效果,不再赘述。
附图说明
图1为PQ光电转移函数的图像。
图2为HLG光电转移函数的图像。
图3为SLF光电转移函数的图像。
图4为本申请实施例提供的高动态范围图像的动态范围调整曲线的示意图。
图5示出了sigmoid曲线的示意图。
图6示出了贝塞尔曲线的示意图。
图7为图像的最大亮度与显示设备的最大显示亮度相同时的映射曲线的示例。
图8示出了本申请实施例提供的系统架构的示意图。
图9示出了本申请实施例提供的动态范围映射的方法的示意性流程图。
图10示出了本申请实施例提供的一种动态范围映射的装置的示意性框图。
图11示出了本申请实施例提供的另一种动态范围映射的装置的示意性框图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
首先,对本申请实施例中涉及的相关概念和技术作简单介绍。
1、动态范围(dynamic range)在很多领域用来表示某个变量最大值与最小值的比率。 在数字图像中,动态范围表示了在图像可显示的范围内最大亮度值和最小亮度值之间的比率。自然界的动态范围是非常大的。例如,星空下的夜景亮度约为0.001cd/m 2,太阳本身亮度高达1000,000,000cd/m 2。其中,cd/m 2(坎德拉每平方米)是衡量亮度的国际单位制导出单位。这样,自然界的动态范围达到了1000,000,000/0.001=10 13的数量级。
但是,在自然界真实的场景当中,太阳的亮度和星光的亮度不会同时得到。对真实世界中的自然场景来说,动态范围在10 -3到10 6范围内。由于这是一个非常大的动态范围,因此,我们通常将其称作为高动态范围(high dynamic range,HDR)。相对于高动态范围,普通图片上的动态范围称之为低动态范围(low dynamic range,LDR)或标准动态范围(standard dynamic range,SDR)。由此可以理解的是,数码相机的成像过程实际上就是真实世界的高动态范围到相片的低动态范围的映射。图1示出了由真实世界的高动态范围到显示设备的低动态映射的一个示例。
图像的动态范围越大,表明图像显示的场景细节越多,亮度的层次越丰富,视觉效果越逼真。传统的数字图像一般采用一个字节,即8比特的空间来存储一个像素值,而高动态范围采用浮点数多字节来存储一个像素值,因此,能够表示出自然场景的高动态范围。
光学数字成像的过程(例如,数码相机的成像过程)是将真实场景的光辐射通过图像传感器转化为电信号,并以数字图像的方式保存下来。而图像显示的目的是通过显示设备重现一幅数字图像所描述的真实场景。两者的最终目标是使用户获得与其直接观察真实场景相同的视觉感知。
而光辐射(光信号)所能展示的真实场景中的亮度层次几乎是线性的,因此也将光信号称为线性信号。但是,光学数字成像在将光信号转换为电信号的过程中,并不是每一个光信号都对应着一个电信号,转换得到的电信号是非线性的。因此,也将电信号称为非线性信号。
2、光电转移函数(optical electro transfer function,OETF)表示图像像素的线性信号到非线性信号转换关系。
在可拍摄HDR图像的摄像机出现前,传统相机只能通过控制曝光值将拍摄的光信息记录在一定的范围内。由于显示设备的最大照度信息并不能达到真实世界的亮度信息,并且我们通过显示设备来浏览图像,因此需要光电转移函数。早期的显示设备是阴极射线管(cathode ray tube,CRT)显示器,其光电转移函数就是Gamma函数。在国际电信联盟无线通信组(international telecommunications union-radio communications sector,ITU-R)recommendation BT.1886标准当中定义了这个基于“Gamma”函数的光电转移函数,如下公式(1)所示。
Figure PCTCN2021089981-appb-000037
通过上述转换在量化成8比特后的图像就是传统的SDR图像。SDR图像和上述公式(1)中的转移函数在传统的显示设备(照度在100cd/m 2左右)上表现良好。
随着显示设备的不断升级,相对于传统的显示设备,现阶段的显示设备所能显示的动态范围不断增大。现有的消费者级的HDR显示器可达到600cd/m 2,高端HDR显示器能达到2000cd/m 2,已经远远超出了传统SDR显示设备的显示范围。因此,ITU-R BT.1886标准协议中,与传统SDR显示设备相适应的光电转移函数不再能够很好地表达现阶段HDR 显示设备的显示性能。因此,需要对光电转移函数进行改进,以适应HDR显示设备的升级。
HDR光电转移函数OETF主要有如下三种:感知量化(perceptual quantizer,PQ)光电转移函数、混合对数伽马(hybrid log-Gamma,HLG)光电转移函数和场景亮度保真(scene luminance fidelity,SLF)光电转移函数。这三种光电转移函数为音视频编码标准(audio video coding standard,AVS)标准规定的光电转移函数。
PQ光电转移函数是根据人眼的亮度感知模型提出的感知量化光电转移函数。参见图2,图2为PQ光电转移函数的图像。
PQ光电转移函数表示图像像素的线性信号值到PQ域非线性信号值的转换关系,PQ光电转移函数可以表示为公式(2):
Figure PCTCN2021089981-appb-000038
其中,式(2)中各参数的计算如下:
Figure PCTCN2021089981-appb-000039
其中,L表示线性信号值,其值归一化为[0,1],L'表示非线性信号值,其值取值范围为[0,1],m 1、m 2、c 1、c 2、c 3为PQ光电转移系数,
Figure PCTCN2021089981-appb-000040
Figure PCTCN2021089981-appb-000041
Figure PCTCN2021089981-appb-000042
HLG光电转移函数是在传统的Gamma曲线的基础上改进得到的。参见图3,图3为HLG光电转移函数的图像。
HLG光电转移函数在低段应用传统的Gamma曲线,在高段补充了log曲线。HLG光电转移函数表示图像像素的线性信号值到HLG域非线性信号值的转换关系,HLG光电转移函数可表示为公式(3):
Figure PCTCN2021089981-appb-000043
其中,L表示线性信号值,其取值范围为[0,12],L'表示非线性信号值,其取值范围为[0,1],a、b、c为HLG光电转移系数,a=0.17883277,b=0.28466892,c=0.55991073。
SLF光电转移函数是在满足人眼光学特性的前提下,根据HDR场景亮度分布获得的最优曲线。参见图4,图4为SLF光电转移函数的图像。
SLF光电转移曲线表示图像像素的线性信号值到SLF域非线性信号值的转换关系。图像像素的线性信号值到SLF域非线性信号值的转换关系如公式(4)所示:
Figure PCTCN2021089981-appb-000044
其中,SLF光电转移函数可以表示为公式(5):
Figure PCTCN2021089981-appb-000045
其中,L表示线性信号值,其值归一化为[0,1],L'表示非线性信号值,其值取值范围为[0,1],p、m、a、b为SLF光电转移系数,p=2.3,m=0.14,a=1.12762,b=-0.12762。
3、动态范围的映射方法主要应用在前端HDR信号和后端HDR的显示设备的适配过程中,包括从高到低的色调映射(tone-mapping)过程,以及从低到高的tone-mapping过程。例如,前端是采集到的4000nit的光照信号,而后端显示设备(例如电视剧、平板电脑等)的HDR显示能力只有500nit,因此将4000nit的光照信号映射到500nit的显示设备上,是一种从高到低的tone-mapping过程。又例如,前端是采集到的100nit的SDR光照信号,而后端显示设备的HDR显示能力为2000nit,因此将100nit的光照信号映射到2000nit的显示设备上,是一种从低到高的tone-mapping过程。
动态范围的映射方法可以分为静态的动态范围映射和动态的动态范围映射。静态的动态范围映射方法是根据同一个视频内容或者同一个硬盘内容,由单一的数据进行整体的色调映射过程,也就是同一个视频内容或者硬盘内容的处理曲线通常是一样的。这种方法的好处是携带的信息较少,并且处理流程比较简单。这种方法的缺点是每一个场景都使用同一曲线进行色调映射,这样在有一些场景会导致信息丢失。例如如果曲线重点保护的是亮区,那么在一些极其暗的场景会丢掉一些细节,或者干脆看不见,这样会影响用户体验。
动态的映射方法是根据特定区域,每一个场景或者根据每一帧的内容进行动态的调整。这种方法的好处是可以根据特定区域,每一场景或者每一帧进行不同的曲线处理,这样处理的图像显示结果会更好。但是,缺点是需要每一帧或者每一场景来携带相关的场景信息,携带的信息量较大。
目前,主要有以下五种tone-mapping技术。下面对这五种tone-mapping技术进行描述。
技术一为主要由杜比提出的基于sigmoid曲线的tone-mapping过程。图5示出了sigmoid曲线的示意图。参见图5,横坐标表示输入亮度,即动态范围调整前HDR图像的亮度,纵坐标表示输出亮度,即动态范围调整后图像的亮度。其中,该sigmoid曲线的形状为“S”型,曲线的斜率先上升后下降。例如,以该sigmoid曲线上的调整点为例,通过该sigmoid曲线,可以将亮度约为300cd/m 2的源调整等级(source adaptation level)映射为亮度约为30cd/m 2的目标调整等级(target adaptation level)。
技术二为基于贝塞尔曲线的tone-mapping过程。图6示出了贝塞尔曲线的示意图。其中,图6中横坐标表示输入亮度,即动态范围调整前HDR图像的亮度,纵坐标表示输出亮度,即动态范围调整后图像的亮度。其中,该贝塞尔曲线在输入亮度为0至K s的范围内为线性映射过程,输入亮度为K s至1的范围内为“S”型曲线,曲线的斜率先上升后下降。
技术三是一种基于人眼感知的S型曲线的tone-mapping过程。该曲线的形式如下公式 (6)所示:
Figure PCTCN2021089981-appb-000046
其中,L和L′表示归一化的电信号或光信号,a的取值范围为在0.0~1.0之间,b的取值范围在0.0~1.0之间,p、n和m的取值范围在0.1~N之间,N为大于0.1的有理数,L′为范围是0.0~1.0的有理数,L为范围是0.0~1.0的有理数,k1、k2、k3为有理数。。
技术四是一种结合三次样条和直线的S型曲线的tone-mapping过程。其中,部分的曲线的形式为如下公式(7)所示:
Figure PCTCN2021089981-appb-000047
其中,L和L′为归一化的电信号或者光信号。其中a的取值范围在0.0~1.0之间,b的取值范围在0.0~1.0之间,p、n和m的取值范围在0.1~N之间,N为大于0.1的有理数。L′为范围是0.0~1.0的有理数,L为范围是0.0~1.0的有理数,k1、k2、k3为有理数,k1、k2不同时为0,K3不为0。TH1[i]、TH2[i]、TH3[i]为范围是0.0~1.0的有理数。
技术五是另一种结合三次样条和直线的S型曲线的tone-mapping过程。其中,部分的曲线的形式为如下公式(8)所示:
Figure PCTCN2021089981-appb-000048
其中,L和L′为归一化的电信号或者光信号。其中a的取值范围在0.0~1.0之间,b的取值范围在0.0~1.0之间,p、n和m的取值范围在0.1~N之间,N为大于0.1的有理数。L′为范围是0.0~1.0的有理数,L为范围是0.0~1.0的有理数,k1、k2、k3为有理数。LT为预设有理数,范围是0.0~1.0的有理数。TH1[i]、TH2[i]、TH3[i]为范围是0.0~1.0的有理数。
在动态元数据中会发送与曲线参数相关的元数据。
对于技术一而言,在St2094-10杜比相关的动态元数据定义中,不单发送最大值(maximum PQ-encoded maxRGB)、最小值(minimum PQ-encoded maxRGB)、平均值(average PQ-encoded maxRGB)这些统计值,还发送色调映射偏移(tone mapping offset)、色调映射增益(tone mapping gain)和色调映射伽马(tone mapping gamma)等这些sigmoid曲线相关的参数。
对于技术2而言,在St2094-40相关的动态元数据定义中包含了直方图信息(distribution  MaxRGB),同时也包含了贝塞尔曲线参数(Bezier curve anchors)用于直接生成曲线。
而且St2094系列的标准中,元数据中都包含了目标系统显示实际峰值亮度(targeted system display actual peak luminance)。
对于技术三、技术四和技术五而言,元数据中可以传递最大值、最小值、平均值等信息,也可以传递p、m、a、b、n、K1、K2、K3等曲线参数。
在图像的最大亮度小于显示设备的最大显示亮度的情况下,可以采用上述技术一至技术五的动态范围的映射算法,将高动态范围图像调整到显示设备所能显示的动态范围内进行显示。但是,在图像的最大亮度与显示设备的最大显示亮度接近的情况下,若果仍然使用上述技术一至技术五的动态范围的映射算法,会导致映射之后的显示设备的像素的亮度比原始的图像还要亮的异常现象。
图7示出了图像的最大亮度与显示设备的最大显示亮度相同(例如均为500cd/m 2)时的tone-mapping曲线的示例。请参考图7,其中y=x的直线(两个端点分别为A(500,500)和B(0,0))对应于将输入亮度与输出亮度相同的tone-mapping曲线。根据该y=x的直线,显示设备设备上的像素的亮度与原始图像的亮度相同。例如,对于y=x上面的D点而言,输入亮度与输出亮度均为450cd/m 2
继续参考图7,对于“S”型曲线(两个端点分别为A(500,500)和B(0,0)例如技术一种的sigmoid曲线),则在输入亮度接近500cd/m 2的情况下,在输入亮度相同的情况下,通过“S”型曲线进行tone-mapping的输出亮度高于通过y=x进行tone-mapping的输出亮度。例如,对于与D点输入亮度相同的“S”型曲线上的E点,其输出亮度为480cd/m 2
有鉴于此,本申请提供一种动态范围映射的方法,在图像的最大亮度与显示设备的最大显示亮度接近的情况下,通过对原始的色调映射曲线的参数进行调整,使得调整后的参数对应的色调映射曲线的输出亮度不高于其输入亮度,从而有助于避免出现映射之后的显示设备的像素的亮度比原始的图像还要亮的异常现象。这里,该原始的色调映射曲线可以是根据图像数据的元数据中的目标系统显示实际峰值亮度调整好的固定曲线,例如上述技术一至技术五种的色调映射曲线。
图8示出了本申请实施例提供的动态范围映射的方法的系统架构的示意图。参见图8,前端通过采集和制作可以获取HDR内容,并将该HDR内容和该HDR内容的元数据经传输层发送给显示端。显示端可以包括HDR显示设备进而SDR显示设备。作为示例,当显示端包括HDR显示设备时,可以实现将HDR内容映射到HDR显示设备上,当显示端包括SDR显示设备时,可以实现将HDR内容映射到SDR显示设备上。
示例性的,显示端的产品形态可以为机顶盒、电视显示设备、手机显示设备,以及网络直播、视频应用的转换设备等电子设备。
作为示例,在机顶盒、电视显示设备或手机显示设备上,本申请实施例提供的方案可以以硬件芯片的形态实现,在网络直播或视频播放设备上,本申请实施例提供的方案主要以软件程序代码的形态实现,但是本申请实施例并不限于此。
需要说明的是,本申请实施例仅以图7中的应用场景为例进行描述,但是应用于本申请实施例的系统架构并不限于此。例如,前端还可以获取SDR内容,此时当显示端包括HDR显示设备,可以实现将SDR内容映射到HDR显示设备上。
图9为本申请实施例提供的动态范围映射的方法900的示意性流程图。方法900适用于图8中提供的应用场景,例如由图8中所示的显示端执行。参见图9,方法900包括如下步骤910至940。
910,获取图像数据的特征信息和本地显示设备的显示参数。这里,该图像数据(可表示为V)可以为HDR图像数据,或者SDR图像数据,本申请实施例对此不作限定。
示例性的,显示端设备可以从前端接收视频源,其中主要包含图像数据V,例如像素数据等。一个具体的例子,对于一个4K的视频源,其可以包括3840*2160个的像素点的亮度和颜色数据等。
需要说明的是,本申请实施例不对该图像数据V的格式做限定。例如,从像素数据的色彩空间来说,该图像数据V可以是Y(luminance)UV(chrominance)空间的图像数据,也可以是RGB像素空间的图像数据。又例如,从像素数据的位宽来说,该图像数据V可以是8位的位宽,也可以说10位,或者12位的位宽。
一些实施例中,在获取图像数据V的同时,还可以获取该图像数据的特征信息,例如从元数据(metadata)M中获取。其中,图像数据V的元数据M用于表示该图像数据的数据特征,例如可以包含图像数据的格式,或者该图像数据V对应的曲线参数M curve、目标系统显示实际峰值亮度M TPL(targeted system display actual peak luminance)、图像数据的内容的亮度的最大值MaxSource(所有像素的Y分量的最大、或者所有像素RGB分量的最大值的最大值)、最小值MinSource(所有像素的Y分量的最小、或者所有像素RGB分量的最大值的最小值)、平均值(所有像素的Y分量的平均值、或者所有像素RGB分量的最大值的平均值)、显示内容的变化范围等等,本申请实施例对此不作限定。
一些实施例中,还可以从图像数据V的像素信息中获取该图像数据的特征信息;或者使用预设值的图像数据的特征信息值,本申请实施例对此不作限定。
需要说明的是,当元数据M中包括曲线参数M curve时,本申请实施例不对曲线参数M curve的格式进行限定。例如,对于上文中的技术三而言,元数据中包括的曲线参数M curve可以是p、m、a、b、n、K1、K2、K3等。
一些实施例中,元数据包括动态元数据和静态元数据,可参见标准ST2094-1dynamic metadata for color volume transform或静态元数据的相关标准(static metadata)。示例性的,元数据可以跟随图像一起打包,例如包含不同文件格式,不同编码标准的SEI包,包括硬件的HDMI相关的一些包结构等。
一些实施例中,显示端设备还可以获取该显示端设备(即实际终端设备P,或本地显示设备)的显示参数M TPL(也可以称为显示亮度参数)。示例性的,显示参数M TPL可以包括显示端设备的最大显示亮度MaxDisplay和显示端设备的最小显示亮度MinDisplay,或者其他参数,本申请实施例对此不作限定。
920,获取图像数据的第一色调映射曲线的第一参数。
示例性的,显示端设备可以根据图像数据V的元数据M和显示端设备的显示参数M TPL,获取该图像数据V的第一色调映射曲线的第一参数。例如,根据元数据M中的图像数据V的内容的亮度的平均值average_maxrgb,和/或亮度的最大值MaxSource,和/或亮度的最小值MinSource,和/或显示端设备的最大显示亮度MaxDisplay,和/或显示端设备的最小显示亮度MinDisplay,和/或曲线参数M curve(p1,p2,…),和/或其他数据,获得第一色调映射 曲线的第一参数,可表示为P1 curve(X,p1,p2,…)。其中,X为输入亮度值,p1,p2,…为曲线参数值。
需要说明的是,本申请实施例中对第一色调映射曲线的第一参数P1 curve的形式不作限定。另外,本申请实施例对生成该第一参数P1 curve时所使用的数据,或者生成该第一参数P1 curve时的算法也不作限定。例如,生成第一参数P1 curve的数据可以是元数据,和/或显示端设备的显示参数,也可以是其他预设数据。
作为一个具体的例子,对于上文中的技术五而言,曲线参数M curve例如包括参数值(p、m、a、b、n、K1、K2、K3)和(TH1[i]、TH2[i]、TH3[i]、MB0),可以根据该曲线参数M curve获得第一色调映射曲线的第一参数P1 curve,例如为(p P1、m P1、a P1、b P1、n P1、K1 P1、K2 P1、K3 P1、TH1[i]、TH2[i]、TH3[i]、MD1[i]、MC1[i]、MB1[i]、MA1[i]、MD2[i]、MC2[i]、MB2[i]、MA2[i]、MB3)。
作为另一个具体的例子,对于上文中的技术四而言,曲线参数M curve例如包括参数值(p、m、a、b、n、K1、K2、K3)和(TH1[i]、TH2[i]、TH3[i]、MB0),可以根据该曲线参数M curve获得第一色调映射曲线的第一参数P1 curve,例如为(p P1、m P1、a P1、b P1、n P1、K1 P1、K2 P1、K3 P1、TH1[i]、TH2[i]、TH3[i]、MD1[i]、MC1[i]、MB1[i]、MA1[i]、MD2[i]、MC2[i]、MB2[i]、MA2[i])。
需要说明的是,本申请实施例中的第一色调映射曲线为上述原始色调映射曲线的一个示例,包括但不限于技术一、技术二、技术三、技术四和技术五中使用的色调映射曲线。本申请中的第一映射曲线的第一参数包括但不限于技术一、技术二、技术三、技术四、和技术五中使用的色调映射曲线相关的参数。
930,在预设条件成立时,根据所述特征信息、显示参数和第一参数,获取第二色调映射曲线的第二参数。其中,第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的该第一点处的输入亮度。也就是说,在第二色调映射曲线的输入亮度范围内,根据该第二色调映射曲线对任意一个输入亮度进行映射得到的输出亮度,都不高于该输入亮度。第二参数用于对图像数据进行动态范围映射,可以表示为R curve
作为示例,色调映射曲线的输入亮度可以是线性光,也可以是非线性值,还有可能是线性关系经过归一化后的值(例如10000作为1,或者内容的最大亮度作为1),本申请实施例对此不作限定。
示例性的,可以根据第一参数P1 curve,以及图像数据V的内容的亮度的平均值average_maxrgb,和/或亮度的最大值MaxSource,和/或亮度的最小值MinSource,和/或显示端设备的最大显示亮度MaxDisplay,和/或显示端设备的最小显示亮度MinDisplay,和/或其他数据,获取上述第二色调映射曲线的第二参数R curve
示例性的,第二参数R curve可以具有以下公式(9)所示的形态:
Figure PCTCN2021089981-appb-000049
Figure PCTCN2021089981-appb-000050
其中,L和L′为归一化的电信号或者光信号,Dark、TH3C、TH2D、TH3D、MD1D、MC1D、MB1D、MA1D、MD2D、MC2D、MB2D、MA2D为有理数。
在一些实施例中,该预设条件,例如为按照第一色调映射曲线对于图像数据进行色调映射,会造成第一色调映射曲线上的某一点的输出亮度高于该第一色调映射曲线上的该点的输入亮度。
需要说明的是,本申请实施例中,在色调映射曲线的输出亮度与输入亮度相差在第一范围之内的情况下,可以认为该输出亮度与输入亮度是基本相同的。也就是说,在色调映射曲线的输出亮度高于输入亮度的部分在第一范围之内时,可以认为二者是基本相同的。反之,在色调映射曲线的输出亮度高于输入亮度的部分超出第一范围时,可以认为输出亮度高于输入亮度。
当满足预设条件,即按照第一参数对图像数据进行色调映射,会造成第一色调映射曲线的输出亮度高于第一色调映射曲线的输入亮度时,执行生成上述第二色调映射曲线的第二参数R curve的过程。
作为一种可能的实现方式,上述预设条件可以为第一参数中的参数p P1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的a P1,以及预设的a P1与p P1的对应关系获得的。其中,Tp表示技术三或技术四或技术五中的曲线参数p的阈值。当第一参数p P1超过了Tp时,就有可能出现第二色调映射曲线上的某一点处输出亮度高于输入亮度的现象。
作为一个具体的例子,对于上文中的技术四或技术五而言,第一参数P1 curve中包括a P1、p P1等参数。此时,可以将a P1作为Ta,查找表Tpa(Tp,Ta)得到对应的第一值Tp。这里,该表Tpa(Tp,Ta)即为预设的a P1与p P1的对应关系的一个示例。其中,Ta表示技术三或技术四或技术五中的曲线参数a的阈值。
如果p P1大于Tp,则满足预设条件。可选的,此时可以将第一参数P1 curve中p P1替换为查表获得的该第一值Tp。这样,替换后的该第一参数P1 curve即可以为上述第二参数R curve
如果p P1小于或等于Tp,则不需要执行生成第二色调映射曲线的第二参数R curve的过程。
作为另一种可能的实现方式,上述预设条件可以为第一参数中的参数a P1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的p P1,以及预设的a P1与p P1的对应关系获得的。当第一参数a P1超过了Ta时,就有可能出现第二色调映射曲线上的某一点处输出亮度高于输入亮度的现象。
作为一个具体的例子,对于上文中的技术四或技术五而言,第一参数P1 curve中包括a P1、p P1等参数。此时,可以将p P1作为Tp,查找表Tpa(Tp,Ta)得到对应的第二值Ta。这里,该表Tpa(Tp,Ta)即为预设的a P1与p P1的对应关系的一个示例。
如果a P1大于Ta,则满足预设条件。可选的,此时可以将第一参数P1 curve中的a P1替换为查表获得的第二值Ta。这样,替换后的该第一参数中即可以为上述第二参数R curve
如果a P1小于或等于Ta,则不需要执行生成第二色调映射曲线的第二参数R curve的过程。
在上面的示例中,表Tpa(Tp,Ta)为预设的有理数组合,例如(3.5,0.879),(4.5,0.777)等。需要说明的是,对于表中未出现的值,可以使用线性差值、临近值,或者临近值的加 权平均值等方式生成该值。另外,本申请实施例对表Tpa(Tp,Ta)的具体形式不作限定,例如表Tpa(Tp,Ta)还可以表示为Tp与Ta之间的函数关系。
作为另一种可能的实现方式,上述预设条件为第一参数中的参数a P1与参数p P1的乘积大于第三值Tap,其中,该第三值Tap为预设的有理数。示例性的,该第三值Tap可以为3~4之间的有理数,例如3.2或3.4,本申请实施例对此不作限定。
作为一个具体的例子,对于上文中的技术四或技术五而言,第一参数P1 curve中包括a P1、p P1等参数。此时,可以判断参数a P1与参数p P1的乘积a P1*p P1是否大于预设值Tap。
如果a P1*p P1大于Tap,则满足预设条件。可选的,此时可以将第一参数P1 curve中的p P1替换为Tap/a P1,或者将所述第一参数中的a P1替换为Tap/p P1。这样,替换后的该第一参数中即可以为上述第二参数R curve
如果a P1*p P1小于或等于Tap,则不需要执行生成第二色调映射曲线的第二参数R curve的过程。
在另一些实施例中,还可以将第一色调映射曲线对应的第一参数P1 curve转换到绝对亮度空间,例如线性空间,或者PQ、HLG等非线性空间,此时需要保证y和x相同大小的值亮度相同。然后,可以根据该第一色调映射曲线与y=x直线是否有交点来判断第一色调映射曲线存在高于y=x的部分。例如,当第一色调映射曲线与y=x直线有交点时,可以确定第一色调映射曲线存在高于y=x的部分,当第一色调映射曲线与y=x没有交点时,可以确定第一色调映射曲线不存在高于y=x的部分。
因此,本申请实施例通过对第一色调映射曲线的参数进行进一步的调整,使得调整后的曲线参数(即第二参数)对应的色调映射曲线(即第二色调映射曲线)上的某一点的输出亮度不高于该点对应的输入亮度,从而有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的终端设备的像素的亮度比原始的图像还要亮的异常现象。
在一些可选的实施例中,上述第二参数还包括一次样条曲线参数,该一次样条曲线参数包括该第二色调映射曲线中的一次样条(可以记为第一一次样条)的区间像素点的亮度值的最大值TH3C(也可以称为第一最大输入亮度TH3C),以及该第一一次样条的斜率Dark。示例性的,第一一次样条例如为上文公式(9)中的输入亮度小于TH3C的色调映射曲线,即Dark×L,L<TH3C。其中,L<TH3C为该第一一次样条的区间像素点。
可选的,显示端设备可以获取该第一一次样条的初始区间像素点的亮度值的最大值TH3C0(也可以称为初始第一最大输入亮度TH3C0),和初始斜率Dark0,然后根据该初始第一最大输入亮度TH3C0,确定上述第一最大输入亮度TH3C,以及根据该初始斜率Dark0,确定斜率Dark。
以下是本申请实施例提供的三种获取初始第一最大输入亮度TH3C0的方法。
方法一
显示端设备可以根据第一参数P1 curve,确定上述初始第一最大输入亮度TH3C0。示例性的,当第一色调映射曲线存在一次样条(可以记为第二一次样条,例如上文中的技术二、技术四或技术五)时,可以确定初始第一最大输入亮度TH3C0为第二一次样条的区间像素点的亮度值的最大值。
方法二
显示端设备根据预设值,确定所述初始第一最大输入亮度TH3C0。示例性的,该预设值可以为暗视觉与亮视觉的分解,即人眼视锥细胞与视杆细胞相应强弱发生变化的亮度,比如1nit。
方法三
显示端设备根据图像数据V的元数据M,确定所述初始第一最大输入亮度TH3C0。其中,该元数据M包括直方图暗区像素数量的特征数据,例如直方图暗区像素数量的特征亮度位置,或者暗区像素从暗到亮像素数/累计像素数显著变化的亮度,或者从0到特征亮度累计的像素数占总像素大于预设比例。
以下是本申请实施例提供的三种获取初始斜率Dark0的方法。
方法一
显示端设备可以根据第一参数P1 curve,确定该初始斜率Dark0。示例性的,当第一色调映射曲线存在一次样条(例如第二一次样条)时,可以确定初始斜率Dark0为该第二一次样条的斜率,例如技术四或技术五中的MB0。
方法二
显示端设备可以根据第四值和上述第一最大输入亮度TH3C的比值,确定该初始斜率Dark0,其中所述第四值为所述第一色调映射曲线在所述第一最大输入亮度TH3C处的输出值,例如第四值可以表示为Vdark=P1 curve(TH3C),此时该初始斜率Dark0可以表示为(Vdark/TH3C)。
方法三
显示端设备可以根据所述第一色调映射曲线在0至所述第一最大输入亮度TH3C之间预设输入值的斜率值,确定所述初始斜率Dark0。例如可以为0至所述第一最大输入亮度TH3C之间的斜率值的平均值,或者最大值,或者中间值等,本申请对此不作限定。
需要说明的是,以上获取初始最大输入亮度TH3C0,或者初始斜率Dark0的方式仅作为示例,并不对本申请实施例构成限定,例如通过与上述方法类似的方式,或者通过对上述方法进行惯用手段的置换获得的初始最大输入亮度TH3C0,或者初始斜率Dark0的方式也在本申请实施例的保护范围之内。
以下是本申请实施例提供的两种根据初始第一最大输入亮度TH3C0和初始斜率Dark0,获取第二目标色调映射曲线的第一最大输入亮度TH3C和斜率Dark的方法。
方法一
可以根据以下公式(10)和(11),确定上述第一最大输入亮度TH3C和斜率Dark,即第一初始最大输入亮度TH3C0、第一最大输入亮度TH3C、初始斜率Dark0和斜率Dark满足下面公式(10)和(11)。
TH3C=TH3C0+(MaxSource-TH3C0)*(WA) N2       (10)
Dark=Dark0+(1-Dark0)*(WA) N1      (11)
其中,
Figure PCTCN2021089981-appb-000051
Figure PCTCN2021089981-appb-000052
其中,N1和N2为大于0的有理数,H(L)为色调映射曲线、G(L)为所述H(L)的逆函数。
方法二
可以根据以下公式(12)和(13),确定第一最大输入亮度TH3C和斜率Dark,即第一初始最大输入亮度TH3C0、第一最大输入亮度TH3C、初始斜率Dark0和斜率Dark满足下面公式(12)和(13)。
TH3C=TH3C0+(MaxLum-TH3C0)*(WA) N2       (12)
Dark=Dark0+(1-Dark0)*(WA) N1        (13)
其中,
Figure PCTCN2021089981-appb-000053
Figure PCTCN2021089981-appb-000054
其中,MaxLum为图像数据最大亮度MaxSource的调整值,H(L)为色调映射曲线函数,G(L)为所述H(L)的逆函数。需要说明的是,对于由MaxSource到MaxLum的调整方式,本申请实施例不做限定。
示例性的,对于下面公式(14-1)中的色调映射曲线而言,其逆函数G(L)为公式(15-1)所示。
Figure PCTCN2021089981-appb-000055
Figure PCTCN2021089981-appb-000056
示例性的,对于下面公式(14-2)中的色调映射曲线而言,其逆函数G(L)为公式(15-2)所示。
Figure PCTCN2021089981-appb-000057
Figure PCTCN2021089981-appb-000058
本申请实施例中,在根据第二参数对图像数据进行动态范围映射时,在图像数据的暗区可以使用该直线部分进行色调映射,这样可以控制亮度的增益,同时更方便控制第二参数从直线逐渐变化到y=x的直线,其中y=x的直线相当于色调映射曲线上任一点的输出亮度等于输入亮度,因此本身实施例对于亮度渐变的内容不容易引起闪烁的现象。
在一些可选的实施例中,上述第二色调映射曲线还包括三次样条曲线,该第二参数R curve中还包括第二色调映射曲线的第一三次样条的第一区间像素点的亮度值的最小值。此时,显示端设备可以根据第二色调映射曲线中的一次样条的区间像素点的亮度值的最大值TH3C,即上述第一最大输入亮度TH3C,确定该第一三次样条的第一区间像素点的亮度值的最大值TH1D。示例性的,该第一区间像素点的亮度值的最大值TH1D可以等于第一最大输入亮度TH3C,即TH1D=TH3C。
示例性的,该第一三次样条对应的色调映射曲线可以为上文公式(9)中输入亮度范围为大于或等于TH3C且小于TH2D的色调映射曲线,即MD1D×(L-TH1D) 3+MC1D×(L-TH1D) 2+MB1D×(L-TH1D)+MA1D,TH1D≤L<TH2D,其中,TH1D≤L<TH2D为该第一区间像素点。
其中,第二参数R curve中还包括该第一三次样条的第一区间像素点的亮度值的最大值TH2D,也可以称为第二最大输入亮度TH2D。示例性的,可以根据上文中的第一区间像素点的亮度值的最大值TH1D,确定该第二最大输入亮度TH2D。
在一些可选的实施例中,第二参数R curve中还包括第二色调映射曲线的第二三次样条的第二区间像素点的亮度值的最大值TH3D,也可以称为第三最大输入亮度TH3D。可选的,该第二区间像素点的亮度值的最小值可以为上述TH2D。示例性的,该第二三次样条对应的色调映射曲线为可以上文公式(9)中输入亮度范围为大于或等于TH2D且小于TH3D的色调映射曲线,即MD2D×(L-TH2D) 3+MC2D×(L-TH2D) 2+MB2D×(L-TH2D)+MA2D,TH2D≤L≤TH3D,其中,TH2D≤L≤TH3D为该第二区间像素点。
示例性的,显示端设备可以根据上述第一区间像素点的亮度值的最大值TH1D和第二最大输入亮度TH2D,确定第三最大输入亮度TH3D。
以下是本申请实施例提供的三种确定第二最大输入亮度TH2D和第三最大输入亮度TH3D的方法。
方法一
显示端设备可以根据所述第一区间像素点的亮度值的最大值TH1D和所述第一参数中的TH1[0]、TH2[0]、TH3[0](或者元数据M中包含的参数TH1[0]、TH2[0]、TH3[0]),确定该第二最大输入亮度TH2D。示例性的,TH2D和TH3D可以分别满足以下公式(16-1) 和公式(17-1):
TH2D=TH1D+TH2[0]-TH1[0]                    (16-1)
TH3D=TH2D+TH3[0]-TH2[0]                    (17-1)
方法二
显示端设备可以根据所述第一区间像素点的亮度值的最大值TH1D和所述第一参数中的deltaTH2[0]、deltaTH3[0](或者元数据M中包含的参数deltaTH2[0]、deltaTH3[0]),确定该第二最大输入亮度TH2D。示例性的,TH2D和TH3D可以分别满足以下公式(16-2)和公式(17-2):
TH2D=TH1D+deltaTH2[0]                   (16-2)
TH3D=TH2D+deltaTH3[0]                    (17-2)
方法三
显示端设备可以根据TH1D和预设值,确定TH2D和TH3D。示例性的,TH2D和TH3D可以分别满足以下公式(18)和公式(19):
TH2D=TH1D+B                        (18)
TH3D=TH2D+C*TH2D-D*TH1D                (19)
其中,B为大于0的有理数,例如可以为暗区过渡区像素点的亮度值对应的偏移值,默认值可以为0.15;C和D为大于0的有理数,例如为亮区像素点的亮度值对应的加权系数,默认值可以为0.5。
可选的,可以确定第二参数R curve中(即公式(9)中)的MD1D、MC1D、MB1D、MA1D、MD2D、MC2D、MB2D、MA2D等参数。示例性的,可以根据以下公式(14)至(19)来确定这些参数。
在一些实施例中,上述第二色调映射曲线的第一三次样条的第一区间像素点的亮度的最小值TH1D与上述第一最大输入亮度TH3C(即第一一次样条的区间像素点的亮度值的最大值TH3C)相同。这样,能够使得第二色调映射曲线的一次样条的区间像素点与第一三次样条的第一区间像素点连续。并且该第二色调映射曲线中的第一一次样条和第一三次样条在TH1D处的输出值相同,且该第二色调曲线中的第一一次样条和第一三次样条在TH1D处的一阶导数相同,即该第二色调映射曲线在TH1D处连续。
示例性的,对于公式(9)中的R curve参数而言,当第二色调映射曲线在TH1D处连续时,MA1D、Dark、TH3C、MB1D满足以下公式(20)和(21):
Dark×TH3C=MA1D                      (20)
Dark=MB1D                         (21)
在一些实施例中,上述第二三次样条的第二区间像素点的亮度值的最大值与第一三次样条的第一区间像素点的亮度值的最大值TH2D,即第二最大输入亮度TH2D相同,该第二三次样条和第一三次样条在TH2D处的输出值相同。这样,能够使得第二色调映射曲线的第一三次样条的第一区间像素点与第二三次样条的第二区间像素点连续。并且该第二三次样条和第一三次样条在TH2D处的一阶导数相同,即第二色调映射曲线在TH2D处连续。
示例性的,对于公式(9)中的R curve参数而言,当第二色调映射曲线在TH2D处连续时,MD1D、TH3C、MC1D、MB1D、MA1D、MD2D、TH2D、MB2D、MA2D满足以下 公式(22)和(23)
MD1D×(TH2D-TH3C) 3+MC1D×(TH2D-TH3C) 2+MB1D×(TH2D-TH3C)+MA1D=MA2D
               (22)
3×MD1D×(TH2D-TH3C) 3+2×MC1D×(TH2D-TH3C)+MB1D=MB2D     (23)
在一些实施例中,第二参数还包括第二色调映射曲线的色调映射子函数的曲线参数,该色调映射子函数的第三区间像素点的亮度值的最小值与上述第二三次样条的第二区间像素点的亮度值的最大值TH3D,即第三最大输入亮度TH3D相同。这样,能够使得第二色调映射曲线的第二三次样条的第二区间像素点与色调映射子函数对应的第二区间像素点连续。并且,该第二三次样条和色调映射子函数在所述TH3D处的输出值相同,且该第二三次样条和色调映射子函数在TH3D处的一阶导数相同,即第二色调映射曲线在TH3D处连续。
示例性的,对于公式(9)中的R curve参数而言,当第二色调映射曲线在TH3D处连续时,MD2D、TH3D、TH2D、MC2D、MB2D、MA2D、MD2D、MC2D、MB2D满足以下公式(24)和(25)
MD2D×(TH3D-TH2D) 3+MC2D×(TH3D-TH2D) 2+MB2D×(TH3D-TH2D)+MA2D=P curve(TH3D)         (24)
Figure PCTCN2021089981-appb-000059
另外,一些实施例中,可以根据预设策略获取上述两段三次样条(即第一三次样条和第二三次样条)在TH2D处的值。例如,这两段三次样条在TH2D处的值可以是第二色调映射曲线上的输入亮度为TH1D和TH3D的两个点连线的中间点的值。
本申请实施例中,第二色调映射曲线中的三次样条曲线,一方面可以平滑连接一次样条曲线和基础曲线,另一方面可以有助于方便控制与直线部分相邻的部分的增益。
需要说明的是,本申请实施例中,可以只包含获取第二参数中的一次样条参数的过程,而并不需要涉及获得第二参数中除该一次样条参数之外的参数的过程。
940,根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。示例性的,在获取第二参数之后,可以获取第二色调映射曲线,用于对图像数据进行动态范围映射。
示例性的,根据上述公式(9),可以获得从归一化的HDR/SDR源数据映射到归一化的HDR/SDR显示数据之间的映射关系。例如,可以根显示端设备的最大显示能力、最小小时能力(例如为0),将映射值L′反向归一化到显示端设备的最大显示能力、最小显示能力之间。需要说明的是,上面的反向归一化计算可以是PQ的非线性空间,也可以是归一化0~1的线性空间。另外,反向归一化可以是0-10000nit,也可以是0.0001-100000nit等。本申请实施例对于HDR/SDR映射数据L′的反向归一化范围和过程不作限定。
需要说明的是,在获取第二色调映射曲线之后,后续显示适配处理不但包含色调映射(tone-mapping),在显示之前还可以对其进行进一步调整以调整其饱和度处理,和/或色域变换处理,和/或去噪处理,和/或锐化处理等等,本申请实施例对此不做限定。
还需要说明的是,显示端设备的最大显示能力可以根据设备的参数或者生产商的信息获取。显示端设备的最小值显示能力,通常为0nit,也可以为1nit,本申请实施例对此不做 限定。
因此,本申请实施例通过对色调映射曲线的参数进行进一步的调整,使得调整后的曲线参数对应的色调映射曲线的输出亮度不高于该色调映射曲线的输入亮度,从而有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的显示设备的像素的亮度比原始的图像还要亮的异常现象。因此,本申请实施例对于不同亮度的终端显示设备均能提供较大的灵活性,从而在合理调整参数的情况下达到较好的呈现效果。
在本申请一些可选的实施例中,所述第二参数中的一次样条曲线参数(可以记为第一一次样条曲线参数),可以包括第二色调映射曲线中的第一一次样条的斜率(例如可以表示为MB[0][0])和该第一一次样条的区间像素点的亮度值的最大值(例如可以表示为TH3[0])。
在本申请一些可选的实施例中,所述第二参数中的一次样条曲线参数(可以记为第一一次样条曲线参数),可以包括第二色调映射曲线中的第一一次样条的斜率(例如可以表示为MB[0][0])和该第一一次样条的区间像素点的亮度值的最大值(例如可以表示为TH3[0])以及该第一一次样条与纵坐标轴交点base_offset。
在该实施例中,上述第一参数中包括的一次样条曲线参数(可以记为第二一次样条曲线参数),可以包括所述第一色调映射曲线中的第二一次样条的斜率(例如可以表示为MB_mid[0][0])和/或该第二一次样条的区间像素点的亮度值的最大值(例如可以表示为TH3_mid[0])。
此时,在预设条件成立时,根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数的一种实现方式可以为:根据最大显示亮度MaxDisplay、最大亮度校正值max_lum,对曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取曲线参数MB[0][0]和TH3[0]。
示例性的,如果参数m_a(即色调映射曲线参数a)大于Tm_ap(m_p),则执行生成第二参数的过程,即根据max_lum/MaxDisplay来调整MB[0][0]和TH3[0]。其中,Tm_ap可以是根据预设m_p_T与m_a_T的映射关系,例如查表(m_p_T,m_a_T)获得的,m_p对应色调映射曲线参数p,将根据m_p获得的m_a的预设值Tm_ap(m_p)为m_a_T。
示例性的,在对曲线参数MB_mid[0][0]和TH3_mid[0]进行调整时,输入可以为显示端设备的显示亮度范围的最高显示亮度MaxDisplay(PQ域的值),待处理帧的最大亮度校正值max_lum,元数据中的targeted_system_display_maximum_luminance(如果元数据中不存在targeted_system_display_maximum_luminance,则targeted_system_display_maximum_luminance等于MaxDisplay);原始一次样条曲线(即第一色调映射曲线中的一次样条曲线)参数,MB[0][0],TH3[0];色彩信号映射曲线参数Ptone_mapping,包含m_p、m_m、m_n、m_a、m_b、k1、k2、k3。输出可以为一次样条曲线(即第二色调映射曲线的一次样条)参数,MB[0][0],TH3[0]。
作为一种可能的实现方式,曲线参数MB_mid[0][0]和TH3_mid[0],以及曲线参数MB[0][0]和TH3[0],满足以下公式(26)和(27):
TH3[0]=TH3_mid[0]+(MaxSource-TH3_mid[0])*(WA) N2       (26)
MB[0][0]=MB_mid[0][0]+(1-MB_mid[0][0])*(WA) N1        (27)
其中,
Figure PCTCN2021089981-appb-000060
或者
Figure PCTCN2021089981-appb-000061
其中N1和N2为大于0的有理数,G(L)为映射曲线参数T curve的逆函数。
作为另一种可能的实现方式,曲线参数MB_mid[0][0]和TH3_mid[0],以及曲线参数MB[0][0]和TH3[0],满足以下公式(28)和(29):
TH3[0]=TH3_mid[0]+(MaxLum-TH3_mid[0])*(WA) N2      (28)
MB[0][0]=MB_mid[0][0]+(1-MB_mid[0][0])*(WA) N1       (29)
其中,
Figure PCTCN2021089981-appb-000062
或者
Figure PCTCN2021089981-appb-000063
其中MaxLum为最大亮度校正值(MaxSource的调整值),G(L)为映射曲线参数T curve的逆函数。
作为另一种可能的实现方式,曲线参数MB_mid[0][0]和TH3_mid[0],以及曲线参数MB[0][0]和TH3[0],满足以下公式(30)和(31):
Figure PCTCN2021089981-appb-000064
Figure PCTCN2021089981-appb-000065
其中,
Figure PCTCN2021089981-appb-000066
或者
Figure PCTCN2021089981-appb-000067
其中
Figure PCTCN2021089981-appb-000068
或者
Figure PCTCN2021089981-appb-000069
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值,H(L,m_a_T)同理,N1、N2为有理数,例如N1、N2的默认值可以为0。max(a,b)表示求a和b中较大的一个值;min(a,b)表示求a和b中较小的一个值。
在一些实施例中,k1、k2不同时为0,K3不为0。
示例性的,H(L)为以下几种示例:
Figure PCTCN2021089981-appb-000070
或者
Figure PCTCN2021089981-appb-000071
在本申请一些可选的实施例中,上述第一参数可以包括第二一次样条曲线参数,该第二一次样条曲线参数包括该第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或该第二一次样条的区间像素点的亮度值的最大值TH3_mid[0]和/或该第一一次样条与纵坐标轴交点base_offset_mid,该显示参数包括该终端设备的最大显示亮度MaxDisplay,该特征信息包括该图像数据的最大亮度校正值max_lum。
其中,根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid进行调整,获取所述曲线参数MB[0][0]、TH3[0]和/或base_offset。
作为一种可能的实现方式,曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid,以及曲线参数MB[0][0]、TH3[0]和/或base_offset,满足以下公式:
Figure PCTCN2021089981-appb-000072
Figure PCTCN2021089981-appb-000073
Figure PCTCN2021089981-appb-000074
其中,
Figure PCTCN2021089981-appb-000075
Figure PCTCN2021089981-appb-000076
或者
Figure PCTCN2021089981-appb-000077
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2、N3为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000078
或者,
Figure PCTCN2021089981-appb-000079
需要说明的是,本申请实施例中,可以只包含获取第二参数中的一次样条参数的过程,而并不需要涉及获得第二参数中除该一次样条参数之外的参数的过程,即可以不需要涉及以下处理过程。
在一些可选的实施例中,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。示例性的,TH1[1]可以为TH1D的一个示例,TH2[1]可以为TH2D的一个示例,TH3[1]可以为TH3D的一个示例。
作为一种可能的实现方式,上述三次样条的插点值TH1[1]、TH2[1]、TH3[1]可以根据所述第一参数中第二一次样条曲线参数TH3[0]和三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值的预设偏移值,计算得到。示例性的,TH1[1]、TH2[1]、TH3[1]满足如下公式(32)至(34):
TH1[1]=TH3[0]        (32)
TH2[1]=TH1[1]+B         (33)
TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1]             (34)
其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。示例性的,B的默认值可以为0.15,C和D的默认值可以为0.5。
作为另一种可能的实现方式,上述三次样条的插点值TH1[1]、TH2[1]、TH3[1]可以根据所述第一参数中第二一次样条曲线参数TH3[0]和三次样条的插点值TH1[1]、TH2[1]、TH3[1]的计算相关值,计算得到。示例性的,TH1[1]、TH2[1]、TH3[1]满足如下公式(35)至(37):
TH1[1]=3Spline_TH[i][0][w]                  (35)
TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]     (36)
TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w]
                    (37)
其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值。
在一些可选的实施例中,可以获取在第二色调映射曲线中TH1[1]、TH2[1]、TH3[1]对应的坐标(例如Y坐标),例如分别可以表示为VA1,VA2和VA3。其中,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
在一些可选的实施例中,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
在一些可选的实施例中,其特征在于,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
示例性的,可以根据上述第二色调映射曲线中的一次样条,获得公式(38):
F(L)=MB[0][0]×L                    (38)
然后,将L设置为TH[1],计算得到TH[1]的坐标VA1,满足下式(39):
VA1=MB[0][0]×TH[1]                      (39)
接下来,根据上述第二色调映射曲线中的第一三次样条,获取MA[0][1],MA[1][1],满足下式(40)和(41):
MA[0][1]=VA1                       (40)
MA[1][1]=VA2                      (41)
然后,计算第二色调映射曲线中的第一三次样条的一阶导数GD1,使MB[0][1]=GD1,并计算第二色调映射曲线中的第二三次样条在TH3[1]处的一阶导数GD3,满足下式(42)和(43):
MB[0][1]=GD1=MB[0][0]                 (42)
GD3=m_a×m_m×m_p×K3×m_n×TH3[1] m_m-1×DGD3(L)    (43)
其中,
Figure PCTCN2021089981-appb-000080
之后,计算第二色调映射曲线中第一个三次样条(即第一三次样条)曲线在TH2[1]处的数值VA2[0],计算第二个三次样条(即第二三次样条)曲线在TH3[1]处的数值VA3[0],并使得VA3[0]=VA3。
计算第二个三次样条曲线在TH3[1]处的导数GD3[0],使得GD3[0]=GD3。
计算该第一个三次样条曲线和第二个三次样条曲线分别在TH2[1]的一阶导数GD2[0]、GD2[1],使得GD2[0]=GD2[1]。
计算两个三次样条曲线在TH2[1]处的二阶导数GGD2[0]、GGD2[1],使GGD2[0]=GGD2[1]。
综上可得以下公式(44):
Figure PCTCN2021089981-appb-000081
其中,DTH2=(TH2[1]-TH1[1]),DTH3=(TH3[1]-TH2[1])。
通过上述计算,结合其他条件可以获得第二参数中的MC[0][1],MD[0][1],MB[1][1],MC[1][1],MD[1][1]等参数。
因此,本申请实施例通过对第一色调映射曲线的参数进行进一步的调整,使得调整后的曲线参数(即第二参数)对应的色调映射曲线(即第二色调映射曲线)上的某一点的输出亮度不高于该点对应的输入亮度,从而有助于在图像的最大显示亮度与显示设备的最大显示亮度接近时,避免出现映射之后的终端设备的像素的亮度比原始的图像还要亮的异常现象。
上文结合图9对本申请实施例的动态范围映射的方法进行了详细的描述,下面结合图10和图11对本申请实施例的动态范围映射的装置进行描述,应理解,图10和图11所描述的动态范围映射的装置能够执行图9所示的动态范围映射的方法的各个步骤,上文图9中对各个步骤的限定同样适用于图10和图11所示的装置,因此,下面在描述图10和图11所示的装置时,为了简洁,适当省略重复的描述。
图10是本申请实施例的动态范围映射的装置1000的示意性框图。装置1000包括获取单元1010,处理单元1020和映射单元1030。
获取单元1010,用于获取终端设备的显示参数。
所述获取单元1010还用于获取图像数据的特征信息。
所述获取单元1010还用于获取所述图像数据的第一色调映射曲线的第一参数。
处理单元1020,用于在预设条件成立时,根据所述第一参数、所述终端设备的显示参数和所述图像数据的特征信息,得到第二色调映射曲线的第二参数,其中,所述第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的所述第一点的输入亮 度。
映射单元1030,用于根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。
在本申请某些实现方式中,符合下列任意之一的条件时,则所述预设条件成立:
根据所述第一参数对于图像数据进行色调映射时,所述第一色调映射曲线上第二点处的输出亮度高于所述第一色调映射曲线上的所述第二点处的输入亮度;或者
所述第一参数中的参数pP1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的aP1,以及预设的aP1与pP1的对应关系获得的;或者
所述第一参数中的参数aP1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的pP1,以及预设的aP1与pP1的对应关系获得的;或者
所述第一参数中的参数aP1与参数pP1的乘积大于第三值Tap,其中,所述第三值Tap为预设的有理数。
在本申请某些实现方式中,所述第二参数包括第一一次样条曲线参数,所述第一一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的斜率MB[0][0]或所述第一一次样条的区间像素点的亮度值的最大值TH3[0]。
在本申请某些实现方式中,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
其中,处理单元1020具体用于:
根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取所述曲线参数MB[0][0]和TH3[0]。
在本申请某些实现方式中,所述曲线参数MB_mid[0][0]和TH3_mid[0],以及所述曲线参数MB[0][0]和TH3[0],满足以下公式:
Figure PCTCN2021089981-appb-000082
Figure PCTCN2021089981-appb-000083
其中,
Figure PCTCN2021089981-appb-000084
或者
Figure PCTCN2021089981-appb-000085
其中
Figure PCTCN2021089981-appb-000086
或者
Figure PCTCN2021089981-appb-000087
其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值,同理H(L,m_a_T),N1、N2为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
Figure PCTCN2021089981-appb-000088
或者,
Figure PCTCN2021089981-appb-000089
在本申请某些实现方式中,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。
在本申请某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的预设偏移值得到的,如下所示:
TH1[1]=TH3[0];
TH2[1]=TH1[1]+B;
TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1];
其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。
在本申请某些实现方式中,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值计算得到的,如下所示:
TH1[1]=3Spline_TH[i][0][w];
TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值。
在本申请某些实现方式中,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
在本申请某些实现方式中,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
在本申请某些实现方式中,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
在本申请某些实现方式中,所述获取单元1010具体用于:
获取所述图像数据的元数据;
根据所述元数据以及所述显示参数,确定所述第一色调映射曲线的第一参数。
图11是本申请实施例的动态范围映射的装置1100的硬件结构示意图。图11所示的装置1100可以看成是一种计算机设备,装置1100可以作为本申请实施例的动态范围映射的装置的一种实现方式,也可以作为本申请实施例的动态范围映射的方法的一种实现方式,装置1100包括处理器1101、存储器1102、输入/输出接口1103和总线1105,还可以包括通信接口1104。其中,处理器1101、存储器1102、输入/输出接口1103和通信接口1104通过总线1105实现彼此之间的通信连接。
处理器1101可以采用通用的中央处理器(central processing unit,CPU),微处理器,应用专用集成电路(application specific integrated circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的处理媒体数据的装置中的模块所需执行的功能,或者执行本申请方法实施例的处理媒体数据的方法。处理器1101可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器701中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1101可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1102,处理器1101读取存储器1102中的信息,结合其硬件完成本申请实施例的处理媒体数据的装置中包括的模块所需执行的功能,或者执行本申请方法实施例的处理媒体数据的方法。
存储器1102可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器1102可以存储操作系统以及其他应用程序。在通过软件或者固件来实现本申请实施例的处理媒体数据的装置中包括的模块所需执行的功能,或者执行本申请方法实施例的处理媒体数据的方法时,用 于实现本申请实施例提供的技术方案的程序代码保存在存储器1102中,并由处理器1101来执行处理媒体数据的装置中包括的模块所需执行的操作,或者执行本申请方法实施例提供的处理媒体数据的方法。
输入/输出接口1103用于接收输入的数据和信息,输出操作结果等数据。
通信接口1104使用例如但不限于收发器一类的收发装置,来实现装置1100与其他设备或通信网络之间的通信。可以作为处理装置中的获取模块或者发送模块。
总线1105可包括在装置1100各个部件(例如处理器1101、存储器1102、输入/输出接口1103和通信接口1104)之间传送信息的通路。
应注意,尽管图11所示的装置1100仅仅示出了处理器1101、存储器1102、输入/输出接口1103、通信接口1104以及总线1105,但是在具体实现过程中,本领域的技术人员应当明白,装置1100还包括实现正常运行所必须的其他器件,例如还可以包括显示器,用于显示要播放的视频数据。同时,根据具体需要,本领域的技术人员应当明白,装置1100还可包括实现其他附加功能的硬件器件。此外,本领域的技术人员应当明白,装置1100也可仅仅包括实现本申请实施例所必须的器件,而不必包括图11中所示的全部器件。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述动态范围映射的方法。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述动态范围映射的方法。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (28)

  1. 一种动态范围映射的方法,其特征在于,包括:
    获取终端设备的显示参数;
    获取图像数据的特征信息;
    获取所述图像数据的第一色调映射曲线的第一参数;
    在预设条件成立时,根据所述第一参数、所述终端设备的显示参数和所述图像数据的特征信息,得到第二色调映射曲线的第二参数,其中,所述第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的所述第一点的输入亮度;
    根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。
  2. 根据权利要求1所述的方法,其特征在于,符合下列任意之一的条件时,则所述预设条件成立:
    根据所述第一参数对于图像数据进行色调映射时,所述第一色调映射曲线上第二点处的输出亮度高于所述第一色调映射曲线上的所述第二点处的输入亮度;或者
    所述第一参数中的参数p P1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的a P1,以及预设的a P1与p P1的对应关系获得的;或者
    所述第一参数中的参数a P1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的p P1,以及预设的a P1与p P1的对应关系获得的;或者
    所述第一参数中的参数a P1与参数p P1的乘积大于第三值Tap,其中,所述第三值Tap为预设的有理数。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二参数包括第一一次样条曲线参数,所述第一一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的斜率MB[0][0]和/或所述第一一次样条的区间像素点的亮度值的最大值TH3[0]和/或所述第一一次样条与纵坐标轴交点base_offset。
  4. 根据权利要求1-3任意之一所述的方法,其特征在于,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
    其中,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
    根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取所述曲线参数MB[0][0]和TH3[0]。
  5. 根据权利要求4所述的方法,其特征在于,所述曲线参数MB_mid[0][0]和TH3_mid[0],以及所述曲线参数MB[0][0]和TH3[0],满足以下公式:
    Figure PCTCN2021089981-appb-100001
    Figure PCTCN2021089981-appb-100002
    其中,
    Figure PCTCN2021089981-appb-100003
    Figure PCTCN2021089981-appb-100004
    或者
    Figure PCTCN2021089981-appb-100005
    其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
    Figure PCTCN2021089981-appb-100006
    或者,
    Figure PCTCN2021089981-appb-100007
  6. 根据权利要求1-5任意之一所述的方法,其特征在于,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。
  7. 根据权利要求6所述的方法,其特征在于,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的预设偏移值得到的,如下所示:
    TH1[1]=TH3[0];
    TH2[1]=TH1[1]+B;
    TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1];
    其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。
  8. 根据权利要求6所述的方法,其特征在于,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值计算得到的,如下所示:
    TH1[1]=3Spline_TH[i][0][w];
    TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
    TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
    其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值。
  9. 根据权利要求8所述的方法,其特征在于,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
  10. 根据权利要求8或9所述的方法,其特征在于,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
  11. 根据权利要求8-10任意之一所述的方法,其特征在于,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
  12. 根据权利要求1-11任意之一所述的方法,其特征在于,所述获取所述图像数据的第一色调映射曲线的第一参数,包括:
    获取所述图像数据的元数据;
    根据所述元数据以及所述显示参数,确定所述第一色调映射曲线的第一参数。
  13. 根据权利要求1-12任意之一所述的方法,其特征在于,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0]和/或所述第一一次样条与纵坐标轴交点base_offset_mid,所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
    其中,所述根据所述第一参数、所述显示参数和所述特征信息,获取第二色调映射曲线的第二参数,包括:
    根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid进行调整,获取所述曲线参数MB[0][0]、TH3[0]和/或base_offset。
  14. 根据权利要求13所述的方法,其特征在于,所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid,以及所述曲线参数MB[0][0]、TH3[0]和/或base_offset,满足以下公式:
    Figure PCTCN2021089981-appb-100008
    Figure PCTCN2021089981-appb-100009
    Figure PCTCN2021089981-appb-100010
    其中,
    Figure PCTCN2021089981-appb-100011
    Figure PCTCN2021089981-appb-100012
    或者
    Figure PCTCN2021089981-appb-100013
    其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2、N3为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
    Figure PCTCN2021089981-appb-100014
    或者,
    Figure PCTCN2021089981-appb-100015
  15. 一种动态范围映射的装置,其特征在于,包括:
    获取单元,用于获取终端设备的显示参数;
    所述获取单元还用于获取图像数据的特征信息;
    所述获取单元还用于获取所述图像数据的第一色调映射曲线的第一参数;
    处理单元,用于在预设条件成立时,根据所述第一参数、所述终端设备的显示参数和所述图像数据的特征信息,得到第二色调映射曲线的第二参数,其中,所述第二色调映射曲线上第一点处的输出亮度不高于所述第二色调映射曲线上的所述第一点的输入亮度;
    映射单元,用于根据所述第二色调映射曲线的第二参数对所述图像数据进行动态范围映射。
  16. 根据权利要求15所述的装置,其特征在于,符合下列任意之一的条件时,则所述预设条件成立:
    根据所述第一参数对于图像数据进行色调映射时,所述第一色调映射曲线上第二点处的输出亮度高于所述第一色调映射曲线上的所述第二点处的输入亮度;或者
    所述第一参数中的参数p P1大于第一值Tp,其中,所述第一值Tp是根据所述第一参数中的a P1,以及预设的a P1与p P1的对应关系获得的;或者
    所述第一参数中的参数a P1大于第二值Ta,其中,所述第二值Ta是根据所述第一参数中的p P1,以及预设的a P1与p P1的对应关系获得的;或者
    所述第一参数中的参数a P1与参数p P1的乘积大于第三值Tap,其中,所述第三值Tap为预设的有理数。
  17. 根据权利要求15或16所述的装置,其特征在于,所述第二参数包括第一一次样条曲线参数,所述第一一次样条曲线参数包括所述第二色调映射曲线中的第一一次样条的斜率MB[0][0]和/或所述第一一次样条的区间像素点的亮度值的最大值TH3[0]和/或所述第一一次样条与纵坐标轴交点base_offset。
  18. 根据权利要求15-17任意之一所述的装置,其特征在于,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0],所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
    其中,处理单元具体用于:
    根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]和TH3_mid[0]进行调整,获取所述曲线参数MB[0][0]和TH3[0]。
  19. 根据权利要求18所述的装置,其特征在于,所述曲线参数MB_mid[0][0]和TH3_mid[0],以及所述曲线参数MB[0][0]和TH3[0],满足以下公式:
    Figure PCTCN2021089981-appb-100016
    Figure PCTCN2021089981-appb-100017
    其中,
    Figure PCTCN2021089981-appb-100018
    Figure PCTCN2021089981-appb-100019
    或者
    Figure PCTCN2021089981-appb-100020
    其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
    Figure PCTCN2021089981-appb-100021
    或者,
    Figure PCTCN2021089981-appb-100022
  20. 根据权利要求15-19任意之一所述的装置,其特征在于,所述第二参数包括三次样条曲线参数,所述三次样条曲线参数包括所述第二色调映射曲线上的三次样条的插点值TH1[1]、TH2[1]、TH3[1],其中,TH1[1]表示所述三次样条的第一区间像素点的亮度值的最小值,TH2[1]表示所述三次样条的第一区间像素点的亮度值的最大值和所述三次样条的第二区间像素点的亮度值的最小值,TH3[1]表示所述三次样条的第二区间像素点的亮度值的最大值。
  21. 根据权利要求20所述的装置,其特征在于,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的预设偏移值得到的,如下所示:
    TH1[1]=TH3[0];
    TH2[1]=TH1[1]+B;
    TH3[1]=TH2[1]+C*TH2[1]-D*TH1[1];
    其中,B,C和D为所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]计算相关值的预设值,B为暗区过渡区像素点的亮度值对应的预设偏移值,C和D为亮区像素点的亮度值对应的预设加权系数。
  22. 根据权利要求20所述的装置,其特征在于,所述三次样条的插点值TH1[1]、TH2[1]、TH3[1]是根据所述第一参数中第二一次样条曲线参数TH3[0]、所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值计算得到的,如下所示:
    TH1[1]=3Spline_TH[i][0][w];
    TH2[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w];
    TH3[1]=3Spline_TH[i][0][w]+3Spline_TH_Delta1[i][1][w]+3Spline_TH_Delta1[i][2][w];
    其中,3Spline_TH[i][0][w]、3Spline_TH_Delta1[i][1][w]、3Spline_TH_Delta1[i][2][w]为从元数据中提取的所述插点值TH1[1]、TH2[1]、TH3[1]的计算相关值。
  23. 根据权利要求22所述的装置,其特征在于,所述第二色调映射曲线中的一次样条在TH3[0]处的Y坐标与所述第二色调映射曲线中的三次样条在TH1[1]处的Y坐标相同,且所述一次样条在TH3[0]处的一阶导数与所述三次样条在TH1[1]处的一阶导数相同。
  24. 根据权利要求22或23所述的装置,其特征在于,所述第二色调映射曲线中的第一三次样条在TH2[1]处的Y坐标与所述第二色调映射曲线中的第二三次样条在TH2[1]处的Y坐标相同,且所述第一三次样条在TH2[1]处的一阶导数与所述第二三次样条在TH2[1]处的一阶导数相同。
  25. 根据权利要求22-24任意之一所述的装置,其特征在于,所述第二色调映射曲线中的第二三次样条在TH3[1]处的Y坐标与所述第二色调映射曲线中的第三色调映射函数在TH3[1]处的Y坐标相同,且所述第二三次样条在TH3[1]处的一阶导数与所述第三色调映射函数在TH3[1]处的一阶导数相同。
  26. 根据权利要求15-25任意之一所述的装置,其特征在于,所述获取单元具体用于:
    获取所述图像数据的元数据;
    根据所述元数据以及所述显示参数,确定所述第一色调映射曲线的第一参数。
  27. 根据权利要求15-26任意之一所述的装置,其特征在于,所述第一参数包括第二一次样条曲线参数,所述第二一次样条曲线参数包括所述第一色调映射曲线中的第二一次样条的斜率MB_mid[0][0]和/或所述第二一次样条的区间像素点的亮度值的最大值TH3_mid[0]和/或所述第一一次样条与纵坐标轴交点base_offset_mid,所述显示参数包括所述终端设备的最大显示亮度MaxDisplay,所述特征信息包括所述图像数据的最大亮度校正值max_lum;
    其中,处理单元具体用于:
    根据所述最大显示亮度MaxDisplay、所述最大亮度校正值max_lum,对所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid进行调整,获取所述曲线参数MB[0][0]、TH3[0]和/或base_offset。
  28. 根据权利要求27所述的装置,其特征在于,所述曲线参数MB_mid[0][0]、TH3_mid[0]和/或base_offset_mid,以及所述曲线参数MB[0][0]、TH3[0]和/或base_offset,满足以下公式:
    Figure PCTCN2021089981-appb-100023
    Figure PCTCN2021089981-appb-100024
    Figure PCTCN2021089981-appb-100025
    其中,
    Figure PCTCN2021089981-appb-100026
    Figure PCTCN2021089981-appb-100027
    或者
    Figure PCTCN2021089981-appb-100028
    其中,L为输入信号,G(L)为色调映射曲线对应的函数H(L)的逆函数,m_a、m_b、m_m、m_n、k1、k2、k3为曲线参数,G(L,m_a_T)表示G(L)的参数M_a取值为m_a_T时输入变量L对应的G(L)值N1、N2、N3为有理数,max(a,b)表示求a和b中较大的一个值,min(a,b)表示求a和b中较小的一个值,H(L)为
    Figure PCTCN2021089981-appb-100029
    或者,
    Figure PCTCN2021089981-appb-100030
PCT/CN2021/089981 2020-04-30 2021-04-26 动态范围映射的方法和装置 WO2021218924A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP21796388.3A EP4135316A4 (en) 2020-04-30 2021-04-26 METHOD AND DEVICE FOR DYNAMIC RANGE IMAGING
KR1020227041352A KR20230003066A (ko) 2020-04-30 2021-04-26 동적 범위 맵핑 방법 및 장치
JP2022566031A JP7462072B2 (ja) 2020-04-30 2021-04-26 ダイナミックレンジのマッピング方法及び機器
US17/975,893 US20230054046A1 (en) 2020-04-30 2022-10-28 Dynamic range mapping method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010365696.3A CN113596424B (zh) 2020-04-30 2020-04-30 动态范围映射的方法和装置
CN202010365696.3 2020-04-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/975,893 Continuation US20230054046A1 (en) 2020-04-30 2022-10-28 Dynamic range mapping method and apparatus

Publications (1)

Publication Number Publication Date
WO2021218924A1 true WO2021218924A1 (zh) 2021-11-04

Family

ID=78237389

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/089981 WO2021218924A1 (zh) 2020-04-30 2021-04-26 动态范围映射的方法和装置

Country Status (7)

Country Link
US (1) US20230054046A1 (zh)
EP (1) EP4135316A4 (zh)
JP (1) JP7462072B2 (zh)
KR (1) KR20230003066A (zh)
CN (2) CN113596424B (zh)
TW (1) TWI790596B (zh)
WO (1) WO2021218924A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113850743A (zh) * 2021-11-30 2021-12-28 江苏游隼微电子有限公司 一种基于自适应参数的视频全局色调映射方法
CN114359083A (zh) * 2021-12-24 2022-04-15 北京航空航天大学 一种面向干扰环境的高动态热红外图像自适应预处理方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11734806B2 (en) 2021-11-24 2023-08-22 Roku, Inc. Dynamic tone mapping

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645942A (zh) * 2004-01-22 2005-07-27 柯尼卡美能达影像株式会社 图像处理装置、摄影装置、图像处理方法及图像处理程序
WO2008136629A1 (en) * 2007-05-03 2008-11-13 Mtekvision Co., Ltd. Image brightness controlling apparatus and method thereof
US20170034520A1 (en) * 2015-07-28 2017-02-02 Canon Kabushiki Kaisha Method, apparatus and system for encoding video data for selected viewing conditions
CN107211182A (zh) * 2015-05-26 2017-09-26 松下电器(美国)知识产权公司 显示方法和显示装置
CN109155844A (zh) * 2016-05-16 2019-01-04 Lg 电子株式会社 图像处理设备和使用该图像处理设备的图像处理方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102105645B1 (ko) * 2012-10-08 2020-05-04 코닌클리케 필립스 엔.브이. 색상 제한들을 통한 루미넌스 변화 이미지 처리
US20180152686A1 (en) * 2016-11-28 2018-05-31 Microsoft Technology Licensing, Llc Tone mapping functions for rendering high dynamic range video on enhanced dynamic range display devices
US10403214B2 (en) * 2017-05-12 2019-09-03 Apple Inc. Electronic devices with tone mapping to accommodate simultaneous display of standard dynamic range and high dynamic range content
JP7184544B2 (ja) 2018-06-08 2022-12-06 シャープ株式会社 表示制御装置、表示装置、テレビジョン、及び表示制御方法
US10863157B2 (en) 2018-07-06 2020-12-08 Samsung Electronics Co., Ltd. Guided tone mapping of high dynamic range video based on a Bezier curve for presentation on a display device
CN110867172B (zh) * 2019-11-19 2021-02-26 苹果公司 动态控制标准动态范围和高动态范围内容的电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645942A (zh) * 2004-01-22 2005-07-27 柯尼卡美能达影像株式会社 图像处理装置、摄影装置、图像处理方法及图像处理程序
WO2008136629A1 (en) * 2007-05-03 2008-11-13 Mtekvision Co., Ltd. Image brightness controlling apparatus and method thereof
CN107211182A (zh) * 2015-05-26 2017-09-26 松下电器(美国)知识产权公司 显示方法和显示装置
US20170034520A1 (en) * 2015-07-28 2017-02-02 Canon Kabushiki Kaisha Method, apparatus and system for encoding video data for selected viewing conditions
CN109155844A (zh) * 2016-05-16 2019-01-04 Lg 电子株式会社 图像处理设备和使用该图像处理设备的图像处理方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4135316A4

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113850743A (zh) * 2021-11-30 2021-12-28 江苏游隼微电子有限公司 一种基于自适应参数的视频全局色调映射方法
CN114359083A (zh) * 2021-12-24 2022-04-15 北京航空航天大学 一种面向干扰环境的高动态热红外图像自适应预处理方法
CN114359083B (zh) * 2021-12-24 2022-11-29 北京航空航天大学 一种面向干扰环境的高动态热红外图像自适应预处理方法

Also Published As

Publication number Publication date
TWI790596B (zh) 2023-01-21
EP4135316A4 (en) 2023-09-13
US20230054046A1 (en) 2023-02-23
CN116132648A (zh) 2023-05-16
EP4135316A1 (en) 2023-02-15
TW202143693A (zh) 2021-11-16
JP2023523775A (ja) 2023-06-07
CN113596424A (zh) 2021-11-02
KR20230003066A (ko) 2023-01-05
CN113596424B (zh) 2022-12-06
JP7462072B2 (ja) 2024-04-04

Similar Documents

Publication Publication Date Title
RU2711102C1 (ru) Устройство и способ улучшения обмена данными изображения на основе нелинейности восприятия яркости между разными возможностями отображения
WO2021218924A1 (zh) 动态范围映射的方法和装置
US10692465B2 (en) Transitioning between video priority and graphics priority
US9076224B1 (en) Image processing for HDR images
JP6891882B2 (ja) 画像処理装置、および画像処理方法、並びにプログラム
US11030729B2 (en) Image processing method and apparatus for adjusting a dynamic range of an image
CN111885312B (zh) Hdr图像的成像方法、系统、电子设备及存储介质
CN107888943B (zh) 图像处理
CN114866809B (zh) 视频转换方法、装置、设备、存储介质及程序产品
US10332481B2 (en) Adaptive display management using 3D look-up table interpolation
CN111724316B (zh) 处理高动态范围图像的方法和装置
WO2021073304A1 (zh) 一种图像处理的方法及装置
CN112689138B (zh) 一种图像信号转换处理方法、装置及终端设备
US20230140259A1 (en) Image dynamic range processing method and apparatus
CN116167950B (zh) 图像处理方法、装置、电子设备及存储介质
WO2021073209A1 (zh) 处理高动态范围图像的方法和装置
TW202404342A (zh) 產生高動態範圍影像的方法及影像處理系統

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21796388

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022566031

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2021796388

Country of ref document: EP

Effective date: 20221107

ENP Entry into the national phase

Ref document number: 20227041352

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE