WO2025044350A1 - 一种图像显示方法与电子设备 - Google Patents

一种图像显示方法与电子设备 Download PDF

Info

Publication number
WO2025044350A1
WO2025044350A1 PCT/CN2024/096441 CN2024096441W WO2025044350A1 WO 2025044350 A1 WO2025044350 A1 WO 2025044350A1 CN 2024096441 W CN2024096441 W CN 2024096441W WO 2025044350 A1 WO2025044350 A1 WO 2025044350A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
area
highlight
backlight brightness
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/096441
Other languages
English (en)
French (fr)
Inventor
周刘
艾金钦
文锦松
周阳
刘海啸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP24857895.7A priority Critical patent/EP4654179A4/en
Publication of WO2025044350A1 publication Critical patent/WO2025044350A1/zh
Priority to US19/375,050 priority patent/US20260057850A1/en
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/3406Control of illumination source
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/2007Display of intermediate tones
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • G09G3/36Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source using liquid crystals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/40Picture signal circuits
    • H04N1/407Control or modification of tonal gradation or of extreme levels, e.g. background level
    • H04N1/4072Control or modification of tonal gradation or of extreme levels, e.g. background level dependent on the contents of the original
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/02Improving the quality of display appearance
    • G09G2320/0271Adjustment of the gradation levels within the range of the gradation scale, e.g. by redistribution or clipping
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0613The adjustment depending on the type of the information to be displayed
    • G09G2320/062Adjustment of illumination source parameters
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0626Adjustment of display parameters for control of overall brightness
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0626Adjustment of display parameters for control of overall brightness
    • G09G2320/0646Modulation of illumination source brightness and image signal correlated to each other
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/066Adjustment of display parameters for control of contrast
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0686Adjustment of display parameters with two or more screen areas displaying information with different brightness or colours
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2360/00Aspects of the architecture of display systems
    • G09G2360/16Calculation or use of calculated indices related to luminance levels in display data

