WO2021073209A1 - 处理高动态范围图像的方法和装置 - Google Patents

处理高动态范围图像的方法和装置 Download PDF

Info

Publication number
WO2021073209A1
WO2021073209A1 PCT/CN2020/107428 CN2020107428W WO2021073209A1 WO 2021073209 A1 WO2021073209 A1 WO 2021073209A1 CN 2020107428 W CN2020107428 W CN 2020107428W WO 2021073209 A1 WO2021073209 A1 WO 2021073209A1
Authority
WO
WIPO (PCT)
Prior art keywords
maximum value
maximum
rgb component
pixels
value
Prior art date
Application number
PCT/CN2020/107428
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 CN202080062583.4A priority Critical patent/CN114342401A/zh
Priority to EP20877695.5A priority patent/EP4037319A4/en
Publication of WO2021073209A1 publication Critical patent/WO2021073209A1/zh
Priority to US17/720,534 priority patent/US11875487B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/10Intensity circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • 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/02Improving the quality of display appearance
    • G09G2320/0233Improving the luminance or brightness uniformity across the screen
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2360/00Aspects of the architecture of display systems
    • G09G2360/16Calculation or use of calculated indices related to luminance levels in display data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • This application relates to the field of image processing, and more specifically, to a method and device for processing high dynamic range images.
  • 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. Since the dynamic range of natural scenes in the real world is between 10-3 and 106, and the dynamic range is very large, it is called High Dynamic Range (HDR). Compared with high dynamic range images, the dynamic range of ordinary images is Low Dynamic Range (LDR).
  • HDR High Dynamic Range
  • LDR Low Dynamic Range
  • Display devices at this stage generally refer to those with a dynamic range of less than 0.1 to 400 nits as Standard Dynamic Range (SDR) display devices; those with a dynamic range from 0.01 to 540 nits are referred to as High Dynamic Range (HDR) displays.
  • SDR Standard Dynamic Range
  • HDR High Dynamic Range
  • Equipment, different high dynamic range display devices display different dynamic ranges, such as 0.01 to 540nits high dynamic range display devices, 0.005 to 1000nits high dynamic range display devices, etc.
  • the adjustment of the HDR image dynamic range is only related to parameters such as the maximum brightness of the displayed content of the image and the minimum brightness of the displayed content, the maximum brightness value and the minimum brightness value that can be displayed by the display device. Using only these parameters will cause more loss of the brightness level of the HDR image, the brightness contrast is not obvious, and the display effect of the adjusted HDR image on the display device is not good.
  • the embodiments of the present application provide a method and device for processing HDR images, which can improve the display effect of HDR images.
  • an embodiment of the present application provides a method for processing a high dynamic range image, and the method includes:
  • the HDR image includes a plurality of pixels
  • the image information includes a first percentage and the maximum value of the RGB component of the first pixel corresponding to the first percentage
  • the first percentage indicates that the maximum value of the RGB component in the plurality of pixels is less than or equal to the first
  • At least one pixel of the maximum value of the RGB component of the pixel accounts for the percentage of the plurality of pixels
  • the second percentage indicates that the maximum value of the RGB component in the plurality of pixels is less than or equal to the maximum value of the RGB component of the second pixel
  • the percentage of at least one pixel of the plurality of pixels, the maximum value of the RGB component represents the maximum value of the R component, the G component, and the B component of the pixel, and the first percentage and the second hundred
  • the scores are all greater than 0 and less than 1;
  • the maximum value of the RGB component of the first pixel corresponding to the first percentage, the RGB component of the second pixel corresponding to the second percentage and the second percentage Maximum value determining the reference maximum value of the HDR image
  • the maximum value of the RGB component of the first pixel and the maximum value of the RGB component of the second pixel are not the maximum brightness of the display content or the minimum brightness of the display content of the HDR image
  • the The reference maximum value obtained by the above pixels is classified, and the corrected maximum value of the HDR image is calculated according to the reference maximum value, which can improve the classification accuracy of HDR images with different levels of dynamic range. Therefore, applying the maximum correction value to the adjustment of the dynamic range of the HDR image can improve the display effect of the HDR image.
  • the above-mentioned method may be executed by an image processing apparatus.
  • the first percentage can be a first percentage
  • the second percentage can be a second percentage
  • the maximum value of the RGB component of the first pixel is 80
  • the maximum value of the RGB component of the second pixel is 30, and the maximum value of the RGB component of the third pixel It is 60 and the maximum value of the fourth RGB component is 55.
  • 25% corresponds to the second pixel
  • 50% corresponds to the fourth pixel
  • 75% corresponds to the third pixel
  • 100 corresponds to the first pixel.
  • the pixels with the maximum RGB component less than or equal to 30 account for 25% of the 4 pixels
  • the pixels with the maximum RGB component less than or equal to 55 (the second and fourth pixels) Pixels) account for 50% of the 4 pixels
  • the pixels with the maximum RGB component less than or equal to 60 account for 75% of the 4 pixels
  • the maximum RGB component is less than or equal to 80 pixels (the second, fourth, third, and first pixels) account for 100% of the 4 pixels.
  • the multiple pixels included in the above HDR image may be understood as multiple pixels included in the effective display area of the HDR image, and the effective display area may be a part of or all of the area in the HDR image.
  • the effective display area of the HDR image may be a rectangular area determined by the display horizontal size and the display vertical size.
  • the image processing apparatus may obtain the image information of the HDR image in a variety of ways, which is not limited in the embodiment of the present application.
  • the image processing device may calculate the HDR image by using an existing method to obtain the image information.
  • the image processing apparatus may obtain the image information through metadata carried by the HDR image.
  • the image processing apparatus may use multiple methods to determine the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage, and the The maximum value of the RGB component of the second pixel corresponding to the second percentage determines the reference maximum value of the HDR image, which is not limited in the embodiment of the present application.
  • the image information further includes an average value among the maximum values of the RGB components of the plurality of pixels, and the value corresponding to the first percentage and the first percentage
  • the maximum value of the RGB component of the first pixel, the maximum value of the RGB component of the second pixel corresponding to the second percentage and the second percentage, determining the reference maximum value of the HDR image includes: The first percentage, the maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the maximum value of the RGB component of the plurality of pixels And the average value among the maximum values of the RGB components of the plurality of pixels to determine the reference maximum value.
  • the reference maximum value MAX can be determined by the following formula:
  • the maximum value of the RGB maximum_maxrgb represents the maximum value component of the plurality of pixels
  • the average of the maximum average_maxrgb represents the plurality of pixels of the RGB components
  • the K 1 represents the first percentage
  • the K 2 represents the second percentage
  • F() represents a preset function
  • B, K 1 and K 2 are preset values, 0 ⁇ B ⁇ 1, K 1 -K 2 ⁇ 0.5, 0 ⁇ K 1 ⁇ 1, 0 ⁇ K 2 ⁇ 1.
  • the aforementioned F() function may be a constant function or an increasing function, which is not limited in the embodiment of the present application.
  • the method further includes: according to the third ratio, the third RGB component maximum, the fourth GRB component maximum, the fourth ratio, the fifth RGB component maximum, and the sixth GRB component maximum. Value to verify the accuracy of the corrected maximum value, wherein the third ratio represents the difference between the pixel whose maximum RGB component is less than or equal to the maximum value of the third RGB component in the plurality of pixels and the plurality of pixels
  • the ratio of the number of pixels in the fourth GRB component to the number of pixels in the processed image whose maximum RGB component is less than or equal to the maximum value of the fourth RGB component to the number of pixels in the processed image is The third ratio, the fourth ratio represents the ratio of the pixel with the maximum value of the RGB component in the plurality of pixels that is less than or equal to the maximum value of the fifth RGB component to the number of the plurality of pixels, the sixth GRB
  • the maximum value of the component satisfies the ratio of the number of pixels with the maximum RGB component less than or equal to the maximum value of the sixth RGB component to the number of pixels in the processed image
  • the image information further includes an average value among the maximum values of the RGB components of the multiple pixels
  • the determining unit is specifically configured to: according to the first percentage, the first percentage The maximum value of the RGB component of a pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the maximum value of the RGB component of the plurality of pixels, and the RGB components of the plurality of pixels The average value among the maximum values determines the reference maximum value.
  • the determining unit is further configured to perform at least one of the following steps:
  • the brightness variation range variance_maxrgb is determined by the following formula:
  • the image information further includes the maximum value of the maximum value of the RGB components of the plurality of pixels and the average value of the maximum value of the RGB components of the plurality of pixels, and the image information is based on the brightness
  • the change range, determining the reference maximum value includes: determining the reference maximum value according to the brightness change range, the maximum value among the maximum value of the RGB components of the plurality of pixels, and the average value of the maximum value of the RGB components of the plurality of pixels. The reference maximum value.
  • the reference maximum value MAX is determined by the following formula:
  • maximum_maxrgb represents the maximum value among the maximum values of the RGB components of the multiple pixels
  • average_maxrgb represents the average value of the maximum values of the RGB components of the multiple pixels
  • variance_maxrgb represents the brightness variation range
  • F() represents a preset function
  • the reference maximum value MAX is determined by the following formula:
  • each grading interval corresponds to an expression
  • the expression is used to calculate the maximum brightness correction value, and the reference maximum value and a plurality of preset grading intervals
  • Determining the maximum brightness correction value of the HDR image includes: determining a first grading interval to which the reference maximum value belongs from among the multiple grading intervals, the first grading interval corresponding to a first expression; according to the The first expression determines the maximum brightness correction value.
  • the maximum brightness correction value maximum_maxrgb1 of the HDR image is determined by the following formula:
  • the method further includes: according to a third percentage corresponding to the maximum value of the RGB component of the third pixel in the HDR image, the third percentage is in the processed image
  • the maximum value of the GRB component of the fourth pixel corresponding to in the HDR image, the maximum value of the RGB component of the fifth pixel corresponding to the fourth percentage in the HDR image, and the fourth percentage in the processed HDR image Corresponding to the maximum value of the GRB component of the sixth pixel, the accuracy of the maximum brightness correction value is verified, and the processed image is an image of the HDR image after dynamic range adjustment.
  • the maximum value of the GRB component of the pixel to verify the accuracy of the corrected maximum value including: And When determining that the maximum brightness correction value is accurate, K 3 -K 4 ⁇ M, M is the preset first threshold, T is the preset second threshold, 0 ⁇ T ⁇ 2, and K 3 represents the The third percentage, Represents the maximum value of the RGB component of the third pixel, Represents the maximum value of the RGB component of the fourth pixel, K 4 represents the fourth percentage, Represents the maximum value of the RGB component of the fifth pixel, Represents the maximum value of the RGB component of the sixth pixel.
  • a maximum value of a RGB component and a second maximum value of the RGB component corresponding to a second ratio the first ratio indicating that the pixel whose maximum value of the RGB component is less than or equal to the maximum value of the first RGB component and the The ratio of the number of the plurality of pixels, the second ratio represents the ratio of the number of pixels with the maximum value of the RGB component in the plurality of pixels that is less than or equal to the maximum value of the second RGB component to the number of the plurality of pixels, the The maximum value of the RGB component represents the largest component value among the R component, G component, and B component of a pixel; according to the first ratio corresponding to the first RGB component maximum value and the second ratio corresponding to the second ratio Two RGB component maximum values, determining the reference maximum value of the image to be processed; adjusting the maximum value of the RGB component maximum values of the multiple pixels according to the reference maximum value and multiple preset classification intervals, To determine the maximum brightness correction value of the image to be processed, wherein each of the multiple grading intervals corresponds to a value range
  • the first ratio is greater than the second ratio
  • the maximum value of the first RGB component corresponding to the first ratio and the first ratio corresponding to the second ratio are Two RGB component maximum values
  • determining the reference maximum value of the image to be processed including: maximizing the first RGB component maximum value corresponding to the first ratio and the second RGB component corresponding to the second ratio value The difference between the values is determined as the brightness variation range of the image to be processed; and the reference maximum value is determined according to the brightness variation range.
  • the brightness variation range variance_maxrgb is determined by the following formula:
  • K 1 represents the first ratio
  • K 2 represents the second ratio
  • K 1 and K 2 are preset values, K 1 -K 2 ⁇ 0.5, 0 ⁇ K 1 ⁇ 1, 0 ⁇ K 2 ⁇ 1.
  • the image information further includes the maximum value of the maximum value of the RGB components of the plurality of pixels and the average value of the maximum value of the RGB components of the plurality of pixels, and the image information is based on the brightness
  • the change range, determining the reference maximum value includes: determining the reference maximum value according to the brightness change range, the maximum value among the maximum value of the RGB components of the plurality of pixels, and the average value of the maximum value of the RGB components of the plurality of pixels. The reference maximum value.
  • MAX B ⁇ maximum_maxrgb+A ⁇ (2 ⁇ average_maxrgb)+(1-A-B) ⁇ variance_maxrgb,
  • maximum_maxrgb represents the maximum value among the maximum values of the RGB components of the multiple pixels
  • average_maxrgb represents the average value of the maximum values of the RGB components of the multiple pixels
  • variance_maxrgb represents the brightness variation range
  • F() represents a preset function
  • the reference maximum value MAX is determined by the following formula:
  • K 1 represents the first ratio
  • K 2 represents the second ratio
  • A, K 1 and K 2 are preset values, 0 ⁇ A ⁇ 1, 0 ⁇ K 1 ⁇ 1, 0 ⁇ K 2 ⁇ 1.
  • each grading interval corresponds to an expression
  • the expression is used to calculate the maximum brightness correction value
  • the maximum brightness correction value maximum_maxrgb1 is determined by the following formula:
  • MaxRefDisplay represents the maximum display brightness of the reference display device applicable before the dynamic range of the image to be processed is adjusted
  • MIN represents the preset classification threshold
  • MAX represents the reference maximum value
  • the method further includes: if the maximum brightness correction value is less than the maximum display brightness of the current display device applicable after the dynamic range of the image to be processed is adjusted, the maximum brightness The correction value maximum_maxrgb1 is changed to the maximum display brightness of the current display device.
  • the method further includes: according to the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth GRB component corresponding to the third ratio, and the fifth RGB component corresponding to the fourth ratio.
  • the maximum value of the component and the maximum value of the sixth GRB component corresponding to the fourth ratio are used to verify the accuracy of the maximum brightness correction value, where the third ratio indicates that the maximum value of the RGB components in the plurality of pixels is less than or equal to The ratio of the pixel with the maximum value of the third RGB component to the number of the plurality of pixels, and the maximum value of the fourth GRB component satisfies that the maximum value of the RGB component in the pixels of the processed image is less than or equal to the maximum value of the fourth RGB component
  • the ratio of the number of pixels of the value to the number of pixels of the processed image is the third ratio
  • the fourth ratio indicates that the maximum value of the RGB component in the plurality of pixels is less than or equal to the maximum value of the fifth RGB component
  • the maximum value of the third RGB component corresponding to the third ratio, the maximum value of the fourth GRB component corresponding to the third ratio, the maximum value of the fifth RGB component corresponding to the fourth ratio and The sixth GRB component maximum value corresponding to the fourth ratio, verifying the accuracy of the maximum brightness correction value includes:
  • K 3 -K 4 ⁇ M M is the preset first threshold
  • T is the preset second threshold
  • K 3 represents all
  • the third ratio Represents the maximum value of the third RGB component
  • P′ K3 represents the maximum value of the fourth RGB component
  • K 4 represents the fourth ratio
  • the method further includes at least one of the following steps: determining the maximum value of the first RGB component according to the first ratio and the plurality of pixels; and determining the maximum value of the first RGB component according to the second ratio and the Determining the maximum value of the second RGB component according to the plurality of pixels; determining the maximum value of the third RGB component according to the third ratio and the plurality of pixels; according to the third ratio and the processed image Determine the maximum value of the fourth RGB component; determine the maximum value of the fifth RGB component based on the fourth ratio and the plurality of pixels; or, determine the maximum value of the fifth RGB component based on the fourth ratio and the processed image , Determine the maximum value of the sixth RGB component.
  • an embodiment of the present application further provides an image processing device, which is configured to execute the method described in the fifth aspect or various possible implementation manners of the fifth aspect.
  • the device may include a unit for executing the method described in the foregoing fifth aspect or various possible implementation manners of the fifth aspect.
  • an embodiment of the present application further provides an image processing device, which is configured to execute the method described in the sixth aspect or various possible implementation manners of the sixth aspect.
  • the device may include a unit for executing the method described in the sixth aspect or various possible implementation manners of the sixth aspect.
  • an embodiment of the present application also provides an image processing device, the device includes a processor and a memory, the processor is coupled to the memory, and the processor is configured to cause the apparatus to perform the above aspects or The methods described in the various possible implementations of each aspect.
  • an embodiment of the present application also provides a chip device, including: an input interface, an output interface, at least one processor, a memory, the input interface, the output interface, the processor, and the memory Communication with each other through internal connection paths, the processor is used to execute the code in the memory, characterized in that, when the processor executes the code, the chip device realizes the above aspects or various possibilities of each aspect The method described in the implementation mode.
  • this application provides a computer-readable storage medium for storing a computer program, characterized in that the computer program includes the above-mentioned aspects or the various possible implementation manners of each aspect. Method of instruction.
  • the present application provides a computer program product, the computer program product contains instructions, characterized in that, when the instructions are run on a computer, the computer realizes the above aspects or various possibilities in each aspect. The method described in the implementation mode.
  • Figure 1 is an image of the PQ photoelectric transfer function.
  • Figure 2 is an image of the HLG photoelectric transfer function.
  • Fig. 5 is an application scenario of image processing provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of a method 100 for processing a high dynamic range image provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of an image processing apparatus 200 provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of an image processing device 300 provided by an embodiment of the application.
  • HDR High Dynamic Range
  • LDR Low Dynamic Range
  • 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.
  • Optical Electro Transfer Function represents the conversion relationship between linear signals of image pixels and non-linear signals.
  • the existing consumer-grade HDR display can reach 600cd/m 2
  • the high-end HDR display can reach 2000cd/m 2 , which is far beyond the display range of traditional SDR display devices. Therefore, in the International Telecommunications Union-Radio Communications Sector (ITU-R) BT.1886 standard protocol, the photoelectric transfer function that is compatible with traditional SDR display equipment can no longer express the current HDR display well. The display performance of the device. Therefore, the photoelectric transfer function needs to be improved to adapt to the upgrade of HDR display devices.
  • ITU-R International Telecommunications Union-Radio Communications Sector
  • the 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 brightness fidelity (Scene Luminance Fidelity, SLF) photoelectric transfer function.
  • PQ Perceptual Quantizer
  • HLG Hybrid Log-Gamma
  • SLF scene brightness 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 1, 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 (1):
  • 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 2.
  • Figure 2 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 (2):
  • 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 3, 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 (3):
  • the SLF photoelectric transfer function can be expressed as formula (4):
  • the existing display device can display a limited dynamic range, it is impossible to directly display an image with a high dynamic range (for example, the maximum brightness reaches 1000 nits or 10000 nits, etc.). Moreover, different display devices have different display capabilities. Therefore, a dynamic range adjustment algorithm is generally used to adjust the dynamic range of the high dynamic range image according to the display capability of the display device.
  • the dynamic range of the HDR image is adjusted to the dynamic range that the display device can display for display, or the dynamic range of the HDR image is adjusted from the dynamic range that a display device (such as a reference display device) can display. Display within the dynamic range of another display device (such as the current display device).
  • nits is a unit that characterizes brightness, which is equivalent to candela per square meter (cd/m 2 ).
  • HDR image described in the embodiment of the present application may be an optical signal or an electrical signal, which is not limited in the embodiment of the present application.
  • the HDR image is an optical signal
  • the optical signal can be converted into an electrical signal through the above three photoelectric conversion functions.
  • L 1 generally uses the largest image display content
  • Brightness is the true maximum value obtained by statistics of the image content of the HDR image, such as OETF (10000nits)
  • L 2 generally uses the minimum brightness of the display content of the image, and is the minimum value obtained by the statistics of the image content of the HDR image, such as 0
  • L' 1 is the maximum value that the display device can display, such as OETF (100 nits)
  • L' 2 is the minimum value that the display device can display, such as OETF (0.005 nits).
  • the two end points of (L 1 , L' 1 ) and (L 2 , L' 2 ) are specifically A(x 1 , y 1 ) and B(x 2 , y 2 ), use one
  • this curve (ie, curve 5) represents the dynamic range of HDR image from 0 ⁇ 10000 (nits ) Adjust to 0.005(nits) ⁇ 100(nits). Therefore, the display device corresponding to the brightness range can display an image with a compressed dynamic range of 0.005 (nits) to 100 (nits).
  • the maximum brightness L 1 of the display content of the HDR image is used to adjust the dynamic range of the HDR image.
  • L 1 the maximum brightness of the display content of the HDR image
  • Fig. 5 is an application scenario of the method for processing HDR images provided by an embodiment of the application.
  • the image processing device adjusts the dynamic range of the HDR image to be processed, and outputs the adjusted HDR image.
  • FIG. 6 is a schematic flowchart of a method 100 for processing an HDR image provided by an embodiment of the application.
  • the method 100 is suitable for the application scenario provided in FIG. 5 and is executed by, for example, the image processing apparatus shown in FIG. 5.
  • the method 100 includes the following S110-S140.
  • the HDR image includes a plurality of pixels, and the image information includes a first percentage, the maximum value of the RGB component of the first pixel corresponding to the first percentage, The second percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage.
  • the first percentage represents the percentage of at least one pixel in the plurality of pixels whose maximum RGB component is less than or equal to the maximum RGB component of the first pixel to the plurality of pixels
  • the second Percentage represents the percentage of at least one pixel of the plurality of pixels whose maximum RGB component is less than or equal to the maximum value of the RGB component of the second pixel to the plurality of pixels
  • the maximum value of the RGB component represents all pixels
  • the maximum value of the R component, the G component, and the B component of, the first percentage and the second percentage are both greater than 0 and less than 1.
  • the first percentage can be a first percentage
  • the second percentage can be a second percentage
  • the first percentage represents the percentage of at least one pixel in the plurality of pixels whose maximum RGB component is less than or equal to the maximum RGB component of the first pixel to the plurality of pixels
  • the second Percentage represents the percentage of at least one pixel of the plurality of pixels whose maximum RGB component is less than or equal to the maximum value of the RGB component of the second pixel to the plurality of pixels
  • the maximum value of the RGB component represents all pixels
  • the maximum value of the R component, the G component, and the B component of, the first percentage and the second percentage are both greater than 0 and less than 1.
  • the maximum value of the RGB component of the first pixel is 80
  • the maximum value of the RGB component of the second pixel is 30
  • the maximum value of the RGB component of the third pixel is 60
  • the maximum value of the RGB component of the third pixel is 60.
  • the maximum value of each RGB component is 55, then 25% corresponds to the second pixel, 50% corresponds to the fourth pixel, 75% corresponds to the third pixel, and 100 corresponds to the first pixel.
  • the pixels with the maximum RGB component less than or equal to 30 account for 25% of the 4 pixels
  • the pixels with the maximum RGB component less than or equal to 55 (the second and fourth pixels) Pixels) account for 50% of the 4 pixels
  • the pixels with the maximum RGB component less than or equal to 60 account for 75% of the 4 pixels
  • the maximum RGB component is less than or equal to 80 pixels (the second, fourth, third, and first pixels) account for 100% of the 4 pixels.
  • the multiple pixels included in the above HDR image may be understood as multiple pixels included in the effective display area of the HDR image, and the effective display area may be a part of or all of the area in the HDR image.
  • the effective display area of the HDR image may be a rectangular area determined by the display horizontal size and the display vertical size.
  • the image processing apparatus may obtain the image information of the HDR image in a variety of ways, which is not limited in the embodiment of the present application.
  • the image processing apparatus may obtain the image information through metadata carried by the HDR image.
  • S110 may also be: acquiring image information of a high dynamic range HDR image to be processed, the HDR image includes a plurality of pixels, and the image information includes the first pixel corresponding to the first percentage with the largest RGB component Value and a second percentage corresponding to the maximum value of the RGB component of the second pixel, and the first percentage indicates that the maximum value of the RGB component of the plurality of pixels is less than or equal to the maximum value of the RGB component of the first pixel At least one pixel occupies a percentage of the plurality of pixels, and the second percentage indicates that at least one pixel of the plurality of pixels whose maximum RGB component is less than or equal to the maximum RGB component of the second pixel occupies the The percentage of a plurality of pixels, the maximum value of the RGB component represents the maximum value of the R component, the G component, and the B component of a pixel, and the first percentage and the second percentage are both greater than 0 and less than 1.
  • the image processing device may obtain the maximum RGB value of the first pixel corresponding to the first percentage and the maximum RGB value of the second pixel corresponding to the second percentage in various ways. The embodiment does not limit this.
  • the image processing apparatus may use multiple methods to determine the maximum value of the RGB component of the first pixel corresponding to the first percentage, the second percentage, and the The maximum value of the RGB component of the second pixel corresponding to the second percentage determines the reference maximum value of the HDR image, which is not limited in the embodiment of the present application.
  • the image processing apparatus may determine the reference maximum value MAX through the following formula (5):
  • the method for processing HDR images provided by the embodiments of this application is adopted, due to the above with Calculate the reference maximum value for the two pixels in the HDR image except the maximum brightness and the minimum brightness of the display content, and finally adjust the maximum value of the maximum value of the RGB component of the HDR image according to the reference maximum value, which can avoid In the prior art, when the maximum brightness adjustment is used, the adjusted image is too dark.
  • the image processing apparatus may determine the reference maximum value MAX through the following formula (6):
  • the maximum value of the RGB maximum_maxrgb represents the maximum value component of the plurality of pixels
  • the average of the maximum average_maxrgb represents the plurality of pixels of the RGB components
  • the K 1 represents the first percentage
  • the K 2 represents the second percentage
  • F() represents a preset function
  • B, K 1 and K 2 are preset values, 0 ⁇ B ⁇ 1, K 1 -K 2 ⁇ 0.5, 0 ⁇ K 1 ⁇ 1, 0 ⁇ K 2 ⁇ 1.
  • S120 may also be: according to the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage, Determine the reference maximum value of the HDR image.
  • the image processing apparatus may calculate the difference between the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage , Determine as the brightness change range of the HDR image; determine the reference maximum value according to the brightness change range.
  • the image processing apparatus may determine the brightness variation range variance_maxrgb through the following formula (7):
  • K 1 represents the first percentage
  • K 2 represents the second percentage
  • K 1 and K 2 are preset values, K 1 -K 2 ⁇ 0.5, 0 ⁇ K 1 ⁇ 1, 0 ⁇ K 2 ⁇ 1.
  • the image information further includes the maximum value among the maximum values of the RGB components of the plurality of pixels and the average value of the maximum values of the RGB components of the plurality of pixels
  • the image processing device may, according to the brightness change range, The maximum value among the maximum values of the RGB components of the plurality of pixels and the average value of the maximum values of the RGB components of the plurality of pixels determine the reference maximum value.
  • the image processing apparatus may determine the reference maximum value MAX through the following formula (8):
  • maximum_maxrgb represents the maximum value among the maximum values of the RGB components of the multiple pixels
  • average_maxrgb represents the average value of the maximum values of the RGB components of the multiple pixels
  • variance_maxrgb represents the brightness variation range
  • F() represents a preset function
  • the F() function in the above formula (6) and formula (8) may be a constant function or an increasing function, which is not limited in the embodiment of the present application.
  • maximum_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%
  • 2 ⁇ average_maxrgb is the maximum value of the RGB component of the pixel corresponding to 100%
  • K1-K2 ⁇ 0.5 is corresponding to greater than 50%
  • the maximum value of the RGB component of the pixel, the final reference maximum value is obtained by setting different weights for these 3 dimensions, and the maximum value of the RGB component maximum value of the HDR image is finally adjusted according to the reference maximum value, which can avoid the existing When using the technology to adjust the maximum brightness, the adjusted image is too dark.
  • S130 Determine the corrected maximum value of the HDR image according to the reference maximum value and multiple preset grading intervals, where the grading interval is used to grade the reference maximum value, and the multiple grading intervals Each hierarchical interval in corresponds to a value range of the reference maximum value, and the corrected maximum value is used to correct the maximum value among the maximum values of the RGB components of the plurality of pixels included in the HDR image.
  • grading a parameter refers to dividing the parameter into different levels according to different value ranges. Different values of this parameter may fall in different value ranges, and values falling in different value ranges are said to belong to different levels (or, levels).
  • the concept of parameter grading can also refer to the prior art, which will not be described in detail here.
  • S140 may also be: adjusting the dynamic range of the HDR image according to the maximum brightness correction value.
  • the accuracy of grading HDR images with different levels of dynamic range can be improved. Therefore, applying the maximum brightness correction value to the adjustment of the dynamic range of the HDR image can improve the display effect of the HDR image.
  • the embodiment of the present application also provides a method for verifying the accuracy of the maximum brightness correction value of the HDR image.
  • the image processing device may calibrate the maximum brightness correction value according to the following formula (14) to obtain the calibrated maximum brightness correction value maximum_maxrgb1':
  • maximum_maxrgb1' is the maximum brightness correction value after calibration
  • the offset is a preset offset value
  • FIG. 7 shows a schematic block diagram of an HDR image processing apparatus 200 provided by an embodiment of the present application.
  • the device 200 includes:
  • the acquiring unit 210 is configured to acquire image information of a high dynamic range HDR image to be processed.
  • the HDR image includes a plurality of pixels, and the image information includes a first percentage and a first percentage corresponding to the first percentage.
  • the maximum value of the RGB component of the pixel, the second percentage, and the maximum value of the RGB component of the second pixel corresponding to the second percentage, the first percentage means that the maximum value of the RGB component in the plurality of pixels is less than Or the percentage of at least one pixel equal to the maximum value of the RGB component of the first pixel to the plurality of pixels, and the second percentage indicates that the maximum value of the RGB component in the plurality of pixels is less than or equal to the second At least one pixel of the maximum value of the RGB component of the pixel accounts for the percentage of the plurality of pixels, the maximum value of the RGB component represents the maximum value among the R component, the G component, and the B component of the pixel, the first percentage And the second percentage is greater than 0 and less than 1.
  • the acquiring unit 210 may be used to acquire image information of a high dynamic range HDR image to be processed, the HDR image includes a plurality of pixels, and the image information includes the RGB of the first pixel corresponding to the first percentage.
  • the maximum value of the component and the maximum value of the RGB component of the second pixel corresponding to the second percentage, the first percentage indicates that the maximum value of the RGB component in the plurality of pixels is less than or equal to the maximum value of the RGB component of the first pixel
  • the value of at least one pixel occupies a percentage of the plurality of pixels, and the second percentage indicates that at least one pixel of the plurality of pixels whose maximum RGB component is less than or equal to the maximum RGB component of the second pixel occupies
  • the percentage of the plurality of pixels, the maximum value of the RGB component represents the maximum value of the R component, the G component, and the B component of the one pixel, and the first percentage and the second percentage are both greater than 0 And less than 1.
  • the determining unit 220 may be used to determine the maximum value of the RGB component of the first pixel corresponding to the first percentage and the maximum value of the RGB component of the second pixel corresponding to the second percentage. Value, determine the reference maximum value of the HDR image; determine the maximum brightness correction value of the HDR image according to the reference maximum value and a plurality of preset grading intervals, wherein the grading interval is used to compare the reference The maximum value is graded, each of the multiple grading intervals corresponds to a value range of the reference maximum value, and the maximum brightness correction value is used to correct the multiple pixels included in the HDR image. The maximum value among the maximum values of RGB components.
  • the adjusting unit 230 is configured to adjust the dynamic range of the HDR image according to the maximum correction value of the HDR image.
  • the adjustment unit 230 may be used to adjust the dynamic range of the HDR image according to the maximum brightness correction value.
  • the image information further includes an average value among the maximum values of the RGB components of the multiple pixels
  • the determining unit 220 is specifically configured to: according to the first percentage, the The maximum value of the RGB component of the first pixel, the second percentage and the maximum value of the RGB component of the second pixel, the maximum value of the maximum value of the RGB component of the plurality of pixels, and the RGB of the plurality of pixels
  • the average value of the component maximum values determines the reference maximum value.
  • the determining unit 220 is specifically configured to determine the reference maximum value MAX according to the above formula (6).
  • each classification interval corresponds to an expression
  • the expression is used to calculate the maximum correction value of the HDR
  • the determining unit 220 is specifically configured to: The first grading interval to which the reference maximum value belongs is determined in the interval, and the first grading interval corresponds to a first expression; and the corrected maximum value is determined according to the first expression.
  • the device further includes: a verification unit 240 configured to use a third percentage and a third percentage corresponding to the third percentage in the HDR image according to the third percentage.
  • the maximum value of the RGB component of the pixel, the maximum value of the GRB component of the fourth pixel corresponding to the third percentage in the output image, the fourth percentage, and the corresponding fourth percentage in the HDR image The maximum value of the RGB component of the fifth pixel and the maximum value of the GRB component of the sixth pixel corresponding to the fourth percentage in the output HDR image are verified to verify the accuracy of the corrected maximum value.
  • the output image is
  • the HDR image is an image after dynamic range adjustment.
  • the determining unit 220 is specifically configured to: compare the maximum value of the RGB component of the first pixel corresponding to the first percentage and the second percentage corresponding to the The difference between the maximum value of the RGB component of the second pixel is determined as the brightness variation range of the HDR image; and the reference maximum value is determined according to the brightness variation range.
  • the determining unit 220 is specifically configured to determine the brightness variation range variance_maxrgb according to the above formula (7).
  • the image information further includes the maximum value among the maximum values of the RGB components of the plurality of pixels and the average value of the maximum values of the RGB components of the plurality of pixels, and the determining unit 220 specifically It is used to determine the reference maximum value according to the brightness variation range, the maximum value of the maximum value of the RGB component of the plurality of pixels, and the average value of the maximum value of the RGB component of the plurality of pixels.
  • the determining unit 220 is specifically configured to determine the reference maximum value MAX by using the above formula (8).
  • each grading interval corresponds to an expression
  • the expression is used to calculate the maximum brightness correction value
  • the determining unit 220 is specifically configured to: The first grading interval to which the reference maximum value belongs is determined in, and the first grading interval corresponds to a first expression; and the maximum brightness correction value is determined according to the first expression.
  • the determining unit 220 is further configured to: if the maximum brightness correction value is less than the maximum display brightness of the current display device applicable after the dynamic range of the HDR image is adjusted, the The maximum brightness correction value maximum_maxrgb1 is updated to the maximum display brightness of the current display device.
  • the device further includes: a verification unit 240, which is configured to correspond to the maximum value of the RGB component of the third pixel in the HDR image according to the third percentage, and the maximum value of the corresponding third pixel in the HDR image.
  • the maximum value of the GRB component of the fourth pixel corresponding to the third percentage in the processed image, the maximum value of the RGB component of the fifth pixel corresponding to the fourth percentage in the HDR image, and the fourth percentage The maximum value of the GRB component of the corresponding sixth pixel in the processed HDR image is divided to verify the accuracy of the maximum brightness correction value.
  • the processed image is the dynamic range adjustment of the HDR image image.
  • the verification unit 240 is specifically configured to: And When determining that the maximum brightness correction value is accurate, K 3 -K 4 ⁇ M, M is the preset first threshold, T is the preset second threshold, 0 ⁇ T ⁇ 2, and K 3 represents the The third percentage, Represents the maximum value of the RGB component of the third pixel, Represents the maximum value of the RGB component of the fourth pixel, K 4 represents the fourth percentage, Represents the maximum value of the RGB component of the fifth pixel, Represents the maximum value of the RGB component of the sixth pixel.
  • FIG. 8 shows an image processing device 300 provided by an embodiment of the present application.
  • the device 300 may include the device 200 described in FIG. 7 or the device 300 may be the device 200 described in FIG. 7.
  • the device 200 may adopt the hardware architecture shown in FIG. 8.
  • the device 300 may include a processor 310, a transceiver 320, and a memory 330, and the processor 310, the transceiver 320, and the memory 330 communicate with each other through an internal connection path.
  • the related functions implemented by the determining unit 220, the adjusting unit 230, and the verification unit 240 in FIG. 7 may be implemented by the processor 310, and the related functions implemented by the acquiring unit 210 may be implemented by the processor 310 controlling the transceiver 320.
  • the processor 310 may include one or more processors, such as one or more central processing units (CPU).
  • processors such as one or more central processing units (CPU).
  • CPU central processing units
  • the CPU may be a single-core CPU, or It can be a multi-core CPU.
  • the transceiver 320 is used to send and receive data and/or information, and to receive data and/or information.
  • the transceiver may include a transmitter and a receiver, the transmitter is used to send data and/or signals, and the receiver is used to receive data and/or signals.
  • the memory 330 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable memory (erasable read only memory, EPROM), read-only memory A compact disc (read-only memory, CD-ROM), and the memory 330 is used to store related instructions and data.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable memory
  • EPROM erasable read only memory
  • CD-ROM compact disc
  • the memory 330 is used to store related instructions and data.
  • the memory 330 is used to store program codes and data of the device, and may be a separate device or integrated in the processor 310.
  • FIG. 8 only shows a simplified design of the device 300.
  • the device 300 may also include other necessary components, including but not limited to any number of transceivers, processors, controllers, memories, etc., and all devices that can implement this application are within the protection scope of this application. within.
  • the device 300 may be replaced with a chip device, for example, a communication chip that can be used in the device to implement related functions of the processor in the device.
  • the chip device can be a field programmable gate array, a dedicated integrated chip, a system chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, and a programmable controller or other integrated chips for realizing related functions.
  • the chip may optionally include one or more memories for storing program codes. When the codes are executed, the processor realizes corresponding functions.
  • the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not correspond to the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Picture Signal Circuits (AREA)
  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

