An image display method and an electronic device
Patent Information
- Application Number
- CN202510577315.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
在对包括HDR区域和SDR区域的原始显示图像进行图像处理时,HDR区域的HDR数据的HDR会被强制压缩到SDR色彩亮度范围,这样,会丢失HDR数据,只能生成SDR图像,并在显示屏上显示,导致显示效果差,例如,出现色彩和亮度失真等问题
[0030]其中,第二方面、第三方面和第四方面的设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。
Smart Images

Figure CN123020723A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display, and more particularly to an image display method and an electronic device. Background Technology
[0002] With the development of high dynamic range (HDR) technology, the requirements for image display in mobile phones and other electronic devices are becoming increasingly higher.
[0003] In practical applications, when HDR images are displayed on a screen, they are usually not full-frame images and cannot fill the entire screen. The HDR image forms an HDR area in the very center of the screen, while the area outside the HDR image (i.e., the perimeter of the screen) is filled with lower-brightness pixels (usually within SDR) to form an SDR area. Therefore, the display image includes both the HDR area of the HDR image and the SDR area outside the HDR image.
[0004] Currently, the tools used for image processing of HDR images are still SDR image processing tools. When processing the original display image, which includes both HDR and SDR regions, the HDR data in the HDR region is forcibly compressed to the SDR color and brightness range. This results in the loss of HDR data, and only an SDR image is generated for display, leading to poor display quality, such as color and brightness distortion. Summary of the Invention
[0005] This application provides an image display method and electronic device that can retain HDR data in the original displayed image to generate an SDR image or an HDR image, thereby improving the display effect. Furthermore, it can selectively display an SDR image or an HDR image on the display screen based on the maximum brightness of the display screen.
[0006] To achieve the objective, the embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, an image display method is provided, the method comprising: acquiring first SDR data of a standard dynamic range (SDR) region and HDR data of a high dynamic range (HDR) region of an image to be processed; performing tone mapping from the HDR data to the SDR to obtain second SDR data; obtaining a target SDR image based on the first SDR data and the second SDR data; and displaying the target SDR image on the display screen when the maximum brightness of the display screen is less than or equal to a first brightness threshold.
[0008] The aforementioned image display method converts HDR data from HDR regions in the image to be processed into second SDR data, then merges the first SDR data from the SDR regions of the image to be processed with the converted second SDR data to obtain a target SDR image. Finally, the target SDR image is displayed on the display screen when the maximum brightness of the display screen is less than or equal to a first brightness threshold. This image display method can retain the HDR data from the HDR regions in the image to be processed to obtain the target SDR image, thereby improving the display effect, such as realism, integrity, and quality. Furthermore, it can meet the display requirements of displays with low maximum brightness, allowing the target SDR image to be displayed on such displays.
[0009] In one possible implementation of the first aspect, the method further includes: the maximum brightness of the display screen being a second brightness threshold; when the maximum brightness of the display screen is greater than a first brightness threshold, obtaining a gain map based on the image to be processed and the target SDR image; the gain map being used to characterize the difference data between the brightness of each pixel in the image to be processed and the target SDR image; obtaining a target gain map based on the gain map and the second brightness threshold; and obtaining a target HDR image based on the target gain map and the target SDR image and displaying it on the display screen.
[0010] In this implementation, after obtaining the target SDR image, a gain map is obtained by comparing the image to be processed and the target SDR image. Then, the first brightness of each pixel in the gain map is compared with a second brightness threshold to obtain a target gain map including the target gain values of each pixel. The target gain map and the target SDR image are then fused to obtain the target HDR image. Finally, the target HDR image is displayed on the display screen when the maximum brightness of the display is greater than the first brightness threshold. This image display method can retain HDR data in the HDR region of the image to be processed to obtain the target HDR image, thereby improving the display effect, such as realism, integrity, and quality. It can also meet the display requirements of displays with high maximum brightness, allowing the target HDR image to be displayed on such displays.
[0011] In one possible implementation of the first aspect, obtaining a target gain map based on a gain map and a second brightness threshold includes: obtaining a target gain value for a pixel based on a first brightness and a second brightness threshold of the pixel in the image to be processed; and obtaining a target gain map based on the target gain value.
[0012] In this implementation, the first brightness of each pixel is compared with a second brightness threshold to obtain a target gain map that includes the target gain value of each pixel. This allows for obtaining the target gain value for each pixel, thus generating the target gain map, and enables independent processing of each pixel, achieving the highest precision local control.
[0013] In one possible implementation of the first aspect, a target gain value for a pixel is obtained based on a first brightness and a second brightness threshold of the pixel in the image to be processed, including: when the first brightness of the pixel is less than or equal to the second brightness threshold, the target gain value is the gain value of the pixel; when the first brightness of the pixel is greater than the second brightness threshold, the target gain value is the gain value of the pixel whose brightness is equal to the second brightness threshold.
[0014] In this implementation, by comparing the first brightness of each pixel in the image to be processed with a second brightness threshold, the brightness of pixels exceeding the second brightness threshold is limited to the brightness range suitable for displaying HDR images, thus obtaining the target gain value for each pixel. This method ensures that the first brightness of all pixels is within the brightness range suitable for displaying HDR images, improving display effects such as realism, integrity, and quality.
[0015] In one possible implementation of the first aspect, the image to be processed includes multiple image blocks; the HDR region includes multiple HDR image blocks; the HDR image block is an image block in which the number of target pixels in the multiple image blocks is greater than a number threshold; the brightness of the target pixels is greater than a first brightness threshold; and the SDR region is the region in the image to be processed other than the HDR region.
[0016] In this implementation, an image block containing pixels whose brightness exceeds a first brightness threshold (reference white point brightness) in greater numbers is called an HDR image block, and multiple such HDR images constitute an HDR region. The region in the image to be processed, excluding the HDR region, is called the SDR region. This allows for better differentiation between the SDR and HDR regions of the image to be processed based on pixel brightness information, thereby obtaining the first SDR data for the SDR region and the HDR data for the HDR region.
[0017] In one possible implementation of the first aspect, the HDR data includes pixel values of pixels. The HDR data is tone-mapped from HDR to SDR to obtain second SDR data, including: obtaining a maximum pixel value and a maximum brightness value of the HDR image block based on the first pixel value of the red channel, the second pixel value of the green channel, and the third pixel value of the blue channel of each pixel in the HDR image block within the HDR region; the maximum pixel value is the largest of the first, second, and third pixel values; the maximum brightness value is the maximum brightness value of the pixels in the HDR image block; based on the first, second, and third pixel values, the maximum pixel value, and the maximum brightness value, a fourth pixel value of the red channel, a fifth pixel value of the green channel, and a sixth pixel value of the blue channel of the pixel are obtained respectively; wherein the fourth pixel value is less than the first pixel value, the fifth pixel value is less than the second pixel value, and the sixth pixel value is less than the third pixel value; and the second SDR data is obtained based on the fourth, fifth, and sixth pixel values.
[0018] In this implementation, the pixel values of the red, green, and blue (RGB) channels of each pixel in the HDR image block within the HDR region are first obtained. Then, based on the RGB channel pixel values of each pixel, the maximum pixel value and the maximum brightness value of the HDR image block are obtained. Next, based on the RGB channel pixel values, the maximum pixel value, and the maximum brightness value, they are converted to SDR RGB channel pixel values. Finally, the SDR RGB channel pixel values are fused to obtain the second SDR data. By mapping the HDR data to SDR based on the pixel values of each pixel, the pixel values of each pixel can be processed independently, thereby achieving the highest precision local control.
[0019] In one possible implementation of the first aspect, based on the first pixel value, the second pixel value, the third pixel value, the maximum pixel value, and the maximum brightness value, the fourth pixel value of the red channel, the fifth pixel value of the green channel, and the sixth pixel value of the blue channel of a pixel are obtained respectively, satisfying the following formula: y R =(1+x max / L max 2 )·x R / (1+x max );y G =(1+x max / L max 2 )·x G / (1+x max );y B =(1+x max / L max 2 )·x B / (1+x max ); where x R x is the value of the first pixel. G The second pixel value, x B The value of the third pixel, x max x is the maximum pixel value. max =max(x R ,x G ,x B );L max L represents the maximum brightness value. max =max(L x1 ,L x2 ,L x3 ,…L xn ), where n is the total number of pixels in the HDR image patch, and is a positive integer; L xn The value is the brightness of the nth pixel; max() is the function to find the maximum value; y R The fourth pixel value, y G The value of the fifth pixel, y B This is the value of the sixth pixel.
[0020] In this implementation, the SDR pixel value is calculated for the HDR pixel value of each pixel based on the formula. The calculation method is simple, the calculation result is accurate, and it can ensure that the pixel value of each pixel is within the SDR.
[0021] In one possible implementation of the first aspect, obtaining a gain map based on the image to be processed and the target SDR image includes: obtaining a gain value of a pixel based on a first brightness of a pixel in the image to be processed and a second brightness of a pixel in the target SDR image; and obtaining a gain map based on the gain value of the pixel.
[0022] In this implementation, the gain value (the brightness multiple that each pixel needs to be adjusted from the image to the target SDR image) is obtained by calculating the first brightness of each pixel in the image to be processed and the second brightness of each pixel in the target SDR image. This yields a gain map. This method can obtain the gain value for each pixel and process each pixel independently, thus achieving the highest precision local control.
[0023] In one possible implementation of the first aspect, the gain value of a pixel is obtained based on the first brightness of a pixel in the image to be processed and the second brightness of a pixel in the target SDR image, satisfying the following formula: G=log2((L1+α1) / (L2+α2)); where L1 is the first brightness of the pixel, L2 is the second brightness of the pixel, α1 is the first bias parameter, α2 is the second bias parameter, and G is the gain value of the pixel.
[0024] In this implementation method, the brightness multiple of the first brightness of each pixel in the image to be processed and the second brightness in the target SDR image is calculated based on the formula. The calculation method is simple and the calculation results are accurate.
[0025] In one possible implementation of the first aspect, the image to be processed includes a static screenshot image or a scrolling screenshot image.
[0026] In this implementation, by setting the image to be processed to include static screenshots or scrolling screenshots, the image to be processed can be processed more effectively, thereby improving the display effect.
[0027] In a second aspect, an electronic device is provided, including a memory and one or more processors. The memory stores computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device performs an image display method as described in the first aspect and any embodiment thereof.
[0028] Thirdly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform an image display method as described in the first aspect and any embodiment thereof.
[0029] Fourthly, a computer program product is provided that, when run on an electronic device, causes the electronic device to perform an image display method as described in the first aspect and any embodiment thereof.
[0030] The technical effects of the design methods in the second, third, and fourth aspects can be found in the technical effects of the different design methods in the first aspect, and will not be repeated here. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of a possible hardware structure of an electronic device provided in an embodiment of this application;
[0032] Figure 2 This is a schematic diagram of a possible software structure of an electronic device provided in an embodiment of this application;
[0033] Figure 3 A schematic diagram illustrating how to process an HDR image to obtain an SDR image, providing insights for related technologies.
[0034] Figure 4 A flowchart for obtaining an SDR image by image processing of a raw image including HDR and SDR regions, provided for related technologies;
[0035] Figure 5 A flowchart illustrating an image display method provided in an embodiment of this application;
[0036] Figure 6 A flowchart illustrating another image display method provided in this application embodiment;
[0037] Figure 7 A schematic diagram of an image to be processed provided in an embodiment of this application;
[0038] Figure 8 A flowchart of a process for mapping HDR data from HDR to SDR to obtain second SDR data is provided in this application embodiment;
[0039] Figure 9 This is a schematic diagram illustrating the display of a target SDR image on a display screen in an image display method provided in an embodiment of this application.
[0040] Figure 10 This is a schematic diagram illustrating how a gain map is obtained by comparing an image to be processed and a target SDR image, as provided in an embodiment of this application.
[0041] Figure 11 A flowchart illustrating how to obtain a gain map based on an image to be processed and a target SDR image, as provided in this application embodiment;
[0042] Figure 12 A flowchart illustrating how an electronic device obtains a target gain value for a pixel based on a first brightness and a second brightness threshold of a pixel in an image to be processed, as provided in this application embodiment;
[0043] Figure 13 A flowchart illustrating the process of fusing a target gain map and a target SDR image to obtain a target HDR image, as provided in this application embodiment;
[0044] Figure 14 This is a schematic diagram illustrating the display of a target HDR image on a display screen in an image display method provided in an embodiment of this application.
[0045] Figure 15 This is a schematic diagram illustrating an image display method for displaying an SDR image or an HDR image, provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different. Meanwhile, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding. The terms "coupling" and "connection" involved in the embodiments of this application should be interpreted broadly. For example, it can refer to a physical direct connection or an indirect connection implemented through electronic devices, such as a connection implemented through resistors, inductors, capacitors, or other electronic devices.
[0047] Dynamic range (DR) refers to the ratio of the brightest (highlights) to the darkest (shadows) parts of an image or display device can render.
[0048] High dynamic range (HDR) is a technique used to enhance the brightness, contrast, and color gamut of images or videos, making them more closely resemble the real world as seen by the human eye. HDR's dynamic range is typically 1000 nits (cd / m²). 2 )above.
[0049] Standard dynamic range (SDR) is a traditional image and video display technology. Compared to HDR, it has a narrower dynamic range and more limited brightness and color performance. The dynamic range of SDR is typically 100-300 nits (cd / m²). 2 ).
[0050] Tone mapping uses a non-linear transformation function to compress the brightness values of high dynamic range displays to the range that low dynamic range displays can render, while preserving as much visual detail and contrast as possible.
[0051] This application provides an electronic device with a display function. The electronic device can be mobile or fixed. It can be deployed on land (e.g., indoors or outdoors, handheld or vehicle-mounted), on water (e.g., on ships), or in the air (e.g., airplanes, balloons, and satellites). This electronic device can be referred to as user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent, or terminal device. For example, it can be a mobile phone, tablet computer, laptop computer, smart bracelet, smart screen, smartwatch, virtual reality (VR) device, augmented reality (AR) device, terminal in industrial control, terminal in self-driving, terminal in remote medical care, terminal in smart grid, terminal in transportation safety, terminal in smart city, terminal in smart home, etc. This application does not limit the specific type and structure of the electronic device. The following describes one possible structure of the electronic device.
[0052] Taking mobile phones as an example, the attached document... Figure 1A possible structure of an electronic device 100 is shown. The electronic device 100 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, a mobile communication module 250, a wireless communication module 260, antennas 251 and 261, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. Optionally, in some embodiments, it may also include an audio digital signal processor (ADSP) 243.
[0053] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0054] Processor 210 may include one or more processing units, such as: a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system-on-chip (SoC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, and a neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors. For example, processor 210 may be an application processor (AP). Alternatively, processor 210 may be integrated into a system-on-chip (SoC). Or, processor 210 may be integrated into an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a micro-controller unit (MCU) in an IC chip.
[0055] The processor 210 may also include a memory for storing computer instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store computer instructions or data that the processor 210 has just used or that are being used repeatedly. If the processor 210 needs to use the same computer instructions or data again, it can retrieve them directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves system efficiency.
[0056] In some embodiments, the processor 210 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.
[0057] In some embodiments, the processor may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0058] The ADSP 243 can be coupled to the audio module 270 and the sensor module 280. The ADSP 243 can process audio signals and sensor data. Even when the processor 210 is in sleep mode, the ADSP 243 can remain operational, thereby reducing the power consumption of the electronic device 100.
[0059] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or a combination of multiple interface connection methods.
[0060] The external memory interface 220 can be used to connect an external memory card, thereby expanding the storage capacity of the electronic device 100. The external memory card communicates with the processor 210 through the external memory interface 220 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0061] Internal memory 221 can be used to store computer executable program code, which includes computer instructions. Processor 210 executes various functional applications and data processing of electronic device 100 by running the computer instructions stored in internal memory 221. In addition, internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0062] In this embodiment of the application, when computer instructions are executed by processor 210, electronic device 100 performs the image display method of this embodiment of the application.
[0063] The memory involved in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0064] Electronic device 100 can implement audio functions such as music playback and recording through audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, and application processor.
[0065] Buttons 290 include a power button, volume buttons, etc. Buttons 290 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100. Motor 291 can generate vibration alerts. Motor 291 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 292 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc. SIM card interface 295 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 295 to achieve contact and separation with electronic device 100. Electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. In some embodiments, the electronic device 100 employs an embedded SIM (eSIM) card, which can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0066] The electronic device 100 can implement its shooting function through an ISP, a camera 293, a video codec, a GPU, a display 294, and an application processor. The ISP is used to process data fed back from the camera 293. In some embodiments, the ISP can be located within the camera 293. The camera 293 is used to capture still images or videos. In some embodiments, the electronic device 100 may include one or N cameras 293, where N is a positive integer greater than 1.
[0067] Electronic device 100 can implement display functions through a GPU, display screen 294, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 210 may include one or more GPUs, which execute computer instructions to generate or modify display information.
[0068] In this embodiment of the application, a target SDR image or a target HDR image is displayed on a display screen 294.
[0069] As attached Figure 2As shown, taking the Android operating system running on the electronic device 100 as an example, the software architecture running on the processor 210 includes the application layer, framework layer, system runtime library layer, hardware abstraction layer (HAL), and kernel layer.
[0070] The kernel layer is the layer between hardware and software. For example, the kernel layer includes display drivers, camera drivers, etc. Display drivers are used to drive the display screen to show images or receive user touch operations, while camera drivers are used to drive the camera to capture image data.
[0071] In this embodiment, the display driver is used to drive the display screen 294 to display a target SDR image or a target HDR image.
[0072] The Hardware Abstraction Layer (HAL) is used to abstract hardware. The HAL hides the hardware interface details of a specific platform, providing the operating system with a virtual hardware platform and exhibiting hardware independence. For example, the HAL includes a display module and a camera module. The display module provides a virtual display screen, and the camera module provides a virtual camera module.
[0073] In this embodiment, the display module is used for the virtual display screen 294.
[0074] The system runtime library layer includes C / C++ libraries and runtime libraries. Many core components and services of the Android operating system are built from native code and require C / C++ libraries. When an application is first installed, it is pre-compiled into machine code form as a runtime library; this process is called pre-compilation. This allows for faster startup and execution of the application by running the machine code.
[0075] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The framework layer includes predefined implementation methods. For example, it includes a window manager, content providers, a view system, and a notification manager.
[0076] The application layer can include a series of application packages, such as gallery, camera, and other applications (app).
[0077] In related technologies, with the development of high dynamic range (HDR) technology, the display requirements for images in mobile phones and other electronic devices 100 are becoming increasingly higher.
[0078] Currently, the tools used for image processing of HDR images are still SDR image processing tools, for example, as shown in the attached document. Figure 3As shown, image processing of an HDR image cannot generate an HDR image; only an SDR image can be generated and displayed on the screen, with poor display quality, such as brightness and color distortion. For example, see attached... Figure 4 As shown, when an HDR image is displayed on a screen, it is usually not a full-frame image and cannot fill the entire screen. The HDR image forms an HDR area in the very center of the screen, while the areas outside the HDR image (i.e., the perimeter of the screen) are filled with lower-brightness pixels (usually within SDR) to form an SDR area. Therefore, the display image includes both the HDR image area and the SDR area outside the HDR image. When image processing is performed on the original display image including the HDR and SDR areas, the HDR data of the HDR area is forcibly compressed to SDR. This results in the loss of HDR data, and only an SDR image can be generated and displayed on the screen, with poor display quality, such as color and brightness distortion.
[0079] Therefore, this application provides an image display method that converts HDR data of HDR regions in an image to be processed into second SDR data, then merges the first SDR data of the SDR regions in the image to be processed with the converted second SDR data to obtain a target SDR image. Finally, the target SDR image is displayed on the display screen when the maximum brightness of the display screen is less than or equal to a first brightness threshold. Alternatively, a target HDR image can be obtained based on the image to be processed and the target SDR image, and displayed on the display screen when the maximum brightness of the display screen is greater than the first brightness threshold. This image display method can retain the HDR data of the HDR regions in the image to be processed to obtain a target SDR image or a target HDR image, improving display effects such as realism, completeness, and quality. Furthermore, it can selectively display the target SDR image or the target HDR image on the display screen according to the maximum brightness of the display screen; for example, the target SDR image is displayed when the maximum brightness of the display screen is less than or equal to the first brightness threshold, and the target HDR image is displayed when the maximum brightness of the display screen is greater than the first brightness threshold.
[0080] This application uses an electronic device 100 including an image display method as an example to specifically describe the image display method of this application. For example, see the attached diagram. Figure 5 -Appendix Figure 6 As shown in the embodiment of this application, an image display method is applied to an electronic device 100 and may include steps S501-S509:
[0081] In step S501, the electronic device 100 acquires the first SDR data of the SDR region and the HDR data of the HDR region of the image to be processed.
[0082] For example, see attached Figure 7 As shown, the image to be processed is a display image. The display image includes an SDR region and an HDR region. When an HDR image is displayed on a screen, it is usually not a full-frame image and cannot fill the entire screen. The HDR image is displayed in the center of the screen, forming the HDR region. The areas outside the HDR image (i.e., the perimeter of the screen) are filled with pixels with lower brightness (i.e., SDR data), forming the SDR region. The display image will then include both the HDR region of the HDR image and the SDR region outside the HDR image. Therefore, the image to be processed includes both the SDR region outside the HDR image and the HDR region of the HDR image. Specifically, the first SDR data is the data of the SDR region of the image to be processed, and the HDR data is the data of the HDR region of the image to be processed.
[0083] In one possible implementation, the display screen can be the display screen 294 of the electronic device 100, or it can be the display screen of other displays. The embodiments of this application do not limit the type of display screen.
[0084] HDR images can be acquired during the shooting process or obtained from an image library. In one possible implementation, the source of the HDR image can be acquired during the shooting process of the camera in the electronic device 100, or it can be an image library in the electronic device 100 or an online network, etc. The HDR image can also be an image downloaded from the network or received from other electronic devices. This application embodiment does not limit the source of the HDR image.
[0085] In this embodiment, the image to be processed can also be an image to be captured. In one possible implementation, the image to be captured can be a static screenshot image or a scrolling screenshot image; this embodiment does not limit the type of image to be captured.
[0086] Static screenshots are single-triggered static screenshots. For example, a static screenshot can be triggered directly (e.g., pressing the power button and volume button simultaneously) to generate a single static screenshot. Scrolling screenshots are extended screenshots generated by stitching together images. For example, to generate a scrolling screenshot, first, trigger the screenshot (e.g., pressing the power button and volume button simultaneously). Second, click the "Scrolling Screenshot" or "Extended Screenshot" button in the screenshot preview interface to trigger scrolling. After triggering scrolling, the screen will automatically scroll slowly; scrolling will automatically stop when you manually click "Stop" or reach the bottom of the page. Finally, a single long screenshot is generated.
[0087] First, the image to be processed undergoes an electro-(non-linear)-optical (linear) conversion, transforming the non-linear data into linear data. The following embodiments of this application use linear data as an example to specifically illustrate the image display method of this application.
[0088] Secondly, the image to be processed is divided into regions by image blocks, specifically SDR and HDR regions. In one possible implementation, the image to be processed comprises multiple image blocks, and the HDR region comprises multiple HDR image blocks. An HDR image block is an image block in which the number of target pixels exceeds a certain threshold, and the brightness of the target pixels exceeds a first brightness threshold. The SDR region is the region in the image to be processed excluding the HDR region.
[0089] In one possible implementation, the size of the image block can be 50*50 or 100*100. This application embodiment does not limit the size of the image block.
[0090] The first brightness threshold is the brightness value of the reference white point. The brightness value of the reference white point is used to distinguish whether a pixel's brightness falls within the SDR or HDR brightness range. The brightness value of the reference white point can be set according to actual needs. For example, it can be obtained by statistically analyzing the brightness values of multiple reference white points, such as the average, median, or minimum value; or it can be set based on empirical values, such as 203 nits, 400 nits, or 800 nits.
[0091] In one possible implementation, the brightness value of the reference white point can be set through the brightness bar of the display screen or by inputting the brightness value on the display screen. This application embodiment does not limit the method of setting the brightness value of the reference white point.
[0092] The quantity threshold is the number of target pixels when the image patch is an HDR image patch, and it can be set according to actual needs. For example, it can be obtained by counting multiple quantities of target pixels when the image patch is an HDR image patch, such as the average, median, minimum, or maximum of multiple quantities of target pixels when the image patch is an HDR image patch; it can also be set based on empirical values, such as 10% or 15% of the total number of pixels in the image patch.
[0093] Step S501 described in this embodiment refers to an image block containing pixels whose brightness is greater than a first brightness threshold (reference white point brightness) and whose quantity exceeds a threshold as an HDR image block. Multiple such HDR images constitute an HDR region. The region in the image to be processed other than the HDR region is referred to as the SDR region. In this way, the SDR region and HDR region of the image to be processed can be better distinguished based on the brightness information of the pixels, thereby obtaining the first SDR data of the SDR region and the HDR data of the HDR region.
[0094] In step S502, the electronic device 100 performs tone mapping from the HDR data to SDR to obtain the second SDR data.
[0095] Specifically, the HDR data is tone-mapped from HDR to SDR to obtain the second SDR data, which can be achieved through tone mapping algorithms.
[0096] In one possible implementation, the tone mapping algorithm can be a global tone mapping algorithm or a local tone mapping algorithm. This application does not limit the type of tone mapping algorithm.
[0097] In one possible implementation, the global tone mapping algorithm can be a reinhard algorithm, a linear scaling algorithm, or a logarithmic mapping algorithm, etc. The embodiments of this application do not limit the type of global tone mapping algorithm.
[0098] In one possible implementation, the local tone mapping algorithm can be a bilateral filter decomposition algorithm, or a Retinex algorithm or a Drago algorithm, etc. The embodiments of this application do not limit the type of local tone mapping algorithm.
[0099] In this embodiment of the application, taking the reinhard algorithm as an example, the process of mapping the HDR data from HDR to SDR to obtain the second SDR data is described in detail.
[0100] HDR data includes pixel values of individual pixels. The HDR data is tone-mapped to SDR to obtain second SDR data. This can be done by taking an HDR image patch as a base and tone-mapping the HDR data of that patch to SDR, thus obtaining the second SDR data of the entire HDR region's HDR data tone mapping. In the following embodiments of this application, the process of tone-mapping HDR data to SDR to obtain second SDR data is specifically described using an HDR image patch as an example.
[0101] For example, see attached Figure 8As shown, the process of toning the HDR data from HDR to SDR to obtain the second SDR data may include the following steps S5021-S5024:
[0102] Step S5021, the electronic device 100 acquires the first pixel value x of the R channel of each pixel in the HDR image block. R The second pixel value x of the G channel G and the third pixel value x of the B channel B .
[0103] Since HDR data includes pixel values, the electronic device 100 acquires the first pixel value x of the R channel for each pixel in the HDR image block. R The second pixel value x of the G channel G and the third pixel value x of the B channel B In fact, it acquires HDR data from HDR image patches.
[0104] In this system, the R channel is the red channel in the RGB color channel, the G channel is the green channel in the RGB color channel, and the B channel is the blue channel in the RGB color channel. The first pixel value of the R channel is x. R The second pixel value x of the G channel G and the third pixel value x of the B channel B Let x be the RGB three-channel pixel value of each pixel in the HDR image patch within the HDR region. Therefore, the first pixel value x R The second pixel value x of the G channel G and the third pixel value x of the B channel B These are the pixel values for HDR.
[0105] Step S5022, the electronic device 100 bases its data on the first pixel value x. R The second pixel value x G and the third pixel value x B The maximum pixel value x of the pixel is obtained. max and the maximum brightness value L of the HDR image block max .
[0106] Wherein, the maximum pixel value x max x is the value of the first pixel R The second pixel value x G and the third pixel value x B The maximum value in the range. Based on the first pixel value x. R The second pixel value x G and the third pixel value x B The maximum pixel value x of the pixel is obtained. max It can be expressed by the following formula (1):
[0107] x max =max(x R x G x B ) formula (1);
[0108] Among them, max() is the function to find the maximum value.
[0109] Based on the first pixel value x of each pixel R The second pixel value x G and the third pixel value x B The brightness of each pixel can be obtained through a brightness algorithm. In one possible implementation, the brightness algorithm can be the ITU-R BT.601 standard (SDTV) algorithm, or the ITU-R BT.709 standard (HDTV) or BT.2020 standard (UHDTV / HDR) algorithm. The embodiments of this application do not limit the type of brightness algorithm.
[0110] Maximum brightness value L max This represents the maximum brightness of the pixels in the HDR image patch. Assume the HDR image patch comprises n pixels, based on the first pixel value x. R The second pixel value x G and the third pixel value x B The maximum brightness value L of the HDR image patch is obtained. max It can be expressed by the following formula (2):
[0111] L max =max(L x1 ,L x2 ,L x3 ,…L xn ) formula (2);
[0112] Where max() is the function to find the maximum value, n is a positive integer, and L x1 ,L x2 ,L x3 ,…L xn These are the brightness values of the first pixel, the second pixel, the third pixel, ..., the nth pixel in the HDR image block, respectively.
[0113] In step S5022, the electronic device 100 bases its data on the first pixel value x. R The second pixel value x G and the third pixel value x B This allows us to obtain the maximum pixel value x for each pixel. max And the maximum brightness value L of all pixels in the HDR image block maxThis facilitates the execution of step S5023, thereby converting the pixel values to SDR.
[0114] Step S5023, the electronic device 100 bases its data on the first pixel value x. R The second pixel value x G The third pixel value x B Maximum pixel value x max and maximum brightness value L max The fourth pixel value y of the R channel of each pixel is obtained. R The fifth pixel value y of the G channel G And the sixth pixel value y of the B channel B .
[0115] Among them, based on the first pixel value x R The second pixel value x G The third pixel value x B Maximum pixel value x max and maximum brightness value L max The fourth pixel value y of the R channel of each pixel is obtained. R The fifth pixel value y of the G channel G And the sixth pixel value y of the B channel B It can be expressed using the following formulas (3)-(5):
[0116] y R =(1+x max / L max 2 )*x R / (1+x max ) formula (3);
[0117] y G =(1+x max / L max 2 )*x G / (1+x max ) formula (4);
[0118] y B =(1+x max / L max 2 )*x B / (1+x max ) formula (5).
[0119] In formulas (3)-(5), since x max / L max 2 Therefore, we can obtain y R <x R y G<x G y B <x B In this way, the first pixel value of HDR can be x R The second pixel value x G and the third pixel value x B Tone mapping is performed to obtain the fourth pixel value y in the SDR. R The fifth pixel value y G and the sixth pixel value y B .
[0120] Step S5024, the electronic device 100 based on the fourth pixel value y R The fifth pixel value y G and the sixth pixel value y B The second SDR data was obtained.
[0121] Because the fourth pixel value y R The fifth pixel value y G and the sixth pixel value y B Since these are SDR pixel values, the fourth pixel value y of each pixel can be used. R The fifth pixel value y G and the sixth pixel value y B The data is then fused to obtain the second SDR data.
[0122] The method described in steps S5021-S5024 above for tone mapping of HDR data to SDR to obtain second SDR data involves first obtaining the RGB three-channel pixel values of each pixel in the HDR image block within the HDR region; then, based on the RGB three-channel pixel values of each pixel, obtaining the maximum pixel value of the pixel and the maximum brightness value of the HDR image block; next, converting the RGB three-channel pixel values, the maximum pixel value, and the maximum brightness value into SDR RGB three-channel pixel values; and finally, fusing the SDR RGB three-channel pixel values to obtain the second SDR data. By tone mapping HDR data to SDR based on the pixel values of each pixel, the pixel values of each pixel can be processed independently, thereby achieving the highest precision local control.
[0123] In step S503, the electronic device 100 obtains the target SDR image based on the first SDR data and the second SDR data.
[0124] In step S503, the first SDR data and the second SDR data are merged to form SDR data, and then the SDR data is converted to form the target SDR image.
[0125] In this embodiment, converting SDR data into a target SDR image may include steps such as data decoding, color management, pixel value mapping, and display output. Specifically, firstly, the SDR data is decoded. This step is not mandatory; if the SDR data is raw SDR pixel values or 8-bit channel data, decoding is not required. If the SDR data is not raw SDR pixel values (e.g., compressed format) or 8-bit channel data, data decoding is required to convert the SDR data into raw SDR pixel values or 8-bit channel data. Secondly, the decoded SDR data undergoes color space conversion to the target color space (e.g., sRGB). Thirdly, the pixel values of the target color space are mapped to the display area. Finally, the pixel values mapped to the display area are sent to the graphics card frame buffer to generate the display signal of the target SDR image for display output.
[0126] In step S504, the electronic device 100 determines whether the maximum brightness of the display screen is less than or equal to the first brightness threshold.
[0127] The first brightness threshold is determined by the maximum brightness of the display screen, which dictates whether it can display SDR or HDR content. The first brightness threshold is the brightness value that distinguishes pixels within the SDR or HDR brightness range. In other words, the maximum brightness value within the SDR brightness range is the first brightness threshold. Therefore, it can be determined whether the display screen can display SDR or HDR images based on its maximum brightness and the first brightness threshold. For example, a display screen with a maximum brightness less than or equal to the first brightness threshold displays SDR images, while a display screen with a maximum brightness greater than the first brightness threshold displays HDR images. Therefore, it can be determined whether the maximum brightness of the display screen is less than or equal to the first brightness threshold. If the maximum brightness of the display screen is less than or equal to the first brightness threshold, step S505 is executed. If the maximum brightness of the display screen is greater than the first brightness threshold, step S506 is executed.
[0128] Step S505: Display the target SDR image on the display screen.
[0129] If the maximum brightness of the display is less than or equal to the first brightness threshold, it indicates that the display is not bright enough to display HDR images and can only display SDR images. Therefore, after obtaining the target SDR image, the target SDR image is displayed on the display.
[0130] For example, see attached Figure 9As shown, the image display method described in steps S501-S505 above can convert HDR data of the HDR region in the image to be processed into second SDR data, then merge the first SDR data of the SDR region in the image to be processed with the converted second SDR data to obtain a target SDR image. Finally, when the maximum brightness of the display screen is less than or equal to a first brightness threshold, the target SDR image is displayed on the display screen. This image display method can retain the HDR data of the HDR region in the image to be processed to obtain the target SDR image, thereby improving the display effect, such as realism, integrity, and quality. It can also meet the display requirements of displays with low maximum brightness, displaying the target SDR image on the display screen, for example, when the maximum brightness of the display screen is less than or equal to a first brightness threshold.
[0131] In step S506, the electronic device 100 obtains a gain map based on the image to be processed and the target SDR image.
[0132] When the maximum brightness of the display screen is greater than the first brightness threshold, it indicates that the brightness of the display screen can display an HDR image. At this time, the electronic device 100 can obtain a gain map based on the image to be processed and the target SDR image, and finally obtain the target HDR image, which is then displayed on the display screen.
[0133] The gain map represents the brightness multiple between the brightness of each pixel in the image to be processed and the brightness of the target SDR image. For example, see attached... Figure 10 As shown, the electronic device 100 can obtain a gain map by comparing the image to be processed and the target SDR image.
[0134] Specific examples, such as those shown in the appendix. Figure 11 As shown, the process of obtaining a gain map based on the image to be processed and the target SDR image may include the following steps S5061-S5063:
[0135] In step S5061, the electronic device 100 acquires the first brightness L1 of each pixel in the image to be processed and the second brightness L2 of the same pixel in the target SDR image.
[0136] In this context, a pixel in the image to be processed is any pixel in the image to be processed, and the same pixel in the target SDR image is the pixel in the image to be processed that corresponds to the same position in the image to be processed. In other words, the two pixels are a pair of pixels at corresponding positions in the image to be processed and the target SDR image.
[0137] To obtain the first brightness L1 of each pixel in the image to be processed and the second brightness L2 of the same pixel in the target SDR image, the first pixel value of each pixel in the image to be processed and the second pixel value of the same pixel in the target SDR image can be obtained first, and then the first brightness L1 of each pixel in the image to be processed and the second brightness L2 of the same pixel in the target SDR image can be obtained based on the brightness algorithm in step S5022.
[0138] In step S5062, the electronic device 100 obtains the gain value G of each pixel based on the first brightness L1 and the second brightness L2 of each pixel.
[0139] Based on the first brightness L1 and the second brightness L2 of each pixel, the gain value G of each pixel is obtained, which can be expressed by the following formula (6):
[0140] G=log2((L1+α1) / (L2+α2)) Formula (6);
[0141] Where α1 is the first bias parameter and α2 is the second bias parameter.
[0142] In one possible implementation, the first bias parameter α1 and the second bias parameter α2 may be the same or different. The embodiments of this application do not limit the relative size of the first bias parameter α1 and the second bias parameter α2.
[0143] The first bias parameter α1 is a preset bias brightness of the first brightness L1 of a pixel in the image to be processed, which can be set according to actual needs. For example, it can be obtained by statistically analyzing multiple bias brightness values of the first brightness L1 of a pixel in the image to be processed, such as the mean, median, minimum, or maximum value of multiple bias brightness values of the first brightness L1 of a pixel in the image to be processed; it can also be set based on empirical values, such as 10. -5 Or 10 -6 NEET.
[0144] The second bias parameter α2 is the preset bias brightness of the second brightness L2 of the pixel in the target SDR image, which can be set according to actual needs. For example, it can be obtained by statistically analyzing multiple bias brightness values of the second brightness L2 of the pixel in the target SDR image, such as the mean, median, minimum, or maximum value of multiple bias brightness values of the second brightness L2 of the pixel in the target SDR image; it can also be set based on empirical values, such as 10. -5 Or 10 -6 NEET.
[0145] In step S5063, the electronic device 100 obtains a gain map based on the gain value G of each pixel.
[0146] Since the gain value G of each pixel is used to characterize the brightness multiple that each pixel needs to be adjusted from the image to the target SDR image, the gain values G of each pixel can be fused to obtain a gain map.
[0147] The electronic device 100 described in steps S5061-S5063 above obtains a gain map based on the image to be processed and the target SDR image by calculating the brightness multiple of each pixel's first brightness L1 in the image to be processed and its second brightness L2 in the target SDR image. This yields the gain value, the brightness multiple that each pixel needs to be adjusted from the image to the target SDR image, thus obtaining the gain map. This method can obtain the gain value based on each pixel and process each pixel independently, thereby achieving the highest precision local control.
[0148] In step S507, the electronic device 100 obtains the target gain map based on the gain map and the second brightness threshold.
[0149] The second brightness threshold is the maximum brightness of the display screen. Display screens with different brightness levels have different maximum brightness, which means that the second brightness threshold is different.
[0150] After obtaining the gain map, since the display can display HDR images, and the target SDR image is used to obtain the HDR image through the gain map, some pixels in the HDR image may have brightness exceeding the brightness range that the display can display, resulting in poor display effect, such as color and brightness distortion. Therefore, it is necessary to limit the brightness of these pixels that exceed the brightness range that the display can display HDR images to within that brightness range, thereby improving the display effect, such as realism, integrity and quality.
[0151] Since the maximum brightness of the display screen is greater than the first brightness threshold, it is necessary to compare the first brightness L1 of the pixel with the maximum brightness of the display screen to determine whether the first brightness L1 of the pixel exceeds the maximum brightness that the display screen can display. In other words, the electronic device 100 obtains the target gain map based on the gain map and the second brightness threshold.
[0152] In this embodiment of the application, the electronic device 100 obtains a target gain map based on the gain map and the second brightness threshold, which can be obtained by processing each pixel.
[0153] First, the electronic device 100 obtains the target gain value of each pixel based on a first brightness L1 and a second brightness threshold of the pixels in the image to be processed. For example, see attached... Figure 12 As shown, the process by which electronic device 100 obtains the target gain value of a pixel based on a first brightness L1 and a second brightness threshold of the pixel in the image to be processed may include the following steps S5071-S5073:
[0154] In step S5071, the electronic device 100 determines whether the first brightness L1 of each pixel in the image to be processed is less than or equal to the second brightness threshold.
[0155] Since the first brightness L1 of each pixel of the image to be processed has been obtained in step S5061, it is not necessary to obtain the first brightness L1 of each pixel of the image to be processed again, and we can directly proceed to the judgment step S5071.
[0156] The electronic device 100 determines whether the first brightness L1 of each pixel in the image to be processed is less than or equal to a second brightness threshold in order to determine whether the first brightness L1 of each pixel is within the brightness range that the display screen can display an HDR image. If the first brightness L1 of each pixel in the image to be processed is greater than the second brightness threshold, it indicates that the first brightness L1 of each pixel is not within the brightness range that the display screen can display an HDR image, and step S5072 is executed. If the first brightness L1 of each pixel in the image to be processed is less than or equal to the second brightness threshold, it indicates that the first brightness L1 of each pixel is within the brightness range that the display screen can display an HDR image, and step S5073 is executed.
[0157] In step S5072, the electronic device 100 sets the target gain value to the gain value of the pixel whose brightness is equal to the second brightness threshold.
[0158] If the first brightness L1 of each pixel in the image to be processed is greater than the second brightness threshold, it indicates that the first brightness L1 of each pixel is not within the brightness range that the display screen can display HDR images, and it needs to be limited to the brightness range that the display screen is suitable for displaying HDR images. Then, the electronic device 100 sets the target gain value to the gain value of the pixel whose brightness is equal to the second brightness threshold, so that the first brightness L1 of the pixel is within the brightness range that the display screen can display HDR images, thereby improving the display effect of the image, such as realism, integrity and quality.
[0159] In step S5073, the electronic device 100 sets the target gain value to the gain value of the pixel.
[0160] If the first brightness L1 of each pixel in the image to be processed is less than or equal to the second brightness threshold, it indicates that the first brightness L1 of each pixel is within the brightness range that the display can show HDR images, and no adjustment is needed. In this case, the target gain value is the gain value of that pixel.
[0161] The process described in steps S5071-S5073 above, in which the electronic device 100 obtains the target gain value of a pixel based on the first brightness L1 and the second brightness threshold of the pixel in the image to be processed, involves comparing the first brightness L1 of each pixel in the image to be processed with the second brightness threshold. Pixels with brightness exceeding the second brightness threshold are limited to a brightness range within which the display screen can display an HDR image, thus obtaining the target gain value for each pixel. This method ensures that the first brightness L1 of all pixels is within the brightness range within which the display screen can display an HDR image, improving display effects such as realism, integrity, and quality.
[0162] Secondly, the electronic device 100 obtains a target gain map based on the target gain value.
[0163] The electronic device 100 can fuse the target gain values of each pixel to obtain a target gain map.
[0164] The process described in step S507 above, in which the electronic device 100 obtains a target gain map based on a gain map and a second brightness threshold, involves comparing the first brightness of each pixel with the second brightness threshold to obtain a target gain map that includes the target gain value of each pixel. This allows for obtaining the target gain value based on each pixel, thus generating the target gain map. Each pixel can be processed independently, achieving the highest precision local control.
[0165] In one possible implementation, the method for obtaining the target gain map can be the truncation method described in step S507, i.e., when the first brightness L1 is greater than the second brightness threshold, the gain value of the pixel whose brightness is equal to the second brightness threshold, or it can be the overall darkening method. The embodiments of this application do not limit the method for obtaining the target gain map.
[0166] The overall dimming method refers to globally dimming the brightness of all pixels, reducing the overall brightness, and ensuring that the brightest parts do not exceed the display limit. Overall dimming methods include linear dimming and non-linear dimming methods.
[0167] For the linear darkening method, specifically, firstly, the maximum brightness L1 among the first brightness L1 of all pixels in the image to be processed is obtained. 1max and the maximum brightness that the display screen can show D max Secondly, based on the maximum brightness L in the first brightness L1 1max and the maximum brightness that the display screen can show D max Calculate the darkening coefficient β.
[0168] Among them, the maximum brightness L is based on the first brightness L1. 1max and the maximum brightness that the display screen can show D maxThe darkening coefficient β can be calculated using the following formula (7):
[0169] β=D max / L 1max Formula (7);
[0170] Finally, the first brightness L1 of all pixels in the image to be processed is darkened as a whole. Specifically, this can be expressed by the following formula (8):
[0171] L1′=L1*β Formula (8);
[0172] Where L1′ is the first brightness of the pixel after overall darkening.
[0173] In other words, the initial brightness L1 of all pixels in the image to be processed is adjusted according to the darkening factor β to obtain a brightness that is less than or equal to the maximum brightness D that the display screen can show. max The overall brightness of the pixels after darkening is L1′, which ensures that the brightness of the brightest part does not exceed the maximum brightness of the display screen, thereby improving the display effect.
[0174] For non-linear dimming methods, it is based on the maximum brightness D that the display screen can show. max Non-linear adjustments are made in zones, such as darkening highlights and dimming shadows. In one possible implementation, the adjustment is based on the maximum brightness D that the display can show. max Nonlinear adjustment in intervals can be performed using Gamma correction, logarithmic transformation function, or Reinhard operator. This application does not limit the method of nonlinear adjustment.
[0175] This application uses the Reinhard operator as an example to illustrate the nonlinear darkening method in detail. Specifically, it can be expressed by the following formula (9):
[0176] L1′=L1*D max / (L1+1) formula (9);
[0177] Where L1′ is the first brightness of the pixel after overall darkening.
[0178] This nonlinear darkening method selectively compresses bright areas, thus preserving the visual naturalness of the image to the greatest extent while compressing the visibility of high-brightness pixels.
[0179] In the overall darkening method described above, after darkening all pixels, the first brightness L1′ of the darkened pixels is obtained. At this time, the target gain value is the gain value of the first brightness L1′ of the pixel. Then, based on the target gain value, the target gain map is obtained.
[0180] In step S508, the electronic device 100 obtains the target HDR image based on the target gain map and the target SDR image.
[0181] In step S507, the first brightness L1 of each pixel in the image to be processed is judged and adjusted. After obtaining the target gain map that the first brightness L1 of all pixels is within the range that the display screen can display the HDR image, the target gain map and the target SDR image are fused to obtain the target HDR image.
[0182] In one possible implementation, the target gain map and the target SDR image are fused to obtain the target HDR image, as exemplified in the attached figure. Figure 13 As shown, the steps S5081-S5083 may be included:
[0183] In step S5081, the electronic device 100 expands the brightness value of each pixel in the target SDR image according to the gain value of the target gain map to obtain the target brightness value.
[0184] The target gain map indicates the brightness factor required to convert a pixel from a target SDR image to a target HDR image. Therefore, the electronic device 100 can perform brightness expansion on each pixel in the target SDR image according to the gain value of the target gain map to obtain the target brightness value of the HDR image to be converted.
[0185] In step S5082, the electronic device 100 converts the target brightness value into target HDR.
[0186] After applying the gain value to the target SDR image, the target brightness value is converted to the target HDR to meet the HDR standard and avoid exceeding the maximum brightness of the target HDR, which would lead to overexposure in the highlight areas.
[0187] In step S5083, the electronic device 100 obtains a target HDR image based on the target HDR and target SDR images.
[0188] Finally, the electronic device 100 adjusts the brightness value of each pixel in the target SDR image based on the target HDR to obtain the target HDR image, which can improve the display effect of the target HDR image, such as its realism, integrity and quality.
[0189] The method described in steps S5081-S5083 above, which fuses the target gain map and the target SDR image to obtain a target HDR image, first obtains the target brightness value based on the target gain map, then converts the target brightness value into target HDR, and finally obtains the target HDR image based on the target HDR and the target SDR image. This method first enhances the brightness value of the target SDR image to the target brightness value required for the HDR image, then performs target HDR normalization processing on the target brightness value, and finally adjusts the brightness value of each pixel in the target SDR image based on the target HDR to obtain the target HDR image. This process of reconstructing the target HDR image from the target SDR image according to the target gain map can make the target HDR image conform to HDR standard requirements, improving the display effect of the target HDR image, such as realism, integrity, and quality.
[0190] Step S509: Display the target HDR image on the display screen.
[0191] If the maximum brightness of the display screen is greater than a first brightness threshold, it indicates that the maximum brightness of the display screen is sufficient to display an HDR image. Therefore, after obtaining the target HDR image, the target HDR image is displayed on the display screen.
[0192] For example, see attached Figure 14 As shown, the image display method described in steps S506-S509 above, after obtaining the target SDR image in step S503, can compare the image to be processed and the target SDR image to obtain a gain map. Then, the first brightness L1 of each pixel in the gain map is compared with a second brightness threshold to obtain a target gain map including the target gain value of each pixel. The target gain map and the target SDR image are then fused to obtain a target HDR image. Finally, when the maximum brightness of the display screen is greater than the first brightness threshold, the target HDR image is displayed on the display screen. This image display method can retain HDR data in the HDR region of the image to be processed to obtain a target HDR image, thereby improving the display effect, such as realism, integrity, and quality. It can also meet the display requirements of displays with high maximum brightness, displaying the target HDR image on the display screen, for example, when the maximum brightness of the display screen is greater than the first brightness threshold.
[0193] For example, see attached Figure 15As shown, the image display method described in steps S501-S509 above can convert HDR data of the HDR region in the image to be processed into second SDR data, then merge the first SDR data of the SDR region in the image to be processed with the converted second SDR data to obtain a target SDR image. Finally, when the maximum brightness of the display screen is less than or equal to a first brightness threshold, the target SDR image is displayed on the display screen. Alternatively, a target HDR image can be obtained based on the image to be processed and the target SDR image, and displayed on the display screen when the maximum brightness of the display screen is greater than the first brightness threshold. This image display method can retain the HDR data of the HDR region in the image to be processed to obtain a target SDR image or a target HDR image, improving the display effect, such as realism, integrity, and quality. Furthermore, it can selectively display the target SDR image or the target HDR image on the display screen according to the maximum brightness of the display screen; for example, when the maximum brightness of the display screen is less than or equal to the first brightness threshold, the target SDR image is displayed on the display screen; when the maximum brightness of the display screen is greater than the first brightness threshold, the target HDR image is displayed on the display screen.
[0194] The image display method and electronic device provided in this application embodiment can convert HDR data of HDR regions in an image to be processed into second SDR data, then merge the first SDR data of the SDR regions in the image to be processed with the converted second SDR data to obtain a target SDR image. Finally, when the maximum brightness of the display screen is less than a first brightness threshold, the target SDR image is displayed on the display screen. Alternatively, a target HDR image can be obtained based on the image to be processed and the target SDR image, and displayed on the display screen when the maximum brightness of the display screen is greater than or equal to a first brightness threshold and less than or equal to a second brightness threshold. This image display method can retain HDR data of HDR regions in the image to be processed to obtain a target SDR image or a target HDR image, improving display effects such as realism, integrity, and quality. Furthermore, it can selectively display a target SDR image or a target HDR image on the display screen according to the maximum brightness of the display screen; for example, when the maximum brightness of the display screen is less than a first brightness threshold, the target SDR image is displayed on the display screen; when the maximum brightness of the display screen is greater than or equal to the first brightness threshold, the target HDR image is displayed on the display screen.
[0195] It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules that perform the respective functions. Based on the algorithm steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application. This embodiment can divide the electronic device into functional modules according to the above method examples. For example, each function can be divided into separate functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0196] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.
[0197] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.
[0198] The electronic devices, computer storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0199] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or all the data functions described above.
[0200] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0201] The units described above as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Data or all units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The functions of the integrated unit can be implemented in hardware or as software functional units.
[0202] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the data contributing to them, or all or all of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or all of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0203] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image display method, characterized in that, The method includes: Acquire the first SDR data of the standard dynamic range (SDR) region and the HDR data of the high dynamic range (HDR) region of the image to be processed; The HDR data is tone-mapped from HDR to SDR to obtain second SDR data; Based on the first SDR data and the second SDR data, the target SDR image is obtained; The target SDR image is displayed on the display screen when the maximum brightness of the display screen is less than or equal to a first brightness threshold.
2. The image display method according to claim 1, characterized in that, The maximum brightness of the display screen is a second brightness threshold; the method further includes: When the maximum brightness of the display screen is greater than the first brightness threshold, a gain map is obtained based on the image to be processed and the target SDR image; the gain map is used to characterize the difference data between the brightness of each pixel in the image to be processed and the target SDR image. Based on the gain map and the second brightness threshold, the target gain map is obtained; Based on the target gain map and the target SDR image, a target HDR image is obtained and displayed on the display screen.
3. The image display method according to claim 2, characterized in that, The step of obtaining the target gain map based on the gain map and the second brightness threshold includes: Based on the first brightness and the second brightness threshold of the pixel in the image to be processed, the target gain value of the pixel is obtained; Based on the target gain value, a target gain map is obtained.
4. The image display method according to claim 3, characterized in that, The step of obtaining the target gain value of a pixel based on the first brightness and the second brightness threshold of the pixel in the image to be processed includes: When the first brightness of the pixel is less than or equal to the second brightness threshold, the target gain value is the gain value of the pixel. When the first brightness of a pixel is greater than the second brightness threshold, the target gain value is the gain value of the pixel whose brightness is equal to the second brightness threshold.
5. The image display method according to any one of claims 1-4, characterized in that, The image to be processed includes multiple image blocks; the HDR region includes multiple HDR image blocks; the HDR image block is an image block in which the number of target pixels in the multiple image blocks is greater than a number threshold; the brightness of the target pixels is greater than a first brightness threshold; the SDR region is the region in the image to be processed other than the HDR region.
6. The image display method according to claim 5, characterized in that, The HDR data includes pixel values of individual pixels. The step of color mapping the HDR data to SDR to obtain second SDR data includes: Based on the first pixel value of the red channel, the second pixel value of the green channel, and the third pixel value of the blue channel of each pixel in the HDR image block, the maximum pixel value of the pixel and the maximum brightness value of the HDR image block are obtained; the maximum pixel value is the maximum value among the first pixel value, the second pixel value, and the third pixel value; the maximum brightness value is the maximum brightness value among all pixels in the HDR image block. Based on the first pixel value, the second pixel value, the third pixel value, the maximum pixel value, and the maximum brightness value, the fourth pixel value of the red channel, the fifth pixel value of the green channel, and the sixth pixel value of the blue channel of the pixel are obtained respectively; wherein, the fourth pixel value is less than the first pixel value, the fifth pixel value is less than the second pixel value, and the sixth pixel value is less than the third pixel value; The second SDR data is obtained based on the fourth pixel value, the fifth pixel value, and the sixth pixel value of the pixel.
7. The image display method according to claim 6, characterized in that, Based on the first pixel value, the second pixel value, the third pixel value, the maximum pixel value, and the maximum brightness value, the fourth pixel value of the red channel, the fifth pixel value of the green channel, and the sixth pixel value of the blue channel of the pixel are obtained respectively, satisfying the following formula: y R =(1+x max / L max 2 )·x R / (1+x max ); y G =(1+x max / L max 2 )·x G / (1+x max ); y B =(1+x max / L max 2 )·x B / (1+x max ); Where, x R x is the value of the first pixel. G x is the second pixel value. B For the third pixel value, x max x is the maximum pixel value. max =max(x R ,x G ,x B );L max L is the maximum brightness value. max =max(L x1 ,L x2 ,L x3 ,…L xn ), where n is the total number of pixels in the HDR image block, and is a positive integer; L xn The value is the brightness of the nth pixel; max() is the function to find the maximum value; y R For the fourth pixel value, y G For the fifth pixel value, y B This refers to the value of the sixth pixel.
8. The image display method according to claim 3 or 4, characterized in that, The process of obtaining a gain map based on the image to be processed and the target SDR image includes: The gain value of the pixel is obtained based on the first brightness of the pixel in the image to be processed and the second brightness of the pixel in the target SDR image; The gain map is obtained based on the gain value of the pixel.
9. The image display method according to claim 8, characterized in that, The gain value of the pixel is obtained based on the first brightness of the pixel in the image to be processed and the second brightness of the pixel in the target SDR image, satisfying the following formula: G=log2((L1+α1) / (L2+α2)); Wherein, L1 is the first brightness of the pixel, L2 is the second brightness of the pixel, α1 is the first bias parameter, α2 is the second bias parameter, and G is the gain value of the pixel.
10. The image display method according to any one of claims 1-9, characterized in that, The image to be processed includes static screenshots or scrolling screenshots.
11. An electronic device, characterized in that, The device includes a memory and one or more processors, the memory being coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the image display method as described in any one of claims 1-10.
12. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the image display method as described in any one of claims 1-10.
13. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the image display method as described in any one of claims 1-10.