Definitions

  • the present application relates to the field of terminal technology, and in particular to an image display method and an electronic device.
  • the human eye has a very large dynamic range (10 -6 ⁇ 10 -8 ), and can perceive the high dynamic range (HDR) of the real world.
  • HDR high dynamic range
  • the brightness range that a display can display is small, so the display cannot fully restore the high dynamic range of the real world. Therefore, how to improve the dynamic range of image display is a problem that needs to be studied.
  • An image display method and an electronic device provided in the embodiments of the present application are helpful to improve the dynamic range of image display.
  • an image display method which is applied to an electronic device.
  • the method includes: determining a first image to be displayed; determining a highlight area of the first image and backlight brightness information of the display screen according to the image content of the first image or the histogram of the first image, wherein the highlight area is an area on the first image whose brightness value is greater than a first threshold; reducing the brightness of non-highlight areas on the first image, while keeping the brightness of the highlight areas unchanged, to obtain a second image, wherein the non-highlight areas are areas other than the highlight areas on the first image; adjusting the backlight brightness of the display screen according to the backlight brightness information; and displaying the second image on the display screen.
  • the mobile phone before displaying the image, the mobile phone first darkens the non-highlighted area on the image (for example, reduces the grayscale value of the pixel in the non-highlighted area), and keeps the brightness of the highlighted area unchanged (that is, the grayscale value of the pixel in the highlighted area remains unchanged), to obtain a new image, and then adjusts the backlight brightness of the display screen according to the backlight brightness information, and displays the new image on the display screen after the backlight brightness is adjusted.
  • the non-highlighted area on the image for example, reduces the grayscale value of the pixel in the non-highlighted area
  • keeps the brightness of the highlighted area unchanged that is, the grayscale value of the pixel in the highlighted area remains unchanged
  • the backlight brightness of the display screen Due to the effect of the backlight brightness of the display screen, when the display screen displays the new image, the highlighted area on the new image is brighter, and the backlight brightness of the display screen can compensate for the darkening of the non-highlighted area, so that the non-highlighted area is not too dark, so the brightness contrast between the highlighted area and the non-highlighted area is enhanced, that is, the dynamic range of the image display is improved.
  • determining a highlighted area of the first image according to the image content of the first image includes: judging whether the first image contains a preset object according to the image content of the first image; if so, determining that the area on the first image where the preset object is located is a highlighted area.
  • the electronic device can determine the highlight area on the image by means of image semantic recognition, for example, the area where the light source is located on the image is the highlight area.
  • the mobile phone first darkens the area where the non-light source is located on the image (for example, reducing the grayscale value of the pixels in the area where the non-light source is located), and the brightness of the area where the light source is located remains unchanged to obtain a new image, and then adjusts the backlight brightness of the display screen according to the backlight brightness information, and displays the new image on the display screen after adjusting the backlight brightness.
  • the backlight brightness of the display screen Due to the effect of the backlight brightness of the display screen, when the display screen displays a new image, the area where the light source is located on the new image is brighter, and the backlight brightness of the display screen can compensate for the dimming of the area where the non-light source is located, so that the area where the non-light source is located is not too dark, so the brightness contrast between the area where the light source is located and the area where the non-light source is located is enhanced, that is, the dynamic range of the image display is improved.
  • determining a highlight area of the first image according to the image content of the first image includes: running a first algorithm model with the first image as an input parameter to obtain a highlight map of the first image; the first algorithm model is used to adjust the pixel values of pixels in an area where the preset object is located on the first image to a first pixel value when recognizing that the first image contains a preset object, and adjusting the pixel values of pixels in other areas to a second pixel value to obtain the highlight map, the first pixel value being lower than the second pixel value; and determining the highlight area of the first image according to the highlight map.
  • the electronic device can determine the highlight area on the image through the highlight map. This method is relatively convenient and efficient, that is, the highlight area can be determined at a faster speed.
  • determining a highlighted area of the first image according to the highlighted map includes: determining a first pixel point on the highlighted map whose pixel value is the first pixel value; determining a second pixel point on the first image according to the first pixel point, wherein a position of the second pixel point on the first image is the same as a position of the first pixel point on the highlighted map; and determining the area where the second pixel point is located as the highlighted area.
  • the electronic device can determine the highlight area on the image through the highlight map, which is more efficient.
  • determining a highlight area of the first image according to a histogram of the first image includes: dividing the first image into N areas, determining a local histogram of each of the N areas, where N is a positive integer; determining M areas among the N areas according to the local histogram, where M is a positive integer less than or equal to N, and each of the M areas satisfies: an average pixel value is higher than a second threshold, and/or the number of pixels with pixel values higher than the second threshold exceeds a preset number; and determining the M areas as the highlight areas.
  • the electronic device can determine the highlight area of the first image based on the histogram of the first image.
  • the highlight area determined in this way is more accurate.
  • determining the M areas as the highlight areas before determining the M areas as the highlight areas, it also includes: determining K areas among the M areas according to the global histogram of the first image, K is a positive integer less than or equal to M, wherein each of the K areas satisfies: the ratio of S1 to S2 is higher than the first ratio, S1 is the number of pixels in each area whose pixel values are higher than the second threshold, and S2 is the number of all pixels on the first image whose pixel values are higher than the second threshold; determining the M areas as the highlight areas includes: determining the K areas as the highlight areas of the first image.
  • the electronic device may determine a highlight area of the first image based on a global histogram and a local histogram of the first image, thereby improving the accuracy of the determined highlight area.
  • the first image is a high dynamic range image
  • the value of the second threshold is a first value
  • the first image is a low dynamic range image
  • the value of the second threshold is a second value
  • the first value is lower than the second value
  • the second threshold value is large to more accurately determine the highlight area, while the high dynamic range image has a large brightness difference and generally has a dark background, so the second threshold value does not need to be large to determine the highlight area. In this way, the highlight area on various images can be determined more accurately.
  • the first image is a high dynamic range image, and the first ratio is a third value; the first image is a low dynamic range image, and the first ratio is a fourth value, and the third value is lower than the fourth value.
  • the first ratio is set to be low; while the number of pixels in the highlight area (e.g., the area where the cloud or snow scene is located) on the low dynamic range image is large, for example, accounting for 50%-60% of the total number of pixels in the entire image, so the first ratio is set to be high. In this way, the highlight areas on various images can be determined more accurately.
  • the backlight brightness information of the display screen is determined according to the image content of the first image, including: determining the environment in which the first image is located according to the image content of the first image; and determining the backlight brightness information according to the environment.
  • the electronic device determines the backlight brightness information of the display screen according to the image content of the first image.
  • the backlight brightness information determined in this way is more consistent with the environment in which the image is located.
  • the backlight brightness information includes a backlight brightening multiple; when the environment is outdoors or during the day, the backlight brightening multiple is determined to be a first multiple; when the environment is indoors or at night, the backlight brightening multiple is determined to be a second multiple, and the first multiple is higher than the second multiple.
  • the backlight brightness information of the display screen is determined according to the histogram of the first image, including: determining a second ratio of the number of pixels on the first image whose pixel values are lower than a third threshold to the total number of pixels on the first image according to the global histogram of the first image, and determining the backlight brightness information according to the second ratio; or determining a third ratio of the number of pixels on the first image whose pixel values are higher than a fourth threshold to the total number of pixels on the first image according to the global histogram of the first image, and determining the backlight brightness information according to the third ratio.
  • the electronic device can determine the backlight brightness information of the display screen based on the histogram of the first image.
  • the backlight brightness information determined in this way is relatively accurate.
  • the non-highlight area on the first image before reducing the brightness of the non-highlight area on the first image, it also includes: determining a pixel change value ⁇ based on the backlight brightness information; and subtracting the pixel change value ⁇ from the pixel value of each pixel point in the non-highlight area.
  • the electronic device reduces the brightness of the non-highlighted area on the image, which means reducing the pixel value of the pixel in the non-highlighted area.
  • the electronic device After the electronic device reduces the brightness of the non-highlighted area, it will compensate by adjusting the backlight brightness of the display screen to avoid the non-highlighted area being too low in brightness when the image is displayed on the display screen, affecting the user experience.
  • determining the pixel change value ⁇ based on the backlight brightness information includes: determining the pixel value corresponding to the backlight brightness information as the target pixel value based on the backlight brightness information and the correspondence between the backlight brightness information and the pixel value, and the difference between the target pixel value and the current pixel value of each pixel point in the non-highlight area is the pixel change value ⁇ .
  • determining the highlight area of the first image and the backlight brightness information of the display screen based on the image content of the first image it also includes: determining that the first image is a third-party image, and the third-party image is not an image taken locally by the electronic device.
  • the parameters used when shooting the image will be stored, such as exposure information, aperture value, flash, lens focal length, depth of field, and shutter times. These parameters form Exif information and are stored in the electronic device. Therefore, for locally shot images, the electronic device can determine the highlight area and backlight brightness information of the image based on the Exif information of the image. For third-party images, since they are not shot locally, there is no Exif information corresponding to the third-party images in the mobile phone, so for third-party images, the highlight area and backlight brightness information are determined by image content or histogram. Therefore, the technical solution provided in the embodiment of the present application can be applied to third-party images, that is, when the image display method provided in the embodiment of the present application is used to display third-party images, the dynamic range can be improved.
  • determining that the first image is a third-party image includes: reading a flag bit in a first file, and determining that the first image is a third-party image based on the flag bit; wherein the first file is a file obtained when the electronic device stores the first image in a first image format, and the flag bit is used to indicate that the first image is a third-party image or a locally captured image.
  • the file includes a flag.
  • the flag is used to indicate whether the image is a locally captured image or a third-party image. Therefore, through the flag, the electronic device can determine whether an image is a locally captured image or a third-party image, which is relatively convenient.
  • the highlight area of the first image and the backlight brightness information of the display screen based on the image content of the first image or the histogram of the first image it also includes: determining that the first image is a photographic image based on the image content of the first image, and the photographic image refers to an image that includes at least one of scenery, people and animals.
  • the image display method provided in the embodiments of the present application is not used for non-photographic images.
  • the image display method provided in the embodiments of the present application can be used to prompt the dynamic range.
  • the method further includes: when it is determined that the first image is not a photographic image based on image content of the first image, displaying the first image on the display screen.
  • the method further includes: storing a highlight map of the first image and the backlight brightness information.
  • the highlight map and backlight brightness information can be stored. The next time it detects that the user wants to open the first image, the highlight map and backlight brightness information can be read. There is no need to determine the highlight area and backlight brightness information based on the image content and/or histogram of the first image, which is more efficient.
  • the method also includes: in response to a first operation, canceling the display of the second image on the display screen; when receiving an operation for opening the first image again, reading the highlight map and the backlight brightness information; determining the highlight area on the first image according to the highlight map; reducing the brightness of the non-highlight area on the first image, while keeping the brightness of the highlight area unchanged, to obtain a third image, wherein the non-highlight area is other area outside the highlight area on the first image; adjusting the backlight brightness of the display screen according to the backlight brightness information; and displaying the third image on the display screen.
  • the highlight map and backlight brightness information can be stored. The next time it detects that the user wants to open the first image, the highlight map and backlight brightness information can be read. There is no need to determine the highlight area and backlight brightness information based on the image content and/or histogram of the first image, which is more efficient.
  • the highlight map and the backlight brightness information of the first image do not exist in the electronic device; the highlight map is a grayscale image of the first image and the pixel points on the grayscale image whose pixel values are within a first preset range correspond to the pixel points in the highlight area on the first image.
  • the electronic device after the electronic device determines the first image to be displayed, it can first determine whether a highlight map and backlight brightness information are stored. If not, the highlight area and backlight brightness information are determined based on the image content and/or histogram of the first image. If so, the highlight map and backlight brightness information are read, which is more efficient.
  • an electronic device including:
  • a processor a memory, and one or more programs
  • the one or more programs are stored in the memory, and the one or more programs include instructions.
  • the electronic device executes the method steps provided in the first aspect above.
  • a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store a computer program.
  • the computer program When the computer program is executed on a computer, the computer executes the method according to the first aspect.
  • a computer program product comprising a computer program, wherein when the computer program is run on a computer, the computer is enabled to execute the method according to the first aspect.
  • a chip is also provided, which is coupled to a memory in an electronic device and is used to call a computer program stored in the memory and execute the technical solution of the first aspect of the embodiment of the present application.
  • “coupling” refers to the direct or indirect combination of two components with each other.
  • FIG1A is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
  • FIG1B is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a flow chart of an image display method and an electronic device provided in an embodiment of the present application
  • FIG3 is a schematic diagram of a mobile phone display interface provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a first image and a highlight map provided by an embodiment of the present application.
  • FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • At least one of the embodiments of the present application includes one or more; wherein, multiple means greater than or equal to two.
  • words such as “first” and “second” are only used for the purpose of distinguishing descriptions, and cannot be understood as expressing or implying relative importance, nor can they be understood as expressing or implying order.
  • the first moment and the second moment do not represent the importance of the two or the order of the two, but are only for distinguishing descriptions.
  • "and/or” is only a description of the association relationship, indicating that there may be three relationships.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this article generally indicates that the objects associated before and after are in an "or” relationship.
  • references to "one embodiment” or “some embodiments” etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the specification.
  • the phrases “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
  • the terms “including”, “comprising”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized in other ways.
  • the image display method provided in the embodiment of the present application can be applied to electronic devices.
  • the electronic device can have a display screen.
  • the electronic device It can be a portable electronic device such as a mobile phone, a tablet computer, a laptop computer, or a wearable device such as a watch or a bracelet, or a virtual reality (VR) device, an augmented reality (AR) device, a mixed reality (MR) device, etc.
  • VR virtual reality
  • AR augmented reality
  • MR mixed reality
  • the embodiments of the present application do not limit the specific type of electronic device.
  • this article mainly takes the mobile phone as an example.
  • FIG1A shows a schematic diagram of the hardware structure of an electronic device.
  • the electronic device may be, for example, a mobile phone.
  • the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
  • a memory may also be set in the processor 110 for storing instructions and data.
  • the memory in the processor 110 is a high-speed cache memory.
  • the memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 can execute the process of the image display method provided in the embodiment of the present application. For example, the processor 110 can determine the first image to be displayed, and can also determine whether the first image is a third-party image.
  • the third-party image is not a locally captured image, for example, it may include an image received from other devices (for example, a mobile phone) through the wireless communication module 160, or an image downloaded from the network, or a local screenshot image of an electronic device, etc.
  • the processor 110 determines that the first image to be displayed is a third-party image
  • the highlight area of the first image and the backlight brightness information of the display screen 194 are determined according to the image content and/or histogram of the first image.
  • the processor 110 reduces the brightness of the non-highlight area on the first image, and the brightness of the highlight area remains unchanged to obtain a second image. Moreover, the processor 110 adjusts the backlight brightness of the display screen 194 according to the backlight brightness information, and displays the second image through the display screen 194. In this way, when the second image is displayed on the display screen 194, the highlight area on the second image is brighter due to the backlight brightness of the display screen, and the backlight brightness of the display screen compensates for the darkening of the non-highlight area, so that the non-highlight area is not too dark, so the brightness contrast between the highlight area and the non-highlight area is enhanced, that is, the dynamic range of the image display is improved.
  • the specific implementation process will be described later.
  • the processor 110 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple groups of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the electronic device.
  • the I2S interface can be used for audio communication.
  • the processor 110 can include multiple I2S buses.
  • the processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170.
  • the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
  • the audio module 170 The wireless communication module 160 can be coupled via a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to implement the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
  • the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device.
  • the processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc.
  • the GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge an electronic device, and can also be used to transfer data between an electronic device and a peripheral device. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device.
  • the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.
  • antenna 1 can be reused as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to electronic devices.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
  • the mobile communication module 150 may receive electromagnetic waves from the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
  • at least some of the functional modules of the mobile communication module 150 may be arranged in the processor 110.
  • at least some of the functional modules of the mobile communication module 150 may be arranged in the same device as at least some of the modules of the processor 110.
  • the wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the wireless communication module 160 can be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110.
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
  • antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
  • the display screen 194 is used to display the display interface of the application, etc.
  • the display screen 194 includes a display panel.
  • the electronic device may include one or more display screens 194.
  • the backlight brightness of the display screen 194 can be adjusted, for example, according to the backlight brightness information. Assuming that the backlight brightness information is a backlight brightening multiple, such as x1, x2, etc., the larger the backlight brightening multiple, the greater the backlight brightness.
  • Electronic devices can realize shooting through ISP, camera 193, video codec, GPU, display 194 and application processor.
  • the ISP is used to process the data fed back by the camera 193.
  • the internal memory 121 can be used to store computer executable program codes, which include instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121.
  • the internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, and software code of at least one application program, etc.
  • the data storage area may store data (such as images, videos, etc.) generated during the use of the electronic device, etc.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as pictures and videos are saved in the external memory card.
  • the electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
  • the speaker 170A also called a “speaker” is used to convert an audio electrical signal into a sound signal.
  • the electronic device can listen to music or listen to external scenarios such as hands-free calls through one or more speakers 170A.
  • the receiver 170B also called a "earpiece” may be one or more and is used to convert an audio electrical signal into a sound signal.
  • the voice can be received by placing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the earphone jack 170D is used to connect a wired earphone.
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A can be disposed on the display screen 194 .
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes), and can detect the magnitude and direction of gravity when the electronic device is stationary.
  • Distance sensor 180F used to measure distance. Electronic devices can measure distance through infrared or laser.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device emits infrared light outward through the light emitting diode.
  • the electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the temperature sensor 180J is used to detect the temperature.
  • the touch sensor 180K is also called a "touch panel”.
  • the touch sensor 180K can be set on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of a human vocal part.
  • the key 190 includes a power key, a volume key, etc.
  • the key 190 can be a mechanical key. It can also be a touch key.
  • the electronic device can receive key input and generate key signal input related to the user settings and function control of the electronic device.
  • the motor 191 can generate a vibration prompt.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect the SIM The SIM card can be connected to or disconnected from the electronic device by inserting the SIM card into or removing the SIM card from the SIM card interface 195 .
  • FIG1A do not constitute a specific limitation on the electronic device.
  • the electronic device in the embodiment of the present application may include more or fewer components than those in FIG1A.
  • the combination/connection relationship between the components in FIG1A can also be adjusted and modified.
  • FIG1B is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
  • the electronic device may be, for example, a mobile phone.
  • the software structure of the electronic device may be a layered structure, wherein the layered architecture divides the software into several layers, and each layer has a clear role and division of labor.
  • the layers communicate with each other through software interfaces.
  • the layered architecture may be, for example, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application is based on a layered architecture.
  • the system is taken as an example to illustrate the software structure of the electronic device.
  • the system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime and system library, kernel layer and hardware layer.
  • the application layer may include a series of application packages. As shown in FIG1B , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (API) and a programming framework for the application of the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, and the like.
  • the content provider is used to store and obtain data and make the data accessible to the application.
  • the data may include video, images, audio, dialed and received calls, browsing history and bookmarks, phone books, and the like.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and the like.
  • the view system can be used to build applications.
  • the display interface may be composed of one or more views.
  • a display interface including a text notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions for electronic devices. For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
  • the notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that need to be called by the Java language, and the other is the core library of Android.
  • the application layer and the application framework layer run in the virtual machine.
  • the virtual machine executes the Java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files, etc.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the hardware layer includes various hardware, such as Wi-Fi transceivers, cameras, displays, etc.
  • the software structure shown in FIG. 1B does not constitute a specific limitation on the software structure of the electronic device.
  • the software structure of the electronic device in the embodiment of the present application may include more or fewer modules than in FIG. 1B, for example, more or fewer layers than in FIG. 1B, or a certain layer includes more or fewer modules than in FIG. 1B, etc.
  • the combination/connection relationship between the modules in FIG. 1B can also be adjusted and modified.
  • the application framework layer or the system library can be used to execute the process of the image display method provided by the embodiment of the present application.
  • the execution of the application framework layer is mainly taken as an example.
  • the touch sensor in the hardware layer i.e., the touch sensor 180K in Figure 1A
  • receives a touch operation the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into an input event (including touch coordinates, timestamp of the touch operation, and other information).
  • the application framework layer obtains the input event from the kernel layer, identifies the object corresponding to the input event (such as a control, icon, etc.), and distributes the input event to the corresponding application.
  • the input event is distributed to the gallery application in the application layer.
  • the gallery application calls the interface of the application framework layer, so that the application framework layer determines the first image (the image corresponding to the clicked thumbnail) Whether it is a third-party image, if it is a third-party image, the highlight area of the first image and the backlight brightness information of the display screen are determined according to the image content and/or histogram of the first image. After the application framework layer determines the highlight area, the brightness of the non-highlight area on the first image is reduced, and the brightness of the highlight area remains unchanged to obtain the second image.
  • the application framework layer also calls the display screen in the hardware layer (i.e., the display screen 194 in Figure 1A), and adjusts the backlight brightness of the display screen according to the backlight brightness information, and then displays the second image through the display screen.
  • the display screen displays the second image
  • the highlight area on the second image is brighter
  • the backlight brightness of the display screen compensates for the darkening of the non-highlight area, so that the non-highlight area is not too dark, so the brightness contrast between the highlight area and the non-highlight area is enhanced, that is, the dynamic range of the image display is improved.
  • FIG. 2 is a flow chart of an image display method provided in an embodiment of the present application.
  • the method can be executed by a mobile phone, and the mobile phone can have the hardware structure of FIG. 1A and/or the software structure of FIG. 1B. As shown in FIG. 2, the method includes:
  • images not taken by local cameras are called third-party images.
  • images downloaded from the Internet, received from other devices, or taken by screenshots are all third-party images.
  • the mobile phone can store the image in the gallery application in the mobile phone.
  • the mobile phone will store the image as a file in a certain image format, such as the Joint Photographic Experts Group (JPEG) format, the Portable Network Graphics (PNG) format, etc.
  • JPEG Joint Photographic Experts Group
  • PNG Portable Network Graphics
  • the file suffix is .jpeg or .jpg.
  • the file includes a flag.
  • the flag is used to indicate whether the image is a locally captured image or a third-party image.
  • the flag can be represented in binary, such as 00 or 01. When the flag is 00, it represents that the image is a third-party image, and when the flag is 01, it represents that the image is a locally captured image.
  • a possible implementation method is that after the mobile phone takes an image through a local camera, the image is stored as a file in JPEG format, and the flag in the file is set to 01 to indicate that the image is a locally captured image.
  • the mobile phone downloads an image (i.e., a third-party image) from the network, receives it from other devices, or takes a screenshot, the image is stored as a file in JPEG format, and the flag in the file is set to 00 to indicate that the image is a third-party image.
  • an image i.e., a third-party image
  • the embodiment of the present application does not limit the specific position of the flag bit in the file in JPEG format.
  • the file in JPEG format includes multiple markers, a marker can be understood as a field, and each marker consists of 2 or more bytes.
  • the file in JPEG format includes at least an SOI marker and an EOI marker, the SOI marker is used to indicate the beginning of the image, and the EOI marker is used to indicate the end of the image.
  • the flag bit can be located in any marker (or field) in the file in JPEG format.
  • there are reserved markers in the file in JPEG format and the flag bit can be stored in the reserved markers. Assuming that the reserved markers include multiple fields such as 0xFF02-0xFFBF, the flag bit can be stored in a field in 0xFF02-0xFFBF.
  • S201 Receive a first operation, where the first operation is used to open a first image.
  • the mobile phone displays the interface of the gallery application, which includes multiple thumbnails. Thumbnails can be understood as reduced versions of images stored in the gallery application.
  • the mobile phone receives the first operation, which may be the mobile phone receiving a click operation on a thumbnail.
  • the first operation is a click operation on thumbnail 301, that is, the first operation is used to open the image corresponding to thumbnail 301 (i.e., the first image).
  • S202 determining whether the first image is a third-party image or a locally captured image. If the first image is a third-party image, executing S203, if the first image is a locally captured image, executing S206.
  • the mobile phone stores the image as a file in JPEG format, and the file includes a flag bit, which is used to indicate whether the image is a third-party image or a locally captured image. Therefore, after the mobile phone determines the first image to be displayed, it reads the flag bit in the file corresponding to the first image to be displayed. If the flag bit is 01, it is determined that the first image is a locally captured image, and if the flag bit is 00, it is determined that the first image is a third-party image.
  • S202 may be executed or not, so S202 is indicated by a dotted line in Figure 2. If S202 is not executed, after the mobile phone determines the first image to be displayed, S203 is executed regardless of whether the first image is a third-party image or a locally captured image.
  • the mobile phone determines that the image content of the first image includes text, avatars, emoticons, TV series screens, movie screens, or short video screens, and determines that the first image belongs to a non-photographic scene.
  • the mobile phone determines that the image content of the first image includes scenery (green plants, sea water, sky, buildings, etc.), people, animals, etc., and determines that the first image belongs to a photographic scene.
  • the mobile phone can directly display the image without executing subsequent steps.
  • the mobile phone may include an algorithm model, and the algorithm model can identify whether an image is photographic or non-photographic.
  • the input parameter of the algorithm model is an image
  • the output parameter is 1 or 0.
  • the algorithm model calls a database, and a large number of non-photographic images and photographic images are stored in the database.
  • the algorithm module compares the input image with the image in the database.
  • the feature matching of the input image with the non-photographic image in the database may include: the non-photographic image in the database includes features such as text, emoticons, subtitles, and avatars. If the input image includes at least one of these features, it is determined that the input image matches the features of the non-photographic image in the database.
  • the feature matching between the input image and the photographic images in the database may include: the photographic images in the database include features such as green plants, sky, buildings, sea water, desert, people, animals, etc. If the input image includes at least one of these features, it is determined that the input image matches the features of the photographic images in the database.
  • S203 may be executed or not executed, which is not limited in the embodiment of the present application, so S203 is represented by a dotted line in FIG. 2 .
  • the mobile phone can query whether the information of the highlight map (storage path, image size, etc.) and the backlight brightness information of the first image are present in the first file.
  • the file in JPEG format i.e., the first file
  • the information of the highlight map (storage path, image size, etc.) and the backlight brightness information can be located in any one or more of the multiple markers.
  • there are reserved markers in the file in JPEG format and the information of the highlight map and the backlight brightness information can be located in the reserved markers.
  • the information of the highlight map and the backlight brightness information can be located in a field in 0xFF02-0xFFBF, for example, stored in 0xFF08.
  • the highlight map information, backlight brightness information and flag (used to indicate whether the first image is a third-party image or a locally captured image) of the first image may be located in the same mark or different marks, which is not limited in the embodiment of the present application.
  • the highlight map of the first image can be understood as a grayscale map of the first image.
  • the pixel values (e.g., RGB values) of some pixels on the grayscale map are relatively high, such as the pixel values are in the range of 230-255, and these pixels appear to be white or close to white.
  • the pixel values (e.g., RGB values) of other pixels are relatively low, such as the pixel values are in the range of 0-30, and these pixels appear to be black or close to black.
  • the pixels on the grayscale map correspond to the pixels on the first image one by one. For example, the pixels with higher pixel values (e.g., pixel values in the range of 230-255) on the grayscale map correspond to the pixels in the highlight area on the first image.
  • the positions of the pixels with higher pixel values (e.g., pixel values in the range of 230-255) on the grayscale map are the same as the positions of the pixels in the highlight area on the first image on the first image.
  • FIG4 (a) for a schematic diagram of the first image
  • FIG4 (b) for a schematic diagram of the highlight map of the first image.
  • the first image includes a light source
  • the pixels in the area where the light source is located are white or close to white
  • the pixels in other areas are black or close to black.
  • the process of the mobile phone obtaining the highlighted map of the first image shown in (b) of FIG4 may include: the mobile phone uses the first image as an input parameter to run the algorithm model A, the algorithm model A recognizes the object on the first image by image semantic recognition, and recognizes that the first image includes a light source, the algorithm model A adjusts the pixel values of the pixels in the area where the light source is located on the first image to the first pixel value, the first pixel value may be any value in the range of 230-255, and adjusts the pixel values of the pixels in other areas to the second pixel value, the second pixel value may be any value in the range of 0-30, and obtains the highlighted map of the first image, as shown in (b) of FIG4 .
  • the area where the light source is located in the highlight map of the first image looks white or nearly white (because the pixel value is adjusted to any value in the range of 230-255), and other areas look black or nearly black (because the pixel value is adjusted to any value in the range of 0-30).
  • the backlight brightness information is used to indicate the backlight brightness of the display screen.
  • the backlight brightness information can be a backlight brightening multiple or a backlight brightness value.
  • the backlight brightening multiple includes 1 times (expressed as x1), 2 times (expressed as x2), and so on. It should be understood that the larger the backlight brightening multiple, the higher the backlight brightness of the display screen.
  • the backlight brightness value is different from the backlight brightening multiple.
  • the backlight brightness value refers to the specific value of the backlight brightness of the display screen. This article mainly takes the backlight brightness information as the backlight brightening multiple as an example.
  • S204 may be executed or not executed, so S204 is indicated by a dotted line in FIG. 2 .
  • the present embodiment does not limit S202,
  • the execution order between S203 and S204, for example, S204 can be executed before S203, or before S202. It should be noted that if S204 is executed before S202, then after S204 is executed, S205a or S205b may be directly executed without executing S202 and S203.
  • S205a Determine a highlight area on the first image according to the highlight map of the first image.
  • the highlight map of the first image is read according to the storage path.
  • the highlight area on the first image can be determined based on the highlight map. For example, the mobile phone determines a first pixel point (one or more pixels) whose pixel value on the highlight map is within a first preset range (for example, within a range of 230-255), and determines a corresponding second pixel point (including one or more pixels) on the first image based on the first pixel point.
  • the position of the first pixel point on the highlight map is the same as the position of the second pixel point on the first image, and the area where the second pixel point on the first image is located is the highlight area.
  • S205b Determine the highlight area and backlight brightness information of the first image according to the image content of the first image and/or the histogram of the first image.
  • Mode A determining the highlight area and backlight brightness information of the first image according to the image content of the first image.
  • the mobile phone determines a highlight area of the first image according to image content of the first image.
  • the mobile phone can identify the objects contained in the first image by image semantic recognition, and determine the highlight area of the first image according to the recognition result. For example, when the mobile phone recognizes that the first image includes a light source, the area where the light source is located is determined as the highlight area. For example, when the mobile phone recognizes that the first image includes clouds, the area where the clouds are located is determined as the highlight area.
  • the mobile phone determines whether the first image includes a preset object through an image semantic recognition method, and if so, determines that the area where the preset object is located on the first image is a highlight area.
  • the preset object can be the sun, the moon, a street lamp, a cloud, a snow scene, a wall, etc.
  • the preset object can be pre-stored in the mobile phone when the mobile phone leaves the factory.
  • the mobile phone may include an algorithm model A, which is used to determine the highlight map of the image based on the image content.
  • the input parameter of the algorithm model A is an image
  • the output parameter is a highlight map. Please refer to the above description for the highlight map.
  • the mobile phone uses the first image as an input parameter to run the algorithm model A, and the algorithm model A recognizes the first image through image semantic recognition, and recognizes that the first image includes a preset object (for example, a street lamp), so the algorithm model A adjusts the pixel value of the pixel point in the area where the street lamp is located on the first image to a first pixel value, and the first pixel value can be any value in the range of 230-255, for example, and adjusts the pixel value of the pixel point in other areas to a second pixel value, and the second pixel value is any value in the range of 0-30, for example, to obtain the highlight map of the first image, as shown in (b) in Figure 4.
  • the mobile phone obtains the highlight map of the first image through the algorithm model A, it can determine the highlight area on the first image according to the highlight map, and please refer to S205a above for details.
  • the preset object can be refined into a first preset object and a second preset object.
  • the first preset object includes the sun, the moon, a street lamp, etc.
  • the second preset object includes clouds, snow scenes, walls, etc.
  • the mobile phone can first determine whether the first image is a high dynamic range image or a low dynamic range image.
  • the mobile phone can use the minMaxLoc function to find the brightest pixel and the darkest pixel on the first image, and then determine whether the brightness difference between the brightest pixel and the darkest pixel is higher than the preset brightness difference. If so, it is determined that the first image is a high dynamic range image, otherwise, it is determined that the first image is a low dynamic range image.
  • the preset brightness difference can be set in advance. If the first image is a high dynamic range image, the mobile phone determines whether the first preset object is included in the first image by an image semantic recognition method. If so, it is determined that the area where the first preset object is located on the first image is a highlight area. If the first image is a low dynamic range image, the mobile phone determines whether the second preset object is included in the first image by an image semantic recognition method. If so, it is determined that the area where the second preset object is located on the first image is a highlight area.
  • the mobile phone may include two algorithm models, for example, algorithm model B and algorithm model C.
  • the input parameter of algorithm model B is a high dynamic range image, and the output parameter is a highlight map.
  • the input parameter of algorithm model C is a low dynamic range image, and the output parameter is a highlight map. Therefore, after the mobile phone determines the first image to be displayed, it can first determine whether the first image is a high dynamic range image or a low dynamic range image. If the first image is a high dynamic range image, it is calculated by algorithm model B. If the first image is a low dynamic range image, it is calculated by algorithm model C. Among them, the calculation principles of algorithm model B and algorithm model C are the same as those of algorithm model A in the previous text.
  • algorithm model A uses a preset object
  • algorithm model B uses the first preset object
  • algorithm model C uses the second preset object.
  • algorithm model B uses an image semantic recognition algorithm to recognize the first image.
  • algorithm model B adjusts the pixel values of the pixels in the area where the street lamp is located on the first image to a first pixel value (e.g., any value in the range of 230-255), and adjusts the pixel values of the pixels in other areas to a second pixel value (e.g., any value in the range of 0-30), thereby obtaining a highlighted map of the first image.
  • the mobile phone obtains the first image through algorithm model B. After obtaining the highlight map of the image, the highlight region on the first image is determined according to the highlight map of the first image. For details, please refer to S205a above.
  • the highlighted map can be stored.
  • the mobile phone determines through S204 that the highlighted map of the first image is stored in the mobile phone, then reads the highlighted map of the first image, and then determines the highlighted area of the first image according to the highlighted map (i.e., S205a), without having to determine the highlighted area of the first image according to the image content and/or histogram.
  • the storage path, image size, and other information of the highlighted map can be written into the JPEG format file of the first image.
  • the JPEG format file includes multiple markers, and the information of the highlighted map (storage path, image size, etc.) can be located in any of the multiple markers.
  • the information of the highlighted map can be located in reserved markers.
  • the mobile phone determines backlight brightness information according to the image content of the first image.
  • the mobile phone can identify the environment of the first image by image semantic recognition, and determine the backlight brightness information according to the recognition result.
  • the environment of the first image refers to the shooting environment reflected by the first image, such as indoors, outdoors, daytime, night, etc.
  • the backlight brightness information can be a backlight brightening multiple or a backlight brightness value.
  • the backlight brightness information is a backlight brightening multiple as an example, if the mobile phone recognizes that the environment in which the first image is located is daytime and/or indoors, then the backlight brightening multiple is determined to be multiple A; if the mobile phone recognizes that the environment in which the first image is located is night and/or outdoors, then the backlight brightening multiple is determined to be multiple B. Multiple A is higher than multiple B, for example, multiple A is 4 times and multiple B is 3 times.
  • the mobile phone may include an algorithm model D.
  • the input parameter of the algorithm model D is an image
  • the output parameter is the backlight brightening multiple.
  • the mobile phone uses the first image as an input parameter to run the algorithm model D.
  • the algorithm model D recognizes the environment in which the first image is located by image semantic recognition, and different environments are represented by different environmental parameters. For example, if the environment is daytime, the corresponding environmental parameter is 00, if the environment is night, the corresponding environmental parameter is 11, if the environment is indoors, the corresponding environmental parameter is 01, and if the environment is outdoor, the corresponding environmental parameter is 10.
  • the algorithm model D determines the environmental parameters of the first image, it determines the backlight brightening multiples corresponding to the environmental parameters of the first image according to the correspondence between the pre-stored environmental parameters and the backlight brightening multiples, and outputs the backlight brightening multiples.
  • the environment in which the image is located can be further subdivided, for example, night can be subdivided into late night, evening, etc. If the mobile phone recognizes that the environment in which the first image is located is evening, the backlight brightening multiple is determined to be multiple C. If the environment in which the first image is located is late night, the backlight brightening multiple is determined to be multiple D. Multiple C is higher than multiple D.
  • the backlight brightness information can be stored.
  • the mobile phone determines the backlight brightness information.
  • the mobile phone determines through S204 that the backlight brightness information is stored in the mobile phone, and then reads the backlight brightness information.
  • the mobile phone can store the backlight brightness information in a JPEG format file corresponding to the first image.
  • a JPEG format file includes multiple markers, and the backlight brightness information can be in any of the multiple markers.
  • there are reserved markers in a JPEG format file and the backlight brightness information can be stored in the reserved markers.
  • Mode B determining the highlight area and backlight brightness information of the first image according to the histogram of the first image.
  • a histogram refers to counting the number of pixels for each pixel value in the range of 0-255 on an image. For example, count the number of pixels with a pixel value of 0 on an image and the number of pixels with a pixel value of 255 on an image, and then mark the statistical results in a coordinate system to form a histogram.
  • the horizontal axis of the coordinate system represents the pixel value
  • the vertical axis represents the number of pixels. For example, if there are 100 pixels with a pixel value of 255 on an image, then mark a point in the coordinate system with a horizontal axis of 255 and a vertical axis of 100.
  • Histograms include global histograms and local histograms. The difference is that the global histogram counts the entire image, while the local histogram divides the image into multiple regions and counts each region separately. Assume that an image is divided into 6*6 regions, count the number of pixels for each pixel value in the range of 0-255 in the first row and first column, and count the number of pixels for each pixel value in the range of 0-255 in the first row and second column, and so on.
  • the mobile phone determines a highlight area of the first image according to a histogram of the first image.
  • the mobile phone divides the first image into N areas, where N is a positive integer, and the specific value of N can be set in advance.
  • the mobile phone counts the number of pixels of each pixel value in the range of 0-255 in each of the N areas to obtain a local histogram of the first image.
  • the mobile phone determines M areas in the N areas, where M is a positive integer less than or equal to N, and each of the M areas satisfies: the average pixel value is higher than a threshold value 1 (for example, 230), and/or the number of pixels with a pixel value higher than the threshold value 1 exceeds a preset number W 1 , for example, at least half of the pixels in each area have a pixel value higher than the threshold value 1 (for example, 230).
  • the mobile phone determines the M areas, it can determine that the M areas are highlight areas of the first image.
  • the value of the threshold 1 may be different.
  • the mobile phone may determine that the first image is a high dynamic range image. If it is a high dynamic range image or a low dynamic range image, if it is a high dynamic range image, the value of threshold 1 is X1, if it is a low dynamic range image, the value of threshold 1 is X2, and X1 can be lower than X2.
  • the brightness difference of objects on the low dynamic range image is not obvious, so only when the value of threshold 1 is larger, the highlight area can be determined more accurately, and the high dynamic range image has a large brightness difference and generally has a dark background, so the threshold 1 does not need to be large to determine the highlight area.
  • the mobile phone can use the minMaxLoc function to find the brightest pixel and the darkest pixel on the first image, and then determine whether the brightness difference between the brightest pixel and the darkest pixel is higher than the preset brightness difference. If so, it is determined that the first image is a high dynamic range image, otherwise, it is determined that the first image is a low dynamic range image.
  • Another possible way is that after the mobile phone determines the M areas, it can determine K areas in the M areas according to the global histogram, where K is a positive integer less than or equal to M, and determine the K areas as highlight areas.
  • one possible way for the mobile phone to determine K areas in the M areas according to the global histogram is to perform the following process for each area in the M areas: 1. Determine the number of pixels in the area whose pixel values are higher than the threshold 1 as S1. 2. The mobile phone determines the total number of pixels in the entire image of the first image whose pixel values are higher than the threshold 1 as S2 according to the global histogram. 3. Determine whether S1/S2 is higher than the threshold 2 (for example, 5%). If so, determine that this area meets the conditions; otherwise, determine that this area does not meet the conditions. The above process is performed once for each area in the M areas, and K areas that meet the conditions are determined in the M areas.
  • the value of the above threshold 2 may be different.
  • the mobile phone may determine whether the first image is a high dynamic range image or a low dynamic range image. If it is a high dynamic range image, the value of threshold 2 is X3, and if it is a low dynamic range image, the value of threshold 2 is X4. X3 may be lower than X4.
  • threshold 2 may be a value within 5%-10%, and for a low dynamic range image, threshold 2 may be a value within 50%-60%.
  • the value of threshold 2 is relatively low
  • the number of pixels in the highlight area (such as the area where the cloud or snow scene is located) on the low dynamic range image is relatively large, for example, accounting for 50%-60% of the total number of pixels in the entire image, so the value of threshold 2 is relatively high.
  • the value of threshold 2 may be related to the value of N.
  • N when N is larger, that is, an image is divided into more regions and the number of pixels in each region is smaller, then S1 decreases and S1/S2 becomes smaller (S2 is fixed), so the value of threshold 2 is smaller; conversely, when N is smaller, that is, an image is divided into fewer regions and the number of pixels in each region is larger, then S1 increases and S1/S2 becomes larger (S2 is fixed), so the value of threshold 2 is larger.
  • the mobile phone determines backlight brightness information according to the histogram of the first image.
  • the mobile phone determines the global histogram of the first image, it determines based on the global histogram that the number of pixels on the first image with pixel values higher than threshold 3 (e.g., 230) exceeds a preset number W 2 , and/or the ratio of the number of pixels on the first image with pixel values higher than threshold 3 (e.g., 230) to the total number of pixels in the first image exceeds a preset ratio P 1 , indicating that the first image is brighter overall, and then determines the backlight brightening multiple to be multiple E.
  • threshold 3 e.g., 230
  • the backlight brightness information may be a backlight brightening multiple or a backlight brightness value, and here the backlight brightness information is taken as an example of the backlight brightening multiple.
  • the mobile phone determines based on the global histogram that the number of pixels on the first image with pixel values lower than threshold 4 (for example, 30) exceeds a preset number W 3 , and/or the ratio of the number of pixels on the first image with pixel values lower than threshold 4 (for example, 30) to the total number of pixels of the first image exceeds a preset ratio P 2 , indicating that the first image is dark as a whole, and then determines that the backlight brightening multiple is multiple F.
  • Multiple E is higher than multiple F.
  • threshold 3 may be higher than threshold 4, for example, threshold 3 is any value in the range of 230-255, and threshold 4 is any value in the range of 0-30.
  • the specific values of preset number W 2 , preset number W 3 , preset ratio P 1 and preset ratio P 2 are not limited in the embodiments of the present application.
  • S206 Determine the highlight area and backlight brightness information of the first image according to the Exif information of the first image.
  • the parameters used when shooting the image will be stored, such as exposure information, aperture value, flash, lens focal length, depth of field, and shutter times. These parameters form exchangeable image file format (Exchangeable image file format, Exif) information and are stored in the mobile phone. Therefore, for locally shot images, the mobile phone can determine the highlight area and backlight brightness information of the image based on the Exif information of the image. For third-party images, since they are not shot locally on the mobile phone, there is no Exif information corresponding to the third-party images in the mobile phone, so for third-party images, the highlight area and backlight brightness information are determined by the image content or histogram.
  • the mobile phone determines the highlight area of the first image according to the Exif information of the first image by determining, according to the exposure information, that an area with a higher exposure intensity on the first image is the highlight area.
  • the mobile phone determines the backlight brightness information according to the Exif information of the first image by: the mobile phone determines the backlight brightness information according to the exposure information.
  • the mobile phone stores a correspondence between the exposure information and the backlight brightness information, and determines the backlight brightness information based on the exposure information in the Exif information and the correspondence.
  • the non-highlighted area refers to other areas on the first image except the highlighted area.
  • a possible implementation of S207 is that the mobile phone reduces the grayscale value of each pixel in the non-highlight area on the first image, and keeps the grayscale value of each pixel in the highlight area unchanged, to obtain a second image.
  • the mobile phone may first determine how much the grayscale value is reduced, that is, the grayscale change value ⁇ .
  • the mobile phone determines the grayscale change value ⁇ based on the backlight brightness information, that is, the grayscale change value ⁇ is related to the backlight brightness information.
  • the process of the mobile phone determining the grayscale change value ⁇ based on the backlight brightening multiple includes: the mobile phone stores a correspondence between the backlight brightening multiple and the grayscale change value ⁇ , and based on the correspondence, determines the grayscale change value ⁇ corresponding to the backlight brightening multiple.
  • the correspondence is pre-stored in the mobile phone, and the correspondence can be, for example, the following table:
  • the grayscale value of each pixel in the non-highlight area of the first image is reduced by 10.
  • the grayscale value of each pixel in the non-highlight area of the first image is reduced by 20.
  • the grayscale change value ⁇ of the non-highlighted area on the first image is related to the backlight brightness information (for example, the backlight brightening multiple), and the higher the backlight brightening multiple, the larger the grayscale change value ⁇ of the non-highlighted area.
  • the backlight brightness information for example, the backlight brightening multiple
  • the overall brightness of the first image is increased, that is, the brightness of both the highlighted area and the non-highlighted area is increased, and the brightness contrast (i.e., dynamic range) of the highlighted area and the non-highlighted area cannot be enhanced.
  • the mobile phone before displaying the image, the mobile phone first reduces the grayscale value of the pixel point in the non-highlighted area on the image, and the grayscale value of the pixel point in the highlighted area remains unchanged to obtain a new image, and then adjusts the backlight brightness of the display screen according to the backlight brightening multiple, and displays the new image on the display screen.
  • the grayscale change value ⁇ of the non-highlight area is determined according to the backlight brightening multiple, and the higher the backlight brightening multiple, the larger the grayscale change value ⁇ , taking the backlight brightening multiple in the above table as x1 and the grayscale change value ⁇ as 10, when the grayscale value of the non-highlight area on the image decreases by 10, the non-highlight area becomes darker, and when the backlight brightening multiple of the display is x1, the backlight brightness of the display can just compensate for the darkening of the non-highlight area.
  • the non-highlight area on the new image can be restored to its original brightness, because although the grayscale value of the non-highlight area on the new image decreases, causing the non-highlight area to darken, the backlight brightness of the display compensates for the darkening of the non-highlight area.
  • the grayscale value of the highlight area on the new image remains unchanged, when the display displays the new image, due to the backlight brightness of the display, the highlight area on the new image is brighter. In this way, when the display displays the new image, the brightness contrast between the highlight area and the non-highlight area is enhanced, that is, the dynamic range of the image display is improved.
  • the mobile phone when the mobile phone recognizes that the environment in which the first image is located is daytime and/or indoors, it determines that the backlight brightening multiple is multiple A; when the mobile phone recognizes that the environment in which the first image is located is night and/or outdoor, it determines that the backlight brightening multiple is multiple B. Multiple A is higher than multiple B. This is because, in the embodiment of the present application, the mobile phone needs to first reduce the brightness of the non-highlight area on the image (that is, reduce the grayscale value of the pixel points in the non-highlight area).
  • the pixel change value ⁇ of the non-highlight area is positively correlated with the backlight brightening multiple, that is, the more the brightness of the non-highlight area is reduced, the greater the backlight brightening multiple. Therefore, if an image is located in the dark environment (such as (a) in Figure 4), since the details on the image itself are unclear, if the brightness of the non-highlight area is reduced too much, more details will be lost, so the brightness of the non-highlight area is reduced less (that is, the grayscale change value ⁇ is smaller), and the corresponding backlight brightening multiple can be smaller.
  • the grayscale change value ⁇ is larger
  • the corresponding backlight brightening multiple can be larger. Therefore, if an image is in the dark, the grayscale change value ⁇ is small, and the corresponding backlight brightening multiple is low. If an image is in the daytime, the grayscale change value ⁇ is large, and the corresponding backlight brightening multiple is high.
  • the mobile phone reduces the gray value of each pixel in the first image (for example, reduces the gray value change value ⁇ ) to obtain a third image, and the mobile phone splices the image blocks in the highlight area on the first image with the image blocks in the first area on the third image to obtain the second image.
  • the first area on the third image is located at the same position as the non-highlight area on the first image.
  • S208 Adjust the backlight brightness of the display screen according to the backlight brightness information.
  • the backlight brightness information can be a backlight brightening multiple or a backlight brightness value.
  • the backlight brightness information as the backlight brightening multiple as an example, for example, the backlight brightening multiple is x2, and the current multiple of the display is x1, then the display backlight brightness multiple is increased to x2.
  • the mobile phone includes a microcontroller unit (MCU), and the MCU is responsible for adjusting the brightness of the backlight of the display screen.
  • the backlight is a light source located behind the display screen, that is, an auxiliary light-emitting device, and its light-emitting effect will affect the visual effect of the display screen. Regarding the backlight, this application will not go into details.
  • the MCU can adjust the brightness of the backlight according to the backlight.
  • the processor e.g., central processing unit
  • the processor executes S207, it can send an instruction to the MCU, the instruction including the backlight brightness information, and after the MCU receives the instruction, it adjusts the brightness of the backlight source according to the backlight brightness information.
  • the brightness of the highlighted area in the second image remains unchanged, while the non-highlighted area becomes darker (the grayscale value decreases by ⁇ ). Therefore, after the mobile phone adjusts the backlight brightness of the display, when the second image is displayed on the display, the backlight brightness of the display compensates for the darkening of the non-highlighted area, and because the grayscale value of the highlighted area remains unchanged, the backlight brightness of the display makes the brightness of the highlighted area higher. In this way, when the display displays the second image, the contrast between the highlighted area and the non-highlighted area is enhanced, that is, the dynamic range is improved.
  • a switch may be further provided in the mobile phone.
  • the mobile phone uses the image display method provided in the embodiment of the present application for display, that is, the mobile phone executes the process of Figure 2.
  • the switch When the switch is in the off state, one way is that when the mobile phone receives an operation for opening the first image, the first image is directly displayed without executing the process of Figure 2; or, the mobile phone may also execute part of the process in Figure 2, for example, after the mobile phone receives an operation for opening the first image, it determines whether the first image is a third-party image or a locally captured image, and if it is a third-party image, the first image is directly displayed, and if it is a locally captured image, it is displayed using the method of S206-S209.
  • FIG5 is a schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present application.
  • the electronic device 500 may be the mobile phone mentioned above.
  • the electronic device 500 may include: one or more processors 501; one or more memories 502; a communication interface 503, and one or more computer programs 504, and the above-mentioned devices may be connected via one or more communication buses 505.
  • the one or more computer programs 504 are stored in the above-mentioned memory 502 and are configured to be executed by the one or more processors 501, and the one or more computer programs 504 include instructions.
  • the instruction can be used to execute the relevant steps of the mobile phone in the corresponding embodiment above, for example, the steps of the mobile phone in the embodiment shown in FIG2.
  • the communication interface 503 is used to realize the communication between the electronic device 500 and other devices, for example, the communication interface may be a transceiver.
  • the method provided by the embodiments of the present application is introduced from the perspective of an electronic device (e.g., a mobile phone) as an execution subject.
  • the electronic device may include a hardware structure and/or a software module to implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the functions described above is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof.
  • all or part of the embodiments can be implemented in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • 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.
  • the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein.
  • the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
  • SSD Solid State Disk
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer program that directs a computer or other programmable data processing device to work in a specific manner.
  • the instructions stored in the computer-readable memory generate a product including an instruction device, which implements the functions specified in one or more processes in the flowchart and/or one or more blocks in the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Control Of Indicators Other Than Cathode Ray Tubes (AREA)

