Terminal device and method for creating / displaying HDR image
By regionally adjusting and encoding HDR images in the terminal device, the problem of unexpanded dynamic range in the existing technology is solved, and a display effect of higher contrast and dynamic range is achieved.
Patent Information
- Application Number
- CN202410531178.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-06-15
AI Technical Summary
Existing HDR image display technology cannot make full use of higher dynamic range display devices, resulting in the inability to effectively increase the contrast between highlight areas and dark areas, and the dynamic range cannot be truly expanded.
By adjusting the image in different regions in the terminal device, encoding and adjusting the pixel values according to the screen brightness and exposure parameters, an extended image is generated to increase the brightness of the highlight area and reduce the brightness of the dark area to achieve contrast improvement and dynamics. Expansion of scope.
When displaying HDR images, the contrast between the highlight and dark areas is increased, the dynamic range of the image is expanded, making it closer to the real brightness and scene, and full use of higher dynamic range display devices.
Smart Images

Figure CN118590766A
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210675917.6, and the original application date is 2022.06.15. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to a terminal device and a method for creating / displaying HDR images. Background Art
[0003] With the development of the terminal industry, most terminal devices support high dynamic range (HDR) photography technology, which can capture and display the huge dynamic range of the real world under the limited dynamic range available in typical imaging sensors and display devices.
[0004] Currently, HDR photography is usually implemented by taking multiple images of the same scene at different exposure levels, blending them together into a single image, and then applying some form of "tone mapping" to bring the fused image into the dynamic range of a standard dynamic range (SDR) display. The fused image is generally stored as an 8-bit image, with a final dynamic range of approximately 255:1.
[0005] However, with the continuous improvement of display technology, most current display devices can provide a higher dynamic range than 255: 1. However, when displaying the fused image, these display devices cannot display the image with a higher dynamic range. Summary of the invention
[0006] In view of this, the present application provides a terminal device and a method for creating / displaying an HDR image, which can make the highlight area and the dark area have higher contrast and higher dynamic range when the HDR image is displayed on a device with a higher dynamic range.
[0007] In a first aspect, the present application provides a terminal device, the terminal device includes a display screen, a memory and one or more processors, and the one or more processors are coupled to the memory; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors are configured to execute the computer instructions, the following operations are performed: in response to a user's operation of viewing an image file, decoding the image file to obtain a pixel value of each pixel in a first image and brightness information of each pixel in the first image under a target exposure parameter; according to the brightness information of each pixel, dividing the first image into multiple image areas, the multiple image areas include a first area and a second area, the first area is a dark area in the first image, and the second area is a highlight area in the first image; determining a target screen brightness according to a current screen brightness and a maximum screen brightness of the display screen, the target screen brightness is greater than the current screen brightness and less than or equal to the maximum screen brightness; adjusting the pixel values of the pixels in the first area based on a first adjustment coefficient, and adjusting the pixel values of the pixels in the second area based on a second adjustment coefficient, to obtain an extended image, wherein the first adjustment coefficient is a ratio of the current screen brightness to the target screen brightness, and the second adjustment coefficient is greater than or equal to 1; adjusting the screen brightness of the display screen to the target screen brightness, and displaying the extended image.
[0008] In the process of displaying the first image, the screen brightness of the mobile phone is increased to increase the observed brightness of each pixel; at the same time, the pixel values of the pixels in the first area are reduced to reduce the observed brightness of the pixels in the first area, and the pixel values of the pixels in the second area are increased or maintained to increase or maintain the observed brightness of the pixels in the second area, so as to achieve the effect of not changing the observed brightness of the pixels in the second area and increasing the observed brightness of the pixels in the second area. In other words, in the process of displaying the HDR image (the first image), the bright areas in the HDR image can be made brighter, and the dark areas can be made darker or remain unchanged, thereby increasing the light-dark contrast of the HDR image and expanding the dynamic range of the HDR image.
[0009] In one embodiment of the first aspect, one or more processors are further configured to perform the following operations: obtain multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond one-to-one to the multiple exposure parameters; perform tone mapping on the multiple frames of images to obtain a first image; obtain a pixel value of each pixel in the first image; group the pixels in the first image according to a preset pixel grouping strategy, and obtain brightness information of each group of pixels under a target exposure parameter, where the target exposure parameter is one of the multiple exposure parameters, or is a parameter determined based on at least two of the multiple exposure parameters; and perform encoding operations on the brightness information and the pixel value of each pixel to obtain an image file.
[0010] The image file obtained based on the implementation method of the present application includes both the pixel values of the first image and the brightness information before tone mapping, and the brightness information can better reflect the actual brightness of the first image. In this way, the dynamic range of the first image is adjusted based on the brightness information during the display of the first image, so that the image can be displayed closer to the actual brightness.
[0011] In one implementation of the first aspect, the one or more processors are further configured to perform the following operations: obtaining a target exposure image corresponding to a target exposure parameter, wherein if the target exposure parameter is a first parameter among multiple exposure parameters, the target exposure image is an image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two exposure parameters among multiple exposure parameters, the target exposure image is an image obtained by fusing image frames corresponding to at least two exposure parameters; obtaining a brightness value of each pixel in each group of pixels in the target exposure image; and taking an average of the brightness values of all pixels in each group of pixels in the target exposure image as brightness information of the group of pixels under the target exposure parameter. By grouping pixels, the amount of brightness information can be reduced, thereby reducing the size of the file.
[0012] In an implementation of the first aspect, the one or more processors are further configured to perform the following operations: perform an encoding operation on the pixel value of each pixel to obtain first encoded data; perform an encoding operation on the brightness information to obtain second encoded data; and write the second encoded data into the first encoded data to obtain an image file. In other words, the brightness information can be written into the image to obtain only one image file.
[0013] In one implementation of the first aspect, the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, the M pixels correspond one-to-one to the M sub-adjustment coefficients, and the one or more processors are further configured to perform the following operations: determine the brightness value of the jth pixel based on the brightness information of the jth pixel, j≤M; calculate the sub-adjustment coefficient of the jth pixel based on the brightness value of the jth pixel, wherein the sub-adjustment coefficient of the jth pixel is positively correlated with the brightness value of the jth pixel, and the sub-adjustment coefficient of the jth pixel is greater than 1; adjust the pixel value of the jth pixel based on the sub-adjustment coefficient of the jth pixel.
[0014] That is, the second adjustment coefficient of each pixel point can be different. By adjusting the pixel value of the second area in this way, the light and dark contrast of each pixel point in the second area can be retained, making the display result more realistic.
[0015] In one implementation of the first aspect, the second adjustment coefficient is 1.
[0016] In one embodiment of the first aspect, one or more processors are further configured to perform the following operations: determine the brightness value of the corresponding pixel point based on the brightness information of each pixel point; calculate the brightness mean of the brightness value of each pixel point; determine a first threshold value based on the brightness mean value, the first threshold value is greater than the brightness mean value, and the first threshold value is positively correlated with the brightness mean value; if the brightness value of any pixel point is less than the first threshold value, divide any pixel point into the first area; if the brightness value of any pixel point is greater than or equal to the first threshold value, divide any pixel point into the second area.
[0017] In one embodiment of the first aspect, the multiple image areas also include a third area, and the one or more processors are further configured to perform the following operations: determine the brightness value of the corresponding pixel point based on the brightness information of each pixel point; calculate the brightness mean of the brightness value of each pixel point; determine the second threshold and the third threshold value based on the brightness mean, the second threshold value is less than the brightness mean value, the third threshold value is greater than the brightness mean value, and the second threshold value, the third threshold value and the brightness mean value are positively correlated; if the brightness value of any pixel point is less than the second threshold value, divide the any pixel point into the first area; if the brightness value of any pixel point is greater than or equal to the second threshold value and less than the third threshold value, divide the any pixel point into the third area; if the brightness value of any pixel point is greater than or equal to the third threshold value, divide the any pixel point into the second area.
[0018] In an implementation of the first aspect, the target screen brightness is the maximum screen brightness.
[0019] In an implementation of the first aspect, the target screen brightness is a larger value between the maximum screen brightness and a first brightness threshold, and the first brightness threshold is a product of the current screen brightness and a preset multiple.
[0020] In a second aspect, an embodiment of the present application provides a terminal device, which includes a display screen, a memory and one or more processors, and the one or more processors are coupled to the memory; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors are configured to execute the computer instructions, the following operations are performed: obtaining multiple frames of images under multiple exposure parameters, and the multiple frames of images correspond one-to-one to multiple exposure parameters; performing tone mapping on the multiple frames of images to obtain a first image; obtaining the pixel value of each pixel in the first image; grouping the pixels in the first image according to a preset pixel grouping strategy, and obtaining brightness information of each group of pixels under a target exposure parameter, wherein the target exposure parameter is one of the multiple exposure parameters, or is a parameter determined based on at least two of the multiple exposure parameters; encoding the brightness information and the pixel value of each pixel respectively to obtain an image file.
[0021] It can be seen that the image file obtained based on the implementation method of the present application includes both the pixel values of the first image and the brightness information before tone mapping, and the brightness information can better reflect the actual brightness of the first image. In this way, the dynamic range of the first image is adjusted based on the brightness information during the display of the first image, so that the image can be displayed closer to the actual brightness.
[0022] In one embodiment of the second aspect, one or more processors are further configured to perform the following operations: obtain multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond one to one with the multiple exposure parameters; perform tone mapping on the multiple frames of images to obtain a first image; obtain a pixel value of each pixel in the first image; group the pixels in the first image according to a preset pixel grouping strategy, and obtain brightness information of each group of pixels under a target exposure parameter, where the target exposure parameter is one of the multiple exposure parameters, or is a parameter determined based on at least two of the multiple exposure parameters; perform encoding operations on the brightness information and the pixel value of each pixel to obtain an image file. By performing grouping operations on the pixels, the amount of brightness information can be reduced, thereby reducing the size of the file.
[0023] In an implementation of the second aspect, the one or more processors are further configured to perform the following operations: perform an encoding operation on the pixel value of each pixel to obtain first encoded data; perform an encoding operation on the brightness information to obtain second encoded data; and write the second encoded data into the first encoded data to obtain an image file. In other words, the brightness information can be written into the image to obtain only one image file.
[0024] In a third aspect, an embodiment of the present application provides a method for creating an HDR image, which is applied to a terminal device, and the method includes: obtaining multiple frames of images under multiple exposure parameters, and the multiple frames of images correspond one-to-one to multiple exposure parameters; performing tone mapping on the multiple frames of images to obtain a first image; obtaining the pixel value of each pixel in the first image; grouping the pixels in the first image according to a preset pixel grouping strategy, and obtaining brightness information of each group of pixels under a target exposure parameter, wherein the target exposure parameter is one exposure parameter among multiple exposure parameters, or is a parameter determined based on at least two exposure parameters among multiple exposure parameters; encoding the brightness information and the pixel value of each pixel respectively to obtain an image file.
[0025] In one implementation of the third aspect, obtaining brightness information of each group of pixels under a target exposure parameter includes: obtaining a target exposure image corresponding to the target exposure parameter, wherein, if the target exposure parameter is a first parameter among multiple exposure parameters, the target exposure image is an image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two exposure parameters among the multiple exposure parameters, the target exposure image is an image obtained by fusing image frames corresponding to the at least two exposure parameters; obtaining a brightness value of each pixel in each group of pixels in the target exposure image; and taking an average of the brightness values of all pixels in each group of pixels in the target exposure image as the brightness information of the group of pixels under the target exposure parameter.
[0026] In one implementation of the third aspect, encoding operations are performed on the brightness information and the pixel value of each pixel respectively to obtain an image file, including: encoding the pixel value of each pixel to obtain first encoded data; encoding the brightness information to obtain second encoded data; and writing the second encoded data into the first encoded data to obtain an image file.
[0027] In a fourth aspect, an embodiment of the present application also provides a method for displaying an HDR image, which is applied to a terminal device, and the method includes: in response to a user's operation of viewing an image file, decoding the image file to obtain a pixel value of each pixel in the first image and brightness information of each pixel in the first image under a target exposure parameter; dividing the first image into multiple image areas according to the brightness information of each pixel, the multiple image areas including a first area and a second area, the first area being a dark area in the first image, and the second area being a highlight area in the first image; determining a target screen brightness according to the current screen brightness and the maximum screen brightness of the display screen, the target screen brightness being greater than the current screen brightness and less than or equal to the maximum screen brightness; adjusting the pixel values of the pixels in the first area based on a first adjustment coefficient, and adjusting the pixel values of the pixels in the second area based on a second adjustment coefficient to obtain an extended image, wherein the first adjustment coefficient is a ratio of the current screen brightness to the target screen brightness, and the second adjustment coefficient is greater than or equal to 1; adjusting the screen brightness of the display screen to the target screen brightness, and displaying the extended image.
[0028] In one implementation of the fourth aspect, the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, the M pixels correspond one-to-one to the M sub-adjustment coefficients, and adjusting the pixel values of the pixels in the second area based on the second adjustment coefficient includes: determining the brightness value of the jth pixel based on the brightness information of the jth pixel, j≤M; calculating the sub-adjustment coefficient of the jth pixel based on the brightness value of the jth pixel, wherein the sub-adjustment coefficient of the jth pixel is positively correlated with the brightness value of the jth pixel, and the sub-adjustment coefficient of the jth pixel is greater than 1; and adjusting the pixel value of the jth pixel based on the sub-adjustment coefficient of the jth pixel.
[0029] In one implementation of the fourth aspect, the second adjustment coefficient is 1.
[0030] In one embodiment of the fourth aspect, dividing the first image into multiple image areas according to the brightness information of each pixel includes: determining the brightness value of the corresponding pixel according to the brightness information of each pixel; calculating the brightness mean of the brightness value of each pixel; determining a first threshold according to the brightness mean, the first threshold is greater than the brightness mean, and the first threshold is positively correlated with the brightness mean; if the brightness value of any pixel is less than the first threshold, dividing any pixel into the first area; if the brightness value of any pixel is greater than or equal to the first threshold, dividing any pixel into the second area.
[0031] In one embodiment of the fourth aspect, the multiple image areas also include a third area, and dividing the first image into multiple image areas according to the brightness information of each pixel includes: determining the brightness value of the corresponding pixel according to the brightness information of each pixel; calculating the brightness mean of the brightness value of each pixel; determining a second threshold and a third threshold according to the brightness mean, the second threshold is less than the brightness mean, the third threshold is greater than the brightness mean, and the second threshold, the third threshold and the brightness mean are positively correlated; if the brightness value of any pixel is less than the second threshold, the any pixel is divided into the first area; if the brightness value of any pixel is greater than or equal to the second threshold and less than the third threshold, the any pixel is divided into the third area; if the brightness value of any pixel is greater than or equal to the third threshold, the any pixel is divided into the second area.
[0032] In one implementation of the fourth aspect, the target screen brightness is the maximum screen brightness.
[0033] In an implementation of the fourth aspect, the target screen brightness is a larger value between the maximum screen brightness and a first brightness threshold, and the first brightness threshold is a product of the current screen brightness and a preset multiple.
[0034] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, comprising computer instructions, which, when executed on a terminal, enables the terminal to execute any one of the methods in the third aspect or the fourth aspect.
[0035] In a sixth aspect, an embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed on a terminal, enables the terminal to execute any one of the methods in the third aspect or the fourth aspect.
[0036] It can be understood that the beneficial effects that can be achieved by the computer-readable storage medium of the fifth aspect and the computer program product of the sixth aspect provided above can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0038] Figure 2A A flowchart of a method for creating an HDR image provided in an embodiment of the present application;
[0039] Figure 2B A schematic diagram of synthesizing a first image provided by an embodiment of the present application;
[0040] Figure 3 A shooting schematic diagram;
[0041] Figure 4 A schematic diagram of a pixel grouping strategy;
[0042] Figure 5 A schematic diagram of another pixel grouping strategy;
[0043] Figure 6 A flowchart of a method for displaying an HDR image provided by an embodiment of the present application;
[0044] Figure 7 A schematic diagram of displaying an image in different ways provided by an embodiment of the present application;
[0045] Figure 8 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical scheme in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. Wherein, in the description of the present application, unless otherwise specified, "at least one" refers to one or more, and "a plurality of" refers to two or more than two. In addition, in order to facilitate the clear description of the technical scheme of the embodiment of the present application, in the embodiment of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit necessarily different.
[0047] In order to make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:
[0048] HDR means that the ratio between the highest and lowest values of the signal (i.e., the dynamic range) is greater than or equal to a preset first threshold. When HDR is reflected in an image, it can be understood that there are highlight areas and dark areas in the image, and the ratio between the brightness value of the highlight area and the brightness value of the dark area exceeds the first threshold. Such an image can also be called an HDR image.
[0049] SDR means that the ratio between the highest and lowest values of the signal (i.e., the dynamic range) is less than the preset first threshold and greater than or equal to the preset second threshold (the second threshold is less than the first threshold). Reflecting SDR in an image can be understood as the presence of highlight areas and dark areas in the image, and the ratio between the brightness value of the highlight area and the brightness value of the dark area is less than the preset first threshold and greater than or equal to the preset second threshold. Such an image can also be called an SDR image.
[0050] The exposure value (EV) can reflect the exposure level of the image. By adjusting the exposure parameters of the camera, the image can have different EVs. Among them, the exposure parameters refer to the parameters used to affect the exposure of the camera, including but not limited to aperture, shutter, exposure time, sensitivity, etc. In the embodiment of the present application, the exposure value of normal exposure is represented as EV0, the exposure value of underexposure is represented as EV-, and the exposure value of overexposure is represented as EV+. In addition, the exposure value EV0×2 n Expressed as EVn. For example, EV-1 means the exposure value is half of EV0, and EV-2 means the exposure value is half of EV-1; for another example, EV1 means the exposure value is twice of EV0, and EV2 means the exposure value is twice of EV1.
[0051] In one solution provided by the prior art, a terminal device can take multiple images of the same scene with different exposure values, and fuse these images together into an "HDR" image. However, this "HDR" image is generally an 8-bit image, and its final dynamic range is about 255:1. This makes the dynamic range of the "HDR" image still within the standard dynamic range. In other words, this "HDR" image is actually an SDR image.
[0052] When an "HDR" image is displayed on a device with a higher dynamic range, the brightness of the "HDR" image can increase or decrease with the brightness of the device screen. However, during the change, the brightness of the highlight and dark areas of the "HDR" image can change year-on-year, which means that the contrast between the highlight and dark areas does not change. In other words, the dynamic range of the "HDR image" displayed by the device does not change, and the higher dynamic range of the device is not fully utilized.
[0053] In view of this, an embodiment of the present application provides a method for generating / displaying an HDR image, which is applied to a terminal device. The terminal device can encode brightness information that can reflect the actual brightness of the HDR image and the pixel value of the HDR image into an image file during the process of generating the HDR image. Also, during the process of displaying the HDR image, the highlight area of the HDR image can be increased or maintained, and the pixel value of the dark area can be reduced according to the actual brightness and the brightness capability of the terminal device, so that the highlight area of the HDR image is brighter, and the dark area of the HDR image is darker or close to the original brightness of the dark area of the HDR image, thereby increasing the contrast between the highlight area and the dark area, thereby expanding the dynamic range of the HDR image, and making the HDR image displayed by the terminal device closer to the real scene.
[0054] The image display method provided in the embodiment of the present application can be applied to a terminal device. The terminal device can be a mobile phone, a tablet, a laptop computer, or other device with a camera and a display screen. The embodiment of the present application does not specifically limit the specific form of the terminal device.
[0055] like Figure 1As shown, the terminal device may be specifically a mobile phone 100. The mobile phone 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0056] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
[0057] It is to be understood that the structure shown in this embodiment does not constitute a specific limitation on the mobile phone 100. In other embodiments, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0058] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0059] The controller may be the nerve center and command center of the mobile phone 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0060] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0061] In some embodiments, the processor 110 may include one or more interfaces. The interface 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 universal serial bus (USB) interface, etc.
[0062] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0063] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the terminal device through the power management module 141.
[0064] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0065] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
[0066] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0067] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0068] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
[0069] The wireless communication module 160 can provide wireless communication solutions for application on the mobile phone 100, including WLAN (such as (wirelessfidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), nearfield wireless communication technology (nearfield communication, NFC), infrared technology (infrared, IR), etc.
[0070] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.
[0071] The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0072] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.
[0073] The mobile phone 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture a static image or a video. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0074] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0075] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0076] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0077] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0078] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the mobile phone 100. The mobile phone 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0079] The embodiment of the present application provides a method for creating / displaying an HDR image. The following will describe the process of creating a backward compatible HDR image and displaying an HDR image in conjunction with the accompanying drawings.
[0080] In some embodiments, Figure 2A As shown, the process of creating an HDR image method may include:
[0081] S201, acquiring multiple frames of images, where the multiple frames of images correspond to multiple exposure parameters one by one.
[0082] The multiple frames of images are images taken by the mobile phone in the same scene under different exposure parameters. Figure 3As shown, the mobile phone can display a shooting preview interface 301. The shooting preview interface 301 may include a shutter 302. In response to the user clicking / touching the shutter 302, the mobile phone shoots multiple frames of images. In one possible implementation, the mobile phone may include a first camera, a second camera, and a third camera, and the first camera, the second camera, and the third camera may respectively shoot with different exposure parameters to obtain multiple frames of images. Alternatively, in another possible implementation, the mobile phone can continuously shoot multiple frames of images with different exposure parameters, and the shooting time of each frame of the image is as close to synchronization as possible.
[0083] For example, Figure 2B As shown, the multi-frame image may include image 1 and image 2. Image 1 is taken by the camera based on exposure parameter 1, and image 2 is taken by the camera based on exposure parameter 2. It can be seen that the EV value corresponding to image 1 is smaller than the EV value corresponding to image 2. Image 1 is underexposed, which results in a clearer outline in the highlight area of the picture, but the dark area is blurred due to lack of exposure. Image 2 is overexposed, which causes the highlight area in the picture to be distorted due to overexposure, while the dark area can see the details and outline clearly due to the compensation of the exposure value.
[0084] It should be noted that Figure 2B Taking the image frames under EV- and EV+ as an example, in fact, the mobile phone can also obtain image frames under more exposure conditions, such as image frames under EV0, EV-1, EV-2, EV+1, EV+2, etc., without specific restrictions here.
[0085] S202: Perform tone mapping on multiple frames of images to obtain a first image.
[0086] The mobile phone can fuse multiple frames of images into a first image in a tone mapping manner. Among them, tone mapping may include global tone mapping and local tone mapping. Global tone mapping can be mapped using a histogram, a gamma function, a Sigmoid nonlinear function, etc. Global tone mapping can well preserve the global contrast, but will lose some local details. Local tone mapping can first divide the first image into regions, and then process each divided region in a manner similar to global tone mapping, and finally retain the relative contrast between adjacent regions, which can well preserve local details.
[0087] Exemplarily, the first image obtained can be as follows Figure 2B The first image is relative to the single frame image (eg Figure 2B For the images 1 and 2 in FIG. 1 , both the dark and highlight areas have more obvious details and contours, and have a higher dynamic range. In other words, the first image is an HDR image.
[0088] S203: Obtain the pixel value of each pixel in the first image.
[0089] Depending on the type of image sensor that captures the image, the pixel value of each pixel includes but is not limited to RGB value, RGGB value, RGBW value, RYYB value, etc. Among them, RGB means that the color of each pixel is composed of three components: red (red, R), green (green, G) and blue (blue, B). RGGB means that the color of each pixel is composed of four components: red, green, green and blue. RGBW means that the color of each pixel is composed of four components: red, green, blue and white (white, W). RYYB means that the color of each pixel is composed of four components: red, yellow (yellow, Y), yellow and blue. Among them, the pixel value of each pixel can be obtained by the image sensor.
[0090] S204: group the pixels included in the first image according to a preset pixel grouping strategy, and obtain brightness information of each group of pixels under target exposure parameters.
[0091] Among them, the target exposure parameter can be one of multiple exposure parameters, or a parameter obtained by combining at least two of the multiple exposure parameters, which can be set according to actual shooting requirements. For example, if the dark details of the required image are relatively clear, the target exposure parameter can be relatively large; if the highlight area of the required image is relatively clear and there is no overexposure, the target exposure parameter can be relatively small; if the required image has a relatively clear light and dark contrast and there is no overexposure or underexposure, the target exposure parameter can be moderate. In an optional embodiment, the target exposure parameter can be a parameter obtained by combining multiple exposure parameters, that is, the exposure parameter corresponding to the first image.
[0092] Exemplarily, the multiple exposure parameters include EV-1, EV0, EV+1, and EV+2. The mobile phone can directly take any one of EV-1, EV0, EV+1, and EV+2 as the target exposure parameter. Alternatively, if in a certain scene, in order to capture the dark details in the image, the EV needs to be between EV+1 and EV+2, then the mobile phone can change the exposure time, sensitivity and other parameters to make the EV between EV+1 and EV+2 to obtain the target exposure parameter.
[0093] In another optional implementation, multiple exposure parameters can be input into a pre-trained neural network model to obtain a target exposure parameter. In short, the target exposure parameter is a value that can be changed according to actual shooting requirements, and its setting method can be set and maintained by the maintainer in the background.
[0094] The image corresponding to the target exposure parameter is the target exposure image. The target exposure image can be understood as the exposure image that should be obtained when the mobile phone shoots with the target exposure parameter. If the target exposure parameter is one of multiple exposure parameters, the target exposure image can be the image shot by the mobile phone under the target exposure parameter. If the target exposure parameter is a parameter obtained by combining at least two exposure parameters among multiple exposure parameters, the target exposure image can be an image obtained by fusion of image frames corresponding to the at least two exposure parameters. For example, the multiple exposure parameters include EV0, EV-, and EV+, and correspond to EV0 image frames, EV- image frames, and EV+ image frames, respectively. If the target exposure parameter is EV0, the EV0 image frame is used as the target exposure image; if the target exposure parameter is a parameter obtained by combining EV- and EV+, the image obtained by fusion of the EV- image frame and the EV+ image frame is used as the target exposure image. For another example, if the target exposure parameter is a parameter obtained by combining the above multiple exposure parameters, the first image obtained by fusion of multiple frames of images corresponding to the multiple exposure parameters is used as the target exposure image.
[0095] The brightness information of each group of pixels under the target exposure parameters can be understood as the brightness information of each group of pixels in the target exposure image. For example, the mobile phone takes EV0 images, EV- images, and EV+ images, and obtains the first image based on the EV0 images, EV- images, and EV+ images. If the mobile phone uses EV0 as the target exposure parameter, the brightness information of a group of pixels in the first image under the target exposure parameters is the brightness information of the group of pixels in the EV0 image.
[0096] In addition, the preset pixel grouping strategy can be set according to actual needs. Exemplarily, the preset pixel grouping strategy can divide a pixel into a group, or can divide a pixel matrix composed of n×m pixels into a group, for example, a pixel matrix composed of 2×2 or 3×2 pixels can be divided into a group, and no specific limitation is made here.
[0097] If the mobile phone divides a pixel into a group, the brightness information of each group of pixels under the target exposure parameters is the brightness value of the pixel in the target image. If the mobile phone divides a pixel matrix consisting of n×m pixels into a group, the brightness information of the group of pixels under the target exposure parameters can be the average brightness value of all pixels in the group of pixels in the target image, or the average brightness value remaining after removing the outliers of the brightness values of all pixels, and no specific limitation is made here.
[0098] For example, Figure 4 A pixel grouping strategy is shown. Figure 4In the image, the mobile phone regards each pixel as a pixel group. Among them, the pixel value of pixel A1 is R1G1B1, the pixel value of pixel A2 is R2G2B2, and the coordinates of pixel A1 and pixel A2 in the image are the same. The brightness information of pixel A2 under the target exposure parameters is the brightness information of pixel A2 in the target exposure image, that is, the brightness information of pixel A1. Therefore, the brightness information L1 of pixel A1 can be calculated through the pixel values R1, G1, and B1 of pixel A1, and it is used as the brightness information of pixel A2 under the target exposure parameters.
[0099] The brightness value and the pixel value can satisfy the formula: L = 0.299R + 0.587G + 0.114B. Where L is the brightness value. For example, the pixel value of pixel A1 is (R100, G100, B100), and it can be determined that the brightness value of pixel A1 is 0.299R + 0.587G + 0.114B = 29.9 + 58.7 + 11.4 = 100. Therefore, the brightness information of pixel A2 under the target exposure parameters is 100.
[0100] For example, Figure 5 Another pixel grouping strategy is shown. Figure 5 In the figure, the first image and the target exposure image both include 9×4 pixels. The mobile phone divides the 9×4 pixels into 12 groups, each of which includes 3×1 pixels. Among them, pixel group 1 includes pixel M1, pixel M2 and pixel M3. Pixel group 2 includes pixel N1, pixel N2 and pixel N3. Among them, the coordinates of pixel M1 and pixel N1 in the image are the same, the coordinates of pixel M2 and pixel N2 in the image are the same, and the coordinates of pixel M3 and pixel N3 in the image are the same. The pixel values of pixel M1 are R3, G3, B3, and W3, the pixel values of pixel M2 are R4, G4, B4, and W4, and the pixel values of pixel M3 are R5, G5, B5, and W5. The pixel values of pixel point N1 are R6, G6, B6, and W6, the pixel values of pixel point N2 are R7, G7, B7, and W7, and the pixel values of pixel point N3 are R8, G8, B8, and W8. The brightness information of pixel group 2 under the target exposure parameters is the brightness information of pixel group 2 in the target exposure image, that is, the brightness information of pixel group 1. The mobile phone can calculate the brightness value L3 according to the pixel value (R3, G3, B3, and W3) of pixel point M1, calculate the brightness value L4 according to the pixel value (R4, G4, B4, and W4) of pixel point M2, and calculate the brightness value L5 according to the pixel value (R5, G5, B5, and W5) of pixel point M3, and then use the average value L6 of the brightness value L3, the brightness value L4, and the brightness value L5 as the brightness information of pixel group 2 under the target exposure parameters.
[0101] S205, encoding the brightness information and the pixel value to obtain an image file.
[0102] In an embodiment of the present application, the mobile phone can encode pixel values using the Joint Photographic Experts Group (JPEG) standard, high efficiency video coding (HEVC), portable network graphics (PNG), run-length encoding (RLE), etc. to obtain first encoded data.
[0103] Among them, the format of the first encoded data includes but is not limited to JPEG, high efficiency image file format (HEIF), HEIC, PNG, bitmap (BMP), graphics interchange format (GIF), etc., and no specific limitation is made here.
[0104] In addition, the mobile phone can encode the brightness information using linear encoding or non-linear encoding to obtain the second encoded data. Each encoded brightness information can have a bit width of 8 bits, 10 bits or higher. Among them, non-linear encoding may include encoding using a gamma function, etc., which is not specifically limited here. In addition, when encoding the brightness information, the grouping method of the pixel group can also be encoded into the second encoded data.
[0105] The mobile phone can also write the second coded data into a specific field of the first coded data to generate an image file. For example, taking the format of the first coded data as PNG as an example, a standard PNG file includes a PNG file signature field and multiple PNG data blocks. The mobile phone can write the second coded data into the PNG data block to generate an image file.
[0106] It should be noted that, depending on the format of the first encoded data, the fields into which the second encoded data is written are not necessarily the same. It is only necessary to write the second encoded data into the fields of the first encoded data that do not affect the information carried by the first encoded data itself. No specific restrictions are made here.
[0107] In this way, the image file created by the mobile phone includes both the pixel values of the first image and the brightness information before tone mapping is performed. The brightness information can better reflect the actual brightness of the first image, making it easier to adjust the brightness of the first image during the subsequent display of the first image.
[0108] In some embodiments, Figure 6 As shown, the process of displaying an HDR image may include:
[0109] S301, in response to a user's operation of viewing an image file, the mobile phone decodes the image file to obtain brightness information and pixel values of a first image.
[0110] S302: Determine a brightness mean according to the brightness information.
[0111] The brightness mean is the average of all brightness values, which is used to reflect the real brightness level of the first image. For example, if the bit width of the brightness information is 8 bits, after digitizing it, the brightness value ranges from 0 to 255. After each brightness value is digitized, the average brightness value can be obtained.
[0112] S303: Divide the first image into a plurality of image regions according to the brightness mean, where the plurality of image regions at least include a first region and a second region.
[0113] The first area is a dark area in the first image, and the second area is a highlight area in the first image.
[0114] In an optional implementation, the mobile phone may divide the first image into two image regions, where the two image regions are respectively a first region and a second region.
[0115] The mobile phone can first determine the first threshold value according to the brightness mean, and then divide the first image into the first area and the second area based on the first threshold value. The first threshold value is greater than or equal to the brightness mean value, and the larger the brightness mean value, the larger the first threshold value. The first threshold value can be linearly or nonlinearly related to the brightness mean value, and no specific restrictions are made here. The mobile phone can divide the pixels whose brightness values are lower than the first threshold value into the first area, and divide the pixels whose brightness values are higher than the second threshold value into the second area. In this way, the first area can contain the pixels in the darker area of the first image, and the second area can contain the pixels in the brighter area of the first image.
[0116] Exemplarily, the first threshold may be 165. If the brightness value of pixel 1 is determined to be 100 according to the brightness information, since 100<165, the pixel 1 is divided into the first area. If the brightness value of pixel 2 is determined to be 188 according to the brightness information, since 188>165, the pixel 2 is divided into the second area.
[0117] In another optional implementation, the mobile phone may divide the first image into a first area, a second area and a third area, wherein the third area is a transition area between the first area and the second area.
[0118] The mobile phone can determine the second threshold and the third threshold according to the brightness mean, and divide the first image into the first area, the second area and the third area based on the second threshold and the third threshold. Among them, the second threshold is less than the brightness mean, the third threshold is greater than or equal to the brightness mean, and the larger the brightness mean, the larger the second threshold and the third threshold. The second threshold and the third threshold can be linearly or nonlinearly related to the brightness mean, and no specific restrictions are made here. The mobile phone can divide the pixels whose brightness values are lower than the second threshold into the first area, divide the pixels whose brightness values are greater than or equal to the second threshold and less than the third threshold into the third area, and divide the pixels whose brightness values are greater than or equal to the third threshold into the second area. In this way, the first area is the darker area in the first image, the second area is the brighter area in the first image, and the third area is the excessive area of the first area and the second area, with moderate brightness.
[0119] It should be noted that the above only shows two ways of dividing the image regions. The embodiment of the present application can also use a more sophisticated partitioning method to divide the first image into more image regions, and no specific limitation is made here.
[0120] S304: Determine the target screen brightness based on the current screen brightness and the maximum screen brightness.
[0121] In an embodiment of the present application, in order to make the first image appear brighter, the screen brightness may be increased. The maximum screen brightness is the maximum brightness supported by the mobile phone screen. In an optional implementation, the mobile phone may first determine a first brightness threshold based on the current screen brightness. For example, the mobile phone may use a preset multiple of the current screen brightness as the first brightness threshold. The preset multiple may be any value greater than 1, such as 3. Then, the mobile phone may compare the first brightness threshold with the maximum screen brightness. If the first brightness threshold is less than or equal to the maximum screen brightness, the target screen brightness is determined to be the first brightness threshold. If the first brightness threshold is greater than the maximum screen brightness, the target screen brightness is determined to be the maximum screen brightness.
[0122] In another optional implementation, the target screen brightness can be fixed to the maximum screen brightness, that is, no matter what the current screen brightness is, the mobile phone always uses the maximum screen brightness as the target screen brightness.
[0123] S305, adjusting the pixel values of the pixels in the first area based on the first adjustment coefficient, and adjusting the pixel values of the pixels in the second area based on the second adjustment coefficient to obtain an extended image, wherein the first adjustment coefficient is less than 1, and the second adjustment coefficient is greater than or equal to 1.
[0124] Specifically, the mobile phone can multiply the first adjustment coefficient with the pixel value of all pixels in the first area to obtain new pixel values corresponding to each pixel; and multiply the second adjustment coefficient with the pixel value of all pixels in the second area to obtain new pixel values corresponding to each pixel.
[0125] Among them, when the mobile phone determines the target screen brightness by comparing the first brightness threshold and the maximum screen brightness, if the first brightness threshold is less than the maximum screen brightness, the target screen brightness is the first brightness threshold, and the first adjustment coefficient is the ratio of the current screen brightness to the first brightness threshold, that is, the reciprocal of the preset multiple; if the first brightness threshold is greater than or equal to the maximum screen brightness, the target screen brightness is the maximum screen brightness, and the first adjustment coefficient is the ratio of the current screen brightness to the maximum screen brightness. When the mobile phone fixes the maximum screen brightness as the target screen brightness, the first adjustment coefficient is the ratio of the current screen brightness to the maximum screen brightness. It can be seen that the first adjustment coefficient is the ratio of the current screen brightness to the target screen brightness.
[0126] When the first adjustment coefficient Q1 is the inverse of the preset multiple, since the preset multiple is greater than 1, it can be obtained that Q1 < 1. In addition, when the first adjustment coefficient Q1 is the ratio of the current screen brightness to the maximum screen brightness, the current screen brightness of the mobile phone is represented by A Nits, and the maximum screen brightness of the mobile phone is represented by B Nits, and the first adjustment coefficient Q1 can be obtained as A / B.
[0127] In another optional implementation, the second adjustment coefficient is a variable value and is related to the brightness information of each pixel in the second area. Specifically, the second adjustment coefficient of each pixel is related to the brightness information of the pixel. Specifically, the brightness information of each pixel can be digitized to obtain a brightness value, and then the second adjustment coefficient of the pixel is calculated based on the brightness value. If the second area includes N pixels, the second adjustment coefficient of the i-th pixel satisfies the formula: Q2 i =1+L i / L max Among them, Q2 i Indicates the second adjustment coefficient of the i-th pixel, L i Indicates the brightness value of the i-th pixel, L max Indicates the maximum brightness value of the pixel. For example, taking the brightness information as 8 bits, the brightness information can be digitized into 0 to 255. If the brightness value of a pixel is C, the second adjustment coefficient Q2 corresponding to the pixel is 1+C / 255.
[0128] This method can make different pixel values have different second adjustment coefficients, and can preserve the light and dark relationship between different pixel points in the second area as much as possible.
[0129] In an optional implementation, the second adjustment coefficient may be 1. When the second adjustment coefficient is 1, the pixel values of the pixels in the second area remain unchanged.
[0130] Since the first adjustment coefficient is less than 1, the new pixel value corresponding to each pixel in the first area is less than the original pixel value corresponding to the pixel. Since the second adjustment coefficient is greater than or equal to 1, the new pixel value corresponding to each pixel in the second area is greater than or equal to the original pixel value corresponding to the pixel.
[0131] S306, adjusting the screen brightness of the mobile phone to the target screen brightness, and displaying the extended image.
[0132] In an optional implementation, the relationship between the observed brightness of a certain pixel and the screen brightness can satisfy the formula: Lg = Gray * Lp, where Lg is the observed brightness, Lp is the screen brightness, and Gray is the pixel grayscale. The observed brightness of a certain pixel can indicate the brightness of the pixel on the display screen. The pixel grayscale of a pixel is related to the pixel value of the pixel, where the larger the pixel value, the larger the pixel grayscale. For example, the pixel grayscale and the pixel value can satisfy the formula: Gray = 0.299R + 0.587G + 0.114B.
[0133] It can be seen that when an image is displayed on a mobile phone screen, the screen brightness of the mobile phone and the pixel value of the pixel point will affect the brightness of the pixel point on the screen. Among them, when the pixel value of the pixel point is constant, the greater the screen brightness of the mobile phone, the greater the observed brightness of the pixel point, that is, the brighter the pixel point looks; when the screen brightness of the mobile phone is constant, the greater the pixel value of the pixel point, the greater the observed brightness of the pixel point, that is, the brighter the pixel point looks. Conversely, if the observed brightness of a certain pixel point is to remain unchanged when the screen brightness is increased, the pixel value of the pixel point can be reduced.
[0134] It can be understood that the process of displaying the first image in the present application is actually: when the screen brightness of the mobile phone is increased, the pixel values of the pixels in the first area on the first image are reduced so that the observed brightness of the pixels in the first area on the first image is close to the observed brightness before the screen brightness is adjusted; at the same time, the pixel values of the pixels in the second area on the first image are maintained or increased so that the observed brightness of the pixels in the second area on the second image is greater than the observed brightness before the screen brightness is adjusted. In other words, the brightness of the first area on the first image is kept unchanged, and the brightness of the second area on the first image is increased.
[0135] Exemplarily, the process of displaying the first image is described by adjusting the screen brightness of the mobile phone from the current screen brightness A to the target screen brightness C, the first adjustment coefficient is A / C, and the second adjustment coefficient is 1. The mobile phone can first generate an extended image according to the first adjustment coefficient and the second adjustment coefficient. In the process of generating the extended image, the pixel value of the pixel point on the first area of the first image is reduced by A / C times, so that the pixel grayscale of the pixel point on the first area is reduced by A / C times; the pixel value of the pixel point on the second area of the first image remains unchanged. When the mobile phone adjusts the screen brightness from the current screen brightness A to the target screen brightness C, the screen brightness of all the pixel points on the first image is increased by C / A times. It can be seen that after displaying the first image, the observed brightness of the pixel points on the first area is first reduced by A / C times, and then increased by C / A times, which is the same as its original observed brightness; the observed brightness of the pixel points on the second area is increased by C / A times, which is higher than its original observed brightness. This can increase the light and dark contrast between the first area and the second area on the first image, and expand the dynamic range of the first image.
[0136] For example, the first image may be Figure 7 As shown in (a), the first image 701 includes a first area 701a and a second area 701b. If the mobile phone does not obtain the extended image of the first image in advance, and directly increases the screen brightness and displays the first image, the following can be obtained: Figure 7 In the image 702 shown in (b), the observed brightness of the first area 702a and the second area 702b in the image 702 increases, but the brightness contrast of the image 702 does not change, and is the same as that of the image 701. After the mobile phone obtains the extended image of the first image, it increases the screen brightness and displays the extended image, and the following can be obtained: Figure 7 703 shown in (c) of FIG. 703. It can be seen that the observed brightness of the first area 703a in the image 703 is close to the observed brightness of the first area 701a in the first image 701, and the observed brightness of the second area 703b in the image 703 is significantly higher than the observed brightness of the second area 701b in the first image 701. Compared with the first image 701, the first area 703a and the second area 703b in the image 703 have a higher light-dark contrast, and the image 703 has a larger dynamic range.
[0137] It should be noted that the first image displayed by the mobile phone may be created by other terminal devices and then transmitted to the mobile phone, or may be created by the mobile phone itself. In other words, the process of creating an HDR image and the process of displaying an HDR image may be completed by the same device or by different devices, and no specific limitation is made here.
[0138] In summary, the present application achieves the effect of not changing the observed brightness of the pixels in the second area and increasing the observed brightness of the pixels in the second area by increasing the screen brightness of the mobile phone in the process of displaying the first image, thereby increasing the observed brightness of each pixel; and at the same time, by reducing the pixel value of the pixels in the first area to reduce the observed brightness of the pixels in the first area, and increasing or maintaining the pixel value of the pixels in the second area to increase or maintain the observed brightness of the pixels in the second area. In other words, in the process of displaying an HDR image, the bright areas in the HDR image can be made brighter, and the dark areas can be made darker or remain unchanged, thereby increasing the light-dark contrast of the HDR image and expanding the dynamic range of the HDR image.
[0139] In addition, the HDR image display method provided in the embodiment of the present application can adapt to the brightness capability supported by the screen of the terminal device and can fully utilize the brightness capability of the terminal device.
[0140] The present application also provides a chip system, such as Figure 8 As shown, the chip system includes at least one processor 801 and at least one interface circuit 802. The processor 801 and the interface circuit 802 can be interconnected through a line. For example, the interface circuit 802 can be used to receive signals from other devices (for example, a memory of a terminal device). For another example, the interface circuit 802 can be used to send signals to other devices (for example, the processor 801).
[0141] For example, the interface circuit 802 can read the instructions stored in the memory of the terminal device and send the instructions to the processor 801. When the instructions are executed by the processor 801, the electronic device (such as Figure 1 The mobile phone in the embodiment) executes each step in the above embodiment.
[0142] Of course, the chip system may also include other discrete devices, which is not specifically limited in the embodiments of the present application.
[0143] The present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are in an electronic device (such as Figure 1 When the method is executed on a mobile phone in the embodiment, the electronic device is enabled to execute each function or step executed by the electronic device in the above method embodiment.
[0144] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0145] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0146] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0147] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0149] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for displaying an image, characterized in that: Applied to an electronic device, the electronic device includes a display screen, and the method includes: Displaying a shooting preview interface, wherein the shooting preview interface includes a shutter; receiving a first operation of the shutter by a user; In response to the first operation, obtaining a first image; Encoding pixel values of pixels of the first image and brightness values of pixels of the first image to obtain an image file of the first image, wherein the brightness value of the first image is determined based on the pixel values of pixels of the first image, and the brightness values of pixels of the first image are represented by pixel grayscale; receiving a second operation of the user on the first image; After the second operation, the image file of the first image is decoded to obtain first data and second data, wherein the first data represents pixel values of pixels of the first image, and the second data represents brightness values of pixels of the first image, the pixels of the first image include first-category pixels and second-category pixels, and the brightness values of the pixels of the first category are smaller than the brightness values of the pixels of the second category; According to the brightness values of the pixels of the first image, the pixel values of the first category of pixels and the pixel values of the second category of pixels are adjusted to obtain a target image, wherein the adjustment includes reducing the pixel values of the first category of pixels and maintaining or increasing the pixel values of the second category of pixels; According to the brightness values of the pixels of the first image, increasing the brightness of the display screen to a target screen brightness; When the brightness of the display screen is the target screen brightness, the target image is displayed.
2. The method according to claim 1, characterized in that The bit width of the brightness value of the pixel point of the first image is 8 bits or 10 bits.
3. The method according to claim 1 or 2, characterized in that The first image includes a first area and a second area. The brightness value of any pixel in the first area is less than a first threshold, and the brightness value of any pixel in the second area is greater than or equal to the first threshold. The first type of pixel is located in the first area, and the second type of pixel is located in the second area.
4. The method according to any one of claims 1 to 3, characterized in that The second data and the first data are both decoded images, and the resolution of the second data is smaller than the resolution of the first data.
5. The method according to any one of claims 1 to 4, characterized in that When the first image is an HDR image, the brightness value of the pixel point of the first image is a first brightness value. When the first image is an SDR image, the brightness value of the pixel point of the first image is a second brightness value. The first brightness value is different from the second brightness value.
6. The method according to any one of claims 1 to 5, characterized in that Before adjusting the pixel values of the first-category pixel points and the second-category pixel points, and when the screen brightness of the display screen is the first screen brightness, the observed brightness of the first-category pixel points is the first observed brightness, and the observed brightness of the second-category pixel points is the second observed brightness; After adjusting the pixel values of the first-category pixel points and the second-category pixel points, and when the screen brightness of the display screen is the target screen brightness, the observed brightness of the first-category pixel points is the third observed brightness, and the observed brightness of the second-category pixel points is the fourth observed brightness; The difference between the first observed brightness and the third observed brightness is less than a preset threshold, and the fourth observed brightness is greater than the second observed brightness.
7. The method according to any one of claims 1 to 6, characterized in that The first type of pixel points includes a first pixel point and a second pixel point. The ratio of the pixel value of the first pixel point before adjustment to the pixel value of the first pixel point after adjustment is a first ratio, the ratio of the pixel value of the second pixel point before adjustment to the pixel value of the second pixel point after adjustment is a second ratio, and the first ratio is equal to the second ratio.
8. The method according to any one of claims 1 to 7, characterized in that The second type of pixel points includes a third pixel point and a fourth pixel point, the ratio of the pixel value of the third pixel point before adjustment to the pixel value of the third pixel point after adjustment is a third ratio, the ratio of the pixel value of the fourth pixel point before adjustment to the pixel value of the fourth pixel point after adjustment is a fourth ratio, and the third ratio is equal to the fourth ratio.
9. The method according to any one of claims 1 to 8, characterized in that The target screen brightness is the maximum screen brightness of the display screen.
10. The method according to any one of claims 1 to 9, characterized in that The brightness value of the first image is calculated based on the formula L=0.299R+0.587G+0.114B, where L is the brightness value, and R, G, and B are three components of the pixel.
11. An electronic device, characterized in that: The electronic device includes a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-10.
12. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 10.
13. A chip system, characterized in that: The chip system includes a processor, and the processor is used to call a computer program in a memory to execute the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Image display method and device, terminal and readable storage medium
CN112164007A
Backward compatible high dynamic range (HDR) images
CN114257750A
Automatic exposure estimation for HDR images based on image statistics
US20100329554A1
High dynamic range video generation method and device
WO2021036991A1
Image capturing method and electronic device
WO2021185374A1
Cited By
Image processing method and device
TWI936692B