本申请实施例提供一种处理高动态范围图像的方法和装置,能够提升高动态范围图像的显示效果。该方法包括:获取待处理的高动态范围HDR图像的图像信息,该HDR图像包括多个像素,该图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值;根据该第一百分比对应的该第一像素的RGB分量最大值和该第二百分比对应的该第二像素的RGB分量最大值,确定该HDR图像的参考最大值;根据该参考最大值和预设的多个分级区间,确定该HDR图像的最大亮度校正值,该最大亮度校正值用于修正该HDR图像包括的该多个像素的RGB分量最大值中的最大值;根据该最大亮度校正值,调整该HDR图像的动态范围。

Description

处理高动态范围图像的方法和装置
本申请要求于2019年10月18日递交的申请号为201910995765.6、申请名称为“处理高动态范围图像的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域,并且更具体地,涉及一种处理高动态范围图像的方法和装置。
背景技术
动态范围(Dynamic Range,DR)在很多领域用来表示某个变量的最大值和最小值的比率。在数字图像中,动态范围表征了在图像可显示范围内的最大亮度与最小亮度之间的比率,也就是图像从“最亮”到“最暗”之间灰度划分的等级数,其单位为坎德拉每平方米(cd/m2),也可以表示为尼特(nits)。一个图像的动态范围越大,它所能表示的亮度层次越丰富,图像的视觉效果越逼真。由于真实世界中自然场景的动态范围在10-3到106之间,动态范围非常大,因此称之为高动态范围(High Dynamic Range,HDR)。相对于高动态范围图像,普通图像的动态范围为低动态范围(Low Dynamic Range,LDR)。
现阶段的显示设备,一般把动态范围不足0.1到400nits的称为标准动态范围(Standard Dynamic Range,SDR)显示设备;把动态范围超过0.01到540nits的称为高动态范围High Dynamic Range,HDR)显示设备,不同的高动态范围显示设备显示动态范围也不同,如0.01到540nits的高动态范围显示设备,0.005到1000nits的高动态范围显示设备等。为了使得HDR图像适应不同动态范围的HDR显示设备,需要对HDR图像进行动态范围调整(压缩或拉伸),以将HDR图像的高动态范围调整到显示设备的显示能力范围内进行显示。
现有技术中,HDR图像动态范围的调整,仅和图像的显示内容最大亮度和显示内容最小亮度,显示设备所能显示的最大亮度值和最小亮度值等参数相关。仅使用这些参数会导致HDR图像的亮度层次出现较多丢失,亮度对比不明显,调整后的HDR图像在显示设备上的显示效果不佳。
发明内容
本申请实施例提供一种处理HDR图像的方法和装置,能够提升HDR图像的显示效果。
第一方面,本申请实施例提供一种处理高动态范围图像的方法,所述方法包括:
获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1;
根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;
根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的修正最大值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述修正最大值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值;
根据所述HDR图像的修正最大值,调整所述HDR图像的动态范围。
采用本申请实施例提供的处理HDR图像的方法,由于第一像素的RGB分量最大值和第二像素的RGB分量最大值不是该HDR图像的显示内容最大亮度或显示内容最小亮度,因此,对基于上述像素得到的参考最大值进行分级,并根据参考最大值计算HDR图像的修正最大值,可以提升对不同等级的动态范围的HDR图像的分级准确性。因此,将该修正最大值应用于HDR图像的动态范围的调整,能够提升HDR图像的显示效果。
可选地,上述方法可以由图像处理装置执行。
可选地,该第一百分比可以为第一比例,该第二百分比可以为第二比例。
作为一个可选实施例,以HDR图像包括4个像素为例,第1个像素的RGB分量最大值为80,第2个像素的RGB分量最大值为30,第3个像素的RGB分量最大值为60,第4个RGB分量最大值为55,那么,25%对应第2个像素,50%对应第4个像素,75%对应第3个像素,100对应第1个像素。
也就是说,4个像素中,RGB分量最大值小于或等于30的像素(第2个像素)占4个像素中的25%,RGB分量最大值小于或等于55的像素(第2和第4个像素)占4个像素中的50%,RGB分量最大值小于或等于60的像素(第2、第4和第3个像素)占4个像素中的75%,RGB分量最大值小于或等于80的像素(第2、第4、第3和第1个像素)占4个像素中的100%。
需要说明的是,上述HDR图像中包括的多个像素可以理解为该HDR图像的有效显示区域包括的多个像素,该有效显示区域可以为该HDR图像中的部分区域或全部区域。
例如,该HDR图像的有效显示区域可以为由显示水平尺寸和显示垂直尺寸共同确定的矩形区域。
可选地,图像处理装置可以通过多种方式获取该HDR图像的图像信息,本申请实 施例对此不作限定。
在一种可能的实现方式中,该图像处理装置可以通过现有方法对该HDR图像进行计算,得到该图像信息。
在另一种可能的实现方式中,该图像处理装置可以通过该HDR图像携带的元数据获得该图像信息。
可选地,图像处理装置可以通过多种方式,根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值,本申请实施例对此不作限定。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的平均值,所述根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值,包括:根据所述第一百分比、所述第一像素的RGB分量最大值、所述第二百分比和所述第二像素的RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值中的平均值,确定所述参考最大值。
在一种可能的实现方式中,可以通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000001
其中,
Figure PCTCN2020107428-appb-000002
所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述average_maxrgb表示所述多个像素的RGB分量最大值中的平均值,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000003
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000004
表示所述第二像素的RGB分量最大值,F()表示预设函数,B、K 1和K 2为预设值,0<B<1,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
可选地,上述F()函数可以为常数函数或递增函数,本申请实施例对此不作限定。
例如,F(x)=x,或F(x)=x N,或F(x)=logx,或F(x)=ax+b,其中,a和b为常数。
本申请实施例提供的处理HDR图像的方法,maximum_maxrgb为100%对应的像素的RGB分量最大值,2×average_maxrgb为100%对应的像素的RGB分量最大值,K1-K2≥0.5为大于50%对应的像素的RGB分量最大值,通过对这3个维度设置不同的权重,得到最终的参考最大值,并根据该参考最大值最终调整HDR图像的RGB分量最大值中的最大值,能够避免现有技术中使用最大亮度调整时导致调整后的图像过暗的情况。
在一种可能的实现方式中,可以通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000005
其中,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000006
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000007
表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
采用本申请实施例提供的处理HDR图像的方法,由于上述PK1和PK2为HDR图 像中除显示内容最大亮度和最小亮度外的两个像素,通过这两个像素计算参考最大值,并根据该参考最大值最终调整HDR图像的RGB分量最大值中的最大值,能够避免现有技术中使用最大亮度调整时导致调整后的图像过暗的情况。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述HDR的修正最大值,所述根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的修正最大值,包括:从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述修正最大值。
在一种可能的实现方式中,可以通过如下公式确定所述HDR图像的修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000008
其中,所述MaxRefDisplay表示用于显示所述待处理的所述HDR图像的显示设备的最大显示亮度,所述MIN表示预设的分级阈值,所述MAX表示所述参考最大值。
在一种可能的实现方式中,可以通过如下公式确定所述HDR图像的修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000009
其中,所述maximux_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述MAX表示所述参考最大值,所述A表示预设的分级阈值,min()表示取最小值的运算,f()表示非线性函数或线性函数。
在一种可能的实现方式中,所述方法还包括:根据第三百分比、所述第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比、所述第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
需要说明的是,该修正最大值的准确性也可以理解为该HDR图像的分级准确性。
在一种可能的实现方式中,所述根据第三百分比、所述第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在输出图像中对应的第四像素的GRB分量最大值、第四百分比、所述第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述输出HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,包括:
Figure PCTCN2020107428-appb-000010
Figure PCTCN2020107428-appb-000011
时,确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三百分比,所述
Figure PCTCN2020107428-appb-000012
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000013
表示所述第四像素的RGB分量最大值,所述K 4表示所述第四百分比,所述
Figure PCTCN2020107428-appb-000014
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000015
表示所述第六像素的RGB分量最大值。
第二方面,本申请实施例还提供一种图像处理方法,所述方法包括:
获取待处理图像的图像信息,所述待处理图像包括多个像素,所述图像信息包括第一比值、第一RGB分量最大值、第二比值和第二RGB分量最大值,所述第一比值表示所述多个像素中RGB分量最大值小于或等于所述第一RGB分量最大值的像素与所述多个像素的数量的比值,所述第二比值表示所述多个像素中RGB分量最大值小于或等于所述第二RGB分量最大值的像素与所述多个像素的数量的比值,所述RGB分量最大值表示一个像素的R分量、G分量和B分量中最大的一个分量数值;
根据所述第一比值、所述第一RGB分量最大值、所述第二比值和所述第二RGB分量最大值,确定所述待处理图像的参考最大值;
根据所述参考最大值和预设的多个分级区间,对所述多个像素的RGB分量最大值中的最大值进行调整,以确定所述待处理图像的修正最大值,其中,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围;
根据所述待处理图像的修正最大值,调整所述待处理图像的动态范围。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值的平均值,所述根据所述第一比值、所述第一RGB分量最大值、所述第二比值和所述第二RGB分量最大值,确定所述待处理图像的参考最大值,包括:根据所述第一比值、所述第一RGB分量最大值、所述第二比值和所述第二RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000016
其中,
Figure PCTCN2020107428-appb-000017
所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述average_maxrgb表示所述多个像素的RGB分量最大值的平均值,所述K 1表示所述第一比值,所述
Figure PCTCN2020107428-appb-000018
表示所述第一RGB分量最大值,所述K 2表示所述第二比值,所述
Figure PCTCN2020107428-appb-000019
表示所述第二RGB分量最大值,F()表示预设函数,B、K 1和K 2为预设值,0<B<1,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000020
其中,所述K 1表示所述第一比值,所述
Figure PCTCN2020107428-appb-000021
表示所述第一RGB分量最大值,所述K 2表示所述第二比值,所述
Figure PCTCN2020107428-appb-000022
表示所述第二RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述待处理图像的修正最大值,所述待处理图像的修正最大值maximum_maxrgb1,通过如下公式确定:
Figure PCTCN2020107428-appb-000023
其中,所述MaxRefDisplay表示用于显示所述待处理图像的显示设备的最大显示亮度,所述MIN表示预设的分级阈值,所述MAX表示所述参考最大值。
在一种可能的实现方式中,所述方法还包括:根据第三比值、第三RGB分量最大值、第四GRB分量最大值、第四比值、第五RGB分量最大值和第六GRB分量最大值,验证所述修正最大值的准确性,其中,所述第三比值表示所述多个像素中RGB分量最大值小于或等于所述第三RGB分量最大值的像素与所述多个像素的数量的比值,所述第四GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第四RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第三比值,所述第四比值表示所述多个像素中RGB分量最大值小于或等于所述第五RGB分量最大值的像素与所述多个像素的数量的比值,所述第六GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第六RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第四比值,所述处理后图像为所述待处理图像经动态范围调整后的图像。
在一种可能的实现方式中,所述根据第三比值、第三RGB分量最大值、第四GRB分量最大值、第四比值、第五RGB分量最大值和第六GRB分量最大值,验证所述修正最大值的准确性,包括:
Figure PCTCN2020107428-appb-000024
Figure PCTCN2020107428-appb-000025
时,确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三比值,所述
Figure PCTCN2020107428-appb-000026
表示所述第三RGB分量最大值,P′ K3表示所述第四RGB分量最大值,所述K 4表示所述第四比值,所述
Figure PCTCN2020107428-appb-000027
表示所述第五RGB分量最大值,
Figure PCTCN2020107428-appb-000028
表示所述第六RGB分量最大值。
在一种可能的实现方式中,所述方法还包括以下至少一个步骤:
根据所述第一比值和所述多个像素,确定所述第一RGB分量最大值;
根据所述第二比值和所述多个像素,确定所述第二RGB分量最大值;
根据所述第三比值和所述多个像素,确定所述第三RGB分量最大值;
根据所述第三比值和所述处理后图像的像素,确定所述第四RGB分量最大值;
根据所述第四比值和所述多个像素,确定所述第五RGB分量最大值;或,
根据所述第四比值和所述处理后图像的像素,确定所述第六RGB分量最大值。
第三方面,本申请实施例还提供一种处理高动态范围图像的装置,所述装置包括:
获取单元,用于获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1;
确定单元,用于根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;根据所述参考最大值和预设的多个分级区间,确定所 述HDR图像的修正最大值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述修正最大值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值;
调整单元,用于根据所述HDR图像的修正最大值,调整所述HDR图像的动态范围。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的平均值,所述确定单元具体用于:根据所述第一百分比、所述第一像素的RGB分量最大值、所述第二百分比和所述第二像素的RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值中的平均值,确定所述参考最大值。
在一种可能的实现方式中,所述确定单元具体用于:通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000029
其中,
Figure PCTCN2020107428-appb-000030
所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述average_maxrgb表示所述多个像素的RGB分量最大值中的平均值,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000031
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000032
表示所述第二像素的RGB分量最大值,F()表示预设函数,B、K 1和K 2为预设值,0<B<1,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述确定单元具体用于:通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000033
其中,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000034
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000035
表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述HDR的修正最大值,所述确定单元具体用于:从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述修正最大值。
在一种可能的实现方式中,所述确定单元具体用于:通过如下公式确定所述HDR图像的修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000036
其中,所述MaxRefDisplay表示用于显示所述待处理的所述HDR图像的显示设备的最大显示亮度,所述MIN表示预设的分级阈值,所述MAX表示所述参考最大值。
在一种可能的实现方式中,所述装置还包括:验证单元,所述验证单元用于根据第三百分比、所述第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、 所述第三百分比在输出图像中对应的第四像素的GRB分量最大值、第四百分比、所述第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述输出HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,所述输出图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,所述验证单元具体用于:
Figure PCTCN2020107428-appb-000037
Figure PCTCN2020107428-appb-000038
时,确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三百分比,所述
Figure PCTCN2020107428-appb-000039
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000040
表示所述第四像素的RGB分量最大值,所述K 4表示所述第四百分比,所述
Figure PCTCN2020107428-appb-000041
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000042
表示所述第六像素的RGB分量最大值。
第四方面,本申请实施例还提供一种图像处理装置,所述装置包括:
获取单元,用于获取待处理图像的图像信息,所述待处理图像包括多个像素,所述图像信息包括第一比值、第一RGB分量最大值、第二比值和第二RGB分量最大值,所述第一比值表示所述多个像素中RGB分量最大值小于或等于所述第一RGB分量最大值的像素与所述多个像素的数量的比值,所述第二比值表示所述多个像素中RGB分量最大值小于或等于所述第二RGB分量最大值的像素与所述多个像素的数量的比值,所述RGB分量最大值表示一个像素的R分量、G分量和B分量中最大的一个分量数值;
确定单元,用于根据所述第一比值、所述第一RGB分量最大值、所述第二比值和所述第二RGB分量最大值,确定所述待处理图像的参考最大值;根据所述参考最大值和预设的多个分级区间,对所述多个像素的RGB分量最大值中的最大值进行调整,以确定所述待处理图像的修正最大值,其中,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围;
调整单元,用于根据所述待处理图像的修正最大值,调整所述待处理图像的动态范围。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值的平均值,所述确定单元具体用于:根据所述第一比值、所述第一RGB分量最大值、所述第二比值和所述第二RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在一种可能的实现方式中,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000043
其中,
Figure PCTCN2020107428-appb-000044
所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述average_maxrgb表示所述多个像素的RGB分量最大值的平均值,所述K 1表示所述第一比值,所述
Figure PCTCN2020107428-appb-000045
表示所述第一RGB分量最大值,所述K 2表示所述第二比值,所述
Figure PCTCN2020107428-appb-000046
表示所述第二RGB分量最大值,F()表示预设函数,B、K 1和K 2为预设值,0<B<1,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000047
其中,所述K 1表示所述第一比值,所述
Figure PCTCN2020107428-appb-000048
表示所述第一RGB分量最大值,所述K 2表示所述第二比值,所述
Figure PCTCN2020107428-appb-000049
表示所述第二RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述待处理图像的修正最大值,所述确定单元具体用于通过如下公式确定所述待处理图像的修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000050
其中,所述MaxRefDisplay表示用于显示所述待处理图像的显示设备的最大显示亮度,所述MIN表示预设的分级阈值,所述MAX表示所述参考最大值。
在一种可能的实现方式中,所述装置还包括验证单元,所述验证单元用于:根据第三比值、第三RGB分量最大值、第四GRB分量最大值、第四比值、第五RGB分量最大值和第六GRB分量最大值,验证所述修正最大值的准确性,其中,所述第三比值表示所述多个像素中RGB分量最大值小于或等于所述第三RGB分量最大值的像素与所述多个像素的数量的比值,所述第四GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第四RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第三比值,所述第四比值表示所述多个像素中RGB分量最大值小于或等于所述第五RGB分量最大值的像素与所述多个像素的数量的比值,所述第六GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第六RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第四比值,所述处理后图像为所述待处理图像经动态范围调整后的图像。
在一种可能的实现方式中,所述验证单元具体用于:
Figure PCTCN2020107428-appb-000051
Figure PCTCN2020107428-appb-000052
时,确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三比值,所述
Figure PCTCN2020107428-appb-000053
表示所述第三RGB分量最大值,P′ K3表示所述第四RGB分量最大值,所述K 4表示所述第四比值,所述
Figure PCTCN2020107428-appb-000054
表示所述第五RGB分量最大值,
Figure PCTCN2020107428-appb-000055
表示所述第六RGB分量最大值。
在一种可能的实现方式中,所述确定单元还用于执行以下至少一个步骤:
根据所述第一比值和所述多个像素,确定所述第一RGB分量最大值;
根据所述第二比值和所述多个像素,确定所述第二RGB分量最大值;
根据所述第三比值和所述多个像素,确定所述第三RGB分量最大值;
根据所述第三比值和所述处理后图像的像素,确定所述第四RGB分量最大值;
根据所述第四比值和所述多个像素,确定所述第五RGB分量最大值;或,
根据所述第四比值和所述处理后图像的像素,确定所述第六RGB分量最大值。
第五方面,本申请实施例还提供一种处理高动态范围图像的方法,所述方法包括: 获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1;根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述最大亮度校正值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值;
根据所述最大亮度校正值,调整所述HDR图像的动态范围。
在一种可能的实现方式中,所述第一百分比大于所述第二百分比,所述根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值,包括:将所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值的差,确定为所述HDR图像的亮度变化范围;根据所述亮度变化范围,确定所述参考最大值。
在一种可能的实现方式中,通过如下公式确定所述亮度变化范围variance_maxrgb:
Figure PCTCN2020107428-appb-000056
其中,K 1表示所述第一百分比,
Figure PCTCN2020107428-appb-000057
表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
Figure PCTCN2020107428-appb-000058
表示所述第二像素的RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述根据所述亮度变化范围,确定所述参考最大值,包括:根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
其中,
Figure PCTCN2020107428-appb-000059
maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000060
其中,K 1表示所述第一百分比,
Figure PCTCN2020107428-appb-000061
表示所述第一像素的RGB分量最大值,K 2表 示所述第二百分比,
Figure PCTCN2020107428-appb-000062
表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,包括:从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述最大亮度校正值。
在一种可能的实现方式中,通过如下公式确定所述HDR图像的最大亮度校正值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000063
其中,MaxRefDisplay表示所述HDR图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
在一种可能的实现方式中,所述方法还包括:若所述最大亮度校正值小于所述HDR图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更新为所述当前显示设备的最大显示亮度。
在一种可能的实现方式中,所述方法还包括:根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述最大亮度校正值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,所述根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,包括:当
Figure PCTCN2020107428-appb-000064
Figure PCTCN2020107428-appb-000065
时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,K 3表示所述第三百分比,
Figure PCTCN2020107428-appb-000066
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000067
表示所述第四像素的RGB分量最大值,K 4表示所述第四百分比,
Figure PCTCN2020107428-appb-000068
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000069
表示所述第六像素的RGB分量最大值。
第六方面,本申请实施例还提供一种图像处理方法,所述方法包括:获取待处理图像的图像信息,所述待处理图像包括多个像素,所述图像信息包括第一比值对应的第一RGB分量最大值和第二比值对应的第二RGB分量最大值,所述第一比值表示所述多个像素中RGB分量最大值小于或等于所述第一RGB分量最大值的像素与所述多个像素的数量的比值,所述第二比值表示所述多个像素中RGB分量最大值小于或等于所述第二RGB分量最大值的像素与所述多个像素的数量的比值,所述RGB分量最大值表示一个像素的R分量、G分量和B分量中最大的一个分量数值;根据所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值, 确定所述待处理图像的参考最大值;根据所述参考最大值和预设的多个分级区间,对所述多个像素的RGB分量最大值中的最大值进行调整,以确定所述待处理图像的最大亮度校正值,其中,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围;根据所述最大亮度校正值,调整所述待处理图像的动态范围。
在一种可能的实现方式中,所述第一比值大于所述第二比值,所述根据所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值,确定所述待处理图像的参考最大值,包括:将所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值的差,确定为所述待处理图像的亮度变化范围;根据所述亮度变化范围,确定所述参考最大值。
在一种可能的实现方式中,通过如下公式确定所述亮度变化范围variance_maxrgb:
Figure PCTCN2020107428-appb-000070
其中,K 1表示所述第一比值,
Figure PCTCN2020107428-appb-000071
表示所述第一RGB分量最大值,K 2表示所述第二比值,
Figure PCTCN2020107428-appb-000072
表示所述第二RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述根据所述亮度变化范围,确定所述参考最大值,包括:根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
其中,
Figure PCTCN2020107428-appb-000073
maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
在一种可能的实现方式中,通过如下公式确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000074
其中,K 1表示所述第一比值,
Figure PCTCN2020107428-appb-000075
表示所述第一RGB分量最大值,K 2表示所述第二比值,
Figure PCTCN2020107428-appb-000076
表示所述第二RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述最大亮度校正值maximum_maxrgb1通过如下公式确定:
Figure PCTCN2020107428-appb-000077
其中,MaxRefDisplay表示所述待处理图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
在一种可能的实现方式中,所述方法还包括:若所述最大亮度校正值小于所述待处理图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮 度校正值maximum_maxrgb1更改为所述当前显示设备的最大显示亮度。
在一种可能的实现方式中,所述方法还包括:根据第三比值对应的第三RGB分量最大值、所述第三比值对应的第四GRB分量最大值、第四比值对应的第五RGB分量最大值和所述第四比值对应的第六GRB分量最大值,验证所述最大亮度校正值的准确性,其中,所述第三比值表示所述多个像素中RGB分量最大值小于或等于所述第三RGB分量最大值的像素与所述多个像素的数量的比值,所述第四GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第四RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第三比值,所述第四比值表示所述多个像素中RGB分量最大值小于或等于所述第五RGB分量最大值的像素与所述多个像素的数量的比值,所述第六GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第六RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第四比值,所述处理后图像为所述待处理图像经动态范围调整后的图像。
在一种可能的实现方式中,所述根据第三比值对应的第三RGB分量最大值、所述第三比值对应的第四GRB分量最大值、第四比值对应的第五RGB分量最大值和所述第四比值对应的第六GRB分量最大值,验证所述最大亮度校正值的准确性,包括:
Figure PCTCN2020107428-appb-000078
Figure PCTCN2020107428-appb-000079
时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所K 3表示所述第三比值,
Figure PCTCN2020107428-appb-000080
表示所述第三RGB分量最大值,P′ K3表示所述第四RGB分量最大值,K 4表示所述第四比值,
Figure PCTCN2020107428-appb-000081
表示所述第五RGB分量最大值,
Figure PCTCN2020107428-appb-000082
表示所述第六RGB分量最大值。
在一种可能的实现方式中,所述方法还包括以下至少一个步骤:根据所述第一比值和所述多个像素,确定所述第一RGB分量最大值;根据所述第二比值和所述多个像素,确定所述第二RGB分量最大值;根据所述第三比值和所述多个像素,确定所述第三RGB分量最大值;根据所述第三比值和所述处理后图像的像素,确定所述第四RGB分量最大值;根据所述第四比值和所述多个像素,确定所述第五RGB分量最大值;或,根据所述第四比值和所述处理后图像的像素,确定所述第六RGB分量最大值。
第七方面,本申请实施例还提供一种图像处理装置,所述装置用于执行上述第五方面或第五方面的各种可能的实现方式中所述的方法。可选地,所述装置可以包括用于执行上述第五方面或第五方面的各种可能的实现方式中所述的方法的单元。
第八方面,本申请实施例还提供一种图像处理装置,所述装置用于执行上述第六方面或第六方面的各种可能的实现方式中所述的方法。可选地,所述装置可以包括用于执行上述第六方面或第六方面的各种可能的实现方式中所述的方法的单元。
第九方面,本申请实施例还提供一种图像处理的设备,所述设备包括处理器和存储器,所述处理器和所述存储器耦合,所述处理器用于使得所述装置执行上述各方面或各方面的各种可能的实现方式中所述的方法。
第十方面,本申请实施例还提供一种芯片装置,包括:输入接口、输出接口、至少一个处理器、存储器,所述输入接口、所述输出接口、所述处理器以及所述存储器之间通过内部连接通路互相通信,所述处理器用于执行所述存储器中的代码,其特征在于,当所述处理器执行所述代码时,所述芯片装置实现上述各方面或各方面的各种 可能的实现方式中所述的方法。
第十一方面,本申请提供一种计算机可读存储介质,用于存储计算机程序,其特征在于,所述计算机程序包括用于实现上述各方面或各方面的各种可能的实现方式中所述的方法的指令。
第十二方面,本申请提供一种计算机程序产品,所述计算机程序产品中包含指令,其特征在于,当所述指令在计算机上运行时,使得计算机实现上述各方面或各方面的各种可能的实现方式中所述的方法。
附图说明
图1为PQ光电转移函数的图像。
图2为HLG光电转移函数的图像。
图3为SLF光电转移函数的图像。
图4为本申请实施例提供的高动态范围图像的动态范围调整曲线的示意图。
图5为本申请实施例提供的图像处理的应用场景。
图6为本申请实施例提供的处理高动态范围图像的方法100的示意图。
图7为本申请实施例提供的图像处理装置200的示意图。
图8为本申请实施例提供的图像处理设备300的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
首先,对本申请实施例中涉及的相关概念和技术作简单介绍。
动态范围(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)。由此可以理解的是,数码相机的成像过程实际上就是真实世界的高动态范围到相片的低动态范围的映射。
图像的动态范围越大,表明图像显示的场景细节越多,亮度的层次越丰富,视觉效果越逼真。传统的数字图像一般采用一个字节,即8比特的空间来存储一个像素值,而高动态范围采用浮点数多字节来存储一个像素值,因此,能够表示出自然场景的高动态范围。
光学数字成像的过程(例如,数码相机的成像过程)是将真实场景的光辐射通过图像传感器转化为电信号,并以数字图像的方式保存下来。而图像显示的目的是通过 显示设备重现一幅数字图像所描述的真实场景。两者的最终目标是使用户获得与其直接观察真实场景相同的视觉感知。
而光辐射(光信号)所能展示的真实场景中的亮度层次几乎是线性的,因此也将光信号称为线性信号。但是,光学数字成像在将光信号转换为电信号的过程中,并不是每一个光信号都对应着一个电信号,转换得到的电信号是非线性的。因此,也将电信号称为非线性信号。
光电转移函数(Optical Electro Transfer Function,OETF)表示图像像素的线性信号到非线性信号转换关系。随着显示设备的不断升级,相对于传统的显示设备,现阶段的显示设备所能显示的动态范围不断增大。现有的消费者级的HDR显示器可达到600cd/m 2,高端HDR显示器能达到2000cd/m 2,已经远远超出了传统SDR显示设备的显示范围。因此,国际电信联盟无线通信组(International Telecommunications Union-Radio Communications Sector,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光电转移函数是根据人眼的亮度感知模型提出的感知量化光电转移函数。参见图1,图1为PQ光电转移函数的图像。
PQ光电转移函数表示图像像素的线性信号值到PQ域非线性信号值的转换关系,PQ光电转移函数可以表示为公式(1):
Figure PCTCN2020107428-appb-000083
其中,式(1)中各参数的计算如下:
Figure PCTCN2020107428-appb-000084
其中,L表示线性信号值,其值归一化为[0,1],L'表示非线性信号值,其值取值范围为[0,1],m 1、m 2、c 1、c 2、c 3为PQ光电转移系数,
Figure PCTCN2020107428-appb-000085
Figure PCTCN2020107428-appb-000086
Figure PCTCN2020107428-appb-000087
HLG光电转移函数是在传统的Gamma曲线的基础上改进得到的。参见图2,图2为HLG光电转移函数的图像。
HLG光电转移函数在低段应用传统的Gamma曲线,在高段补充了log曲线。HLG光电转移函数表示图像像素的线性信号值到HLG域非线性信号值的转换关系,HLG光电转移函数可表示为公式(2):
Figure PCTCN2020107428-appb-000088
其中,L表示线性信号值,其取值范围为[0,12],L'表示非线性信号值,其取值范围为[0,1],a、b、c为HLG光电转移系数,a=0.17883277,b=0.28466892,c=0.55991073。
SLF光电转移函数是在满足人眼光学特性的前提下,根据HDR场景亮度分布获得的最优曲线。参见图3,图3为SLF光电转移函数的图像。
SLF光电转移曲线表示图像像素的线性信号值到SLF域非线性信号值的转换关系。图像像素的线性信号值到SLF域非线性信号值的转换关系如公式(3)所示:
Figure PCTCN2020107428-appb-000089
其中,SLF光电转移函数可以表示为公式(4):
Figure PCTCN2020107428-appb-000090
其中,L表示线性信号值,其值归一化为[0,1],L'表示非线性信号值,其值取值范围为[0,1],p、m、a、b为SLF光电转移系数,p=2.3,m=0.14,a=1.12762,b=-0.12762。
由于现有的显示设备所能显示的动态范围是有限的,无法直接显示一张高动态范围的图像(如:最大亮度达到1000nits或10000nits等)。并且,不同的显示设备,其显示能力也各不相同。因此,一般会根据显示设备的显示能力,采用动态范围调整算法将高动态范围图像进行动态范围调整。
换句话说,就是将HDR图像的动态范围调整到显示设备所能显示的动态范围内进行显示,或将HDR图像的动态范围从一个显示设备(如参考显示设备)所能显示的动态范围,调整到另一个显示设备(如当前显示设备)所能显示的动态范围内进行显示。这里,nits(尼特)为表征亮度的单位,等同于坎德拉每平方米(cd/m 2)。
但是,现有技术中仅使用图像内容统计最大值、图像内容统计最小值、显示设备所能显示的最大亮度值和最小亮度值等参数。采用这种方式调整后的HDR图像的亮度层次会出现较多丢失,导致调整后的显示效果不佳。
为此,本申请提供一种处理HDR图像的方法,根据HDR图像的图像信息计算HDR图像的修正最大值,其中,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比和所述第二百分比大于0且小于1,所述修正最大值用于修正所述HDR图像包括的多个像素的RGB分量最大值中的最大值,然后根据该修正最大值调整HDR图像的动态范围,能够提升HDR图像的显示效果。
需要说明的是,本申请实施例中所述的HDR图像可以为光信号或电信号,本申请 实施例对此不作限定。
还需要说明的是,当HDR图像为光信号时,可以通过上述三种光电转换函数,将光信号转换为电信号。
在一种可能的实现方式中,图4示出了通过当前显示设备显示参考显示设备所能显示的HDR图像时,HDR图像的动态范围调整曲线的示意图。参见图4,图中的横坐标表示动态范围调整前HDR图像的亮度,纵坐标表示动态范围调整后图像的亮度。曲线1~曲线5为几种不同的调整曲线的示例,这几条曲线的形状都为“S”型,曲线的斜率先上升后下降。用一条平滑的“S”型将(L 1,L' 1)和(L 2,L' 2)两个端点连接起来,使用这样的曲线对HDR图像动态范围进行调整,就将HDR图像从该参考显示设备所能显示的动态范围[L 1,L 2],调整至该当前显示设备所能显示的动态范围[L' 1,L' 2],其中,L 1一般使用图像的显示内容最大亮度,是对HDR图像的图像内容进行统计得到的真实最大值,例如OETF(10000nits),L 2一般使用图像的显示内容最小亮度,是对HDR图像的图像内容进行统计得到的最小值,例如0,L' 1为显示设备所能显示的最大值,例如OETF(100nits),L' 2为显示设备所能显示的最小值,例如OETF(0.005nits)。
例如,以曲线5为例,(L 1,L' 1)和(L 2,L' 2)两个端点具体为A(x 1,y 1)和B(x 2,y 2),用一条平滑S型曲线将C(x 3,y 3)和D(x 4,y 4)连接起来后,这条曲线(即,曲线5)所表示是将HDR图像的动态范围从0~10000(nits)调整至0.005(nits)~100(nits)。从而,对应亮度范围的显示设备可以对压缩后的动态范围为0.005(nits)~100(nits)的图像进行显示。
从上面描述的HDR图像的动态范围调整的过程可知,采用HDR图像的显示内容最大亮度L 1对HDR图像的动态范围进行调整。在很多的自然场景下,如果只有少数的像素点,例如噪声点,的亮度在L 1附近或等于L 1,而其余的大部分像素点的亮度与L 1的差值比较大,会导致调整后的图像在显示设备上显示整体偏暗,视觉效果不佳。
对于这个问题,本申请实施例进一步提供了一种计算HDR图像的修正最大值的方法,该修正最大值用于修正HDR图像中多个像素的RGB分量最大值中的最大值,并将根据该方法计算得到的HDR图像的修正最大值应用于该HDR图像的动态范围调整,可以进一步提升HDR图像在显示设备上显示的视觉效果。
图5为本申请实施例提供的处理HDR图像的方法的应用场景。参见图5,图像处理装置获取到待处理的HDR图像后,对该待处理的HDR图像进行动态范围的调整,并输出调整后的HDR图像。
图6为本申请实施例提供的处理HDR图像的方法100的示意性流程图,该方法100适用于图5中提供的应用场景,并由例如图5中所示的图像处理装置执行。参见图6,方法100包括如下S110~S140。
S110、获取待处理的HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、第二百分比和所述第二百分比对应的第二像素的RGB分量最大值。其中,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素 的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1。
可选地,该第一百分比可以为第一比例,该第二百分比可以为第二比例。
其中,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1。
例如,以HDR图像包括4个像素为例,第1个像素的RGB分量最大值为80,第2个像素的RGB分量最大值为30,第3个像素的RGB分量最大值为60,第4个RGB分量最大值为55,那么,25%对应第2个像素,50%对应第4个像素,75%对应第3个像素,100对应第1个像素。
也就是说,4个像素中,RGB分量最大值小于或等于30的像素(第2个像素)占4个像素中的25%,RGB分量最大值小于或等于55的像素(第2和第4个像素)占4个像素中的50%,RGB分量最大值小于或等于60的像素(第2、第4和第3个像素)占4个像素中的75%,RGB分量最大值小于或等于80的像素(第2、第4、第3和第1个像素)占4个像素中的100%。
需要说明的是,上述HDR图像中包括的多个像素可以理解为该HDR图像的有效显示区域包括的多个像素,该有效显示区域可以为该HDR图像中的部分区域或全部区域。
例如,该HDR图像的有效显示区域可以为由显示水平尺寸和显示垂直尺寸共同确定的矩形区域。
可选地,S110中,图像处理装置可以通过多种方式获取该HDR图像的图像信息,本申请实施例对此不作限定。
在一种可能的实现方式中,该图像处理装置可以通过现有方法对该HDR图像进行计算,得到该图像信息。
在另一种可能的实现方式中,该图像处理装置可以通过该HDR图像携带的元数据获得该图像信息。
可选地,S110也可以为:获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1。
可选地,该第一百分比可以理解为第一比例或第一比值,该第二百分比可以理解为第二比例或第二比值。
可选地,该图像处理装置可以通过多种方式获取该第一百分比对应的该第一像素 的RGB最大值和该第二百分比对应的该第二像素的RGB最大值,本申请实施例对此不作限定。
在一种可能的实现方式中,该图像处理装置可以确定该HDR图像包括的该多个像素中每个像素的R分量值、G分量值和B分量值;将该每个像素的该R分量值、该G分量值和该B分量值中的最大值,确定为该每个像素的RGB分量最大值;根据该多个像素中的该每个像素的RGB分量最大值,确定该第一百分比对应的该第一像素的RGB分量最大值和该第二百分比对应的该第二像素的RGB最大值,其中,该多个像素中RGB分量最大值小于或等于该第一像素的RGB分量最大值的像素数量占该多个像素的百分比为该第一百分比,该多个像素中RGB分量最大值小于或等于该第二像素的RGB分量最大值的像素数量占该多个像素的百分比为该第二百分比。
S120、根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值。
可选地,图像处理装置可以通过多种方式,根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值,本申请实施例对此不作限定。
在一种可能的实现方式中,图像处理装置可以通过如下公式(5)确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000091
其中,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000092
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000093
表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
采用本申请实施例提供的处理HDR图像的方法,由于上述
Figure PCTCN2020107428-appb-000094
Figure PCTCN2020107428-appb-000095
为HDR图像中除显示内容最大亮度和最小亮度外的两个像素,通过这两个像素计算参考最大值,并根据该参考最大值最终调整HDR图像的RGB分量最大值中的最大值,能够避免现有技术中使用最大亮度调整时导致调整后的图像过暗的情况。
可选地,所述图像信息还包括所述多个像素的RGB分量最大值中的平均值,图像处理装置可以根据所述第一百分比、所述第一像素的RGB分量最大值、所述第二百分比和所述第二像素的RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值中的平均值,确定所述参考最大值。
在另一种可能的实现方式中,图像处理装置可以通过如下公式(6)确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000096
其中,
Figure PCTCN2020107428-appb-000097
所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述average_maxrgb表示所述多个像素的RGB分量最大值中的平均值,所述K 1表示所述第一百分比,所述
Figure PCTCN2020107428-appb-000098
表示所述第一像素的RGB分量最大值,所述K 2表示所述第二百分比,所述
Figure PCTCN2020107428-appb-000099
表示所述第二像素的RGB 分量最大值,F()表示预设函数,B、K 1和K 2为预设值,0<B<1,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
可选地,S120也可以为:根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值。
可选地,图像处理装置可以将所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值的差,确定为所述HDR图像的亮度变化范围;根据所述亮度变化范围,确定所述参考最大值。
在一种可能的实现方式中,图像处理装置可以通过如下公式(7)确定所述亮度变化范围variance_maxrgb:
Figure PCTCN2020107428-appb-000100
其中,K 1表示所述第一百分比,
Figure PCTCN2020107428-appb-000101
表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
Figure PCTCN2020107428-appb-000102
表示所述第二像素的RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
可选地,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,图像处理装置可以根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在另一种可能的实现方式中,图像处理装置可以通过如下公式(8)确定所述参考最大值MAX:
Figure PCTCN2020107428-appb-000103
其中,
Figure PCTCN2020107428-appb-000104
maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
可选地,上述公式(6)和公式(8)中的F()函数可以为常数函数或递增函数,本申请实施例对此不作限定。
例如,F(x)=x,或F(x)=x N,或F(x)=logx,或F(x)=ax+b,其中,a和b为常数。
又例如,公式(6)和公式(8)中,B可以取1/3。
本申请实施例提供的处理HDR图像的方法,maximum_maxrgb为100%对应的像素的RGB分量最大值,2×average_maxrgb为100%对应的像素的RGB分量最大值,K1-K2≥0.5为大于50%对应的像素的RGB分量最大值,通过对这3个维度设置不同的权重,得到最终的参考最大值,并根据该参考最大值最终调整HDR图像的RGB分量最大值中的最大值,能够避免现有技术中使用最大亮度调整时导致调整后的图像过暗的情况。
S130、根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的修正最大值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述修正最大值用于修正所述 HDR图像包括的所述多个像素的RGB分量最大值中的最大值。
需要说明的是,对一个参数(例如,参考最大值)进行分级(也称为,参数分级),是指按照不同的取值范围将这个参数划分为不同的级别。该参数的不同取值可能会落在不同取值范围,而落在不同取值范围的数值则说它们分属不同的级(或,级别)。关于参数分级的概念也可以参考现有技术,这里不作详细说明。
可选地,所述每个分级区间对应一个表达式,所述表达式用于计算所述HDR的修正最大值,S130可以为:图像处理装置从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述修正最大值。
可选地,该多个分级区间以及每个分级区间对应的表达式可以有多种设置方式,本申请实施例对此不作限定。
在一种可能的实现方式中,该多个分级区间包括3个分级区间时,可以通过如下公式(9)确定该修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000105
其中,所述MaxRefDisplay表示用于显示所述待处理的所述HDR图像的显示设备的最大显示亮度,所述MIN表示预设的分级阈值,所述MAX表示所述参考最大值。
可选地,所述MaxRefDisplay可以通过该HDR图像携带的元数据获得。
在另一种可能的实现方式中,该多个分级区间包括2个分级区间时,可以通过如下公式(10)确定该修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000106
其中,所述maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,所述MAX表示所述参考最大值,所述A表示预设的分级阈值,min()表示取最小值的运算,f()表示非线性函数或线性函数。
例如,该预设的分级阈值可以为显示设备的最大显示亮度。
需要说明的是,公式(9)和公式(10)仅示例性示出将参考最大值分为2个分级区间和3个分级区间的情况,以及每个分级与表达式的对应关系。本申请实施例还可以将参考最大值分级为其它数量的分级区间,并设置与每个分级区间对应的表达式,本申请实施例对此不作限定。
因此,根据待处理HDR图像的图像信息,计算得到该HDR图像的参考最大值,并根据该参考最大值的所属的分级区间,计算得到该HDR图像的修正最大值,并将该修正最大值作为调整该待处理的HDR图像的动态范围时的RGB分量最大值中的最大值。
可选地,本申请实施例中所述的修正最大值也可以称为最大亮度校正值。
可选地,S130也可以为:根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述最大亮度校正值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大 值。
可选地,所述每个分级区间对应一个表达式,所述表达式用于计算所述HDR的修正最大值,S130可以包括:图像处理装置从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述最大亮度校正值。
可选地,该多个分级区间以及每个分级区间对应的表达式可以有多种设置方式,本申请实施例对此不作限定。
在一种可能的实现方式中,该多个分级区间包括3个分级区间时,可以通过如下公式(11)确定该修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000107
其中,MaxRefDisplay表示所述HDR图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
可选地,所述MaxRefDisplay可以通过该HDR图像携带的元数据获得。
在另一种可能的实现方式中,该多个分级区间包括2个分级区间时,可以通过如下公式(12)确定该修正最大值maximum_maxrgb1:
Figure PCTCN2020107428-appb-000108
其中,maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,MAX表示所述参考最大值,A表示预设的分级阈值,min()表示取最小值的运算,f()表示非线性函数或线性函数。
例如,该预设的分级阈值可以为所述HDR图像的动态范围调整前所适用的参考显示设备的最大显示亮度。
需要说明的是,公式(11)和公式(12)仅示例性示出将参考最大值分为2个分级区间和3个分级区间的情况,以及每个分级与表达式的对应关系。本申请实施例还可以将参考最大值分级为其它数量的分级区间,并设置与每个分级区间对应的表达式,本申请实施例对此不作限定。
因此,根据待处理HDR图像的图像信息,计算得到该HDR图像的参考最大值,并根据该参考最大值的所属的分级区间,计算得到该HDR图像的最大亮度校正值,并将该最大亮度校正值作为调整该待处理的HDR图像的动态范围时的RGB分量最大值中的最大值。
此外,若所述最大亮度校正值小于所述HDR图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更新为所述当前显示设备的最大显示亮度。
S140、根据所述修正最大值,调整所述HDR图像的动态范围。
需要说明的是,根据所述修正最大值调整HDR图像的动态范围的具体过程,可以参见前文图4中所作的说明,为避免重复,这里不再赘述。
本申请实施例提供的处理HDR图像的方法,通过对参考最大值进行分级,并根据参考最大值计算HDR图像的修正最大值,可以提升对不同等级的动态范围的HDR图 像的分级准确性。因此,将该修正最大值应用于HDR图像的动态范围的调整,能够提升HDR图像的显示效果。
可选地,本申请实施例还提供对该HDR图像的修正最大值的准确性的验证方法。
需要说明的是,该修正最大值的准确性也可以理解为该HDR图像的分级准确性。
可选地,该修正最大值的验证方法包括:图像处理装置根据第三百分比、所述第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在输出图像中对应的第四像素的GRB分量最大值、第四百分比、所述第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述输出HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,所述输出图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,当
Figure PCTCN2020107428-appb-000109
Figure PCTCN2020107428-appb-000110
时,图像处理装置可以确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三百分比,所述
Figure PCTCN2020107428-appb-000111
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000112
表示所述第四像素的RGB分量最大值,所述K 4表示所述第四百分比,所述
Figure PCTCN2020107428-appb-000113
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000114
表示所述第六像素的RGB分量最大值。
例如,以K 3=100%,K 4=99%为例,调整前的HDR图像中P 100≠P 99,说明K 3对应的像素与K 4对应的像素不相等;那么调整后的HDR图像中K 3对应的像素也应不等于K 4对应的像素,即P′ 100-P′ 99>T。
相应地,当
Figure PCTCN2020107428-appb-000115
Figure PCTCN2020107428-appb-000116
时,图像处理装置可以确定所述修正最大值不准确。
可选地,图像处理装置可以根据如下公式(13)对该修正最大值进行校准,得到校准后的修正最大值maximum_maxrgb1':
Figure PCTCN2020107428-appb-000117
其中,所述maximum_maxrgb1为修正最大值,所述offset为预设的偏移值,且0<offset<1。
可选地,S140也可以为:根据所述最大亮度校正值,调整所述HDR图像的动态范围。
需要说明的是,根据所述最大亮度校正值调整HDR图像的动态范围的具体过程,可以参见前文图4中所作的说明,为避免重复,这里不再赘述。
本申请实施例提供的处理HDR图像的方法,通过对参考最大值进行分级,并根据参考最大值计算HDR图像的最大亮度校正值,可以提升对不同等级的动态范围的HDR图像的分级准确性。因此,将该最大亮度校正值应用于HDR图像的动态范围的调整,能够提升HDR图像的显示效果。
可选地,本申请实施例还提供对该HDR图像的最大亮度校正值的准确性的验证方法。
需要说明的是,该最大亮度校正值的准确性也可以理解为该HDR图像的分级准确性。
可选地,该最大亮度校正值的验证方法可以包括:图像处理装置根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述最大亮度校正值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,当
Figure PCTCN2020107428-appb-000118
Figure PCTCN2020107428-appb-000119
时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,K 3表示所述第三百分比,
Figure PCTCN2020107428-appb-000120
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000121
表示所述第四像素的RGB分量最大值,K 4表示所述第四百分比,
Figure PCTCN2020107428-appb-000122
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000123
表示所述第六像素的RGB分量最大值。
例如,以K 3=100%,K 4=99%为例,调整前的HDR图像中P 100≠P 99,说明K 3对应的像素与K 4对应的像素不相等;那么调整后的HDR图像中K 3对应的像素也应不等于K 4对应的像素,即P′ 100-P′ 99>T。
相应地,当
Figure PCTCN2020107428-appb-000124
Figure PCTCN2020107428-appb-000125
时,图像处理装置可以确定所述最大亮度校正值不准确。
可选地,图像处理装置可以根据如下公式(14)对该最大亮度校正值进行校准,得到校准后的最大亮度校正值maximum_maxrgb1':
Figure PCTCN2020107428-appb-000126
其中,maximum_maxrgb1'为校准后的最大亮度校正值,所述offset为预设的偏移值,且0<offset<1。
上面结合图1至图6介绍了本申请实施例提供的处理HDR图像的方法,下面将结合图7和图8介绍本申请实施例提供的图像处理装置和图像处理设备。
图7示出了本申请实施例提供的处理HDR图像的装置200的示意性框图。该装置200包括:
获取单元210,用于获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比大于0且小于1。
也就是说,该获取单元210可以用于获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分 量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1。
确定单元220,用于根据所述第一百分比、所述第一百分比对应的第一像素的RGB分量最大值、所述第二百分比和所述第二百分比对应的第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的修正最大值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述修正最大值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值。
也就是说,该确定单元220可以用于根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述最大亮度校正值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值。
调整单元230,用于根据所述HDR图像的修正最大值,调整所述HDR图像的动态范围。
也就是说,该调整单元230可以用于根据所述最大亮度校正值,调整所述HDR图像的动态范围。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的平均值,所述确定单元220具体用于:根据所述第一百分比、所述第一像素的RGB分量最大值、所述第二百分比和所述第二像素的RGB分量最大值、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值中的平均值,确定所述参考最大值。
在一种可能的实现方式中,所述确定单元220具体用于:通过上述公式(6)确定所述参考最大值MAX。
在一种可能的实现方式中,所述确定单元220具体用于:通过上述公式(5)确定所述参考最大值MAX。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述HDR的修正最大值,所述确定单元220具体用于:从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述修正最大值。
在一种可能的实现方式中,所述确定单元220具体用于:通过上述公式(9)确定所述HDR图像的修正最大值maximum_maxrgb1。
在一种可能的实现方式中,所述装置还包括:验证单元240,所述验证单元240用于根据第三百分比、所述第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在输出图像中对应的第四像素的GRB分量最大值、第四百分比、所述第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述 第四百分比在所述输出HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,所述输出图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,所述验证单元240具体用于:当
Figure PCTCN2020107428-appb-000127
Figure PCTCN2020107428-appb-000128
时,确定所述修正最大值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所述K 3表示所述第三百分比,所述
Figure PCTCN2020107428-appb-000129
表示所述第三像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000130
表示所述第四像素的RGB分量最大值,所述K 4表示所述第四百分比,所述
Figure PCTCN2020107428-appb-000131
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000132
表示所述第六像素的RGB分量最大值。
在一种可能的实现方式中,所述确定单元220具体用于:将所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值的差,确定为所述HDR图像的亮度变化范围;根据所述亮度变化范围,确定所述参考最大值。
在一种可能的实现方式中,所述确定单元220具体用于通过上述公式(7)确定所述亮度变化范围variance_maxrgb。
在一种可能的实现方式中,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述确定单元220具体用于:根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
在一种可能的实现方式中,所述确定单元220具体用于通过上述公式(8)确定所述参考最大值MAX。
在一种可能的实现方式中,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述确定单元220具体用于:从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;根据所述第一表达式,确定所述最大亮度校正值。
在一种可能的实现方式中,所述确定单元220具体用于:通过上述公式(11)确定所述最大亮度校正值maximum_maxrgb1。
在一种可能的实现方式中,所述确定220单元还用于:若所述最大亮度校正值小于所述HDR图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更新为所述当前显示设备的最大显示亮度。
在一种可能的实现方式中,所述装置还包括:验证单元240,所述验证单元240用于根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述最大亮度校正值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
在一种可能的实现方式中,所述验证单元240具体用于:当
Figure PCTCN2020107428-appb-000133
Figure PCTCN2020107428-appb-000134
时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,K 3表示所述第三百分比,
Figure PCTCN2020107428-appb-000135
表示所述第三像素 的RGB分量最大值,
Figure PCTCN2020107428-appb-000136
表示所述第四像素的RGB分量最大值,K 4表示所述第四百分比,
Figure PCTCN2020107428-appb-000137
表示所述第五像素的RGB分量最大值,
Figure PCTCN2020107428-appb-000138
表示所述第六像素的RGB分量最大值。
应理解,这里的装置200以功能单元的形式体现。这里的术语“单元”可以指ASIC、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。在一个可选例子中,本领域技术人员可以理解,装置200可以具体为上述方法100实施例中的图像处理装置,装置200可以用于执行上述方法100实施例中与图像处理装置对应的各个流程和/或步骤,为避免重复,在此不再赘述。
图8示出了本申请实施例提供的图像处理设备300,该设备300可以包括图7中所述的装置200,或者该设备300可以是图7中所述的装置200。该装置200可以采用如图8所示的硬件架构。该设备300可以包括处理器310、收发器320和存储器330,该处理器310、收发器320和存储器330通过内部连接通路互相通信。图7中的确定单元220、调整单元230和验证单元240所实现的相关功能可以由处理器310来实现,获取单元210所实现的相关功能可以由处理器310控制收发器320来实现。
该处理器310可以包括是一个或多个处理器,例如包括一个或多个中央处理单元(central processing unit,CPU),在处理器是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该收发器320用于发送和接收数据和/或信息,以及接收数据和/或信息。该收发器可以包括发射器和接收器,发射器用于发送数据和/或信号,接收器用于接收数据和/或信号。
该存储器330包括但不限于是随机存取存储器(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程存储器(erasable programmable read only memory,EPROM)、只读光盘(compact disc read-only memory,CD-ROM),该存储器330用于存储相关指令及数据。
存储器330用于存储装置的程序代码和数据,可以为单独的器件或集成在处理器310中。
具体地,所述处理器310用于控制收发器与产生或发送所述HDR图像的装置或设备通信。具体可参见方法实施例中的描述,在此不再赘述。
可以理解的是,图8仅仅示出了设备300的简化设计。在实际应用中,设备300还可以分别包含必要的其他元件,包含但不限于任意数量的收发器、处理器、控制器、存储器等,而所有可以实现本申请的设备都在本申请的保护范围之内。
在一种可能的设计中,设备300可以被替换为芯片装置,例如可以为可用于设备中的通信芯片,用于实现装置中处理器的相关功能。该芯片装置可以为实现相关功能的现场可编程门阵列,专用集成芯片,系统芯片,中央处理器,网络处理器,数字信号处理电路,微控制器,还可以采用可编程控制器或其他集成芯片。该芯片中,可选的可以包括一个或多个存储器,用于存储程序代码,当所述代码被执行时,使得处理器实现相应的功能。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺 序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。

Claims (48)

  1. 一种处理高动态范围图像的方法,其特征在于,所述方法包括:
    获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1;
    根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;
    根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述最大亮度校正值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值;
    根据所述最大亮度校正值,调整所述HDR图像的动态范围。
  2. 根据权利要求1所述的方法,其特征在于,所述第一百分比大于所述第二百分比,所述根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值,包括:
    将所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值的差,确定为所述HDR图像的亮度变化范围;
    根据所述亮度变化范围,确定所述参考最大值。
  3. 根据权利要求2所述的方法,其特征在于,通过如下公式确定所述亮度变化范围variance_maxrgb:
    Figure PCTCN2020107428-appb-100001
    其中,K 1表示所述第一百分比,
    Figure PCTCN2020107428-appb-100002
    表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
    Figure PCTCN2020107428-appb-100003
    表示所述第二像素的RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
  4. 根据权利要2或3所述的方法,其特征在于,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述根据所述亮度变化范围,确定所述参考最大值,包括:
    根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
  5. 根据权利要求4所述的方法,其特征在于,通过如下公式确定所述参考最大值MAX:
    MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
    其中,
    Figure PCTCN2020107428-appb-100004
    maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
  6. 根据权利要求1所述的方法,其特征在于,通过如下公式确定所述参考最大值MAX:
    Figure PCTCN2020107428-appb-100005
    其中,K 1表示所述第一百分比,
    Figure PCTCN2020107428-appb-100006
    表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
    Figure PCTCN2020107428-appb-100007
    表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,包括:
    从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;
    根据所述第一表达式,确定所述最大亮度校正值。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,通过如下公式确定所述HDR图像的最大亮度校正值maximum_maxrgb1:
    Figure PCTCN2020107428-appb-100008
    其中,MaxRefDisplay表示所述HDR图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    若所述最大亮度校正值小于所述HDR图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更新为所述当前显示设备的最大显示亮度。
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述方法还包括:
    根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述最大亮度校正值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
  11. 根据权利要求10所述的方法,其特征在于,所述根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述修正最大值的准确性,包括:
    Figure PCTCN2020107428-appb-100009
    Figure PCTCN2020107428-appb-100010
    时,确定所述最大亮度校正值准确,其中,K 3-K 4<M, M为预设的第一阈值,T为预设的第二阈值,0<T<2,K 3表示所述第三百分比,
    Figure PCTCN2020107428-appb-100011
    表示所述第三像素的RGB分量最大值,
    Figure PCTCN2020107428-appb-100012
    表示所述第四像素的RGB分量最大值,K 4表示所述第四百分比,
    Figure PCTCN2020107428-appb-100013
    表示所述第五像素的RGB分量最大值,
    Figure PCTCN2020107428-appb-100014
    表示所述第六像素的RGB分量最大值。
  12. 一种图像处理方法,其特征在于,所述方法包括:
    获取待处理图像的图像信息,所述待处理图像包括多个像素,所述图像信息包括第一比值对应的第一RGB分量最大值和第二比值对应的第二RGB分量最大值,所述第一比值表示所述多个像素中RGB分量最大值小于或等于所述第一RGB分量最大值的像素与所述多个像素的数量的比值,所述第二比值表示所述多个像素中RGB分量最大值小于或等于所述第二RGB分量最大值的像素与所述多个像素的数量的比值,所述RGB分量最大值表示一个像素的R分量、G分量和B分量中最大的一个分量数值;
    根据所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值,确定所述待处理图像的参考最大值;
    根据所述参考最大值和预设的多个分级区间,对所述多个像素的RGB分量最大值中的最大值进行调整,以确定所述待处理图像的最大亮度校正值,其中,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围;
    根据所述最大亮度校正值,调整所述待处理图像的动态范围。
  13. 根据权利要求12所述的方法,其特征在于,所述第一比值大于所述第二比值,所述根据所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值,确定所述待处理图像的参考最大值,包括:
    将所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值的差,确定为所述待处理图像的亮度变化范围;
    根据所述亮度变化范围,确定所述参考最大值。
  14. 根据权利要求13所述的方法,其特征在于,通过如下公式确定所述亮度变化范围variance_maxrgb:
    Figure PCTCN2020107428-appb-100015
    其中,K 1表示所述第一比值,
    Figure PCTCN2020107428-appb-100016
    表示所述第一RGB分量最大值,K 2表示所述第二比值,
    Figure PCTCN2020107428-appb-100017
    表示所述第二RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
  15. 根据权利要求13或14所述的方法,其特征在于,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述根据所述亮度变化范围,确定所述参考最大值,包括:
    根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
  16. 根据权利要求15所述的方法,其特征在于,通过如下公式确定所述参考最大值MAX:
    MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
    其中,
    Figure PCTCN2020107428-appb-100018
    maximum_maxrgb表示所述多个像 素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
  17. 根据权利要求12所述的方法,其特征在于,通过如下公式确定所述参考最大值MAX:
    Figure PCTCN2020107428-appb-100019
    其中,K 1表示所述第一比值,
    Figure PCTCN2020107428-appb-100020
    表示所述第一RGB分量最大值,K 2表示所述第二比值,
    Figure PCTCN2020107428-appb-100021
    表示所述第二RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
  18. 根据权利要求12至17中任一项所述的方法,其特征在于,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述最大亮度校正值maximum_maxrgb1通过如下公式确定:
    Figure PCTCN2020107428-appb-100022
    其中,MaxRefDisplay表示所述待处理图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:
    若所述最大亮度校正值小于所述待处理图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更改为所述当前显示设备的最大显示亮度。
  20. 根据权利要求12至19中任一项所述的方法,其特征在于,所述方法还包括:
    根据第三比值对应的第三RGB分量最大值、所述第三比值对应的第四GRB分量最大值、第四比值对应的第五RGB分量最大值和所述第四比值对应的第六GRB分量最大值,验证所述最大亮度校正值的准确性,其中,所述第三比值表示所述多个像素中RGB分量最大值小于或等于所述第三RGB分量最大值的像素与所述多个像素的数量的比值,所述第四GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第四RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第三比值,所述第四比值表示所述多个像素中RGB分量最大值小于或等于所述第五RGB分量最大值的像素与所述多个像素的数量的比值,所述第六GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第六RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第四比值,所述处理后图像为所述待处理图像经动态范围调整后的图像。
  21. 根据权利要求20所述的方法,其特征在于,所述根据第三比值对应的第三RGB分量最大值、所述第三比值对应的第四GRB分量最大值、第四比值对应的第五RGB分量最大值和所述第四比值对应的第六GRB分量最大值,验证所述最大亮度校正值的准确性,包括:
    Figure PCTCN2020107428-appb-100023
    Figure PCTCN2020107428-appb-100024
    时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所K 3表示所述第三比值,
    Figure PCTCN2020107428-appb-100025
    表示所述第三RGB分量最大值,P′ K3表示所述第四RGB分量最大值,K 4表示所述第 四比值,
    Figure PCTCN2020107428-appb-100026
    表示所述第五RGB分量最大值,
    Figure PCTCN2020107428-appb-100027
    表示所述第六RGB分量最大值。
  22. 根据权利要求20或21所述的方法,其特征在于,所述方法还包括以下至少一个步骤:
    根据所述第一比值和所述多个像素,确定所述第一RGB分量最大值;
    根据所述第二比值和所述多个像素,确定所述第二RGB分量最大值;
    根据所述第三比值和所述多个像素,确定所述第三RGB分量最大值;
    根据所述第三比值和所述处理后图像的像素,确定所述第四RGB分量最大值;
    根据所述第四比值和所述多个像素,确定所述第五RGB分量最大值;或,
    根据所述第四比值和所述处理后图像的像素,确定所述第六RGB分量最大值。
  23. 一种处理高动态范围图像的装置,其特征在于,包括:
    获取单元,用于获取待处理的高动态范围HDR图像的图像信息,所述HDR图像包括多个像素,所述图像信息包括第一百分比对应的第一像素的RGB分量最大值和第二百分比对应的第二像素的RGB分量最大值,所述第一百分比表示所述多个像素中RGB分量最大值小于或等于所述第一像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述第二百分比表示所述多个像素中RGB分量最大值小于或等于所述第二像素的RGB分量最大值的至少一个像素占所述多个像素的百分比,所述RGB分量最大值表示所一个像素的R分量、G分量和B分量中的最大值,所述第一百分比和所述第二百分比均大于0且小于1;
    确定单元,用于根据所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值,确定所述HDR图像的参考最大值;根据所述参考最大值和预设的多个分级区间,确定所述HDR图像的最大亮度校正值,其中,所述分级区间用于对所述参考最大值进行分级,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围,所述最大亮度校正值用于修正所述HDR图像包括的所述多个像素的RGB分量最大值中的最大值;
    调整单元,用于根据所述最大亮度校正值,调整所述HDR图像的动态范围。
  24. 根据权利要求23所述的装置,其特征在于,所述确定单元具体用于:
    将所述第一百分比对应的所述第一像素的RGB分量最大值和所述第二百分比对应的所述第二像素的RGB分量最大值的差,确定为所述HDR图像的亮度变化范围;
    根据所述亮度变化范围,确定所述参考最大值。
  25. 根据权利要求24所述的装置,其特征在于,所述确定单元具体用于通过如下公式确定所述亮度变化范围variance_maxrgb:
    Figure PCTCN2020107428-appb-100028
    其中,K 1表示所述第一百分比,
    Figure PCTCN2020107428-appb-100029
    表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
    Figure PCTCN2020107428-appb-100030
    表示所述第二像素的RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
  26. 根据权利要求24或25所述的装置,其特征在于,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述确定单元具体用于:
    根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个 像素的RGB分量最大值的平均值,确定所述参考最大值。
  27. 根据权利要求26所述的方法,其特征在于,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
    MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
    其中,
    Figure PCTCN2020107428-appb-100031
    maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
  28. 根据权利要求23所述的装置,其特征在于,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
    Figure PCTCN2020107428-appb-100032
    其中,K 1表示所述第一百分比,
    Figure PCTCN2020107428-appb-100033
    表示所述第一像素的RGB分量最大值,K 2表示所述第二百分比,
    Figure PCTCN2020107428-appb-100034
    表示所述第二像素的RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
  29. 根据权利要求23至28中任一项所述的装置,其特征在于,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述确定单元具体用于:
    从所述多个分级区间中确定所述参考最大值所属的第一分级区间,所述第一分级区间对应第一表达式;
    根据所述第一表达式,确定所述最大亮度校正值。
  30. 根据权利要求23至29中任一项所述的装置,其特征在于,所述确定单元具体用于:通过如下公式确定所述最大亮度校正值maximum_maxrgb1:
    Figure PCTCN2020107428-appb-100035
    其中,MaxRefDisplay表示所述HDR图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
  31. 根据权利要求30所述的装置,其特征在于,所述确定单元还用于:
    若所述最大亮度校正值小于所述HDR图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更新为所述当前显示设备的最大显示亮度。
  32. 根据权利要求23至31中任一项所述的装置,其特征在于,所述装置还包括:验证单元,
    所述验证单元用于根据第三百分比在所述HDR图像中对应的第三像素的RGB分量最大值、所述第三百分比在处理后的图像中对应的第四像素的GRB分量最大值、第四百分比在所述HDR图像中对应的第五像素的RGB分量最大值和所述第四百分比在所述处理后的HDR图像中对应的第六像素的GRB分量最大值,验证所述最大亮度校正值的准确性,所述处理后的图像为所述HDR图像经动态范围调整后的图像。
  33. 根据权利要求32所述的装置,其特征在于,所述验证单元具体用于:
    Figure PCTCN2020107428-appb-100036
    Figure PCTCN2020107428-appb-100037
    时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,K 3表示所述第三百分比,
    Figure PCTCN2020107428-appb-100038
    表示所述第三像素的RGB分量最大值,
    Figure PCTCN2020107428-appb-100039
    表示所述第四像素的RGB分量最大值,K 4表示所述第四百分比,
    Figure PCTCN2020107428-appb-100040
    表示所述第五像素的RGB分量最大值,
    Figure PCTCN2020107428-appb-100041
    表示所述第六像素的RGB分量最大值。
  34. 一种图像处理装置,其特征在于,包括:
    获取单元,用于获取待处理图像的图像信息,所述待处理图像包括多个像素,所述图像信息包括第一比值对应的第一RGB分量最大值和第二比值对应的第二RGB分量最大值,所述第一比值表示所述多个像素中RGB分量最大值小于或等于所述第一RGB分量最大值的像素与所述多个像素的数量的比值,所述第二比值表示所述多个像素中RGB分量最大值小于或等于所述第二RGB分量最大值的像素与所述多个像素的数量的比值,所述RGB分量最大值表示一个像素的R分量、G分量和B分量中最大的一个分量数值;
    确定单元,用于根据所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值,确定所述待处理图像的参考最大值;根据所述参考最大值和预设的多个分级区间,对所述多个像素的RGB分量最大值中的最大值进行调整,以确定所述待处理图像的最大亮度校正值,其中,所述多个分级区间中的每个分级区间对应所述参考最大值的一个取值范围;
    调整单元,用于根据所述最大亮度校正值,调整所述待处理图像的动态范围。
  35. 根据权利要求34所述的装置,其特征在于,所述确定单元具体用于:
    将所述第一比值对应的所述第一RGB分量最大值和所述第二比值对应的所述第二RGB分量最大值的差,确定为所述待处理图像的亮度变化范围;
    根据所述亮度变化范围,确定所述参考最大值。
  36. 根据权利要求35所述的装置,其特征在于,所述确定单元具体用于通过如下公式确定所述亮度变化范围variance_maxrgb:
    Figure PCTCN2020107428-appb-100042
    其中,K 1表示所述第一比值,
    Figure PCTCN2020107428-appb-100043
    表示所述第一RGB分量最大值,K 2表示所述第二比值,
    Figure PCTCN2020107428-appb-100044
    表示所述第二RGB分量最大值,K 1和K 2为预设值,K 1-K 2≥0.5,0<K 1<1,0<K 2<1。
  37. 根据权利要求35或36所述的装置,其特征在于,所述图像信息还包括所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,所述确定单元具体用于:
    根据所述亮度变化范围、所述多个像素的RGB分量最大值中的最大值和所述多个像素的RGB分量最大值的平均值,确定所述参考最大值。
  38. 根据权利要求37所述的装置,其特征在于,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
    MAX=B×maximum_maxrgb+A×(2×average_maxrgb)+(1-A-B)×variance_maxrgb,
    其中,
    Figure PCTCN2020107428-appb-100045
    maximum_maxrgb表示所述多个像素的RGB分量最大值中的最大值,average_maxrgb表示所述多个像素的RGB分量最大值的平均值,variance_maxrgb表示所述亮度变化范围,F()表示预设函数,B为预设值。
  39. 根据权利要求34所述的装置,其特征在于,所述确定单元具体用于通过如下公式确定所述参考最大值MAX:
    Figure PCTCN2020107428-appb-100046
    其中,K 1表示所述第一比值,
    Figure PCTCN2020107428-appb-100047
    表示所述第一RGB分量最大值,K 2表示所述第二比值,
    Figure PCTCN2020107428-appb-100048
    表示所述第二RGB分量最大值,A、K 1和K 2为预设值,0<A<1,0<K 1<1,0<K 2<1。
  40. 根据权利要求34至39中任一项所述的装置,其特征在于,所述每个分级区间对应一个表达式,所述表达式用于计算所述最大亮度校正值,所述确定单元具体用于通过如下公式确定所述最大亮度校正值maximum_maxrgb1:
    Figure PCTCN2020107428-appb-100049
    其中,MaxRefDisplay表示所述待处理图像的动态范围调整前所适用的参考显示设备的最大显示亮度,MIN表示预设的分级阈值,MAX表示所述参考最大值。
  41. 根据权利要求34至40中任一项所述的装置,其特征在于,所述确定单元还用于:
    若所述最大亮度校正值小于所述待处理图像的动态范围调整后所适用的当前显示设备的最大显示亮度时,将所述最大亮度校正值maximum_maxrgb1更改为所述当前显示设备的最大显示亮度。
  42. 根据权利要求34至41中任一项所述的装置,其特征在于,所述装置还包括验证单元,所述验证单元用于:
    根据第三比值对应的第三RGB分量最大值、所述第三比值对应的第四GRB分量最大值、第四比值对应的第五RGB分量最大值和所述第四比值对应的第六GRB分量最大值,验证所述最大亮度校正值的准确性,其中,所述第三比值表示所述多个像素中RGB分量最大值小于或等于所述第三RGB分量最大值的像素与所述多个像素的数量的比值,所述第四GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第四RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第三比值,所述第四比值表示所述多个像素中RGB分量最大值小于或等于所述第五RGB分量最大值的像素与所述多个像素的数量的比值,所述第六GRB分量最大值满足处理后图像的像素中RGB分量最大值小于或等于所述第六RGB分量最大值的像素与所述处理后图像的像素的数量的比值为所述第四比值,所述处理后图像为所述待处理图像经动态范围调整后的图像。
  43. 根据权利要求42所述的装置,其特征在于,所述验证单元具体用于:
    Figure PCTCN2020107428-appb-100050
    Figure PCTCN2020107428-appb-100051
    时,确定所述最大亮度校正值准确,其中,K 3-K 4<M,M为预设的第一阈值,T为预设的第二阈值,0<T<2,所K 3表示所述第三比值,
    Figure PCTCN2020107428-appb-100052
    表示所述第三RGB分量最大值,P′ K3表示所述第四RGB分量最大值,K 4表示所述第四比值,
    Figure PCTCN2020107428-appb-100053
    表示所述第五RGB分量最大值,
    Figure PCTCN2020107428-appb-100054
    表示所述第六RGB分量最大值。
  44. 根据权利要求42或43所述的方法,其特征在于,所述确定单元还用于执行以下至少一个步骤:
    根据所述第一比值和所述多个像素,确定所述第一RGB分量最大值;
    根据所述第二比值和所述多个像素,确定所述第二RGB分量最大值;
    根据所述第三比值和所述多个像素,确定所述第三RGB分量最大值;
    根据所述第三比值和所述处理后图像的像素,确定所述第四RGB分量最大值;
    根据所述第四比值和所述多个像素,确定所述第五RGB分量最大值;或,
    根据所述第四比值和所述处理后图像的像素,确定所述第六RGB分量最大值。
  45. 一种图像处理的设备,其特征在于,包括处理器和存储器,所述处理器和所述存储器耦合,所述处理器用于使得所述装置执行权利要求1至22中任一项所述的方法。
  46. 一种芯片装置,包括:输入接口、输出接口、至少一个处理器、存储器,所述输入接口、所述输出接口、所述处理器以及所述存储器之间通过内部连接通路互相通信,所述处理器用于执行所述存储器中的代码,其特征在于,当所述处理器执行所述代码时,所述芯片装置实现上述权利要求1至22中任一项所述的方法。
  47. 一种计算机可读存储介质,用于存储计算机程序,其特征在于,所述计算机程序包括用于实现上述权利要求1至22中任一项所述的方法的指令。
  48. 一种计算机程序产品,所述计算机程序产品中包含指令,其特征在于,当所述指令在计算机上运行时,使得计算机实现上述权利要求1至22中任一项所述的方法。
PCT/CN2020/107428 2019-10-18 2020-08-06 处理高动态范围图像的方法和装置 WO2021073209A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202080062583.4A CN114342401A (zh) 2019-10-18 2020-08-06 处理高动态范围图像的方法和装置
EP20877695.5A EP4037319A4 (en) 2019-10-18 2020-08-06 METHOD AND APPARATUS FOR PROCESSING AN IMAGE WITH HIGH DYNAMIC RANGE
US17/720,534 US11875487B2 (en) 2019-10-18 2022-04-14 High dynamic range image processing method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910995765.6A CN112686809A (zh) 2019-10-18 2019-10-18 处理高动态范围图像的方法和装置
CN201910995765.6 2019-10-18

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/720,534 Continuation US11875487B2 (en) 2019-10-18 2022-04-14 High dynamic range image processing method and apparatus

Publications (1)

Publication Number Publication Date
WO2021073209A1 true WO2021073209A1 (zh) 2021-04-22

Family

ID=75445211

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107428 WO2021073209A1 (zh) 2019-10-18 2020-08-06 处理高动态范围图像的方法和装置

Country Status (4)

Country Link
US (1) US11875487B2 (zh)
EP (1) EP4037319A4 (zh)
CN (2) CN112686809A (zh)
WO (1) WO2021073209A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110211732A1 (en) * 2009-04-23 2011-09-01 Guy Rapaport Multiple exposure high dynamic range image capture
WO2015180854A1 (en) * 2014-05-28 2015-12-03 Koninklijke Philips N.V. Methods and apparatuses for encoding an hdr images, and methods and apparatuses for use of such encoded images
CN107211079A (zh) * 2015-12-17 2017-09-26 皇家飞利浦有限公司 用于图像和视频的动态范围编码
CN108431886A (zh) * 2015-12-21 2018-08-21 皇家飞利浦有限公司 针对特定显示器优化高动态范围图像
CN108781290A (zh) * 2016-03-07 2018-11-09 皇家飞利浦有限公司 对hdr视频进行编码和解码
CN109219961A (zh) * 2016-03-18 2019-01-15 皇家飞利浦有限公司 对hdr视频进行编码和解码

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3926963A3 (en) * 2013-04-30 2022-01-26 Saturn Licensing LLC Transmitting device, transmitting method, receiving device, and receiving method
US8958658B1 (en) * 2013-09-10 2015-02-17 Apple Inc. Image tone adjustment using local tone curve computation
EP3131284A1 (en) * 2015-08-13 2017-02-15 Thomson Licensing Methods, systems and aparatus for hdr to hdr inverse tone mapping
CN106534708B (zh) * 2015-09-15 2020-02-18 瑞昱半导体股份有限公司 宽动态范围影像方法
EP3220349A1 (en) * 2016-03-16 2017-09-20 Thomson Licensing Methods, apparatus, and systems for extended high dynamic range ("hdr") hdr to hdr tone mapping
CN111724316B (zh) * 2017-04-11 2023-11-10 华为技术有限公司 处理高动态范围图像的方法和装置
US10755392B2 (en) * 2017-07-13 2020-08-25 Mediatek Inc. High-dynamic-range video tone mapping

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110211732A1 (en) * 2009-04-23 2011-09-01 Guy Rapaport Multiple exposure high dynamic range image capture
WO2015180854A1 (en) * 2014-05-28 2015-12-03 Koninklijke Philips N.V. Methods and apparatuses for encoding an hdr images, and methods and apparatuses for use of such encoded images
CN107211079A (zh) * 2015-12-17 2017-09-26 皇家飞利浦有限公司 用于图像和视频的动态范围编码
CN108431886A (zh) * 2015-12-21 2018-08-21 皇家飞利浦有限公司 针对特定显示器优化高动态范围图像
CN108781290A (zh) * 2016-03-07 2018-11-09 皇家飞利浦有限公司 对hdr视频进行编码和解码
CN109219961A (zh) * 2016-03-18 2019-01-15 皇家飞利浦有限公司 对hdr视频进行编码和解码

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
US20220245774A1 (en) 2022-08-04
CN114342401A (zh) 2022-04-12
EP4037319A4 (en) 2022-11-30
CN112686809A (zh) 2021-04-20
US11875487B2 (en) 2024-01-16
EP4037319A1 (en) 2022-08-03

Similar Documents

Publication Publication Date Title
CN111724316B (zh) 处理高动态范围图像的方法和装置
JP6615917B2 (ja) 実時間ビデオエンハンスメント方法、端末及び非一時的コンピュータ可読記憶媒体
TWI790596B (zh) 動態範圍映射的方法和裝置
CN113596428B (zh) 映射曲线参数的获取方法和装置
US20230140259A1 (en) Image dynamic range processing method and apparatus
WO2020135234A1 (zh) 一种图像处理方法及装置
WO2018035879A1 (zh) 一种图像处理方法以及装置
CN115496668A (zh) 图像处理方法、装置、电子设备及存储介质
CN107197266A (zh) 一种hdr视频编码方法
CN116668656B (zh) 图像处理方法及电子设备
WO2021073209A1 (zh) 处理高动态范围图像的方法和装置
WO2023040431A1 (zh) 一种色调映射方法、设备及系统
CN114222072B (zh) 图像处理方法、装置、电子设备及存储介质
TW202143739A (zh) 一種高動態範圍hdr視訊的處理方法、編碼設備和解碼設備
EP3108451A1 (en) Image processing to retain small color/gray differences
KR100619699B1 (ko) 화면 분할을 통한 카메라 밝기 조절 방법

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: 20877695

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020877695

Country of ref document: EP

Effective date: 20220427