Abstract

一种图像显示方法与电子设备,用于提升图像显示的动态范围。电子设备确定待显示的第一图像之后,根据第一图像的图像内容或直方图,确定第一图像的高亮区域以及显示屏(194)的背光亮度信息,将第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像,根据背光亮度信息,调整显示屏(194)的背光亮度,然后在显示屏(194)上显示第二图像。

Description

一种图像显示方法与电子设备
相关申请的交叉引用
本申请要求在2023年08月29日提交中国国家知识产权局、申请号为202311114974.8、申请名称为“一种图像显示方法与电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中;本申请要求在2023年09月11日提交中国国家知识产权局、申请号为202311174552.X、申请名称为“一种图像显示方法与电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种图像显示方法与电子设备。
背景技术
人眼的动态范围非常大(10-6~10-8),能够感受到真实世界的高动态范围(High-Dynamic Range,简称HDR)。相比于人眼,显示器能显示的亮度范围小,所以显示器无法完全还原真实世界的高动态范围。因此,如何提升图像显示的动态范围是需要研究的问题。
发明内容
本申请实施例提供的一种图像显示方法与电子设备,有助于提升确定图像显示的动态范围。
第一方面,提供一种图像显示方法,应用于电子设备。该方法包括:确定待显示的第一图像;根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息,所述高亮区域是所述第一图像上亮度值大于第一阈值的区域;将所述第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像,所述非高亮区域是所述第一图像上所述高亮区域以外的其它区域;根据所述背光亮度信息,调整所述显示屏的背光亮度;在所述显示屏上显示所述第二图像。
本申请实施例中,手机在显示图像之前,先将图像上非高亮区域变暗(例如,降低非高亮区域内像素点的灰度值),高亮区域的亮度保持不变(即,高亮区域内像素点的灰度值保持不变),得到新图像,然后根据背光亮度信息,调整显示屏背光亮度,并在调整了背光亮度后的显示屏上显示新图像。由于显示屏背光亮度的作用,显示屏显示新图像时,新图像上高亮区域更亮了,而且显示屏背光亮度能够补偿非高亮区域的变暗,使得非高亮区域不至于过暗,所以高亮区域和非高亮区域的亮度对比增强了,即提升了图像显示的动态范围。
在一种可能的设计中,根据所述第一图像的图像内容,确定所述第一图像的高亮区域,包括:根据所述第一图像的图像内容,判断所述第一图像上是否所包含预设对象;若是,确定所述第一图像上所述预设对象所在区域为高亮区域。
在本申请实施例中,电子设备可以通过图像语义识别的方式确定图像上的高亮区域,例如,图像上光源所在区域是高亮区域。如此,手机在显示图像之前,先将图像上非光源所在区域变暗(例如,降低非光源所在区域内像素点的灰度值),光源所在区域的亮度保持不变,得到新图像,然后根据背光亮度信息,调整显示屏背光亮度,并在调整了背光亮度后的显示屏上显示新图像。由于显示屏背光亮度的作用,显示屏显示新图像时,新图像上光源所在区域更亮了,而且显示屏背光亮度能够补偿非光源所在区域的变暗,使得非光源所在区域不至于过暗,所以光源所在区域和非光源所在区域的亮度对比增强了,即提升了图像显示的动态范围。
在一种可能的设计中,根据所述第一图像的图像内容,确定所述第一图像的高亮区域,包括:将所述第一图像作为输入参数运行第一算法模型,得到第一图像的高亮导图;所述第一算法模型用于在识别出所述第一图像上包含预设对象时,将所述第一图像上所述预设对象所在区域内的像素点的像素值调整为第一像素值,将其它区域内的像素点的像素值调整为第二像素值,得到所述高亮导图,所述第一像素值低于所述第二像素值;根据所述高亮导图,确定所述第一图像的高亮区域。
在本申请实施例中,电子设备可以通过高亮导图确定图像上的高亮区域,这种方式比较便捷,效率较高,即能够以较快的速度确定出高亮区域。
在一种可能的设计中,根据所述高亮导图,确定所述第一图像的高亮区域,包括:确定所述高亮导图上像素值是所述第一像素值的第一像素点;根据所述第一像素点,在所述第一图像上确定第二像素点,第二像素点在所述第一图像上的位置与所述第一像素点在所述高亮导图的位置相同;确定所述第二像素点所在区域为所述高亮区域。
在本申请实施例中,电子设备可以通过高亮导图确定图像上的高亮区域,效率较高。
在一种可能的设计中,根据所述第一图像的直方图,确定所述第一图像的高亮区域,包括:将所述第一图像划分为N个区域,确定所述N个区域中每个区域的局部直方图,N为正整数;根据所述局部直方图,在所述N个区域中确定M个区域,M为小于或等于N的正整数,所述M个区域中每个区域满足:平均像素值高于第二阈值,和/或,像素值高于第二阈值的像素点个数超过预设数量;确定所述M个区域为所述高亮区域。
在本申请实施例中,电子设备可以根据第一图像的直方图,确定第一图像的高亮区域,这种方式所确定的高亮区域比较准确。
在一种可能的设计中,确定所述M个区域为所述高亮区域之前,还包括:根据所述第一图像的全局直方图,在所述M个区域中确定K个区域,K为小于或等于M的正整数,其中,所述K个区域中每个区域满足:S1与S2的比值高于第一比值,S1是所述每个区域内像素值高于所述第二阈值的像素点个数,S2是所述第一图像上像素值高于所述第二阈值的所有像素点的个数;确定所述M个区域为所述高亮区域,包括:确定所述K个区域为所述第一图像的高亮区域。
在本申请实施例中,电子设备可以根据第一图像的全局直方图和局部直方图,确定第一图像的高亮区域,提升确定的高亮区域的准确性。
在一种可能的设计中,所述第一图像是高动态范围图像,所述第二阈值的取值为第一值;所述第一图像是低动态范围图像,所述第二阈值的取值为第二值,所述第一值低于所述第二值。
在本申请实施例中,考虑到低动态范围图像上物体的亮度差异不明显,所以第二阈值取值较大时,才能比较准确的确定出高亮区域,而高动态范围图像由于图像上亮度差异大,一般背景较暗,所以第二阈值不需要取值较大就可以确定出高亮区域。通过这种方式,能够比较准确的确定出各种图像上的高亮区域。
在一种可能的设计中,所述第一图像是高动态范围图像,所述第一比值的取值为第三值;所述第一图像是低动态范围图像,所述第一比值的取值为第四值,所述第三值低于所述第四值。
在本申请实施例中,考虑到高动态范围图像上高亮区域(例如光源所在区域)内的像素点个数较少,例如占整个图像的像素点总数的5%-10%,所以第一比值设置较低;而低动态范围图像上高亮区域(例如云或雪景所在区域)内的像素点个数较多,例如占整个图像上像素点总数的50%-60%,所以第一比值设置较高。通过这种方式,能够比较准确的确定出各种图像上的高亮区域。
在一种可能的设计中,根据所述第一图像的图像内容,确定所述显示屏的背光亮度信息,包括:根据所述第一图像的图像内容,确定所述第一图像所处环境;根据所述环境,确定背光亮度信息。
在本申请实施例中,电子设备根据第一图像的图像内容,确定显示屏的背光亮度信息,这种方式所确定的背光亮度信息,比较符合图像所处环境。
在一种可能的设计中,所述背光亮度信息包括背光提亮倍数;所述环境是室外或白天时,确定所述背光提亮倍数为第一倍数;所述环境是室内或黑夜时,确定所述背光提亮倍数为第二倍数,所述第一倍数高于所述第二倍数。
本申请实施例中,考虑到如果图像所处环境是黑夜,由于图像上细节本身不清楚,如果非高亮区域的亮度降低过多会导致细节丢失更多,所以非高亮区域的亮度降低的少一些,对应的背光提亮倍数可以小一些。如果一张图像所处环境是白天,由于图像上细节较多,非高亮区域的亮度降低多一些细节不容易丢失,所以非高亮区域的亮度降低的少一些,对应的背光提亮倍数可以大一些。因此,如果一张图像是黑夜,对应的背光提亮倍数低,如果一张图像是白天,对应的背光提亮倍数高。
在一种可能的设计中,根据所述第一图像的直方图,确定所述显示屏的背光亮度信息,包括:根据所述第一图像的全局直方图,确定所述第一图像上像素值低于第三阈值的像素点个数占所述第一图像的像素点总数的第二比值,根据所述第二比值,确定所述背光亮度信息;或者,根据所述第一图像的全局直方图,确定所述第一图像上像素值高于第四阈值的像素点个数占所述第一图像上像素点总数的第三比值,根据所述第三比值,确定所述背光亮度信息。
本申请实施例中,电子设备可以根据第一图像的直方图,确定显示屏的背光亮度信息,这种方式所确定的背光亮度信息比较准确。
在一种可能的设计中,在所述将所述第一图像上非高亮区域的亮度降低之前,还包括:根据所述背光亮度信息,确定像素变化值Δ;将所述非高亮区域内每个像素点的像素值减去所述像素变化值Δ。
在本申请实施例中,电子设备降低图像上非高亮区域的亮度是指,降低非高亮区域内像素点的像素值。其中,电子设备将非高亮区域的亮度降低后,会通过调整显示屏的背光亮度来补偿,以避免当显示屏上显示图像时,非高亮区域亮度过低影响用户体验。
在一种可能的设计中,所述根据所述背光亮度信息,确定像素变化值Δ,包括:根据所述背光亮度信息,以及背光亮度信息与像素值之间的对应关系,确定所述背光亮度信息对应的像素值为目标像素值,所述目标像素值与所述非高亮区域内每个像素点的当前像素值之间的差值为所述像素变化值Δ。
在一种可能的设计中,在所述根据所述第一图像的图像内容,确定所述第一图像的高亮区域和所述显示屏的背光亮度信息之前,还包括:确定所述第一图像是第三方图像,所述第三方图像不是所述电子设备本地拍摄的图像。
在本申请实施例中,考虑到电子设备使用本地摄像头拍摄图像时,会将拍摄图像时所使用的参数存储下来,所述参数例如曝光信息、光圈值、闪光灯、镜头焦距、景深、快门次数,这些参数形成Exif信息存储在电子设备中。因此,对于本地拍摄图像,电子设备可以根据图像的Exif信息,确定图像的高亮区域和背光亮度信息。对于第三方图像,由于不是本地拍摄的,手机中没有第三方图像对应的Exif信息,所以对于第三方图像,通过图像内容或直方图确定高亮区域和背光亮度信息。因此,本申请实施例提供的技术方案可以适用于第三方图像,即使用本申请实施例提供的图像显示方法显示第三方图像时,能够提升动态范围。
在一种可能的设计中,确定所述第一图像是第三方图像,包括:读取第一文件中的标志位,根据所述标志位,确定所述第一图像是第三方图像;其中,所述第一文件是所述电子设备将所述第一图像以第一图像格式存储时得到的文件,所述标志位用于指示所述第一图像是第三方图像或本地拍摄图像。
以JPEG格式为例,本申请实施例中,电子设备将图像以JPEG格式存储为文件后,文件中包括标志位(flag)。标志位用于指示图像是本地拍摄图像或第三方图像。因此,通过标志位,电子设备可以确定一张图像是本地拍摄图像还是第三方图像,比较便捷。
在一种可能的设计中,在根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息之前,还包括:根据所述第一图像的图像内容,确定所述第一图像是摄影类图像,所述摄影类图像是指图像上包括风景、人物和动物中的至少一种。
在本申请实施例中,考虑到用户对非摄影类图像(例如,微信聊天截图)的审美要求低,所以对于非摄影类图像不使用本申请实施例提供的图像显示方法,对于摄影类图像可以使用本申请实施例提供的图像显示方法来提示动态范围。
在一种可能的设计中,所述方法还包括:根据所述第一图像的图像内容,确定所述第一图像不是摄影类图像时,在所述显示屏上显示所述第一图像。
在本申请实施例中,考虑到用户对非摄影类图像(例如,微信聊天截图)的审美要求低,所以如果一张待显示图像是非摄影类图像,则直接显示该图像,不需要执行本申请实施例提供的图像显示方法。
在一种可能的设计中,所述方法还包括:存储所述第一图像的高亮导图以及所述背光亮度信息。
在本申请实施例中,电子设备确定出第一图像的高亮导图和背光亮度信息之后,可以将高亮导图和背光亮度信息存储下来,下次检测到用户要打开第一图像时,读取高亮导图和背光亮度信息即可,不需要根据第一图像的图像内容和/或直方图确定高亮区域和背光亮度信息,效率较高。
在一种可能的设计中,所述方法还包括:响应于第一操作,在所述显示屏上取消显示所述第二图像;接收到用于再次打开所述第一图像的操作时,读取所述高亮导图以及所述背光亮度信息;根据所述高亮导图,确定所述第一图像上的高亮区域;将所述第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第三图像,所述非高亮区域是所述第一图像上所述高亮区域以外的其它区域;根据所述背光亮度信息,调整所述显示屏的背光亮度;在所述显示屏上显示所述第三图像。
在本申请实施例中,电子设备确定出第一图像的高亮导图和背光亮度信息之后,可以将高亮导图和背光亮度信息存储下来,下次检测到用户要打开第一图像时,读取高亮导图和背光亮度信息即可,不需要根据第一图像的图像内容和/或直方图确定高亮区域和背光亮度信息,效率较高。
在一种可能的设计中,在根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息之前,还包括:确定所述电子设备中不存在所述第一图像的高亮导图和所述背光亮度信息;所述高亮导图是所述第一图像的灰度图且所述灰度图上像素值处于第一预设范围内的像素点与所述第一图像上高亮区域内的像素点对应。
在本申请实施例中,电子设备确定待显示的第一图像之后,可以先判断是否存储有高亮导图和背光亮度信息,如果没有,则根据第一图像的图像内容和/或直方图确定高亮区域和背光亮度信息,如果有,则读取高亮导图和背光亮度信息,效率较高。
第二方面,还提供一种电子设备,包括:
处理器,存储器,以及,一个或多个程序;
其中,所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述电子设备执行如上述第一方面提供的方法步骤。
第三方面,提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如上述第一方面所述的方法。
第四方面,提供一种计算机程序产品,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如上述第一方面所述的方法。
第五方面,还提供一种芯片,所述芯片与电子设备中的存储器耦合,用于调用存储器中存储的计算机程序并执行本申请实施例第一方面的技术方案,本申请实施例中“耦合”是指两个部件彼此直接或间接地结合。
上述第二方面至第五方面可以达到的技术效果,请参照上述第一方面中相应设计方案可以达到的技术效果的说明,本申请这里不再重复赘述。
附图说明
图1A为本申请一实施例提供的电子设备的硬件结构的示意图;
图1B为本申请一实施例提供的电子设备的软件结构的示意图;
图2为本申请一实施例提供的图像显示方法与电子设备的流程示意图;
图3为本申请一实施例提供的手机显示界面的示意图;
图4为本申请一实施例提供的第一图像与高亮导图的示意图;
图5为本申请一实施例提供的电子设备的结构示意图。
具体实施方式
以下,对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。
本申请实施例涉及的至少一个,包括一个或者多个;其中,多个是指大于或者等于两个。另外,需要理解的是,在本说明书的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为明示或暗示相对重要性,也不能理解为明示或暗示顺序。例如,第一时刻和第二时刻并不代表二者的重要程度或者代表二者的顺序,仅仅是为了区分描述。在本申请实施例中,“和/或”,仅仅是描述关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本说明书的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
在本说明书中所用,根据上下文,术语“当…时”或“当…后”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
本申请实施例提供的图像显示方法可适用于电子设备。电子设备可以具有显示屏。例如,电子设备 可以是手机、平板电脑、笔记本电脑等便捷式电子设备,还可以是手表、手环等可穿戴设备,还可以是虚拟现实(Virtual Reality,VR)设备、增强现实(Augmented Reality,AR)设备、混合现实技术(Mixed Reality,MR)设备等,总之本申请实施例不限定电子设备的具体类型。为了方便描述,本文主要以电子设备是手机为例。
图1A示出了电子设备的硬件结构的示意图。所述电子设备例如可以是手机。如图1A所示,电子设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
其中,处理器110可以执行本申请实施例提供的图像显示方法的流程。例如,处理器110可以确定待显示的第一图像,还可以判断第一图像是否是第三方图像。第三方图像不是本地拍摄图像,例如可以包括通过无线通信模块160从其它设备(例如,手机)接收的图像或者从网络上下载的图像或者电子设备本地截屏图像等等。处理器110确定待显示的第一图像是第三方图像之后,根据第一图像的图像内容和/或直方图,确定第一图像的高亮区域和显示屏194的背光亮度信息。然后,处理器110将第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像。而且,处理器110根据背光亮度信息调整显示屏194的背光亮度,并通过显示屏194显示第二图像。如此,显示屏194上显示第二图像时,由于显示屏背光亮度的作用,第二图像上高亮区域更亮了,而且显示屏背光亮度补偿了非高亮区域的变暗,使得非高亮区域不至于过暗,所以高亮区域和非高亮区域的亮度对比增强了,即提升了图像显示的动态范围。具体的实现过程将在后文说明。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170 与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备充电,也可以用于电子设备与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在本申请另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在电子设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。
显示屏194用于显示应用的显示界面等。显示屏194包括显示面板。在一些实施例中,电子设备可以包括1个或多个显示屏194。在本申请实施例中,显示屏194的背光亮度可调整,例如根据背光亮度信息来调整。假设背光亮度信息是背光提亮倍数,例如x1、x2等,背光提亮倍数越大,则背光亮度越大。
电子设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍 摄功能。其中,ISP用于处理摄像头193反馈的数据。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,以及至少一个应用程序的软件代码等。存储数据区可存储电子设备使用过程中所产生的数据(例如图像、视频等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将图片,视频等文件保存在外部存储卡中。
电子设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备可以通过一个或多个扬声器170A收听音乐,或收听免提通话等外放场景。
受话器170B,也称“听筒”,可以是一个或多个,用于将音频电信号转换成声音信号。当电子设备接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口170D用于连接有线耳机。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。
陀螺仪传感器180B可以用于确定电子设备的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。
气压传感器180C用于测量气压。在一些实施例中,电子设备通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。例如,电子设备可以利用磁传感器180D检测翻盖皮套的开合。
加速度传感器180E可检测电子设备在各个方向上(一般为三轴)加速度的大小。当电子设备静止时可检测出重力的大小及方向。
距离传感器180F,用于测量距离。电子设备可以通过红外或激光测量距离。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备通过发光二极管向外发射红外光。电子设备使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备附近有物体。当检测到不充分的反射光时,电子设备可以确定电子设备附近没有物体。
环境光传感器180L用于感知环境光亮度。电子设备可以根据感知的环境光亮度自适应调节显示屏194亮度。
指纹传感器180H用于采集指纹。
温度传感器180J用于检测温度。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM 卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备的接触和分离。
可以理解的是,图1A所示的部件并不构成对电子设备的具体限定。本申请实施例中的电子设备可以包括比图1A中更多或更少的部件。此外,图1A中的部件之间的组合/连接关系也是可以调整修改的。
图1B为本申请实施例提供的电子设备的软件结构的示意图。所述电子设备例如可以是手机。如图1B所示,电子设备的软件结构可以是分层结构,所述分层架构是将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。所述分层架构比如可以是事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的系统为例,示例性说明电子设备的软件结构。在一些实施例中,将系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,内核层以及硬件层。
应用程序层可以包括一系列应用程序包。如图1B所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图1B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
硬件层包括各种硬件,例如,wifi收发器、摄像头、显示屏等。
可以理解的是,图1B所示的软件结构并不构成对电子设备软件结构的具体限定。本申请实施例中的电子设备的软件结构可以包括比图1B中更多或更少的模块,例如,比图1B更多或更少的层数,或者,某一层中包括比图1B更多或更少的模块等等。此外,图1B中的模块之间的组合/连接关系也是可以调整修改的。
图1B中,应用程序框架层或系统库可以用于执行本申请实施例提供的图像显示方法的流程。此处主要以应用程序框架层执行为例。当硬件层中的触摸传感器(即图1A中的触摸传感器180K)接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成输入事件(包括触摸坐标,触摸操作的时间戳等信息)。应用程序框架层从内核层获取输入事件,识别该输入事件所对应的对象(例如控件、图标等),并将输入事件分发给对应的应用。以触摸操作是触摸单击操作,且单击操作所对应的对象是图库应用中的一张缩略图(可参见后文图3)为例,则输入事件被分发给应用层中的图库应用。图库应用调用应用程序框架层的接口,使得应用程序框架层判断第一图像(被点击的缩略图所对应的图像) 是否为第三方图像,如果是第三方图像,则根据第一图像的图像内容和/或直方图,确定第一图像的高亮区域和显示屏的背光亮度信息。应用程序框架层确定高亮区域之后,将第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像。而且,应用程序框架层还调用硬件层中的显示屏(即图1A中的显示屏194),并且根据背光亮度信息调整显示屏的背光亮度,然后通过显示屏显示第二图像。如此,显示屏显示第二图像时,由于显示屏背光亮度的作用,第二图像上高亮区域更亮了,而且显示屏背光亮度补偿了非高亮区域的变暗,使得非高亮区域不至于过暗,所以高亮区域和非高亮区域的亮度对比增强了,即提升了图像显示的动态范围。
下面以手机为例,结合附图介绍本申请实施例提供的图像显示方法。
请参见图2,为本申请一实施例提供的图像显示方法的流程示意图。该方法可以由手机执行,手机可以具有图1A的硬件结构和/或图1B的软件结构。如图2所示,该方法包括:
S200,获取图像。
手机获取图像的方式较多,例如,通过本地摄像头拍摄,或者,从网上下载,或者,从其它设备处接收,或者,截屏。本文将非本地摄像头拍摄的图像称为第三方图像,例如手机从网上下载、从其它设备处接收或者截屏得到图像都属于第三方图像。
应理解,手机获得图像之后可以将图像存储在手机中的图库应用中。一般,手机会以某种图像格式将图像存储为文件,所述图像格式例如联合图像专家组(Joint Photographic Experts Group,JPEG)格式、可移植网络图形(Portable Network Graphics,PNG)格式等。以JPEG格式为例,手机将图像以JPEG格式存储为文件之后,文件的后缀名为.jpeg或.jpg。
继续以JPEG格式为例,本申请实施例中,手机将图像以JPEG格式存储为文件后,文件中包括标志位(flag)。标志位用于指示图像是本地拍摄图像或第三方图像。标志位可以使用二进制表示,例如00或01。当标志位是00时,代表图像是第三方图像,当标志位是01时,代表图像是本地拍摄图像。一种可能的实现方式为,手机通过本地摄像头拍摄一张图像之后,将图像存储为JPEG格式的文件,并设置文件中的标志位为01,用于指示图像是本地拍摄图像。手机从网络下载、从其它设备处接收或者截屏得到一张图像(即第三方图像)后,将图像存储为JPEG格式的文件,并设置该文件中的标志位为00,用于指示图像是第三方图像。
本申请实施例不限定标志位在JPEG格式的文件中的具体位置。可以理解的是,基于JPEG标准,JPEG格式的文件中包括多个标记(marker),一个标记可以理解为一个字段,每个标记由2个或更多个字节组成。例如,JPEG格式的文件中至少包括SOI标记和EOI标记,SOI标记用于指示图像开始,EOI标记用于指示图像结束。本申请实施例中,标志位可以位于JPEG格式的文件中的任一个标记(或字段)中。例如,JPEG格式的文件中存在预留标记(reserved markers),标志位可以存储在reserved markers中,假设reserved markers中包括0xFF02-0xFFBF等多个字段,标志位可以存储在0xFF02-0xFFBF中的某一个字段中。
S201,接收到第一操作,第一操作用于打开第一图像。
例如,请参见图3,手机显示图库应用的界面,该界面中包括多张缩略图。缩略图可以理解为是图库应用中存储的图像的缩小版。以图3为例,手机接收到第一操作,可以是手机接收到针对某个缩略图的点击操作。以第一操作是针对例如缩略图301的点击操作为例,即第一操作用于打开缩略图301所对应的图像(即第一图像)。
S202,判断第一图像是第三方图像还是本地拍摄图像。如果第一图像是第三方图像,则执行S203,如果第一图像是本地拍摄图像,则执行S206。
如前文所述,手机将图像以JPEG格式存储为文件,文件中包括一标志位,该标志位用于指示图像是第三方图像还是本地拍摄图像。因此,手机确定待显示的第一图像之后,在待显示的第一图像所对应的文件中读取标志位,若标志位是01,确定第一图像是本地拍摄图像,若标志位是00,确定第一图像是第三方图像。
可选的,S202可以执行或不执行,所以图2中S202使用虚线表示。如果S202不执行,手机确定待显示的第一图像之后,无论第一图像是第三方图像还是本地拍摄图像,都执行S203。
S203,根据第一图像的图像内容,判断第一图像是摄影类还是非摄影类。如果是摄影类,则执行S204,如果是非摄影类,则显示第一图像。
例如,手机确定第一图像的图像内容包括文字、头像、表情包、电视剧画面、电影画面或短视频画面等,确定第一图像属于非摄影类场景。手机确定第一图像的图像内容包括风景(绿植、海水、天空、建筑等)、人物、动物等,确定第一图像属于摄影类。在本申请实施例中,对于非摄影类图像,手机可以直接显示该图像,无需执行后续步骤。
可选的,手机中可以包括算法模型,算法模型可以识别出一张图像是摄影类还是非摄影类。例如,算法模型的输入参数是一张图像,输出参数是1或0。当输出参数是1时,代表输入的图像是摄影类,当输出参数是0时,代表输入的图像是非摄影类。一种可能的实现方式为,手机将一张图像作为输入参数运行算法模型时,算法模型调用数据库,数据库中存储有大量的非摄影类图像和摄影类图像,算法模块将输入图像与数据库中的图像进行特征对比。若输入图像与数据库中的非摄影类图像的特征匹配,则输出0,代表非摄影类;若输入图像与数据库中的摄影类图像的特征匹配,则输出1,代表摄影类。示例性的,输入图像与数据库中的非摄影类图像的特征匹配,可以包括:数据库中的非摄影类图像上包括文字、表情包、字幕、头像等特征,如果输入图像中包括这些特征中的至少一个,则确定输入图像与数据库中的非摄影类图像的特征匹配。同理,输入图像与数据库中摄影类图像的特征匹配,可以包括:数据库中的摄影类图像上包括绿植、天空、建筑、海水、沙漠、人物、动物等特征,如果输入图像包括这些特征中的至少一个,确定输入图像与数据库中摄影类图像的特征匹配。
可选的,S203可以执行或不执行,本申请实施例不作限定,所以图2中S203使用虚线表示。
S204,判断手机中是否存在第一图像的高亮导图和背光亮度信息,如果是,执行S205a,否则,执行S205b。
一种可能的实现方式为,以第一图像按照JPEG格式存储为第一文件(文件的后缀名为.jpeg或.jpg)为例,手机可以在第一文件中查询是否存在第一图像的高亮导图的信息(存储路径、图像大小等)和背光亮度信息。如前文所述,JPEG格式的文件(即第一文件)中包括多个标记(marker),高亮导图的信息(存储路径、图像大小等)和背光亮度信息可以位于多个标记中的任一个或多个标记中。例如,JPEG格式的文件中存在预留标记(reserved markers),高亮导图的信息和背光亮度信息可以位于reserved markers中。假设reserved markers中包括0xFF02-0xFFBF等多个字段,高亮导图的信息和背光亮度信息可以位于0xFF02-0xFFBF中的某一个字段中,例如存储在0xFF08中。可选的,第一图像的高亮导图的信息、背光亮度信息和标志位(用于指示第一图像是第三方图像还是本地拍摄图像)可以位于同一标记或不同标记中,本申请实施例不作限定。
第一图像的高亮导图可以理解为第一图像的灰度图,灰度图上有的像素点的像素值(例如,RGB的取值)比较高,例如像素值处于230-255范围内,这些像素点看上去是白色或接近白色,其它像素点的像素值(例如,RGB的取值)比较低,例如像素值处于0-30范围内,这些像素点看上去是黑色或接近黑色。灰度图上的像素点与第一图像上的像素点一一对应,例如,灰度图上像素值较高(例如,像素值处于230-255范围内)的像素点与第一图像上高亮区域内的像素点对应,换言之,灰度图上像素值较高(例如,像素值处于230-255范围内)的像素点在灰度图上的位置与第一图像上高亮区域内的像素点在第一图像上的位置相同。例如,请参见图4中的(a)为第一图像的示意图,图4中的(b)为第一图像的高亮导图的示意图。图4中的(a)中第一图像上包括光源,图4中的(b)中第一图像的高亮导图中光源所在区域的像素点是白色或接近白色,其它区域的像素点是黑色或接近黑色。以图4中的(a)的第一图像为例,手机得到图4中的(b)所示的第一图像的高亮导图的过程可以包括:手机将第一图像作为输入参数运行算法模型A,算法模型A通过图像语义识别方式对第一图像上的物体进行识别,并识别出第一图像上包括光源,算法模型A将第一图像上光源所在区域内的像素点的像素值调整为第一像素值,第一像素值例如可以是230-255范围内的任一值,将其它区域内的像素点的像素值调整为第二像素值,第二像素值例如是0-30范围内的任一值,得到第一图像的高亮导图,如图4中的(b)。因此,第一图像的高亮导图中光源所在区域看上去是白色或接近白色(因为像素值被调整为230-255范围内的任一值),其它区域看上去是黑色或接近黑色(因为像素值被调整为0-30范围内的任一值)。
背光亮度信息用于指示显示屏的背光亮度。背光亮度信息可以是背光提亮倍数或者背光亮度值。背光提亮倍数包括1倍(表示为x1)、2倍(表示为x2)等等。应理解,背光提亮倍数越大,显示屏背光亮度越高。背光亮度值与背光提亮倍数不同,背光亮度值是指显示屏背光亮度的具体值。本文主要以背光亮度信息是背光提亮倍数为例。
可选的,S204可以执行或不执行,所以图2中S204以虚线表示。此外,本申请实施例不限定S202、 S203与S204之间的执行顺序,例如,S204可以在S203之前执行,或者,在S202之前执行。需要说明的是,如果在S202之前执行S204,那么执行完S204之后,可以不执行S202和S203,直接执行S205a或S205b。
S205a,根据第一图像的高亮导图,确定第一图像上的高亮区域。
可选的,若S204中手机在第一文件中查询到第一图像的高亮导图的信息(存储路径、图像大小等),则按照存储路径读取第一图像的高亮导图。手机读取出第一图像的高亮导图之后,可以根据高亮导图确定第一图像上的高亮区域。例如,手机确定高亮导图上像素值处于第一预设范围(例如,处于230-255范围)内的第一像素点(一个或多个像素点),并根据第一像素点,在第一图像上确定对应的第二像素点(包括一个或多个像素点),第一像素点在高亮导图上的位置与第二像素点在第一图像上的位置相同,第一图像上第二像素点所在区域为高亮区域。
S205b,根据第一图像的图像内容和/或第一图像的直方图,确定第一图像的高亮区域和背光亮度信息。
方式A,根据第一图像的图像内容,确定第一图像的高亮区域和背光亮度信息。
(1)、手机根据第一图像的图像内容,确定第一图像的高亮区域。
在本申请实施例中,手机可以通过图像语义识别的方式识别第一图像上所包含的对象,根据识别结果,确定第一图像的高亮区域。例如,手机识别出第一图像上包括光源时,确定光源所在区域为高亮区域。例如,手机识别出第一图像上包括云时,确定云所在区域为高亮区域。
一种可能的方式为,手机通过图像语义识别方法判断第一图像上是否包括预设对象,若是,则确定第一图像上预设对象所在区域是高亮区域。所述预设对象可以是太阳、月亮、路灯、云、雪景、墙等。可选的,预设对象可以在手机出厂时就预先存储于手机中。
可选的,手机中可以包括算法模型A,算法模型A用于根据图像内容确定图像的高亮导图。例如,算法模型A的输入参数是一张图像,输出参数是高亮导图。高亮导图请参见前文描述。以第一图像是图4中的(a)所示的图为例,手机将第一图像作为输入参数运行算法模型A,算法模型A通过图像语义识别方式对第一图像进行识别,并识别出第一图像上包括预设对象(例如,路灯),所以算法模型A将第一图像上路灯所在区域内的像素点的像素值调整为第一像素值,第一像素值例如可以是230-255范围内的任一值,将其它区域内的像素点的像素值调整为第二像素值,第二像素值例如是0-30范围内的任一值,得到第一图像的高亮导图,如图4中的(b)。手机通过算法模型A得到第一图像的高亮导图之后,可以根据高亮导图确定第一图像上的高亮区域,具体请参见前文的S205a。
另一种可能的方式为,预设对象可以细化为第一预设对象和第二预设对象。例如,第一预设对象包括太阳、月亮、路灯等。第二预设对象中包括云、雪景、墙等。手机可以先判断第一图像是高动态范围图像还是低动态范围图像。例如,手机可以使用minMaxLoc函数寻找第一图像上的最亮像素点和最暗像素点,然后判断最亮像素点与最暗像素点之间的亮度差值是否高于预设亮度差值,若是,则确定第一图像是高动态范围图像,否则,确定第一图像是低动态范围图像。可选的,预设亮度差值可以是事先设置好的。如果第一图像是高动态范围图像,手机通过图像语义识别方法判断第一图像上是否包括第一预设对象,若是,则确定第一图像上第一预设对象所在区域是高亮区域。如果第一图像是低动态范围图像,手机通过图像语义识别方法判断第一图像上是否包括第二预设对象,若是,确定第一图像上第二预设对象所在区域是高亮区域。
可选的,手机中可以包括两个算法模型,例如,算法模型B和算法模型C。算法模型B的输入参数是一张高动态范围的图像,输出参数是高亮导图。算法模型C的输入参数是一张低动态范围的图像,输出参数是高亮导图。因此,手机确定待显示的第一图像之后,可以先判断第一图像是高动态范围图像还是低动态范围图像,如果第一图像是高动态范围图像,则通过算法模型B计算,如果第一图像是低动态范围图像,则通过算法模型C计算。其中,算法模型B、算法模型C的计算原理与前文中的算法模型A相同,区别仅仅是算法模型A使用的是预设对象,算法模型B使用的是第一预设对象,算法模型C使用的是第二预设对象。以算法模型B为例,手机确定第一图像是高动态范围图像时,将第一图像作为输入参数运行算法模型B,算法模型B使用图像语义识别算法对第一图像进行识别,假设识别出第一图像上包括第一预设对象(例如,路灯),所以算法模型B将第一图像上路灯所在区域内的像素点的像素值调整为第一像素值(例如230-255范围内的任一值),将其它区域内的像素点的像素值调整为第二像素值(例如0-30范围内的任一值),得到第一图像的高亮导图。手机通过算法模型B得到第一 图像的高亮导图之后,根据第一图像的高亮导图确定第一图像上的高亮区域,具体请参见前文的S205a。
可选的,手机得到第一图像的高亮导图之后,可以将高亮导图存储下来,下次手机检测到用户要打开第一图像时,通过S204确定手机中存储第一图像的高亮导图,则读取第一图像的高亮导图,然后根据高亮导图确定第一图像的高亮区域(即S205a),不需要根据图像内容和/或直方图确定第一图像的高亮区域。例如,手机将第一图像的高亮导图存储在存储器之后,可以将高亮导图的存储路径、图像大小等信息写入在第一图像的JPEG格式文件中。例如,JPEG格式的文件中包括多个标记(marker),高亮导图的信息(存储路径、图像大小等)可以位于多个标记中的任一标记中。例如,高亮导图的信息可以位于reserved markers中。
(2)手机根据第一图像的图像内容,确定背光亮度信息。
在本申请实施例中,手机可以通过图像语义识别的方式识别第一图像所处环境,根据识别结果,确定背光亮度信息。第一图像所处环境是指第一图像所反映出的拍摄环境,例如室内、室外、白天、黑夜等。
如前文所述,背光亮度信息可以是背光提亮倍数或背光亮度值。以背光亮度信息是背光提亮倍数为例,手机识别出第一图像所处环境是白天和/或室内,则确定背光提亮倍数为倍数A;手机识别出第一图像所处环境是黑夜和/或室外,则确定背光提亮倍数是倍数B。倍数A高于倍数B,例如,倍数A是4倍,倍数B是3倍。一种可能的实现方式为,手机中可以包括算法模型D。算法模型D的输入参数是一张图像,输出参数是背光提亮倍数。以第一图像是图4中的(a)所示的图为例,手机将第一图像作为输入参数运行算法模型D,算法模型D通过图像语义识别方式对第一图像所处的环境进行识别,且不同环境以不同的环境参数表示,例如环境是白天,对应的环境参数为00,环境是黑夜,对应的环境参数为11,环境是室内,对应的环境参数为01,环境是室外,对应的环境参数为10。算法模型D确定第一图像的环境参数之后,根据预先存储的环境参数与背光提亮倍数之间的对应关系,确定第一图像的环境参数所对应的背光提亮倍数,并输出背光提亮倍数。
当然,图像所处环境还可以细分,例如黑夜可以细分为深夜、傍晚等。如果手机识别出第一图像所处环境为傍晚,确定背光提亮倍数为倍数C,如果第一图像所处环境为深夜,则背光提亮倍数为倍数D。倍数C高于倍数D。
可选的,本申请实施例中,手机确定背光亮度信息之后,可以将背光亮度信息存储下来,下次手机检测到用户要打开第一图像时,通过S204确定手机中存储背光亮度信息,则读取背光亮度信息即可,不需要根据第一图像的图像内容和/或直方图确定背光亮度信息。可选的,手机可以将背光亮度信息存储在第一图像对应的JPEG格式文件中。例如,JPEG格式的文件中包括多个标记(marker),背光亮度信息可以在多个标记中的任一标记中。例如,JPEG格式的文件中存在预留标记(reserved markers),背光亮度信息可以存储在reserved markers中。
方式B,根据第一图像的直方图,确定第一图像的高亮区域和背光亮度信息。
为了便于理解,先简单说明直方图。直方图是指统计图像上0-255范围内的每个像素值的像素点个数,例如,统计图像上像素值是0的像素点个数,以及图像上像素点是255的像素点个数,然后将统计结果坐标系中标出形成直方图。坐标系的横坐标代表像素值,纵坐标代表像素点个数。例如,一张图像上像素值是255的像素点总有100个,则在坐标系中标出一个点,该点的横坐标是255,纵坐标是100。直方图包括全局直方图和局部直方图,区别在于全局直方图是对整张图像统计,局部直方图是将图像划分为多个区域,对每个区域分别统计。假设一张图像被划分为6*6的区域,统计第一行第一列的区域内0-255范围内每个像素值的像素点个数,并且统计第一行第二列的区域内0-255范围内每个像素值的像素点个数,以此类推。
(1)手机根据第一图像的直方图,确定第一图像的高亮区域。
例如,手机将第一图像划分为N个区域,N为正整数,N的具体取值可以是事先设置好的。手机统计N个区域中每个区域内0-255范围内每个像素值的像素点个数,得到第一图像的局部直方图。手机根据局部直方图,在N个区域中确定M个区域,M为小于或等于N的正整数,这M个区域中每个区域满足:平均像素值高于阈值1(例如,230),和/或,像素值高于阈值1的像素点个数超过预设数量W1,例如,每个区域内有至少一半的像素点的像素值高于阈值1(例如,230)。手机确定M个区域之后,可以确定M个区域为第一图像的高亮区域。
可选的,在不同情况下,上述阈值1的取值大小可以不同。例如,手机可以判断第一图像是高动态 范围图像还是低动态范围图像,如果是高动态范围图像,则阈值1的取值为X1,如果是低动态范围图像,则阈值1的取值为X2,X1可以低于X2。这是因为,低动态范围图像上物体的亮度差异不明显,所以阈值1取值较大时,才能比较准确的确定出高亮区域,而高动态范围图像由于图像上亮度差异大,一般背景较暗,所以阈值1不需要取值较大就可以确定出高亮区域。可选的,手机可以使用minMaxLoc函数寻找第一图像上的最亮像素点和最暗像素点,然后判断最亮像素点与最暗像素点之间的亮度差值是否高于预设亮度差值,若是,则确定第一图像是高动态范围图像,否则,确定第一图像是低动态范围图像。
另一种可能的方式为,手机确定M个区域之后,可以根据全局直方图,在M个区域中确定K个区域,K为小于或等于M的正整数,确定K个区域为高亮区域。其中,手机根据全局直方图在M个区域中确定K个区域的一种可能的方式为,对M个区域中每个区域执行如下流程:1、确定该区域内像素值高于阈值1的像素点个数为S1。2、手机根据全局直方图,确定第一图像的整张图像上像素值高于阈值1的像素点总数为S2。3、确定S1/S2是否高于阈值2(例如,5%),若是,确定此区域满足条件,否则,确定此区域不满足条件。对于M个区域内的每个区域均执行一次上述流程,在M个区域中确定出满足条件的K个区域。
可选的,在不同情况下,上述阈值2的取值大小可以不同。例如,手机可以判断第一图像是高动态范围图像还是低动态范围图像,如果是高动态范围图像,则阈值2的取值为X3,如果是低动态范围图像,则阈值2的取值为X4。X3可以低于X4。例如,对于高动态范围图像,阈值2可以是5%-10%内的一个值,对于低动态范围图像,阈值2可以是50%-60%内的一个值。这是因为,考虑到一般情况下高动态范围图像上高亮区域(例如光源所在区域)内的像素点个数比较少,例如占整个图像的像素点总数的5%-10%,所以阈值2的取值较低,而低动态范围图像上高亮区域(例如云或雪景所在区域)内的像素点个数比较多,例如占整个图像上像素点总数的50%-60%,所以阈值2的取值较高。
可选的,阈值2的取值可以与N的取值相关,例如,N取值较大时,即一张图像被划分的区域越多,每个区域内的像素点越少,那么S1减少,S1/S2变小(S2是固定不变的),所以阈值2的取值较小;反之,N取值较小时,即一张图像被划分的区域越少,每个区域内的像素点越多,那么S1增多,S1/S2变大(S2是固定不变的),所以阈值2的取值较大。
(2)手机根据第一图像的直方图,确定背光亮度信息。
例如,手机确定第一图像的全局直方图之后,根据全局直方图确定第一图像上像素值高于阈值3(例如,230)的像素点个数超过预设数量W2,和/或,第一图像上像素值高于阈值3(例如,230)的像素点个数与第一图像的像素点总数的比值超过预设比值P1,说明第一图像整体偏亮,则确定背光提亮倍数为倍数E。如前文所述,背光亮度信息可以是背光提亮倍数或背光亮度值,此处以背光亮度信息是背光提亮倍数为例。再例如,手机根据全局直方图确定第一图像上像素值低于阈值4(例如,30)的像素点个数超过预设数量W3,和/或,第一图像上像素值低于阈值4(例如,30)的像素点个数与第一图像的像素点总数的比值超过预设比值P2,说明第一图像整体偏暗,则确定背光提亮倍数为倍数F。倍数E高于倍数F。可选的,阈值3可以高于阈值4,例如,阈值3是230-255范围内的任一值,阈值4是0-30范围内的任一值。预设数量W2、预设数量W3、预设比值P1和预设比值P2的具体数值本申请实施例不作限定。
S206,根据第一图像的Exif信息,确定第一图像的高亮区域和背光亮度信息。
需要说明的是,手机使用本地摄像头拍摄图像时,会将拍摄图像时所使用的参数存储下来,所述参数例如曝光信息、光圈值、闪光灯、镜头焦距、景深、快门次数,这些参数形成可交换图像文件格式(Exchangeable image file format,Exif)信息存储在手机中。因此,对于本地拍摄图像,手机可以根据图像的Exif信息,确定图像的高亮区域和背光亮度信息。对于第三方图像,由于不是手机本地拍摄的,手机中没有第三方图像对应的Exif信息,所以对于第三方图像,通过图像内容或直方图确定高亮区域和背光亮度信息。
可选的,手机根据第一图像的Exif信息,确定第一图像的高亮区域的方式可以是,手机根据曝光信息,确定第一图像上曝光强度较大的区域为高亮区域。
可选的,手机根据第一图像的Exif信息,确定背光亮度信息的方式可以是,手机根据曝光信息,确定背光亮度信息。例如,手机中存储有曝光信息与背光亮度信息之间的对应关系,基于Exif信息中曝光信息以及所述对应关系,确定背光亮度信息。
S207,将第一图像的非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像。非高亮区域是指第一图像上除高亮区域以外的其它区域。
可选的,S207的一种可能的实现方式为,手机将第一图像上非高亮区域内每个像素点的灰度值降低,高亮区域内的每个像素点的灰度值保持不变,得到第二图像。可选的,手机在降低非高亮区域内像素点的灰度值之前,可以先确定灰度值降低多少,即灰度变化值Δ。一种可能的方式为,手机根据背光亮度信息,确定灰度变化值Δ,也就是说,灰度变化值Δ与背光亮度信息有关。以背光亮度信息是背光提亮倍数为例,手机根据背光提亮倍数,确定灰度变化值Δ的过程包括:手机中存储有背光提亮倍数与灰度变化值Δ之间的对应关系,基于该对应关系,确定背光提亮倍数所对应的灰度变化值Δ。示例性的,所述对应关系是预先存储在手机中的,所述对应关系例如可以是下表:
假设手机确定显示屏的背光提亮倍数是x1,则基于上表,将第一图像上非高亮区域的每个像素点的灰度值降低10,假设手机确定显示屏的背光提亮倍数是x2,则基于上表,将第一图像上非高亮区域的每个像素点的灰度值降低20。
因此,在本申请实施例中,第一图像上非高亮区域的灰度变化值Δ与背光亮度信息(例如,背光提亮倍数)相关,而且背光提亮倍数越高,则非高亮区域的灰度变化值Δ越大。这是因为,为了使得手机显示图像时,图像上高亮区域亮度更高,需要提升显示屏背光亮度,但是显示屏背光亮度提升后,第一图像整体亮度提升,即高亮区域和非高亮区域的亮度都提升了,无法增强高亮区域和非高亮区域的亮度对比(即动态范围)。因此,本申请实施例中,手机在显示图像之前,先降低图像上非高亮区域内像素点的灰度值,高亮区域内像素点的灰度值保持不变,得到新图像,然后根据背光提亮倍数,调整显示屏背光亮度,并在显示屏上显示新图像。由于非高亮区域的灰度变化值Δ是根据背光提亮倍数确定的,而且背光提亮倍数越高,灰度变化值Δ越大,以上表中背光提亮倍数是x1,灰度变化值Δ是10为例,图像上非高亮区域的灰度值降低10时,非高亮区域变暗了,而显示屏的背光提亮倍数是x1时,显示屏的背光亮度刚好能够补偿非高亮区域的变暗。如此,手机显示新图像时,新图像上非高亮区域可以恢复到原来的亮度,因为虽然新图像上非高亮区域的灰度值降低导致非高亮区域变暗了,但是显示屏的背光亮度补偿了非高亮区域的变暗。此外,由于新图像上高亮区域的灰度值保持不变,所以显示屏显示新图像时,由于显示屏背光亮度的作用,新图像上的高亮区域更亮了,如此,当显示屏显示新图像时,高亮区域和非高亮区域的亮度对比增强了,即提升了图像显示的动态范围。
如前文所述,手机识别出第一图像所处环境是白天和/或室内,则确定背光提亮倍数为倍数A;手机识别出第一图像所处环境是黑夜和/或室外,则确定背光提亮倍数是倍数B。倍数A高于倍数B。这是因为,本申请实施例中,手机需要先降低图像上非高亮区域的亮度(即,降低非高亮区域内像素点的灰度值)。由于非高亮区域的像素变化值Δ与背光提亮倍数正相关,即非高亮区域的亮度降低越多,背光提亮倍数越大。因此,如果一张图像所处环境是黑夜(例如图4中的(a)),由于图像上细节本身不清楚,如果非高亮区域的亮度降低过多会导致细节丢失更多,所以非高亮区域的亮度降低的少一些(即灰度变化值Δ小一些),对应的背光提亮倍数可以小一些。如果一张图像所处环境是白天,由于图像上细节较多,非高亮区域的亮度降低多一些细节不容易丢失,所以非高亮区域的亮度降低的少一些(即灰度变化值Δ大一些),对应的背光提亮倍数可以大一些。因此,如果一张图像是黑夜,灰度变化值Δ小,对应的背光提亮倍数低,如果一张图像是白天,灰度变化值Δ大,对应的背光提亮倍数高。
另一种可能的实现方式为,手机将第一图像内每个像素点的灰度值均降低(例如,降低灰度变化值Δ),得到第三图像,手机将第一图像上的高亮区域内的图像块与第三图像上的第一区域内的图像块拼接得到第二图像。第三图像上的第一区域与第一图像上的非高亮区域的位置相同。
S208,根据背光亮度信息,调整显示屏的背光亮度。
如前文所述,背光亮度信息可以是背光提亮倍数或背光亮度值,以背光亮度信息是背光提亮倍数为例,例如,背光提亮倍数是x2,显示屏当前倍数是x1,则将显示屏背光亮度倍数提升到x2。
可选的,S208的一种实现方式是,手机中包括微控制单元(Microcontroller Unit,MCU),MCU负责调整显示屏的背光源((back light)的亮度。其中,背光源是位于显示屏背后的一个光源,即辅助发光器件,它的发光效果将影响到显示屏的视觉效果,关于背光源,本申请不多赘述。MCU可以根据背 光亮度信息,调整背光源的亮度。可选的,以图2所示的流程由手机中的处理器(例如,中央处理器)执行为例,那么处理器执行到S207之后,可以向MCU发送一指令,该指令中包括背光亮度信息,MCU接收到指令之后,根据背光亮度信息,调整背光源的亮度。
S209,在显示屏上显示第二图像。
相比第一图像,第二图像上高亮区域亮度不变,非高亮区域变暗了(灰度值降低了Δ)。因此,手机调整显示屏的背光亮度之后,在显示屏上显示第二图像时,显示屏的背光亮度补偿了非高亮区域的变暗,而且由于高亮区域的灰度值未变,所以显示屏的背光亮度使得高亮区域的亮度更高了。如此,显示屏显示第二图像时,高亮区域和非高亮区域的对比度增强了,即提升了动态范围。
可选的,本申请实施例中,手机中还可以设置一个开关。当开关处于开启状态时,手机使用本申请实施例提供的图像显示方法进行显示,即手机执行图2的流程。当开关处于关闭状态时,一种方式为,手机接收到用于打开第一图像的操作时,直接显示该第一图像,不需要执行图2的流程;或者,手机也可以执行图2中的部分流程,例如手机接收到用于打开第一图像的操作后,判断第一图像是第三方图像还是本地拍摄图像,如果是第三方图像,则直接显示该第一图像,如果是本地拍摄图像,则使用S206-S209的方式进行显示。
图5为本申请实施例提供的电子设备500的结构示意图。电子设备500可以是前文中的手机。如图5所示,电子设备500可以包括:一个或多个处理器501;一个或多个存储器502;通信接口503,以及一个或多个计算机程序504,上述各器件可以通过一个或多个通信总线505连接。其中该一个或多个计算机程序504被存储在上述存储器502中并被配置为被该一个或多个处理器501执行,该一个或多个计算机程序504包括指令。比如,当电子设备500是前文中的手机时,该指令可以用于执行如上面相应实施例中手机的相关步骤,例如,图2中所示的实施例中手机的步骤。通信接口503用于实现电子设备500与其他设备的通信,比如通信接口可以是收发器。
上述本申请提供的实施例中,从电子设备(例如,手机)作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。在不冲突的情况下,以上各实施例的方案都可以组合使用。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算 机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (23)

  1. 一种图像显示方法,其特征在于,应用于电子设备,所述电子设备具有显示屏,所述方法包括:
    确定待显示的第一图像;
    根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息,所述高亮区域是所述第一图像上亮度值大于第一阈值的区域;
    将所述第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第二图像,所述非高亮区域是所述第一图像上所述高亮区域以外的其它区域;
    根据所述背光亮度信息,调整所述显示屏的背光亮度;
    在所述显示屏上显示所述第二图像。
  2. 根据权利要求1所述的方法,其特征在于,根据所述第一图像的图像内容,确定所述第一图像的高亮区域,包括:
    根据所述第一图像的图像内容,判断所述第一图像上是否包含预设对象;若是,确定所述第一图像上所述预设对象所在区域为高亮区域。
  3. 根据权利要求1所述的方法,其特征在于,根据所述第一图像的图像内容,确定所述第一图像的高亮区域,包括:
    将所述第一图像作为输入参数运行第一算法模型,得到第一图像的高亮导图;所述第一算法模型用于在识别出所述第一图像上包含预设对象时,将所述第一图像上所述预设对象所在区域内的像素点的像素值调整为第一像素值,将其它区域内的像素点的像素值调整为第二像素值,得到所述高亮导图,所述第一像素值低于所述第二像素值;
    根据所述高亮导图,确定所述第一图像的高亮区域。
  4. 根据权利要求3所述的方法,其特征在于,根据所述高亮导图,确定所述第一图像的高亮区域,包括:
    确定所述高亮导图上像素值是所述第一像素值的第一像素点;
    根据所述第一像素点,在所述第一图像上确定第二像素点,第二像素点在所述第一图像上的位置与所述第一像素点在所述高亮导图的位置相同;
    确定所述第二像素点所在区域为所述高亮区域。
  5. 根据权利要求1所述的方法,其特征在于,根据所述第一图像的直方图,确定所述第一图像的高亮区域,包括:
    将所述第一图像划分为N个区域,确定所述N个区域中每个区域的局部直方图,N为正整数;
    根据所述局部直方图,在所述N个区域中确定M个区域,M为小于或等于N的正整数,所述M个区域中每个区域满足:平均像素值高于第二阈值,和/或,像素值高于第二阈值的像素点个数超过预设数量;
    确定所述M个区域为所述高亮区域。
  6. 根据权利要求5所述的方法,其特征在于,确定所述M个区域为所述高亮区域之前,还包括:
    根据所述第一图像的全局直方图,在所述M个区域中确定K个区域,K为小于或等于M的正整数,其中,所述K个区域中每个区域满足:S1与S2的比值高于第一比值,S1是所述每个区域内像素值高于所述第二阈值的像素点个数,S2是所述第一图像上像素值高于所述第二阈值的所有像素点的个数;
    确定所述M个区域为所述高亮区域,包括:
    确定所述K个区域为所述第一图像的高亮区域。
  7. 根据权利要求5或6所述的方法,其特征在于,
    所述第一图像是高动态范围图像,所述第二阈值的取值为第一值;
    所述第一图像是低动态范围图像,所述第二阈值的取值为第二值,所述第一值低于所述第二值。
  8. 根据权利要求6所述的方法,其特征在于,
    所述第一图像是高动态范围图像,所述第一比值的取值为第三值;
    所述第一图像是低动态范围图像,所述第一比值的取值为第四值,所述第三值低于所述第四值。
  9. 根据权利要求1-8任一所述的方法,其特征在于,根据所述第一图像的图像内容,确定所述显示屏的背光亮度信息,包括:
    根据所述第一图像的图像内容,确定所述第一图像所处环境;
    根据所述环境,确定背光亮度信息。
  10. 根据权利要求9所述的方法,其特征在于,所述背光亮度信息包括背光提亮倍数;
    所述环境是室外或白天时,确定所述背光提亮倍数为第一倍数;
    所述环境是室内或黑夜时,确定所述背光提亮倍数为第二倍数,所述第一倍数高于所述第二倍数。
  11. 根据权利要求1-8任一所述的方法,其特征在于,根据所述第一图像的直方图,确定所述显示屏的背光亮度信息,包括:
    根据所述第一图像的全局直方图,确定所述第一图像上像素值低于第三阈值的像素点个数占所述第一图像的像素点总数的第二比值,根据所述第二比值,确定所述背光亮度信息;
    或者,
    根据所述第一图像的全局直方图,确定所述第一图像上像素值高于第四阈值的像素点个数占所述第一图像上像素点总数的第三比值,根据所述第三比值,确定所述背光亮度信息。
  12. 根据权利要求1-11任一所述的方法,其特征在于,在所述将所述第一图像上非高亮区域的亮度降低之前,还包括:
    根据所述背光亮度信息,确定灰度变化值Δ;
    将所述非高亮区域内每个像素点的灰度值减去所述灰度变化值Δ。
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述背光亮度信息,确定灰度变化值Δ,包括:
    根据所述背光亮度信息,以及背光亮度信息与灰度变化值之间的对应关系,确定所述背光亮度信息对应的灰度变化值Δ。
  14. 根据权利要求1-13任一所述的方法,其特征在于,在根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域和所述显示屏的背光亮度信息之前,还包括:
    确定所述第一图像是第三方图像,所述第三方图像不是所述电子设备本地拍摄的图像。
  15. 根据权利要求14所述的方法,其特征在于,确定所述第一图像是第三方图像,包括:
    读取第一文件中的标志位,根据所述标志位,确定所述第一图像是第三方图像;
    其中,所述第一文件是所述电子设备将所述第一图像按照第一图像格式存储形成的文件,所述标志位用于指示所述第一图像是第三方图像或本地拍摄图像。
  16. 根据权利要求1-15任一所述的方法,其特征在于,在根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息之前,还包括:
    根据所述第一图像的图像内容,确定所述第一图像是摄影类图像,所述摄影类图像是指图像上包括风景、人物和动物中的至少一种。
  17. 根据权利要求16所述的方法,其特征在于,所述方法还包括:
    根据所述第一图像的图像内容,确定所述第一图像不是摄影类图像时,在所述显示屏上显示所述第一图像。
  18. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    存储所述第一图像的高亮导图以及所述背光亮度信息。
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:
    响应于第一操作,在所述显示屏上取消显示所述第二图像;
    接收到用于再次打开所述第一图像的操作时,读取所述高亮导图以及所述背光亮度信息;
    根据所述高亮导图,确定所述第一图像上的高亮区域;
    将所述第一图像上非高亮区域的亮度降低,高亮区域的亮度保持不变,得到第三图像,所述非高亮区域是所述第一图像上所述高亮区域以外的其它区域;
    根据所述背光亮度信息,调整所述显示屏的背光亮度;
    在所述显示屏上显示所述第三图像。
  20. 根据权利要求1-19任一所述的方法,其特征在于,在根据所述第一图像的图像内容或所述第一图像的直方图,确定所述第一图像的高亮区域以及所述显示屏的背光亮度信息之前,还包括:
    确定所述电子设备不存在所述第一图像的高亮导图和所述背光亮度信息;其中,所述高亮导图是所述第一图像的灰度图且所述灰度图上像素值处于第一预设范围内的像素点与所述第一图像上高亮区域 内的像素点对应。
  21. 一种电子设备,其特征在于,包括:
    处理器,存储器,以及,一个或多个程序;
    其中,所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述电子设备执行如权利要求1至20中任意一项所述的方法步骤。
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至20中任意一项所述的方法。
  23. 一种计算机程序产品,其特征在于,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至20中任意一项所述的方法。
PCT/CN2024/096441 2023-08-29 2024-05-30 一种图像显示方法与电子设备 Pending WO2025044350A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP24857895.7A EP4654179A4 (en) 2023-08-29 2024-05-30 IMAGE DISPLAY METHOD AND ELECTRONIC DEVICE
US19/375,050 US20260057850A1 (en) 2023-08-29 2025-10-30 Image display method and electronic device

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202311114974 2023-08-29
CN202311114974.8 2023-08-29
CN202311174552.X 2023-09-11
CN202311174552.XA CN117255163A (zh) 2023-08-29 2023-09-11 一种图像显示方法与电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US19/375,050 Continuation US20260057850A1 (en) 2023-08-29 2025-10-30 Image display method and electronic device

Publications (1)

Publication Number Publication Date
WO2025044350A1 true WO2025044350A1 (zh) 2025-03-06

Family

ID=89127308

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/096441 Pending WO2025044350A1 (zh) 2023-08-29 2024-05-30 一种图像显示方法与电子设备

Country Status (4)

Country Link
US (1) US20260057850A1 (zh)
EP (1) EP4654179A4 (zh)
CN (1) CN117255163A (zh)
WO (1) WO2025044350A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120895004A (zh) * 2025-09-27 2025-11-04 深圳市盈佳科技有限公司 基于增强学习的背光源亮度控制方法及系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117255163A (zh) * 2023-08-29 2023-12-19 华为技术有限公司 一种图像显示方法与电子设备
CN120687054A (zh) * 2024-09-19 2025-09-23 华为技术有限公司 一种显示方法及电子设备

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104658487A (zh) * 2015-03-16 2015-05-27 广东欧珀移动通信有限公司 调节图像亮度的方法、装置及移动终端
CN106409240A (zh) * 2016-09-28 2017-02-15 青岛海信电器股份有限公司 液晶显示亮度控制方法、装置及液晶显示设备
CN112164007A (zh) * 2020-09-29 2021-01-01 Oppo广东移动通信有限公司 图像显示方法和装置、终端和可读存储介质
CN112348759A (zh) * 2020-11-25 2021-02-09 Oppo广东移动通信有限公司 图像显示方法和装置、终端和可读存储介质
CN112449120A (zh) * 2019-08-30 2021-03-05 华为技术有限公司 高动态范围视频生成方法及装置
US20210248755A1 (en) * 2020-02-10 2021-08-12 Alibaba Group Holding Limited Product release method and image processing method, apparatus, device, and storage medium
CN116095503A (zh) * 2022-06-15 2023-05-09 荣耀终端有限公司 终端设备及创建/显示hdr图像的方法
CN116259281A (zh) * 2023-03-30 2023-06-13 青岛信芯微电子科技股份有限公司 一种显示设备及背光控制方法
CN117255163A (zh) * 2023-08-29 2023-12-19 华为技术有限公司 一种图像显示方法与电子设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040239796A1 (en) * 2002-09-20 2004-12-02 Seiko Epson Corporation Backlight adjustment processing of image using image generation record information
JP5165076B2 (ja) * 2011-01-31 2013-03-21 シャープ株式会社 映像表示装置
EP3304881B1 (en) * 2015-06-05 2022-08-10 Apple Inc. Rendering and displaying high dynamic range content
CN105025283A (zh) * 2015-08-07 2015-11-04 广东欧珀移动通信有限公司 一种新的色彩饱和度调整方法、系统及移动终端
CN106228936B (zh) * 2016-09-28 2019-01-22 青岛海信电器股份有限公司 背光亮度控制方法、装置及液晶显示设备
CN112863451B (zh) * 2021-01-18 2022-04-19 海信视像科技股份有限公司 显示设备和背光控制方法

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104658487A (zh) * 2015-03-16 2015-05-27 广东欧珀移动通信有限公司 调节图像亮度的方法、装置及移动终端
CN106409240A (zh) * 2016-09-28 2017-02-15 青岛海信电器股份有限公司 液晶显示亮度控制方法、装置及液晶显示设备
CN112449120A (zh) * 2019-08-30 2021-03-05 华为技术有限公司 高动态范围视频生成方法及装置
US20210248755A1 (en) * 2020-02-10 2021-08-12 Alibaba Group Holding Limited Product release method and image processing method, apparatus, device, and storage medium
CN112164007A (zh) * 2020-09-29 2021-01-01 Oppo广东移动通信有限公司 图像显示方法和装置、终端和可读存储介质
CN112348759A (zh) * 2020-11-25 2021-02-09 Oppo广东移动通信有限公司 图像显示方法和装置、终端和可读存储介质
CN116095503A (zh) * 2022-06-15 2023-05-09 荣耀终端有限公司 终端设备及创建/显示hdr图像的方法
CN116259281A (zh) * 2023-03-30 2023-06-13 青岛信芯微电子科技股份有限公司 一种显示设备及背光控制方法
CN117255163A (zh) * 2023-08-29 2023-12-19 华为技术有限公司 一种图像显示方法与电子设备

Non-Patent Citations (1)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120895004A (zh) * 2025-09-27 2025-11-04 深圳市盈佳科技有限公司 基于增强学习的背光源亮度控制方法及系统
CN120895004B (zh) * 2025-09-27 2026-02-10 深圳市盈佳科技有限公司 基于增强学习的背光源亮度控制方法及系统

Also Published As

Publication number Publication date
CN117255163A (zh) 2023-12-19
EP4654179A4 (en) 2026-03-11
US20260057850A1 (en) 2026-02-26
EP4654179A1 (en) 2025-11-26

Similar Documents

Publication Publication Date Title
EP4024845B1 (en) Time-lapse photography method and device
CN114089933B (zh) 显示参数的调整方法、电子设备、芯片及可读存储介质
CN115473957B (zh) 一种图像处理方法和电子设备
WO2025044350A1 (zh) 一种图像显示方法与电子设备
WO2021258814A1 (zh) 视频合成方法、装置、电子设备及存储介质
CN113067940B (zh) 一种电子设备在来电时呈现视频的方法和电子设备
WO2022068511A1 (zh) 视频生成方法和电子设备
CN115794287A (zh) 一种显示方法、电子设备及计算机存储介质
CN113810603B (zh) 点光源图像检测方法和电子设备
CN112150499B (zh) 图像处理方法及相关装置
CN114079725B (zh) 视频防抖方法、终端设备和计算机可读存储介质
CN113297875B (zh) 一种视频文字跟踪方法及电子设备
CN115686403A (zh) 显示参数的调整方法、电子设备、芯片及可读存储介质
WO2021238740A1 (zh) 一种截屏方法及电子设备
CN116723382B (zh) 一种拍摄方法及相关设备
WO2022179495A1 (zh) 一种隐私风险反馈方法、装置及第一终端设备
CN114283195B (zh) 生成动态图像的方法、电子设备及可读存储介质
CN118446882B (zh) 一种图片背景和文字颜色适配方法及相关装置
CN113891008B (zh) 一种曝光强度调节方法及相关设备
WO2022228196A1 (zh) 一种视频处理方法及相关装置
CN117492628A (zh) 一种图像处理方法及装置
CN114115772A (zh) 灭屏显示的方法及装置
CN113495733A (zh) 主题包安装方法、装置、电子设备及计算机可读存储介质
WO2024046010A1 (zh) 一种界面显示方法、设备及系统
WO2025031233A1 (zh) 一种确定目标对象的方法与电子设备

Legal Events

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

Ref document number: 24857895

Country of ref document: EP

Kind code of ref document: A1

WWP Wipo information: published in national office

Ref document number: 2024857895

Country of ref document: EP