Disclosure of Invention
The application provides a display method and electronic equipment, and by the display method, the sense of reality of pictures displayed on a display screen of the electronic equipment can be improved.
In a first aspect, the present application provides an electronic device that may include a camera assembly, a display screen, a memory, a processor, a camera, a display screen, and a memory each coupled to the processor, wherein:
the camera shooting assembly can be used for shooting a first picture;
the memory may be used for storing a first picture, a photographing environment illuminance, which is an environment illuminance at the time of photographing the first picture, and a first brightness, which is a brightness value of a first gray-scale pixel point of the first picture at the photographing environment illuminance;
the processor may be configured to obtain a first ambient illuminance of a first scene when the electronic device displays the first picture in the first scene, determine a second luminance based on the captured ambient illuminance, the first luminance, and the first ambient illuminance, the second luminance being a luminance value of a first gray-scale pixel in the first picture at the first ambient illuminance;
the display screen can be used for displaying a first picture in a first scene, wherein the brightness value of a pixel point of a first gray level of the first picture is second brightness.
Thus, the first picture displayed by the electronic device in the first scene is consistent with the look and feel of the first picture in the shooting environment. That is, the electronic device may more realistically display the first picture.
In one possible implementation, the processor may be further configured to determine, based on the second luminance, a luminance value of a pixel of the second gray level of the first picture as the third luminance.
Thus, when the display screen of the electronic device displays the first picture, the brightness values of the pixels with other gray scale values can be determined according to the brightness values of the pixels with the first gray scale of the first picture.
In one possible implementation, the processor may be configured to determine the imaging ambient illuminance based on an exposure value of the imaging assembly, or to determine the imaging ambient illuminance based on one or more of weather, time, and location at which the first picture was taken.
In this way, the processor can determine the shooting ambient illumination.
In one possible implementation, the processor may be configured to determine the first ambient illuminance based on one or more of weather, time, and place when the first picture is displayed.
In this way, the processor may determine the first ambient illuminance.
In one possible implementation, the electronic device further includes an ambient light sensor coupled with the processor, the ambient light sensor operable to:
Collecting the illumination of a shooting environment when a first picture is shot;
And when the electronic equipment displays the first picture, acquiring first ambient illuminance.
Thus, the electronic device can determine the photographing ambient illuminance and the first ambient illuminance through the ambient light sensor.
In one possible implementation, the processor may be configured to:
When the electronic equipment displays the first picture in the second scene, acquiring second ambient illuminance of the second scene;
determining fourth brightness based on the shooting ambient illuminance, the first brightness and the second ambient illuminance, wherein the fourth brightness is a brightness value of a first gray-scale pixel point of the first picture under the second ambient illuminance;
Mapping the brightness value of the pixel point of the first gray scale of the first picture into fourth brightness;
The display screen can be used for displaying a first picture in a second scene, wherein the brightness value of a pixel point of a first gray level of the first picture is fourth brightness.
In this way, the brightness values of the pixels of the first gray scale of the first picture displayed by the electronic device under different ambient illuminances are different. The brightness of the first picture displayed by the electronic equipment in any scene is consistent with the brightness of the first picture in the shooting environment. Therefore, the sense of reality of the first picture displayed by the electronic equipment can be improved, and user experience can be improved.
In one possible implementation, if the second ambient illuminance is less than the first ambient illuminance, the fourth brightness is less than the second brightness;
If the second ambient illuminance is greater than the first ambient illuminance, the fourth brightness is greater than the second brightness;
if the second ambient illuminance is equal to the first ambient illuminance, the fourth luminance is equal to the second luminance.
In this way, the smaller the ambient illuminance is, that is, the darker the viewing environment is, the smaller the luminance value of the pixel point of the first gray scale of the first picture displayed by the electronic device is. On the contrary, the greater the ambient illuminance is when the first picture is displayed, that is, the brighter the viewing environment is, the greater the brightness value of the pixel point of the first gray scale of the first picture displayed by the electronic device is.
In a second aspect, an electronic device is provided that may include a camera assembly, a display screen, a memory, a processor, the camera assembly, the display screen, and the memory being respectively coupled to the processor, wherein:
the image pickup assembly can be used for shooting a high dynamic range image, compressing a high dynamic range area in the high dynamic range image to obtain a compressed image and compression information, wherein the compression information comprises a corresponding relation between a dynamic range and a compression ratio in the compressed image;
The memory may be used to store the compressed picture and compression information;
The processor may be configured to obtain a compressed picture and compression information when the electronic device displays the compressed picture;
based on the compression information, obtaining the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range picture;
Tone mapping is carried out on the compressed picture based on the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range picture to obtain a tone mapped picture, wherein the brightness at the maximum value of the high dynamic range in the tone mapped picture is the maximum brightness supported by the display screen;
the display screen may be used to display the tone mapped picture.
Therefore, when the electronic equipment displays the compressed picture, the picture can be subjected to tone mapping based on the corresponding relation between the dynamic range of the picture and the display brightness capability of the display screen, and the region with high dynamic range in the picture can be restored. In this way, the contrast and detail of the areas of high dynamic range of the displayed picture can be increased, reducing the luminance saturation.
In one possible implementation, the processor may be configured to:
Determining a dynamic range in the high dynamic range picture based on the compression information;
And determining the corresponding relation between the dynamic range in the high dynamic range picture and the brightness of the display screen, wherein the brightness of the maximum value of the high dynamic range in the high dynamic range picture is set as the maximum value of the brightness of the display screen.
In this way, the processor may restore the dynamic range of the high dynamic range picture and may map the dynamic range of the high dynamic range picture with the brightness of the display screen. Therefore, the display capability of the display screen can be fully utilized, and the contrast of the high dynamic range area in the high dynamic range picture can be restored.
In one possible implementation, the multiple of the maximum value of the dynamic range in the compressed picture and the maximum value of the standard dynamic range is a first multiple, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range is a second multiple, and the multiple of the maximum value of the dynamic range in the tone mapped picture and the maximum value of the standard dynamic range is a third multiple;
the first multiple is less than the second multiple, and the third multiple is greater than the first multiple and less than or equal to the second multiple.
In this way, the tone mapped picture displayed by the electronic device can restore the original picture as much as possible, namely, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range.
In a third aspect, an electronic device is provided that may include a camera assembly, a display screen, a memory, and a processor, the camera assembly, the display screen, and the memory being respectively coupled to the processor, wherein:
The camera assembly may be used to capture a first video, the first video comprising a first image frame;
The memory may be used to store a first image frame, a first photographing ambient illuminance, which is an ambient illuminance at the time of photographing the first image frame, and a first brightness, which is a brightness value of a pixel point of a first gray scale of the first image frame at the first photographing ambient illuminance;
The processor may be configured to obtain a first ambient illuminance of a first scene when the electronic device displays the first image frame in the first scene, determine a second luminance based on the first photographing ambient illuminance, the first luminance, and the first ambient illuminance, the second luminance being a luminance value of a first gray-scale pixel in the first image frame at the first ambient illuminance;
The display screen may be configured to display a first image frame of the first video in the first scene, wherein a luminance value of a first gray-scale pixel of the first image frame is a second luminance.
Thus, the first video displayed by the electronic device in the first scene is consistent with the look and feel of the first video in the shooting environment. That is, the electronic device may more realistically display the first video.
In one possible implementation, the processor may be further configured to determine, based on the second luminance, a luminance value of a pixel of the second gray level of the first image frame as the third luminance.
Thus, when the display screen of the electronic device displays the first image frame of the first video, the brightness values of the pixels with other gray scale values can be determined according to the brightness values of the pixels with the first gray scale of the first image frame.
In one possible implementation, the processor may be configured to:
when the electronic equipment displays the first image frame in the second scene, acquiring second ambient illuminance of the second scene;
determining fourth brightness based on the shooting ambient illuminance, the first brightness and the second ambient illuminance, wherein the fourth brightness is a brightness value of a first gray-scale pixel point of the first image frame under the second ambient illuminance;
mapping the brightness value of the pixel point with the first gray level of the first image frame into fourth brightness;
The display screen may be configured to display a first image frame in the second scene, wherein a luminance value of a pixel point of a first gray level of the first image frame is a fourth luminance.
In this way, the brightness values of the pixels of the first gray scale of the first image frame displayed by the electronic device under different ambient illuminances are different. The brightness of the first image frame displayed by the electronic equipment in any scene is consistent with the brightness of the first image frame in shooting environment. Therefore, the sense of reality of the first image frame displayed by the electronic equipment can be improved, and user experience can be improved.
In one possible implementation, the first video further includes a second image frame;
The memory may be used to store a second image frame, a second photographing environment illuminance, which is an environment illuminance at the time of photographing the second image frame, and a fifth brightness, which is a brightness value of a pixel point of a first gray level of the second image frame at the second photographing environment illuminance;
The processor may be configured to, when the electronic device displays the second image frame in the first scene, obtain a first ambient illuminance of the first scene, determine a sixth luminance based on the photographing ambient illuminance, the fifth luminance, and the first ambient illuminance, the sixth luminance being a luminance value of a first gray-scale pixel in the second image frame at the first ambient illuminance;
The display screen may be configured to display a second image frame of the first video in the first scene, the first gray-scale pixel of the second image frame having a sixth brightness value.
The illuminance of the shooting environment of the first image frame may be the same as or different from the illuminance of the shooting environment of the second image frame. That is, the first imaging environment illuminance may be equal to or different from the second imaging environment illuminance. When the first photographing environment illuminance is equal to the second photographing environment illuminance, the sixth luminance may be equal to the second luminance.
In this way, when two frames of image frames of the first video displayed in the same scene of the electronic device are captured under different capturing environments, the brightness values of the pixels of the first gray level of the two frames of image frames may be different. The look and feel of the brightness of an image frame displayed by the electronic device may be consistent with the look and feel of the image frame in a shooting scene.
The fourth aspect provides a display method which can be applied to electronic equipment, and the method can comprise the steps of shooting a first picture, storing shooting environment illumination and first brightness, wherein the shooting environment illumination is the environment illumination when the first picture is shot, the first brightness is the brightness value of a first gray-scale pixel point of the first picture under the shooting environment illumination, when the first picture is displayed in a first scene, acquiring the first environment illumination of the first scene, determining second brightness based on the shooting environment illumination, the first brightness and the first environment illumination, the second brightness is the brightness value of the first gray-scale pixel point of the first picture under the first environment illumination, mapping the brightness value of the first gray-scale pixel point of the first picture to the second brightness, and displaying the first picture in the first scene, wherein the brightness value of the first gray-scale pixel point of the first picture is the second brightness.
By the method provided by the fourth aspect, the first picture displayed by the electronic device in the first scene is consistent with the look and feel of the first picture in the shooting environment. That is, the electronic device may more realistically display the first picture.
In one possible implementation, when the first picture is displayed in the first scene, the method may further include determining, based on the second luminance, a luminance value of a pixel of the second gray level of the first picture as the third luminance.
Thus, when the display screen of the electronic device displays the first picture, the brightness values of the pixels with other gray scale values can be determined according to the brightness values of the pixels with the first gray scale of the first picture.
In one possible implementation manner, the method can further comprise the steps of obtaining second ambient illuminance of the second scene when the electronic device displays the first picture in the second scene, determining fourth brightness based on the shooting ambient illuminance, the first brightness and the second ambient illuminance, wherein the fourth brightness is a brightness value of a first gray-scale pixel point of the first picture under the second ambient illuminance, mapping the brightness value of the first gray-scale pixel point of the first picture to the fourth brightness, and displaying the first picture in the second scene, wherein the brightness value of the first gray-scale pixel point of the first picture is the fourth brightness.
In this way, the brightness values of the pixels of the first gray scale of the first picture displayed by the electronic device under different ambient illuminances are different. The brightness of the first picture displayed by the electronic equipment in any scene is consistent with the brightness of the first picture in the shooting environment. Therefore, the sense of reality of the first picture displayed by the electronic equipment can be improved, and user experience can be improved.
In one possible implementation, if the second ambient illuminance is less than the first ambient illuminance, the fourth brightness is less than the second brightness;
If the second ambient illuminance is greater than the first ambient illuminance, the fourth brightness is greater than the second brightness;
if the second ambient illuminance is equal to the first ambient illuminance, the fourth luminance is equal to the second luminance.
In this way, the smaller the ambient illuminance is, that is, the darker the viewing environment is, the smaller the luminance value of the pixel point of the first gray scale of the first picture displayed by the electronic device is. On the contrary, the greater the ambient illuminance is when the first picture is displayed, that is, the brighter the viewing environment is, the greater the brightness value of the pixel point of the first gray scale of the first picture displayed by the electronic device is.
A fifth aspect provides a display method, which can be applied to an electronic device, and the method can include shooting a high dynamic range picture, compressing a high dynamic range region in the high dynamic range picture to obtain a compressed picture and compression information, wherein the compression information comprises a corresponding relation between a dynamic range and a compression ratio in the compressed picture, storing the compressed picture and the compression information, acquiring the compressed picture and the compression information when the electronic device displays the compressed picture, acquiring the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range picture based on the compression information, tone-mapping the compressed picture based on the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range picture to obtain a tone-mapped picture, and displaying the tone-mapped picture, wherein the brightness at the maximum value of the high dynamic range in the tone-mapped picture is the maximum brightness supported by the display screen.
Therefore, when the electronic equipment displays the compressed picture, the picture can be subjected to tone mapping based on the corresponding relation between the dynamic range of the picture and the display brightness capability of the display screen, and the region with high dynamic range in the picture can be restored. In this way, the contrast and detail of the areas of high dynamic range of the displayed picture can be increased, reducing the luminance saturation.
In one possible implementation, obtaining the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range picture based on the compression information may include determining the dynamic range in the high dynamic range picture based on the compression information, and determining the corresponding relation between the dynamic range in the high dynamic range picture and the brightness of the display screen, wherein the brightness of the maximum value of the high dynamic range in the high dynamic range picture is set as the maximum value of the brightness of the display screen.
In this way, the processor may restore the dynamic range of the high dynamic range picture and may map the dynamic range of the high dynamic range picture with the brightness of the display screen. Therefore, the display capability of the display screen can be fully utilized, and the contrast of the high dynamic range area in the high dynamic range picture can be restored.
In one possible implementation, the multiple of the maximum value of the dynamic range in the compressed picture and the maximum value of the standard dynamic range is a first multiple, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range is a second multiple, and the multiple of the maximum value of the dynamic range in the tone mapped picture and the maximum value of the standard dynamic range is a third multiple;
the first multiple is less than the second multiple, and the third multiple is greater than the first multiple and less than or equal to the second multiple.
In this way, the tone mapped picture displayed by the electronic device can restore the original picture as much as possible, namely, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range.
In a sixth aspect, there is provided a photographing system including a photographing apparatus and a display apparatus, wherein:
the shooting device is used for shooting a first picture;
Storing a first picture, shooting ambient illuminance and first brightness, wherein the shooting ambient illuminance is the ambient illuminance when the first picture is shot, and the brightness value of a first gray-scale pixel point of the first picture with the first brightness;
transmitting the first picture, the shooting environment illumination and the first brightness to a display device;
The display device is used for receiving a first picture, shooting environment illumination and first brightness, acquiring the first environment illumination when the first picture is displayed in a first scene, determining second brightness based on the shooting environment illumination, the first brightness and the first environment illumination, wherein the second brightness is the brightness value of a first gray-scale pixel point of the first picture under the first environment illumination, mapping the brightness value of the first gray-scale pixel point of the first picture to the second brightness, and displaying the first picture in the first scene, wherein the brightness value of the first gray-scale pixel point of the first picture is the second brightness.
In this way, the display device can make the appearance of the brightness of the displayed first picture coincide with the appearance of the brightness of the first picture in the shooting environment.
In one possible implementation, the display device may also be used to:
when the first picture is displayed in the second scene, obtaining second ambient illuminance of the second scene, determining fourth brightness based on the shot ambient illuminance, the first brightness and the second ambient illuminance, wherein the fourth brightness is a brightness value of a first gray-scale pixel point of the first picture under the second ambient illuminance, mapping the brightness value of the first gray-scale pixel point of the first picture to the fourth brightness, and displaying the first picture in the second scene, wherein the brightness value of the first gray-scale pixel point of the first picture is the fourth brightness.
In this way, the luminance values of the pixels of the first gray scale of the first picture displayed by the display device under different ambient illuminance are different. The brightness of the first picture displayed by the display device in any scene is consistent with the brightness of the first picture in the shooting environment. Therefore, the sense of reality of the first picture displayed by the display device can be improved, and user experience can be improved.
In one possible implementation, the photographing device may be configured to photograph a high dynamic range picture, compress a high dynamic range region in the high dynamic range picture to obtain a compressed picture and compression information, store the compressed picture and the compression information, and send the compressed picture and the compression information to the display device;
The display device can be used for receiving compressed pictures and compression information, obtaining the corresponding relation between the brightness of a display screen and the dynamic range of the high dynamic range pictures based on the compression information when the compressed pictures are displayed, performing tone mapping on the compressed pictures based on the corresponding relation between the brightness of the display screen and the dynamic range of the high dynamic range pictures to obtain tone mapped pictures, wherein the brightness at the maximum value of the high dynamic range in the tone mapped pictures is the maximum brightness supported by the display screen, and displaying the tone mapped pictures.
Therefore, when the display device displays the compressed picture, tone mapping can be carried out on the picture based on the corresponding relation between the dynamic range of the picture and the display brightness capability of the display screen, and the region with high dynamic range in the picture can be restored. In this way, the contrast and detail of the areas of high dynamic range of the displayed picture can be increased, reducing the luminance saturation.
In one possible implementation, the multiple of the maximum value of the dynamic range in the compressed picture and the maximum value of the standard dynamic range is a first multiple, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range is a second multiple, and the multiple of the maximum value of the dynamic range in the tone mapped picture and the maximum value of the standard dynamic range is a third multiple;
the first multiple is less than the second multiple, and the third multiple is greater than the first multiple and less than or equal to the second multiple.
In this way, the tone mapped picture displayed by the display device can restore the original picture as much as possible, namely, the multiple of the maximum value of the high dynamic range in the high dynamic range picture and the maximum value of the standard dynamic range.
In a possible implementation manner, the photographing device may be the electronic device provided in the first to third aspects.
In a possible implementation manner, the display device may be the electronic device provided in the first to third aspects.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, which when executed by a computer causes the computer to implement a method as described in any one of the possible implementations of the first aspect.
In an eighth aspect, embodiments of the present application provide a computer program product for, when run on an electronic device, causing the electronic device to perform the method as described in any one of the possible implementations of the first aspect.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. "first" and "second" and the like are used to distinguish between different objects and are not used to describe a particular order of objects. For example, the first object and the second object are used to distinguish between different objects, and are not used to describe a particular order of objects.
In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more. For example, a plurality of processing units refers to two or more processing units, and a plurality of systems refers to two or more systems.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or reference to an embodiment of the application that is described as "exemplary" or "e.g." is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The term "and/or" in the present application is merely an association relationship describing the association object, indicating that three relationships may exist. For example, A and/or B may represent three cases where A alone, both A and B, and B alone are present.
For better understanding of the technical solution provided in the present application, before describing the technical solution of the present application, the electronic device 100 with a photographing function and a display function, to which the present application is applicable, is first described with reference to the accompanying drawings. In an embodiment of the present application, the electronic device 100 may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, and other devices having a photographing function and a display function. The embodiment of the present application is not limited to what type and type of the electronic device 100 is.
The term "User Interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which enables conversion between an internal form of information and a form acceptable to the user. The user interface is a source code written in a specific computer language such as java, extensible markup language (extensible markup language, XML) and the like, and the interface source code is analyzed and rendered on the electronic equipment to finally be presented as content which can be identified by a user. A commonly used presentation form of a user interface is a graphical user interface (graphic user interface, GUI), which refers to a graphically displayed user interface that is related to computer operations. It may be a visual interface element of text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc., displayed in a display of the electronic device.
Currently, in some examples, to enable a better viewing experience, the electronic device 100 may adjust the brightness of the display screen according to the brightness of the environment in which it is currently located. For example, in a brighter environment, the electronic device 100 may adjust the brightness of the display screen to be brighter. In a darker environment, the electronic device 100 may adjust the brightness of the display screen to be darker.
When the electronic device 100 photographs, the brightness of a photographed scene in which the electronic device 100 is located may affect the brightness of a photographed picture or video. When the photographed scene is brighter, the picture or video photographed by the electronic device 100 also appears brighter. When the photographed scene is dark, the picture or video photographed by the electronic device 100 may also appear dark.
In some scenes, the darkness in a captured scene of a picture or video captured by the electronic device 100 may be different from the darkness in a scene in which the user views the captured picture or video. For example, as shown in fig. 1A, the electronic device 100 may display a user interface 10A, and a picture 102 may be included in the user interface 10A. The photographed scene of the picture 102 is a scene with brighter daytime light.
Optionally, the user interface 10A may further include text information 103a, where the text information 103a may be used to indicate the time of the picture 102 (e.g., 10:00) and the location of the shot (e.g., xx-city xx region).
As shown in fig. 1A, the electronic device 100 may display a user interface 10B, in which a picture 105 may be included in the user interface 10B. The shot scene of the picture 105 is a scene with darker light at night. Optionally, text information 103B may also be included in the user interface 10B, where the text information 103B may be used to indicate the time of the picture 105 (e.g., 19:00) and the location of the shot (e.g., xx-city xx region).
Optionally, a menu 104 may be included in the user interfaces 10A, 10B. The menu 104 may include sharing controls, favorites controls, editing controls, deleting controls, and more controls. The sharing control may be used to trigger sharing of a picture displayed in the current user interface (e.g., picture 102 displayed in user interface 10A or picture 105 displayed in user interface 10B). The collection control may be used to trigger collection of a picture displayed in the current user interface (e.g., picture 102 displayed in user interface 10A, or picture 105 displayed in user interface 10B) into a collection folder. The editing control may be used to trigger editing functions such as rotation, cropping, adding filters, blurring, etc. of a picture displayed in the current user interface (e.g., picture 102 displayed in user interface 10A, or picture 105 displayed in user interface 10B). The delete control may be used to trigger deletion of a picture displayed in the current user interface (e.g., picture 102 displayed in user interface 10A or picture 105 displayed in user interface 10B). The more controls may be used to trigger opening more functions related to the picture displayed in the current user interface (e.g., picture 102 displayed in user interface 10A or picture 105 displayed in user interface 10B).
When the electronic device 100 displays the picture 102 and the picture 105, the ambient illuminance is 700lux (lux, unit of illuminance), and the peak luminance of the display screen is 130nit (nit, unit of luminance). When the electronic device 100 displays the picture 102 and the picture 105 with different shooting scenes with the same brightness of the display screen, the picture 102 is darker than the real shooting scene, and the picture 105 is brighter than the real shooting scene. For example, the gray-scale value of pixel 1 in picture 102 is 160, and the gray-scale value of pixel 2 in picture 105 is 160. The brightness of the pixel 1 will be darker than the brightness of the real photographed scene, and the pixel 2 will be brighter than the brightness of the real photographed scene.
As also shown in fig. 1B, the picture 106 is a daytime shot, but the electronic device 100 displays the picture 106 with darker brightness than the shot scene. The picture 107 is a picture taken at night, but the electronic device 100 displays the picture 107 with a brighter brightness than the scene taken.
In this way, the image displayed by the electronic device 100 is not realistic enough, thereby affecting the user experience.
With the continued development of electronic device cameras, electronic device 100 may take high dynamic range (HIGHDYNAMICRANGE, HDR) pictures. Then, the electronic device 100 compresses and saves the photographed HDR picture. When the electronic device 100 displays the HDR picture, the electronic device 100 needs to restore the compressed HDR picture and display the restored HDR picture.
Currently, the electronic device 100 may compress and restore an HDR picture using a Hybrid Log Gamma (HLG) standard. Illustratively, FIG. 2A shows an HLG graph schematic of the prior art. As shown in fig. 2A, the horizontal axis represents the dynamic range at the time of actual photographing by a camera (camera), and the unit is a percentage. The highest luminance corresponding to the standard dynamic range (STANDARDDYNAMICRANGE, SDR) is defined as 100%. A luminance range greater than 100% is the luminance range to which HDR corresponds. The highest luminance corresponding to HDR is 5000%, which is 50 times the highest luminance corresponding to SDR.
As shown in fig. 2A, the vertical axis represents standard codewords for picture coding in nit in HLG standard. In the HLG standard, the highest luma code corresponding to SDR is 203nit and the highest luma code corresponding to hdr is 1000nit. In the HLG standard, the highest luminance corresponding to the encoded HDR is about 5 (1000/203≡5) times the highest luminance corresponding to the encoded SDR.
As shown in fig. 2A, in the dynamic range compression curve 201, the highest luminance corresponding to HDR is 500% and is 5 times as high as the highest luminance corresponding to SDR when photographing. In picture coding, the highest luminance coding corresponding to SDR is 203nit and the highest luminance coding corresponding to hdr is 1000nit. The highest luminance corresponding to the encoded HDR is about 5 times the highest luminance corresponding to the encoded SDR.
As shown in fig. 2A, in the dynamic range compression curve 202, the highest luminance corresponding to HDR is 2000% and 20 times the highest luminance corresponding to SDR is 100% at the time of photographing. In picture coding, the highest luminance coding corresponding to SDR is 203nit, and the highest luminance coding corresponding to HDR is 1000nit. The highest luminance corresponding to the encoded HDR is about 5 times the highest luminance corresponding to the encoded SDR.
As shown in fig. 2A, in the dynamic range compression curve 203, the highest luminance corresponding to HDR is 5000% and 50 times the highest luminance corresponding to SDR is 100% at the time of photographing. In picture coding, the highest luminance coding corresponding to SDR is 203nit and the highest luminance coding corresponding to hdr is 1000nit. The highest luminance corresponding to the encoded HDR is about 5 times the highest luminance corresponding to the encoded SDR.
As shown in fig. 2A, a portion of the dynamic range compression curve 201, the dynamic range compression curve 202, and the dynamic range compression curve 202, the horizontal axis of which is greater than 100%, that is, the HDR portion, may be referred to as a highlight information portion. For the dynamic range compression curve 202 and the dynamic range compression curve 203, the dynamic range of the picture is more than 5 times when actually photographed, but the picture is compressed to 5 times of the HLG standard when encoded. Thus, the slopes of dynamic range compression curve 202 and dynamic range compression curve 203 are less than 1. And after the picture is subjected to HLG coding, the slope of the dynamic range compression curve corresponding to the picture is smaller than 1, and the dynamic range of the picture is calculated according to the dynamic range of the actual camera.
That is, when an HDR image is being photographed, the electronic apparatus 100 may store dynamic range information much larger than 5 times the reference white. The electronic device 100 may then compress the HDR image in accordance with the HLG standard, and eventually, when displayed, only exhibits a 5-fold luminance dynamic range. In this way, the inability to restore the true luminance dynamic range of the HDR picture taken may deteriorate the contrast of the portion of the picture that is originally highlighted, thereby affecting the realism of the picture. Illustratively, as shown in fig. 2B, when storing the picture 210, the electronic device 100 may compress the picture 210 according to the HLG curve shown in fig. 2A. At the time of display, the electronic device 100 cannot restore the true luminance dynamic range at the time of taking the picture 210. Thus, the contrast between the light portion and the wall portion in the highlight region 2101 in the picture 210 displayed by the electronic device 100 is not high, and the light color is oversaturated.
In order to improve the authenticity of the pictures and videos displayed by the electronic device 100, the embodiment of the application provides a display method, in which, when displaying the pictures or videos, the electronic device 100 can determine the brightness of the display screen based on the shooting ambient illuminance of the shooting scene of the pictures or videos and the current viewing ambient brightness. The electronic device 100 adjusts the brightness of the display screen to the determined brightness to display a picture or video. When the picture to be displayed is an HDR picture, the electronic device 100 may further restore the highlight information portion in the HDR picture according to the brightness capability of the current display screen, to present details and contrast of the highlight information portion of the HDR picture. Thereby making the picture or video displayed by the electronic device 100 more realistic.
Before describing a display method provided by an embodiment of the present application, an exemplary electronic device 100 provided by an embodiment of the present application is described.
Fig. 3A is a schematic hardware structure of the electronic device 100 according to an embodiment of the present application.
As shown in fig. 3A, the electronic device 100 may include a processor 301, an internal memory 302, a camera assembly 303, a display 304, an ambient light sensor 305, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 301 may include one or more processing units, for example, the processor 301 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a memory, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 301 for storing instructions and data. In some embodiments, the memory in the processor 301 is a cache memory. The memory may hold instructions or data that the processor 301 has just used or recycled. If the processor 301 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 301 is reduced, thus improving the efficiency of the system.
In some embodiments, processor 301 may include one or more interfaces. The interfaces may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SERIAL DATA LINE, SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 301 may contain multiple sets of I2C buses. The processor 301 may be coupled to a touch sensor, charger, flash, camera assembly 303, etc., respectively, via different I2C bus interfaces. For example, the processor 301 may couple to the touch sensor through an I2C interface, such that the processor 301 communicates with the touch sensor through an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 301 may contain multiple sets of I2S buses. The processor 301 may be coupled to the audio module via an I2S bus to enable communication between the processor 301 and the audio module.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 301 with the wireless communication module. For example, the processor 301 communicates with a bluetooth module in the wireless communication module through a UART interface to implement a bluetooth function.
The MIPI interface may be used to connect the processor 301 with peripheral devices such as the display screen 304, camera assembly 303, and the like. The MIPI interfaces include camera serial interfaces (CAMERA SERIAL INTERFACE, CSI), display serial interfaces (DISPLAY SERIAL INTERFACE, DSI), and the like. In some embodiments, processor 301 and camera component 303 communicate through a CSI interface to implement the camera functionality of electronic device 100. The processor 301 and the display screen 304 communicate through a DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 301 with the camera assembly 303, display screen 304, ambient light sensor 305, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The electronic device 100 implements display functions through a GPU, a display screen 304, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 304 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 301 may include one or more GPUs that execute program instructions to generate or change display information.
The display 304 is used to display images, videos, and the like. The display 304 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microLed, micro-oLed, a quantum dot LIGHT EMITTING diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 304, N being a positive integer greater than 1.
The electronic device 100 may implement a photographing function through an ISP, a photographing component 303, a video codec, a GPU, a display screen 304, an application processor, and the like.
The ISP is used to process the data fed back by the camera assembly 303. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, an ISP may be provided in the camera assembly 303.
The camera assembly 303 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 may include 1 or N camera assemblies 303, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record video in a variety of encoding formats, such as moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent recognition of the electronic device 100, for example, image recognition, face recognition, voice recognition, text understanding, etc., can be realized through the NPU.
The internal memory 302 may be used to store computer executable program code including instructions. The processor 301 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 302. The internal memory 302 may include a stored program area and a stored data area. The storage program area may store an operating system, an application required for at least one function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, etc.), and the like. The storage data area may store data created during use of the electronic device 100 (e.g., face information template data, fingerprint information templates, etc.), and so on. In addition, the internal memory 302 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 memory (universal flash storage, UFS), and the like.
Ambient light sensor 305 is used to sense ambient light levels. The electronic device 100 may adaptively adjust the brightness of the display 304 based on the perceived ambient light level. Ambient light sensor 305 may also be used to automatically adjust white balance during photographing.
The electronic device 100 may have more or fewer components than shown in fig. 3A, may combine two or more components, or may have a different configuration of components. The various components shown in fig. 3A may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
In order to better understand the software structure of the electronic device 100 shown in fig. 3A, the software structure of the electronic device 100 is described below. Before explaining the software structure of the electronic device 100, an architecture that can be adopted by a software system of the electronic device 100 will be first described.
Specifically, in practical applications, the software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
Furthermore, it is understood that software systems currently in use in mainstream electronic devices include, but are not limited to, windows systems, android systems, and iOS systems. For convenience of explanation, the embodiment of the present application takes an Android system with a layered architecture as an example, and illustrates a software structure of the electronic device 100.
In addition, the processing method of the camera request provided in the embodiment of the application is applicable to other systems in specific implementation.
Fig. 3B illustrates a schematic software and hardware architecture of the electronic device 100 according to an embodiment of the present application.
As shown in fig. 3B, the software-hardware architecture of the electronic device 100 includes a software system and a hardware layer that implements related shooting (e.g., preview, photo, video, etc.) and display together with the software structure. The layered architecture divides the software system of the electronic device 100 into several layers, each of which has a distinct role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the system is divided into four layers, from top to bottom, an application layer (application layer), a framework layer (FWK), a hardware abstraction layer (hardware abstraction layer, HAL), a driver layer (DRIVE LAYER), respectively.
The application layer may include a series of application packages. As shown in fig. 3B, the application package may include a camera application and a gallery application.
Optionally, the application package may also be calendar, call, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications (also referred to as applications). The embodiment of the present application is not limited thereto.
The framework layer provides an application programming interface (application programming interface, API) and programming framework for application packages of the application layer. The framework layer includes some predefined functions.
As shown in fig. 3B, the framework layer may include a camera service module, a picture/video metadata management module, and a display engine. The camera service module may receive a camera request issued by the camera application, and send the camera request issued by the camera application to the hardware abstraction layer. In an embodiment of the present application, the camera request issued by the camera application includes, but is not limited to, a preview request, a photographing request, a video recording request, and the like. The preview request is used to request a screen captured by the camera component of the electronic device 100 in a camera application. The photographing request may be used to request a photographing component of the electronic device 100 to photograph and save a picture photographed by the photographing component. The video recording request is used to request the camera assembly of the electronic device 100 to capture video and save the video captured by the camera assembly.
In some examples, a picture may also be referred to as an image frame, which is not limited by embodiments of the present application.
In some possible implementations, the camera service module may also obtain a hardware abstraction layer upload picture or video. The camera service module may then transmit the acquired picture or video to the picture/video metadata management module.
In other possible implementations, the camera service module may obtain the memory address of the picture or video that is taken according to the camera request and uploaded by the hardware abstraction layer. The camera service module may then send the storage address of the picture or video to the picture/video metadata management module
The picture/video metadata management module may be used to receive pictures or videos sent by the camera service module. The picture/video metadata management module may then store the metadata of the picture or video along with the picture in a database of the electronic device 100 for storing the picture and video.
Taking a picture as an example, as shown in fig. 3C, metadata information of the picture may include metadata base information and metadata extension information. The metadata base information of the picture may include, but is not limited to, a shooting time of the picture, a uniform resource locator (uniformresourcelocator, URL), among others. The metadata extension information of the picture may include, but is not limited to, one or more of photographing environment illuminance, compression information, highest dynamic range, face information/blue sky information, AI identification information, category information, color temperature information, highlight color information, and noise information. The illumination of the shooting environment is the brightness of the shooting environment when the shooting assembly shoots. The compression information is used for recording the corresponding relation between the initial brightness value of the high dynamic range area in the HDR picture and the compressed brightness value. The highest dynamic range refers to the maximum value of the luminance in the picture. The face information/blue sky information may be used to indicate whether there is a face/blue sky in the picture. The AI-identifying information can be used to indicate information identified from the content of the picture, such as, for example, a scene in the picture (e.g., day, night, landscape, indoor, outdoor, etc.), a subject (e.g., plant, animal, person, object, food, etc.), a location of the subject in the picture, and so forth. The category information may be used to indicate a classification of the picture, e.g., landscape, portrait, delicacy, etc. The color temperature information may be used to describe a color temperature value of the picture. Highlighting color information may be used to describe color values of high dynamic range areas in a picture. The noise information is used to indicate pixels in the picture where noise is present.
For example, a first field in the metadata information may be used to describe the time of taking the picture. The second field in the metadata information may describe a URL of the picture. A third field in the metadata information may be used to describe the shooting ambient illuminance of the picture. A fourth field in the metadata information may be used to describe compression information of the picture. A fifth field in the metadata information may be used to describe the highest dynamic range of the picture. The sixth field in the metadata information may be used to describe face information or blue sky information contained in the picture. For example, when the value of the sixth field is 0, it indicates that the picture contains a face, and when the value of the sixth field is 1, it indicates that the picture contains a blue sky. A seventh field in the metadata information may be used to describe AI-identifying information of the picture. An eighth field in the metadata information may be used to describe category information of the picture. A ninth field in the metadata information may be used to describe color temperature information of the picture. A tenth field in the metadata information may be used to describe highlight color information of the picture. An eleventh field in the metadata information may be used to describe noise information of the picture.
As shown in fig. 3B, the display engine may include a tone mapping (tonemapping) module and a backlight control (backlightcontrol) module. The tone mapping module may be configured to tone map a compressed HDR picture to be displayed, and map compressed luminance values of a high dynamic range region in the HDR picture to luminance values before compression (i.e. initial luminance values) during display. The backlight control module can be used for controlling the brightness of the display screen.
In some embodiments, the framework layer may also be referred to as an application framework layer.
The hardware abstraction layer HAL is an interface layer between an application framework layer and a drive layer and provides a virtual hardware platform for an operating system.
The camera hardware abstraction layer may be included in the hardware abstraction layer HAL. The camera hardware abstraction layer may be configured to receive a camera request issued by the framework layer, and send camera parameters in the camera request to the camera component through the driver layer.
Optionally, the camera hardware abstraction layer may store the picture or video acquired by the camera component into a buffer address of the corresponding camera request, and send the buffer address to the camera service module in the framework layer.
In the embodiment of the present application, taking a picture as an example, a camera request corresponding to the picture refers to a camera request including camera parameters for acquiring the picture. I.e. the camera can obtain the picture according to the camera parameters in the camera request. For example, the camera obtains the picture 1 according to the camera parameters in the camera request 1, and then the camera request 1 may be referred to as a camera request corresponding to the picture 1.
The driver layer is a layer between hardware and software. The driver layer includes drivers for various hardware. The driving layer may include an image pickup drive, a display drive, and the like. Wherein the camera drive is used to capture images by an image sensor (e.g., image sensor 1, image sensor 2, etc.) driving one or more cameras in the camera assembly and to drive an image signal processor to pre-process the images. The display drive is used to drive the display.
The hardware layers may include camera components, image signal processors (IMAGE SIGNAL processors, ISPs), ambient light sensors, displays, and the like. The camera assembly may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.) therein. Optionally, a time of flight (TOF) sensor, a multispectral sensor, etc. may also be included in the camera assembly. The image signal processor may be used to process the pictures taken by the camera assembly. The display may be used to display pictures presented by the camera application. The ambient light sensor may be configured to sense ambient light and transmit the sensed ambient light to the backlight control module. Optionally, the ambient light sensor may also send the perceived ambient light level to a picture/video metadata management module.
In an embodiment of the present application, an application in the electronic device 100 that may be used to take pictures may not be limited to a camera application. Taking the camera application as an example, the photographing procedure of the electronic device 100 may include that the camera application may issue a camera request to a camera hardware abstraction layer through a camera service module when responding to a photographing operation of a user. The camera hardware abstraction layer may issue camera parameters in the camera request to the camera component through the camera driver. The camera assembly may take pictures according to the camera parameters. Optionally, the camera module may send the acquired picture to the image signal processor. The image signal processor may process the picture, e.g., remove noise from the picture, white balance the picture, etc. The image signal processor can upload the processed pictures to the camera hardware abstraction layer through the camera driver. The camera hardware abstraction layer may then upload the processed picture to the camera service module. The camera service module may upload the picture to the camera application, which may display the picture in the preview interface.
The camera service module may also send the processed picture to a picture/video metadata management module. The metadata information and the pictures acquired by the picture/video metadata management module are stored in a picture file.
In the embodiment of the present application, the application in the electronic device 100 that may display the picture or the video may not be limited to the gallery application. Taking a gallery as an example, the process of displaying a picture by the electronic device 100 may include that when the gallery application responds to an operation of displaying the picture 1 by a user, metadata information such as shooting environment illuminance, height compression information and the like of a shooting scene of the picture 1 may be obtained from the picture/video metadata management module. Then, the gallery application may send metadata information such as shooting ambient illuminance and highly compressed information of the shooting scene of the picture 1 to the display engine. The tone mapping module in the display engine can restore the compressed high dynamic range brightness in the picture 1 based on the compression information to obtain the restored picture 1. The backlight control module in the display engine may determine the brightness of the picture displayed in the display screen based on the shooting ambient illuminance of the shooting scene of picture 1, and the current viewing ambient brightness. The backlight control module can set the brightness of each pixel point in the picture according to the determined brightness of the picture when the picture is displayed. For how the electronic device 100 adjusts the brightness of the display screen according to the shooting ambient illuminance and the viewing ambient brightness of the shooting scene of the picture, refer to the description of fig. 4 below, and are not repeated here. For how the electronic device 100 specifically restores the compressed luminance with a high dynamic range in the picture 1 based on the compression information, the restored picture 1 may be referred to as the description of fig. 7 below, which is not repeated here.
Based on the hardware structure and the software framework of the electronic device 100, the embodiment of the application provides a display method. Fig. 4 schematically shows a flow chart of a display method according to an embodiment of the present application. As shown in fig. 4, a display method provided by an embodiment of the present application may include the following steps:
S401, the electronic device 100 captures a picture 1, stores the picture 1, the captured ambient illuminance, and the luminance 1, wherein the captured ambient illuminance is the ambient illuminance when the picture 1 is captured, and the luminance 1 is the luminance value of the first gray-scale pixel point of the picture 1 under the captured ambient illuminance.
The electronic device 100 may acquire the picture 1 in response to a photographing operation by a user. When acquiring the picture 1, the electronic device 100 may also acquire the illuminance of the shooting environment of the shooting scene of the picture 1.
In one possible implementation, an ambient light sensor 305, as shown in fig. 3A, may be present in the electronic device 100. The electronic device 100 can acquire the photographing environment illuminance of the photographing scene of the picture 1 through the ambient light sensor 305.
Alternatively, in another possible implementation, the electronic device 100 may determine the illumination of the shooting environment of the picture 1 and the shooting scene according to one or more of the sensitivity, the aperture value, and the exposure time of the image capturing component.
In another possible implementation, the electronic device 100 may also determine the shooting ambient illuminance of the shooting scene of the picture 1 according to an algorithm for calculating the ambient brightness. For example, the algorithm for calculating the environmental brightness may be a neural network model whose training data includes a plurality of pictures and photographing environmental illuminance of a photographing scene corresponding to the plurality of pictures. The electronic device 100 may input the picture 1 to the neural network model and acquire the photographing environment illuminance of the photographing scene of the picture 1 output by the neural network model.
The method for obtaining the illuminance of the shooting environment of the shooting scene of the picture 1 is not limited in the embodiment of the application.
In one possible implementation, the electronic device 100 may store the picture 1, and store the shooting ambient illuminance corresponding to the picture 1, and the luminance values corresponding to the respective grayscale values of the picture 1 under the shooting ambient illuminance. For example, the luminance value of the pixel point of the first gray level in the picture 1 at the shooting ambient illuminance is luminance 1. For example, the electronic device 100 may store the photographing environment illuminance corresponding to the picture 1 and the luminance value corresponding to each gray-scale value of the picture 1 under the photographing environment illuminance in the metadata information corresponding to the picture 1. The information specifically included in the metadata information of the picture 1 may be referred to the description in fig. 3C, and will not be described herein.
There are a variety of forms of saving this metadata information:
1. The electronic device 100 may save the metadata information of the picture 1 in a file for saving the picture 1. For example, the metadata information of picture 1 is stored in a file in joint photographic experts group (jointphotographicexpertsgroup, JPEG) format in an exchangeable image file (exchangeable IMAGE FILE, EXIF) format.
2. The electronic device 100 may encode the metadata information of picture 1 into picture 1 in a particular encoding format.
The embodiment of the application does not limit the storage form of the metadata information of the picture 1.
S402. when the electronic device 100 displays the picture 1 in the scene 1, the ambient illuminance 1 of the scene 1 is acquired.
The electronic device 100 may display picture 1 in scene 1. When the electronic device 100 displays the picture 1 in response to the operation 1 for the picture 1, the electronic device 100 may acquire the ambient illuminance 1 of the current scene 1.
In one possible implementation, an ambient light sensor may be included in the electronic device 100, through which the electronic device 100 may detect the ambient illuminance 1.
Alternatively, in another possible implementation, the electronic device 100 may determine the ambient illuminance 1 based on the current time, weather, and location. For example, the electronic device 100 may obtain that the current time is 10:00 a.m., the weather is sunny, and the location is outdoors. The electronic device 100 may then determine that the current scene 1 is brighter, the value of ambient illuminance 1 is greater, e.g., the ambient illuminance 1 is 5000lux, based on the current time and place. For another example, the electronic device 100 may obtain that the current time is 22:00 pm, the weather is raining, and the location is outdoors. The electronic device 100 may then determine that scene 1 is darker, the value of ambient illuminance 1 is smaller, e.g., ambient illuminance 1 is 10lux, based on the current time and place.
The embodiment of the present application does not limit how the electronic device 100 obtains the ambient illuminance 1 of the scene.
The electronic device 100 may receive an operation 1 of the user for displaying the picture 1 in the scene 1, for example, the operation 1 may be a thumbnail of the user clicking on the picture 1 in a gallery application. Or the operation 1 may be that the user inputs a voice instruction for showing the picture 1 to the electronic device 100, for example, the voice instruction may be "show picture 1". The embodiment of the present application is not particularly limited to this operation 1.
In response to the user operation 1, the electronic apparatus 100 may read out the picture 1 and the photographing environment illuminance corresponding to the picture 1 from the memory. The shooting environment illuminance corresponding to the picture 1 is the environment illuminance of the shooting scene when the picture 1 is shot.
In one possible implementation, the shooting ambient illuminance corresponding to the picture 1 may be stored in metadata information of the picture 1. The electronic device 100 may obtain the photographing environment illumination corresponding to the picture 1 from the metadata information of the picture 1.
In another possible implementation manner, the electronic device 100 does not store the shooting environment illumination corresponding to the picture 1, and the picture file of the picture 1 does not include the shooting environment illumination corresponding to the picture 1. The electronic device 100 may include an algorithm for calculating illuminance of a shooting environment. When the input of the algorithm for calculating the photographing environment illuminance is the picture 1, the output of the algorithm for calculating the photographing environment illuminance may be the photographing environment illuminance corresponding to the picture 1.
S403, the electronic device 100 determines brightness 2 based on the shooting ambient illuminance, brightness 1 and ambient illuminance 1, where brightness 2 is a brightness value of a first gray-scale pixel point of the picture 1 under the ambient illuminance 1.
The luminance 1 can be understood as the luminance of the pixel point of the first gray level of the picture 1 viewed by the human eye in the photographing environment. The luminance 1 may be determined based on the photographing environment illuminance.
Illustratively, in one possible implementation, luminance 1 = shooting ambient illuminance/pi ("/" denotes divisor).
The electronic device 100 may determine the luminance 2 according to the photographing environment illuminance, the luminance 1, and the viewing environment luminance corresponding to the picture 1. The brightness 2 is the brightness value of the pixel point of the first gray level of the picture 1 under the ambient illuminance 1. In this way, the brightness of the pixel with the gray level value of the first gray level in the picture 1 seen by the user in the shooting environment is consistent with the brightness of the pixel with the gray level value of the first gray level in the picture 1 displayed in the display screen in the viewing environment, so that the picture 1 can be ensured to be consistent with the viewing environment in the shooting environment, namely, the sense of reality of the picture 1 displayed on the electronic device 100 is stronger, and the user experience can be improved.
The electronic device 100 may select a pixel with a first gray level as a reference point in the picture 1, and determine the brightness of the pixel with the first gray level displayed on the display screen in the viewing environment. Then, when the picture 1 is displayed, the electronic device 100 can determine the brightness of the pixel points with different gray scale values in the whole picture according to the brightness of the reference point.
In one possible implementation, the electronic device 100 may further determine, based on the luminance 2, that the luminance value of the pixel point of the second gray level of the picture 1 is the luminance 3.
In one possible implementation, the luminance of the pixel with the gray level of the second gray level in the picture 1 (i.e. luminance 3) is the luminance of the pixel with the gray level of the first gray level (i.e. luminance 2) multiplied by the first coefficient. The first coefficient may be equal to the second gray level divided by the first gray level.
Illustratively, the first gray level may be 255 and the second gray level may be 125. That is, the electronic device 100 may use a pixel point with a gray-scale value of 255 in the picture 1 as the reference point. The electronic device 100 may determine that the brightness of the pixel with the gray level value of 255 in the picture 1 in the viewing environment is brightness 2 according to the illuminance of the photographing environment, the brightness of the pixel with the gray level value of 255 in the picture 1 in the photographing environment (i.e., brightness 1), and the illuminance of the environment 1. Then, the electronic device 100 can determine the luminance 3 of the pixel with the gray level of 125 according to the luminance of the pixel with the gray level of 255, where the luminance 3 is about half of the luminance 2. When displaying the picture 1, the electronic device 100 may set the luminance of the pixel having the gray-scale value of 255 in the picture 1 to the luminance 2, and set the luminance of the pixel having the gray-scale value of 125 to the luminance 3. In this way, the electronic device 100 may determine the brightness of each gray-scale pixel in the picture 1 according to the brightness of the gray-scale pixel having the gray-scale value of 255.
In one possible implementation, a visual consistency model may exist in the electronic device 100, where the input of the visual consistency model may be the shooting ambient illuminance, the luminance 1, and the ambient illuminance 1 corresponding to the picture 1, and the output of the visual consistency model may be the luminance 2. In this way, the electronic device 100 may determine, by using the visual consistency model, the brightness of the pixel point having the first gray level as the gray level value in the picture 1 displayed in the display screen in the viewing environment.
In some examples, the visual consistency model may also be referred to as a neural network model, a computational model, etc., and the name of the visual consistency model is not limited by embodiments of the present application.
For example, as shown in fig. 5A, when the electronic apparatus 100 takes a picture, the illuminance of the photographing environment is 7000lux. The electronic apparatus 100 can acquire the photographing environment illuminance at the time of photographing. In addition, the electronic device 100 may determine, according to the illuminance of the shooting environment, the luminance of the pixel 3 with the gray-scale value of 255 in the picture watched by the human eye in the shooting environment, that is, the luminance of the pixel 3 with the gray-scale value of 255 in the picture displayed on the display screen in the shooting environment is 2000nit. The electronic device 100 may also obtain that the ambient illuminance currently under the viewing scene 1 is 1000lux. The electronic device 100 may input the photographing environment illuminance 7000lux, the luminance 2000nit of the pixel point 3 having the gray-scale value of 255 in the picture displayed in the display screen under the photographing environment, and the environment illuminance 1000lux into the vision consistency model, and the vision consistency model may output the luminance 400nit of the pixel point having the gray-scale value of the first gray-scale in the picture 1 displayed in the display screen under the viewing environment.
As shown in fig. 5B, the electronic device 100 may display a picture presentation interface 500A in a scene with an ambient illuminance of 1000lux, where the picture presentation interface 500A includes a picture 501. The picture 501 is taken in a shooting scene with an illuminance of 7000 lux. That is, the electronic device 100 determines that the luminance of the pixel point with the first gray level in the picture 1 displayed in the display screen under the viewing environment 1 is 400nit based on the illuminance of the shooting environment of the picture 501, the luminance of the pixel point 3 with the gray level value of 255 in the picture displayed in the display screen under the shooting environment, and the ambient illuminance. When the electronic device 100 displays the picture 501 in the viewing environment 1, the brightness of the pixel point having the gray scale value of 255 in the picture 501 may be set to 400nit.
As another example, as shown in fig. 5C, when the electronic apparatus 100 takes a picture, the illuminance of the shooting environment is 7000lux. The electronic apparatus 100 can acquire the photographing environment illuminance at the time of photographing. In addition, the electronic device 100 may determine, according to the illuminance of the shooting environment, the luminance of the pixel 3 with the gray-scale value of 255 in the picture watched by the human eye in the shooting environment, that is, the luminance of the pixel 3 with the gray-scale value of 255 in the picture displayed on the display screen in the shooting environment is 2000nit. The electronic device 100 may also obtain that the ambient illuminance currently under the viewing scene 2 is 100lux. The electronic device 100 may input the photographing environment illuminance 7000lux, the luminance 2000nit of the pixel point 3 having the gray-scale value of 255 in the picture displayed in the display screen under the photographing environment, and the environment illuminance 100lux into the vision consistency model, and the vision consistency model may output the luminance 150nit of the pixel point having the gray-scale value of the first gray-scale in the picture 1 displayed in the display screen under the viewing environment 2.
As shown in fig. 5D, the electronic device 100 may display a picture display interface 500B in a scene with an ambient illuminance of 100lux, where the picture display interface 500B includes a picture 501. The picture 501 is taken in a shooting scene with an illuminance of 7000 lux. That is, the electronic device 100 determines that the luminance of the pixel point with the first gray level in the picture 1 displayed in the display screen under the viewing environment 2 is 150nit based on the illuminance of the photographing environment of the picture 501, the luminance of the pixel point 3 with the gray level value 255 in the picture displayed in the display screen under the photographing environment, and the viewing environment luminance. When the electronic device 100 displays the picture 501 in the viewing environment 1, the brightness of the pixel point having the gray scale value of 255 in the picture 501 may be set to 150nit.
Illustratively, the inputs and outputs of the visual consistency model may be as shown in Table 1 below.
TABLE 1
As shown in Table 1, when the visual consistency model is input such that the illuminance of the shooting environment is 0lux, the brightness of the pixel with the first gray level in the picture under the shooting environment is 1nit, and the brightness of the viewing environment is 100lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 8nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the photographing environment is 0lux, the brightness of the pixel having the first gray level in the picture under the photographing environment is 10nit, and the brightness of the viewing environment is 100lux, the output is that the brightness of the pixel having the first gray level in the picture 1 displayed in the display screen under the viewing environment is 50nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the photographing environment is 0lux, the brightness of the pixel having the first gray level in the picture under the photographing environment is 50nit, and the brightness of the viewing environment is 100lux, the output is that the brightness of the pixel having the first gray level in the picture 1 displayed in the display screen under the viewing environment is 200nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the photographing environment is 0lux, the brightness of the pixel with the first gray level in the picture under the photographing environment is 100nit, and the brightness of the viewing environment is 100lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 350nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the shooting environment is 0lux, the brightness of the pixel with the first gray level in the picture under the shooting environment is 1nit, and the brightness of the viewing environment is 1000lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 25nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the photographing environment is 0lux, the brightness of the pixel with the first gray level in the picture under the photographing environment is 10nit, and the brightness of the viewing environment is 1000lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 150nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the photographing environment is 0lux, the brightness of the pixel with the first gray level in the picture under the photographing environment is 50nit, and the brightness of the viewing environment is 1000lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 400nit.
As shown in Table 1, when the visual consistency model is input such that the illuminance of the shooting environment is 0lux, the brightness of the pixel with the first gray level in the picture under the shooting environment is 100nit, and the brightness of the viewing environment is 1000lux, the output is that the brightness of the pixel with the first gray level in the picture 1 displayed in the display screen under the viewing environment is 700nit.
Table 1 above is merely an example, and embodiments of the present application are not limited to a particular input and a particular output of a visual consistency model.
S404, the electronic device 100 maps the brightness value of the pixel point of the first gray level of the picture 1 to brightness 2.
When the electronic device 100 determines that the luminance value of the first gray-level pixel of the picture 1 is luminance 2 in the scene 1, the processor in the electronic device 100 may map the luminance value of the first gray-level pixel of the picture 1 to luminance 2. For example, the electronic device 100 may set the luminance of the pixel having the first gray level as the gray level value in the picture 1 to the luminance 1. For example, the picture 1 may be fig. 5B, and the brightness of the pixel with the gray-scale value 255 in the picture 501 is set to 400nit. It can be understood that one or more pixels with the first gray level in the image 1 may exist, and the number of pixels with the first gray level in the image 1 is not specifically limited in the embodiment of the present application. The processor of the electronic device 100 may also send the mapping result to the display screen.
S405, the electronic device 100 displays a picture 1 in the scene 1, wherein the brightness of a pixel point of the first gray level of the picture 1 is brightness 2.
The electronic device 100 may display picture 1 in scene 1 via a display screen. The brightness of the pixel point of the first gray level of the picture 1 displayed by the electronic device 100 is brightness 2.
In a possible implementation manner, the display method provided by the embodiment of the application further includes the steps of obtaining the ambient illuminance 2 of the scene 2 when the electronic device 100 displays the picture 1 in the scene 2, determining the brightness 4 based on the shot ambient illuminance, the brightness 1 and the ambient illuminance 2, wherein the brightness 4 is the brightness value of the first gray-level pixel point of the picture 1 under the ambient illuminance 2, mapping the brightness value of the first gray-level pixel point of the picture 1 to the brightness 4, and displaying the picture 1 in the scene 2, wherein the brightness value of the first gray-level pixel point of the picture 1 is the brightness 4. In this way, when the electronic device 100 displays the picture 1 in different viewing scenes, the brightness of the pixel point with the first gray level in the picture 1 displayed in the display screen of the electronic device 100 is different. As illustrated in fig. 5B and 5D, in a viewing environment with a viewing environment brightness of 1000lux, the brightness of a pixel point with a gray scale value of 255 in a picture 501 displayed by the electronic device 100 is 400nit. In a viewing environment with a viewing environment brightness of 100lux, the brightness of a pixel point with a gray scale value of 255 in a picture 501 displayed by the electronic device 100 is 150nit.
According to the display method provided by the embodiment of the application, the electronic device 100 can determine the brightness of the pixel with the gray level value of the first gray level in the picture displayed on the display screen under the viewing environment according to the illumination of the shooting environment of each picture, the brightness of the pixel with the gray level value of the first gray level in the picture under the shooting environment and the brightness of the viewing environment. In this way, in the picture viewed by the user on the electronic device 100, the appearance of the brightness of the pixel having the first gray level of the picture viewed by the user is consistent with the appearance of the brightness of the pixel having the first gray level of the picture in the shooting environment. That is, the displayed picture displayed by the electronic device 100 has higher visual consistency than the actual photographed scene of the picture, and the picture looks more realistic. Thus, the user experience can be improved.
Illustratively, fig. 6 shows an exemplary picture display effect of the present application. As shown in fig. 6, the picture 601 is a picture taken during the daytime. The photographing content of the picture 601 is the same as that of the picture 106 shown in fig. 1B, and the photographing time of the picture 601 is the same as that of the picture 106. By the display method provided by the embodiment of the application, the brightness of the picture 601 displayed by the electronic device 100 is closer to the brightness of the shooting scene than the brightness of the picture 106.
As shown in fig. 6, the picture 602 is a picture taken at night. The photographing content of the picture 602 is the same as that of the picture 107 shown in fig. 1B, and the photographing time of the picture 602 is the same as that of the picture 107. By the display method provided by the embodiment of the application, the brightness of the picture 602 displayed by the electronic device 100 is closer to the brightness of the shooting scene than the brightness of the picture 107.
In the embodiment of the present application, the display method shown in fig. 4 may be applied to video. The electronic device 100 may map the brightness of each frame of video image frame in the manner shown in fig. 4. For example, the electronic device 100 may store the video and the luminance value (e.g., luminance 5) of the first gray-scale pixel point in each image frame of the video and the shooting ambient illuminance of each image frame in the video when shooting the video. The electronic device 100 may obtain ambient illumination in the currently viewed scene while displaying the video. Then, the electronic device 100 may determine the luminance 6 based on the shooting ambient illuminance of the first image frame in the video, the luminance value of the first gray-scale pixel point of the first image frame, and the ambient illuminance in the current viewing scene. The luminance 6 is a luminance value of a pixel point of a first gray level of the first image frame under an ambient illuminance of the current viewing scene. Next, the electronic device 100 may map the luminance value of the pixel point of the first gray level of the first image frame to luminance 6. The electronic device 100 may display a first image frame of the video, where the luminance value of the pixel point of the first gray level of the first image frame displayed by the electronic device 100 is luminance 6. It is understood that the electronic device 100 may display each image frame in the video according to the display method of the first image frame, which will not be described in detail in the present application.
In some scenarios, the electronic device 100 may take an HDR picture. When the picture taken by the electronic device 100 is an HDR picture, the electronic device 100 compresses the high dynamic range area in the HDR picture when stored. When displayed, the electronic device 100 restores the compressed picture according to the brightness capability of the display screen. When the luminance capability of the display screen of the electronic device 100 is lower than the multiple of the dynamic range of the HDR picture, the multiple of the dynamic range of the HDR picture restored by the electronic device 100 is lower than the multiple of the dynamic range before compression, so that the contrast ratio of the luminance in the high dynamic range area in the HDR picture displayed by the electronic device 100 is poor. Taking the dynamic range compression curve 203 in fig. 2A as an example, the highest luminance corresponding to HDR is 5000% and 50 times the highest luminance corresponding to SDR is 100% at the time of photographing. In picture coding, the highest luminance coding corresponding to SDR is 203nit and the highest luminance coding corresponding to hdr is 1000nit. The highest luminance corresponding to the encoded HDR is about 5 times the highest luminance corresponding to the encoded HDR. That is, when an HDR image is being photographed, the electronic apparatus 100 may store dynamic range information much larger than 5 times the reference white. The electronic device 100 may then compress the HDR image in accordance with the HLG standard, and eventually, when displayed, only exhibits a 5-fold luminance dynamic range. In this way, the inability to restore the true luminance dynamic range of the HDR picture taken may deteriorate the contrast of the portion of the picture that is originally highlighted, thereby affecting the realism of the picture.
The embodiment of the application provides a display method, which can include that when an electronic device 100 shoots an HDR picture, the electronic device 100 can save compression information corresponding to the HDR picture and the HDR picture. When the electronic device 100 displays the HDR picture, the HDR picture may be tone mapped according to the brightness displaying capability of the display screen of the electronic device 100 and the compression information corresponding to the HDR picture, to obtain a tone mapped picture. Finally, the electronic device 100 displays the tone mapped picture.
Fig. 7 schematically illustrates a display method according to an embodiment of the present application. As shown in fig. 7, a display method provided by an embodiment of the present application may include the following steps:
s701, electronic equipment 100 shoots an HDR picture, compresses a high dynamic range area in the HDR picture to obtain a compressed picture and compression information, wherein the compression information comprises a corresponding relation between a dynamic range and a compression ratio in the compressed picture.
The electronic device 100 may take an HDR picture. Generally, considering that different display ends have different supporting capability for HDR, and that the storage space occupied by the HDR picture is relatively large, the electronic device 100 generally compresses the captured HDR picture and then stores the compressed HDR picture, so that the storage space of the electronic device 100 can be saved, and the HDR picture can be displayed on the display ends with different display capabilities.
The electronic device 100 may compress the HDR picture to obtain a compressed picture and compression information. The multiple of the dynamic range of the luminance of the compressed picture is smaller than the multiple of the dynamic range of the luminance of the HDR picture. Illustratively, as shown in (a) in fig. 8A, the dynamic range compression curve corresponding to the HDR picture may be any one of the dynamic range compression curve 201, the dynamic range compression curve 202, and the dynamic range compression curve 203. Taking dynamic range compression curve 203 as an example, the highest luminance corresponding to an HDR picture is 5000% and is 50 times the highest luminance corresponding to SDR, 100%. I.e. a multiple of 50 times the dynamic range of the HDR picture. After the HDR picture is encoded and compressed, the highest luminance corresponding to the high dynamic range area part in the compressed picture is 1000nit, and the highest luminance corresponding to the standard dynamic range part is 203nit. The corresponding highest luminance in the compressed picture is about 5 times the highest luminance corresponding to the standard dynamic range portion. I.e. a multiple of the dynamic range in the compressed picture of about 5 times.
The electronic device 100 may store compression information, which may include a correspondence between a dynamic range and a compression ratio of the HDR picture. That is, the compression information may be used to record how HRD pictures are compressed into compressed pictures. Or the compression information may include a correspondence between the high dynamic range of the HDR picture and the compression ratio.
In the embodiment of the present application, the correspondence between the dynamic range and the compression ratio of the HDR picture may be stored in the form of a curve. Alternatively, the correspondence between the dynamic range and the compression ratio of the HDR picture may exist in the form of a table. The embodiment of the present application is not limited thereto.
Illustratively, the correspondence between the dynamic range and the compression ratio of the HDR picture is stored in the form of a curve. For example, the compression information stored by the electronic device 100 may be a dynamic range compression curve corresponding to the HDR picture, or a compression curve of a high dynamic range region in the HDR picture. For example, the compression information may be the dynamic range compression curve 203, or a highlight information portion in the dynamic range compression curve 203.
In one possible implementation, the electronic device 100 may store the compressed information into metadata information corresponding to the HDR picture. For example, the compressed information may be stored as an extension field in the metadata information. The embodiment of the application does not limit the storage form of the compressed information.
S702, when the electronic device 100 displays the compressed picture, acquiring the compressed picture and compression information.
The electronic device 100 may receive operation 2, which operation 2 may be used to display the compressed picture. For example, the operation 2 may be the user clicking on a thumbnail of the compressed picture in a gallery application of the electronic device 100. Or the operation 2 may be that the user inputs a voice instruction for presenting the compressed picture to the electronic device 100, for example, the voice instruction may be "presenting the compressed picture". The embodiment of the present application is not particularly limited to this operation 2.
In response to this operation 2, the electronic apparatus 100 may acquire the compressed picture and the compression information while the electronic apparatus 100 displays the compressed picture.
S703, the electronic device 100 may obtain a corresponding relationship between the brightness of the display screen and the dynamic range of the HDR picture based on the compressed information.
The electronic device 100 may obtain a correspondence between the brightness of the display screen and the dynamic range of the HDR picture according to the correspondence between the dynamic range of the compressed picture and the compression ratio.
In one possible implementation, the electronic device 100 stores the correspondence between the dynamic range and the compression ratio of the compressed picture in the form of a curve. The dynamic range of the compressed picture may be the horizontal axis and the compression ratio is the vertical axis. Then, the electronic device 100 may reverse map the curve, that is, the dynamic range of the compressed picture is taken as the vertical axis, and the compression ratio is taken as the horizontal axis, so as to analyze the dynamic range of the HDR picture. Then, the electronic device 100 maps the dynamic range of the HDR picture with the display brightness capability of the display screen according to the display brightness capability of the display screen, so as to obtain a corresponding relationship between the display brightness capability of the display screen and the dynamic range of the HDR picture.
Illustratively, as shown in fig. 8A, the electronic device 100 may save the correspondence between the dynamic range and the compression ratio of HDR in the form of a dynamic compression curve. The correspondence of the dynamic range of HDR and the compression ratio may be as shown in any one of the dynamic range compression curve 201, the dynamic range compression curve 202, and the dynamic range compression curve 203 shown in (a) of fig. 8A. The electronic device 100 may reverse map the dynamic range compression curve 201 to a curve 803 shown in (b) in fig. 8A. The electronic device 100 may reverse map the dynamic range compression curve 202 to the curve 802 shown in (b) in fig. 8A. The electronic device 100 may reverse map the dynamic range compression curve 203 to a curve 801 shown in (b) in fig. 8A.
Taking curve 801 as an example, electronic device 100 may obtain from curve 801 that the highest luminance corresponding to the HDR region of the HDR picture is 5000%, and the highest luminance corresponding to the SDR region is 100%. The highest luminance corresponding to the HDR region in the HDR picture is 50 times the highest luminance corresponding to the SDR region. The electronic device 100 may perform a one-to-one correspondence between the dynamic range of the HDR and the display luminance capability of the display screen, to obtain a correspondence between the display luminance capability of the display screen and the dynamic range of the HDR picture.
Taking the curve 801 as an example, the electronic device 100 may obtain from the curve 801 that the highest luminance corresponding to the HDR region in the HDR picture is 50 times the highest luminance corresponding to the SDR region. If the highest brightness of the display brightness capability of the display screen of the electronic device 100 is 500nit and the displayable SDR brightness is 10nit, the electronic device 100 has the capability of restoring the dynamic range by 50 times. The SDR brightness that can be displayed is 10nit. Then, the electronic device 100 may map the highest luminance of the HDR corresponding to the display screen and the highest luminance corresponding to the HDR region in the HDR picture, and map the SDR luminance corresponding to the display screen and the highest luminance corresponding to the SDR region in the HDR picture. That is, the electronic device 100 may map 5000% of the highest luminance corresponding to the HDR region in the HDR picture with 500nit of the highest luminance of the display screen, and 100% of the highest luminance corresponding to the SDR region in the HDR picture with 10nit of the display screen. In this way, the electronic device 100 may obtain a correspondence between the display brightness capability of the display screen and the dynamic range of the HDR picture. Illustratively, the correspondence between the display luminance capability of the display screen and the dynamic range of the HDR picture is shown as a curve 804 in (c) of fig. 8A, and the slope of the curve 804 may be 1. The curve 804 can also exhibit a 50-fold dynamic range at the display end, which can better exhibit the contrast of the highlight region.
If the electronic device 100 maps the dynamic range of the HDR picture with the display brightness capability of the display screen according to the multiple of the dynamic range of the compressed picture, the multiple of the dynamic range of the brightness of the finally displayed picture is the same as the multiple of the dynamic range of the compressed picture, which results in poor contrast of the highlight region of the displayed picture. For example, the vertical axis in (a) of fig. 8A shows that the dynamic range of data encoded according to the HLG standard is about 5 times, that is, a multiple of the dynamic range of a compressed picture is about 5 times. Illustratively, as shown by curve 805 shown in (c) of fig. 8A, the electronic device 100 maps the dynamic range of the HDR picture by a factor of 50 with the luminance dynamic range of the display screen by a factor of 5. That is, the electronic device 100 may map 5000% of the highest luminance corresponding to the HDR region in the HDR picture with 50nit of the highest luminance of the display screen, and 100% of the highest luminance corresponding to the SDR region in the HDR picture with 10nit of the display screen. Thus, when a pixel with 5000% luminance of the HDR picture is displayed on the display screen, the luminance is 50nit, and when a pixel with 3000% luminance of the HDR picture is displayed on the display screen, the luminance is also 50nit. Thereby resulting in poor pixel contrast in the high dynamic range region of the HDR picture displayed by the display screen, resulting in distortion of the displayed HDR picture. And, the display capability of the electronic device 100 is not used.
S704, the electronic device 100 performs tone mapping on the compressed picture based on the corresponding relation between the brightness of the display screen and the dynamic range of the HDR picture to obtain a tone mapped picture, wherein the brightness at the maximum value of the high dynamic range in the tone mapped picture is the maximum brightness supported by the display screen.
The electronic device 100 may tone map the compressed picture based on the correspondence between the display screen brightness and the dynamic range of the HDR picture. For example, taking the correspondence between the display luminance capability and the dynamic range of the compressed picture as shown in the curve 804 shown in (c) of fig. 8A as an example, the electronic device 100 may map the luminance of the pixel point with the dynamic range of 5000% in the compressed picture to 500nit and the luminance of the pixel point with the dynamic range of 100% in the compressed picture to 10nit. In turn, the electronic device 100 may determine the brightness of each pixel in the compressed picture as displayed in the display screen according to the curve 804. In this way, the electronic device 100 may obtain a tone mapped picture. The luminance at the maximum value of the high dynamic range in the tone mapped picture is the maximum luminance supported by the display screen.
Illustratively, fig. 8B illustrates a dynamic range curve corresponding to the compressed picture and a dynamic range curve corresponding to the tone-mapped picture. The compression curve in fig. 8B is a dynamic range curve corresponding to the compressed picture. The horizontal axis of the compression curve represents the dynamic range of the luminance corresponding to the picture before compression (original picture), and the vertical axis of the compression curve represents the dynamic range of the luminance corresponding to the picture after compression. The reduction curve in fig. 8B is a dynamic range curve corresponding to the tone-mapped picture. The horizontal axis of the reduction curve represents the dynamic range of the luminance corresponding to the original picture, and the vertical axis of the reduction curve represents the dynamic range of the luminance corresponding to the tone-mapped picture. The dynamic range of the luminance of the original picture, the dynamic range of the luminance of the compressed picture, and the dynamic range of the luminance of the tone-mapped picture shown in fig. 8B may be as shown in table 2 below.
TABLE 2
As shown in table 2, the brightness value of the pixel point in the original picture ranges from 0.0nit to 3.0nit. The brightness value of the pixel point in the compressed picture is from 0.0 to 1.0nit. The brightness value of the pixel point in the picture after tone mapping is from 0.0nit to 3.0nit.
As shown in table 2, the luminance value of the pixel point in the original picture is 0.0nit, and in the compressed picture, the luminance value of the pixel point is 0.0nit, and in the tone-mapped picture, the luminance value of the pixel point is 0.0nit. The brightness value of the pixel point in the original picture is 0.2nit, and the brightness value of the pixel point in the compressed picture is 0.3nit; in the tone-mapped picture, the luminance value of the pixel is 0.0nit. And the brightness values of the pixels in the original picture are 0.4nit and 0.6nit, the brightness values of the pixels in the compressed picture are all compressed to be 0.4nit, and the brightness values of the pixels in the tone-mapped picture are respectively 0.1nit and 0.2nit. And the brightness value of the pixel point in the original picture is 0.8nit, the brightness value of the pixel point in the compressed picture is compressed to be 0.5nit, and the brightness value of the pixel point in the tone-mapped picture is 0.4nit. And the brightness values of the pixels in the original picture are respectively 0.5nit and 0.7nit, and the brightness values of the pixels in the compressed picture are respectively 0.9nit and 1.1nit. And the brightness values of the pixels in the original picture are respectively 0.9nit and 1.1nit, and the brightness values of the pixels in the compressed picture are respectively 0.7nit and 1.5 nit. And the brightness values of the pixels in the original picture are 1.7nit, 1.9nit and 2.1nit, the brightness values of the pixels in the compressed picture are all compressed to be 0.8nit, and the brightness values of the pixels in the tone-mapped picture are respectively 1.3nit, 1.5nit and 1.7nit. And the brightness values of the pixels in the original picture are respectively 2.0nit, 2.2nit and 2.4nit, and the brightness values of the pixels in the compressed picture are respectively 0.9nit and 2.2nit and 2.4nit. And the brightness values of the pixels in the original picture are 2.8nit and 3.0nit, the brightness values of the pixels in the compressed picture are 1.0nit, and the brightness values of the pixels in the tone-mapped picture are 2.7nit and 3.0nit respectively.
As can be seen from table 2, the brightness of the tone mapped picture is closer to the brightness of the original picture. The contrast of the tone mapped picture between different brightnesses is also closer to the contrast of the original picture.
S705. the electronic device 100 displays the tone mapped picture.
The electronic device 100 may display the tone mapped picture. The multiple of the dynamic range of the luminance of the tone mapped picture is greater than the multiple of the dynamic range of the luminance of the compressed picture and less than or equal to the multiple of the dynamic range of the luminance of the HDR picture (i.e. the original picture).
According to the display method provided by the embodiment of the application, when the picture is displayed, the electronic equipment 100 can acquire the compression information of the picture, and based on the corresponding relation between the dynamic range of the brightness of the picture in the compression information and the compression ratio, the corresponding relation between the dynamic range of the picture and the display brightness capability of the display screen is determined. Then, the electronic device 100 may tone-map the picture based on the correspondence between the dynamic range of the picture and the display brightness capability of the display screen, and restore the region with a high dynamic range in the picture. In this way, the contrast and detail of the high dynamic range region of the displayed picture (i.e., the highlight region in the picture) can be increased, reducing the luminance saturation.
Illustratively, as shown in fig. 9, the electronic device 100 employs a picture 901 displayed by the display method shown in fig. 7. The shooting environment and the shooting content of this picture 901 are the same as those of the picture 210 shown in fig. 2B. The contrast of the light portion and the wall portion in the highlight region 9011 in the picture 901 is improved, and the light color saturation is reduced, compared to the picture 210. That is, the electronic device 100 displays the original picture according to the prior art, and the displayed picture effect is shown as a picture 210 shown in fig. 2B. The electronic device 100 displays the original picture according to the display method provided by the embodiment of the present application, and the displayed picture effect is shown as the picture 901. According to the picture displayed by the display method provided by the embodiment of the application, the contrast of the highlight region in the picture can be improved, and the saturation of the highlight region in the picture can be reduced. Therefore, the displayed picture has stronger sense of reality, and the user experience can be improved.
In one possible implementation, the electronic device 100 may infer the shooting environment illuminance from the light source information in the shooting environment when shooting. For example, the electronic device 100 may detect that the current light is strong, and then the electronic device 100 may infer that the illuminance of the shooting environment is high. Or the electronic device 100 may infer that the illuminance of the shooting environment corresponding to the picture is higher according to the shooting scene of the picture as the daytime. When displaying the picture, the electronic device 100 may enhance the highlight region in the picture and also enhance the saturation of the picture.
In one possible implementation, an ambient light sensor may not be present in the electronic device 100. The electronic device 100 may determine the type of light source in the current environment according to the frame captured by the camera. The electronic device 100 may then determine the current ambient brightness based on the light source type. Illustratively, when the electronic device 100 determines that the light source type is an incandescent lamp based on the captured picture by the camera. The light source of a typical incandescent lamp is regularly fixed, and in a scene using an incandescent lamp, its ambient brightness is about 500lux. Thus, the electronic device 100 may infer that the current ambient brightness is 500lux based on the light source type as an incandescent lamp.
In one possible implementation, when displaying a picture, the electronic device 100 adjusts the saturation of the picture based on the ambient lighting of the picture. For example, in one possible implementation, the electronic device 100 may determine the saturation of the color of the picture in the viewing environment based on the illumination of the shooting environment of the picture and the saturation of the picture in the shooting environment, and the brightness of the viewing environment. In this way, the saturation of the picture can be kept consistent in the viewing environment and in the shooting environment.
In one possible implementation, when displaying a picture, the electronic device 100 may perform enhancement, or tone mapping or color processing in regions according to information related to the picture in metadata information of the picture, such as contour, face, blue sky, and the like. For example, the picture has a face and a blue sky. When the image is displayed, the electronic device 100 may enhance the color of the blue sky portion in the image, improve the color saturation of the blue sky portion, and leave the face portion unprocessed, so that the details of the face portion may be preserved, and the face portion of the person may be more real.
In one possible implementation, when displaying a picture, the electronic device 100 may determine to adjust the brightness of the noise region according to noise information in metadata information in the picture, and one or more of a viewing environment, a display screen size, a user viewing distance, and an age of the user. For example, when the picture has more noise, the display screen currently displaying the picture is larger, the viewing environment is darker, the viewing distance of the user is closer, and the user belongs to a crowd with better eyesight such as young people or children, the electronic device 100 may lower the brightness of the area where the noise is located to the brightness threshold 1 when displaying the picture. When the noise in the picture is large, the display screen of the current displayed picture is small, the viewing environment is bright, the user viewing distance is long, and the user belongs to the people with poor eyesight such as the elderly, when the picture is displayed by the electronic device 100, the brightness of the area where the noise in the picture is located can be reduced to the brightness threshold value 2. Wherein the luminance threshold 2 is greater than the luminance threshold 1. The specific values of the brightness threshold 1 and the brightness threshold 2 are not limited in the embodiment of the application.
In the embodiment of the present application, when the electronic device 100 displays a picture, the above steps S401 to S404 may be performed, or only the steps S701 to S705 may be performed. The electronic apparatus 100 may also perform steps S401 to S404 and steps S701 to S705 simultaneously. That is, after determining the luminance of each pixel point of the SDR portion in the picture according to steps S401 to S404, the electronic device 100 may then tone-map the picture according to steps S701 to S705 to determine the luminance of the HDR portion in the picture, and then, when the electronic device 100 displays the picture in the display screen, may set the luminance of the SDR portion and the luminance of the HDR portion in the picture according to the determined luminance of the SDR portion and the luminance of the HDR portion.
In one possible implementation, when the picture to be displayed is an SDR picture, the electronic device 100 may display the SDR picture according to steps S401-S404. When a picture is to be displayed, the electronic device 100 may display the HDR picture in accordance with steps S701 to S705, or simultaneously execute steps S401 to S404 and steps S701 to S705.
In the embodiment of the present application, the electronic device 100 may perform tone mapping on other parameters of the picture according to steps S701-S705, for example, the saturation of the color, the color value of the highlight region, or the color value of the face region in the picture, the color value of the blue sky region in the picture, and so on, so that the picture quality displayed by the electronic device 100 is better.
It will be appreciated that the display method shown in fig. 7 may also be applied to video. The HDR image frames contained in the video of the electronic device 100 are compressed, resulting in compressed image frames and image frame compression information. The image frame compression information includes a correspondence between a dynamic range and a compression ratio in the compressed image frame. While the electronic device 100 displays the HDR image frames in the video, the electronic device 100 may obtain compressed image frames and image frame compression information. The electronic device 100 may obtain a correspondence between the display screen brightness and the dynamic range of the HDR image frame based on the image frame compression information. The electronic device 100 performs tone mapping on the compressed image frame based on the corresponding relationship between the brightness of the display screen and the dynamic range of the HDR image frame, to obtain a tone mapped image frame, where the brightness at the maximum value of the high dynamic range in the tone mapped image frame is the maximum brightness supported by the display screen. The electronic device 100 may display the tone mapped image frame while the video is displayed.
Fig. 10 schematically illustrates a display system 1000 according to an embodiment of the present application. As shown in fig. 10, the clapping system 1000 may include a photographing device 1001 and a display device 1002. Wherein:
The photographing apparatus 1001 may include a camera. The photographing apparatus 1001 may take a picture with a camera and store the picture and metadata information of the picture.
The display device 1002 may include a display screen. The display device 1002 may display the picture transmitted by the photographing device 1001 through a display screen.
In one possible implementation manner, the display device 1002 may be further configured to determine, according to an illuminance of a shooting environment of a picture, a luminance of a pixel having a first gray scale in a picture displayed in a display screen under the shooting environment, and a current viewing environment luminance, a luminance of a pixel having a first gray scale in a picture displayed in a display screen under the viewing environment. Regarding how the display device 1002 determines the brightness of the pixel with the first gray level in the picture displayed in the display screen under the viewing environment according to the illuminance of the capturing environment, the pixel with the first gray level in the picture displayed in the display screen under the capturing environment, and the brightness of the current viewing environment, reference may be made to the description in step S403, which is not repeated herein.
In one possible implementation, the display device 1002 may further obtain a correspondence between the display brightness capability of the display screen and the dynamic range of the picture captured by the capturing device 1001 according to the corresponding compression information of the picture. Then, the electronic device 100 performs tone mapping on the compressed picture based on the correspondence between the display brightness capability of the display screen and the dynamic range of the picture, to obtain a tone mapped picture. Finally, the display device 1002 may also display the tone mapped picture. Reference may be made specifically to the descriptions in the above steps S701 to S705, and the description is omitted here.
The display system 1000 may implement any of the possible methods performed by the electronic device 100 described above.
The photographing apparatus 1001 may be a device having photographing capability, for example, a camera-equipped device such as a camera, a cellular phone, a tablet, a notebook computer, a wristwatch, or the like. The display device 1002 may be a device having display capability, such as a device having a display screen, for example, a mobile phone, a tablet, a notebook computer, and a wristwatch.
In some examples, the capture device 1001 may capture a picture and display the captured picture. The photographing apparatus 1001 may also transmit the photographed picture to other apparatuses, for example, a display apparatus 1002.
In some examples, the display device 1002 also has a photographing function, and can take a picture and display the taken picture. The display device 1002 may also receive pictures transmitted by other devices (e.g., the photographing device 1001) and display the received pictures.
The embodiment of the present application is not limited to the photographing apparatus 1001 and the display apparatus 1002.
In the embodiment of the present application, the first picture may be picture 1. The first luminance may be luminance 1, the second luminance may be luminance 2, the third luminance may be luminance 3, and the fourth luminance may be luminance 4. The first scene may be scene 1 and the second scene may be scene 2. The first ambient illuminance may be ambient illuminance 1 and the second ambient illuminance may be ambient illuminance 2.
While the application has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that the foregoing embodiments may be modified or equivalents may be substituted for some of the features thereof, and that the modifications or substitutions do not depart from the spirit of the embodiments.
As used in the above embodiments, the term "when..is interpreted as meaning" if..or "after..or" in response to determining..or "in response to detecting..is" depending on the context. Similarly, the phrase "when determining..or" if (a stated condition or event) is detected "may be interpreted to mean" if determined.+ -. "or" in response to determining.+ -. "or" when (a stated condition or event) is detected "or" in response to (a stated condition or event) "depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. The storage medium includes a ROM or a random access memory RAM, a magnetic disk or an optical disk, and other various media capable of storing program codes.