Image preview method and terminal device

By adjusting image pixel values ​​and display brightness, the problem of underutilization of the dynamic range of HDR images in existing technologies has been solved, achieving a higher dynamic range image display effect.

CN118338120BActive Publication Date: 2026-07-31HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2023-01-11
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies fail to fully utilize the higher dynamic range of HDR images displayed on display devices, resulting in unchanged contrast between highlight and shadow areas and failing to accurately reflect the visual effects of real-world scenes.

Method used

By acquiring pixel and brightness information from multiple frames of images, the pixel values ​​of the images are adjusted to increase the brightness of highlight areas and decrease the brightness of shadow areas. Combined with the brightness adjustment of the display screen, this achieves image display with a higher dynamic range.

Benefits of technology

It enhances the contrast between highlight and shadow areas, making the displayed image closer to the real scene and making full use of the display device's higher dynamic range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118338120B_ABST
    Figure CN118338120B_ABST
Patent Text Reader

Abstract

This application provides an image preview method and terminal device, relating to the field of image processing technology. The method can make dark areas of an image darker and bright areas brighter or remain unchanged, thereby improving the dynamic range of the image. The method includes: acquiring multiple frames of images; acquiring pixel information and brightness information of a first image obtained by fusing the multiple frames, the pixel information including the pixel value of each pixel in the first image, and the brightness information including the brightness value of each pixel in the first image under target exposure parameters; adjusting the first image according to the pixel information and brightness information to obtain a second image, wherein the pixel value of a pixel in a first region of the first image is greater than the pixel value of the corresponding pixel in the second image, and the pixel value of a pixel in a second region of the first image is less than or equal to the pixel value of the corresponding pixel in the second image; increasing the screen brightness of the display screen and displaying the second image on the display screen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image preview method and terminal device. Background Technology

[0002] With the development of the terminal industry, most terminal devices support High Dynamic Range (HDR) technology. HDR technology can capture and display the vast dynamic range of the real world, even with the limited dynamic range available in typical imaging sensors and display devices. Dynamic range (DR) is used in many fields to represent the ratio of the maximum to the minimum value of a variable. In digital images, dynamic range characterizes the ratio between the maximum and minimum brightness within the displayable range of an image; that is, the number of gray levels divided between the "brightest" and "darkest" areas of the image. The larger the dynamic range of an image, the richer the brightness levels it can represent, and the more realistic the visual effect of the image.

[0003] Currently, HDR technology is typically implemented by capturing multiple images of the same scene at different exposure levels, fusing these images into a single image, and then applying some form of tone mapping operation to bring the fused image into the dynamic range of a standard dynamic range (SDR) display. The fused image is generally stored as an 8-bit image, and its final dynamic range is approximately 255:1.

[0004] However, with the continuous improvement of display technology, most current display devices can provide a dynamic range higher than 255:1. However, when displaying the fused image, these devices cannot display the image with a higher dynamic range. Summary of the Invention

[0005] This application provides an image preview method and terminal device for displaying images with a small dynamic range with a higher dynamic range, thereby obtaining a visual range closer to the real world scene.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] In a first aspect, this application provides an image preview method, applied to a terminal device including a display screen. The method includes: in response to a user opening a camera application, acquiring multiple frames of images, wherein the multiple frames of images correspond one-to-one with multiple sets of exposure parameters; acquiring pixel information and brightness information of a first image obtained by fusing the multiple frames of images; wherein the pixel information includes the pixel value of each pixel in the first image, and the brightness information includes the brightness value of each pixel in the first image under a target exposure parameter, wherein the target exposure parameter is any one of the multiple sets of exposure parameters or a combination of at least two sets of exposure parameters; adjusting the first image according to the pixel information and brightness information. The image is processed to obtain a second image; wherein the pixels of the first image correspond one-to-one with the pixels of the second image, the pixel value of the pixels in the first region of the first image is greater than the pixel value of the corresponding pixels in the second image, and the pixel value of the pixels in the second region of the first image is less than or equal to the pixel value of the corresponding pixels in the second image. The first region includes pixels in the first image whose brightness value is less than a first threshold under the target exposure parameters, and the second region includes pixels in the first image whose brightness value is greater than a second threshold under the target exposure parameters. The second threshold is greater than or equal to the first threshold. The screen brightness of the display screen is increased, and the second image is displayed on the display screen.

[0008] Understandably, since the pixel values ​​of the pixels in the first region of the first image are greater than the pixel values ​​of the corresponding pixels in the second image, and the pixel values ​​of the pixels in the second region of the first image are less than or equal to the pixel values ​​of the corresponding pixels in the second image, that is, during the process of the terminal device displaying the first image, the pixel values ​​of the highlight areas (i.e., the second region) of the first image are increased or maintained, and the pixel values ​​of the dark areas (i.e., the first region) are reduced, thereby increasing the screen brightness of the display screen, making the highlight areas of the first image brighter and the dark areas of the first image darker or close to the original brightness of the dark areas of the first image, increasing the contrast between the highlight areas and the dark areas, displaying the first image with a higher dynamic range, and making the image displayed by the terminal device in the preview scene closer to the real scene.

[0009] In one embodiment provided by the first aspect, obtaining brightness information of a first image includes: obtaining a target exposure image corresponding to target exposure parameters; wherein the target exposure image is an image captured by a terminal device based on the target exposure parameters; grouping the pixels in the target exposure image according to a preset grouping strategy, and using the average brightness value of all pixels in each group as the brightness value of each pixel in the corresponding group in the first image under the target exposure parameters. Thus, the obtained brightness information can reflect the true brightness of the first image.

[0010] In one embodiment provided in the first aspect, if the target exposure parameter is a first parameter among a plurality of exposure parameters, the target exposure image is an image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two of the plurality of exposure parameters, the target exposure image is an image obtained by fusing the image frames corresponding to at least two of the exposure parameters, and the pixels of the first image correspond one-to-one with the pixels of the target exposure image.

[0011] In one embodiment provided in the first aspect, adjusting a first image based on pixel information and brightness information to obtain a second image includes: multiplying the pixel values ​​of pixels in a first region by a first adjustment coefficient to obtain the pixel values ​​of pixels in the first region in the second image; wherein the first adjustment coefficient is greater than 0 and less than 1; multiplying the pixel values ​​of pixels in a second region by a second adjustment coefficient to obtain the pixel values ​​of pixels in a second region in the second image; wherein the second adjustment coefficient is greater than or equal to 1.

[0012] In one embodiment provided by the first aspect, the second region includes N pixels, each corresponding to a second adjustment coefficient. Multiplying the pixel values ​​of the pixels in the second region by the second adjustment coefficients yields the pixel values ​​of the pixels in the second region within the second image. This includes: calculating the second adjustment coefficient of the i-th pixel based on its brightness value; wherein the second adjustment coefficient of the i-th pixel is positively correlated with its brightness value, the second adjustment coefficient of the i-th pixel is greater than 1, i ≤ N, and i and N are both positive integers; and multiplying the pixel value of the i-th pixel by its second adjustment coefficient to obtain the pixel value of the i-th pixel in the second image. By setting different second adjustment coefficients for different pixels, the brightness relationship between different pixels within the second region can be preserved.

[0013] In one embodiment provided in the first aspect, the first adjustment coefficient is the ratio of the first screen brightness to the second screen brightness, the first screen brightness is the screen brightness before the display brightness is adjusted, the second screen brightness is the screen brightness after the display brightness is adjusted, and the second screen brightness is greater than the first screen brightness and less than or equal to the maximum screen brightness of the display.

[0014] In one embodiment provided in the first aspect, the second screen brightness is the maximum screen brightness.

[0015] In one embodiment provided in the first aspect, the second screen brightness is the smaller of the maximum screen brightness and the first brightness threshold, the first brightness threshold is the product of the first screen brightness and a preset multiple, and the preset multiple is a natural number greater than 1.

[0016] In one embodiment provided in the first aspect, the first threshold and the second threshold are determined based on a first average brightness value, which is the average brightness value of all pixels under the target exposure parameters, and the first threshold and the second threshold are positively correlated with the first average brightness value.

[0017] In one embodiment provided in the first aspect, the first threshold is less than the first average brightness value, and the second threshold is greater than the first average brightness value.

[0018] In a second aspect, this application provides a terminal device, which includes: a memory, a display screen, and one or more processors; the memory and the display screen are coupled to the processors; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the terminal device performs the method as described in any of the first aspects.

[0019] Thirdly, this application provides a computer-readable storage medium including computer instructions; when the computer instructions are executed on a terminal device, the terminal device performs the method as described in any of the first aspects.

[0020] Fourthly, this application provides a computer program product that, when run on a terminal device, causes the terminal device to perform the method as described in the first aspect and any of its possible design methods.

[0021] Fifthly, this application provides a chip system including one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via lines. The aforementioned chip system can be applied to a terminal device including a communication module and a memory. The interface circuits are used to receive signals from the memory of the terminal device and send the received signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the terminal device can perform the method as described in the first aspect and any of its possible design embodiments.

[0022] The technical effects of any of the design methods in aspects two through five can be found in the technical effects of different design methods in aspect one, and will not be repeated here. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0024] Figure 2 An interface diagram of a terminal device provided in an embodiment of this application;

[0025] Figure 3 A flowchart illustrating an image preview method provided in this application embodiment. Figure 1 ;

[0026] Figure 4A A schematic diagram illustrating the fusion of multiple frames to obtain a first image, as provided in an embodiment of this application;

[0027] Figure 4B A schematic diagram illustrating how a second image is obtained from a first image, as provided in an embodiment of this application;

[0028] Figure 5 A flowchart illustrating an image preview method provided in this application embodiment. Figure 2 ;

[0029] Figure 6 A schematic diagram of a grouping strategy provided in an embodiment of this application;

[0030] Figure 7 This is a schematic diagram illustrating another grouping strategy provided in an embodiment of this application;

[0031] Figure 8 A comparison diagram of display effects provided for an embodiment of this application;

[0032] Figure 9 A flowchart illustrating an image preview method provided in this application embodiment. Figure 3 ;

[0033] Figure 10 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0034] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. In the description of this application, unless otherwise stated, "at least one" refers to one or more, and "more than one" refers to two or more. Furthermore, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0035] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the relevant concepts or technologies is given first:

[0036] Dynamic range is used in many fields to represent the ratio of the maximum to the minimum value of a variable. In digital imaging, dynamic range characterizes the ratio between the maximum and minimum brightness within the displayable range of an image; that is, the number of gray levels the image divides from "brightest" to "darkest." The larger the dynamic range of an image, the richer the brightness levels it can represent, and the more realistic the visual effect of the image.

[0037] Generally, images with a dynamic range exceeding 0.01–1000 nits are called high dynamic range (HDR) images, while those with a dynamic range less than 0.1–400 nits are called standard dynamic range (SDR) images. Images with HDR are called high dynamic range (HDR) images, and images with SDR are called standard dynamic range (SDR) images. HDR images can be used to describe the full visual range of real-world scenes, revealing details in extremely dark and bright areas that might be lost with traditional shooting equipment but are perceptible to the human visual system.

[0038] Exposure values ​​(EVs) reflect the exposure level of an image. By adjusting the camera's exposure parameters, images can have different EV values. Exposure parameters refer to those that affect the amount of exposure by the camera, including but not limited to aperture, shutter speed, exposure time, and ISO sensitivity. In this embodiment, a properly exposed exposure value is represented as EV0, an underexposed exposure value as EV-, and an overexposed exposure value as EV+. Furthermore, the exposure value EV0 × 2... n It is represented as EVn. For example, EV-1 means half the exposure value of EV0, and EV-2 means half the exposure value of EV-1; as another example, EV1 means twice the exposure value of EV0, and EV2 means twice the exposure value of EV1.

[0039] In one existing technology, a terminal device can capture multiple images of the same scene at different exposure values ​​and then merge these images to create an "HDR image." However, this "HDR image" is typically an 8-bit image, with a final dynamic range of approximately 255:1. This means that the dynamic range of the "HDR image" remains within the standard dynamic range. In other words, this "HDR image" is actually an SDR image.

[0040] When displaying an HDR image on a device with a higher dynamic range, the brightness of the HDR image can increase or decrease with the brightness of the device's screen. However, during this change, the brightness of the highlight and shadow areas of the HDR image can change proportionally, meaning the contrast between the highlight and shadow areas remains unchanged. In other words, the dynamic range of the HDR image displayed by the device does not change, and the device's higher dynamic range is not fully utilized.

[0041] In view of this, this application provides an image preview method applied to a terminal device. The terminal device can acquire multiple frames of images after opening a camera application and fuse these frames to obtain a first image, which is equivalent to an SDR image. The terminal device can then acquire pixel information and brightness information of the first image. The brightness information includes the brightness value of each pixel in the first image under target exposure parameters, which can be used to reflect the true brightness of the first image. Then, the first image is adjusted according to the pixel information and brightness information to obtain a second image, wherein the pixel value of pixels in a first region of the first image is greater than the pixel value of the corresponding pixel in the second image, and the pixel value of pixels in a second region of the first image is less than or equal to the pixel value of the corresponding pixel in the second image. The terminal device then increases the screen brightness of its display screen and displays the second image on the screen.

[0042] As can be seen, during the preview process, the terminal device can increase or maintain the pixel value of the highlight area (i.e., the second area) of the SDR image and decrease the pixel value of the dark area (i.e., the first area). Thus, after increasing the screen brightness of the display, the highlight area of ​​the SDR image is brighter, and the dark area of ​​the SDR image is darker or close to the original brightness of the dark area of ​​the SDR image, increasing the contrast between the highlight area and the dark area. This results in displaying the SDR image with a higher dynamic range, making the SDR image displayed by the terminal device in the image preview scene closer to the real scene.

[0043] The terminal device provided in this application embodiment can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, laptop, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device and / or smart city device, etc., which have cameras and displays. This application embodiment does not impose any special restrictions on the specific type of terminal device.

[0044] Figure 1 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 1As shown, the terminal 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0045] The aforementioned sensor module 180 may include sensors such as pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.

[0046] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the terminal device. In other embodiments, the terminal device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0047] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0048] The controller can serve as the nerve center and command center of a terminal device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0049] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0050] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0051] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the terminal device. In other embodiments, the terminal device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0052] The charging management module 140 receives charging input from a charger, which can be either a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the terminal device via the power management module 141.

[0053] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be housed in the same device.

[0054] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. In some embodiments, antenna 1 and mobile communication module 150 of the terminal device are coupled, and antenna 2 and wireless communication module 160 are coupled, enabling the terminal device to communicate with networks and other devices through wireless communication technology.

[0055] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0056] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on terminal devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.

[0057] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be housed in the same device.

[0058] The wireless communication module 160 can provide solutions for wireless communication applications on terminal devices, including WLAN (such as wireless fidelity, Wi-Fi) networks, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and other wireless communication technologies.

[0059] 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0060] The terminal device implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0061] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.

[0062] The terminal device can implement shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture still images or videos. In some embodiments, the terminal device may include one or N cameras 193, where N is a positive integer greater than 1.

[0063] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0064] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the terminal device by running the instructions stored in internal memory 121. For example, in this embodiment, processor 110 can execute instructions stored in internal memory 121, which may include a program storage area and a data storage area.

[0065] The program storage area can store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area can store data created during the use of the terminal device (such as audio data, phonebook, etc.). Furthermore, the internal memory 121 can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0066] The terminal device can implement audio functions, such as music playback and recording, through an audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor. Buttons 190 include a power button and volume buttons. Buttons 190 can be mechanical buttons or touch buttons. A motor 191 can generate vibration alerts. The motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. An indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. A SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the terminal device. The terminal device can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, and SIM cards.

[0067] The image preview method provided in this application will be explained in detail below with reference to the accompanying drawings.

[0068] This application provides an image preview method applicable to terminal devices including a display screen. For example, taking a mobile phone as an example, the phone may have an application with shooting capabilities (hereinafter referred to as a camera app) installed, allowing users to take photos and videos. During the user's use of the camera app to take photos, the phone captures multiple frames of images with different exposure values. The pixel information and brightness information of a first image obtained by fusing these multiple frames are acquired. Then, based on the current and maximum screen brightness of the display screen, tone mapping is performed on the first image to obtain a second image. Finally, the second image is displayed on the display screen with increased brightness. The second image is obtained by the mobile phone using the image preview method provided in this application. For details, please refer to [link to relevant documentation]. Figure 3 Related textual descriptions will not be described here.

[0069] For example, such as Figure 2As shown in (a), the phone's main interface 201 (also known as the desktop) includes a camera application icon 202. The phone can receive a user's click on the camera application icon 202 (i.e., the user's action of opening the camera application). In response to this click, as... Figure 2 As shown in (b), the mobile phone increases the screen brightness of the display and displays image 203, which is the second image.

[0070] In order to implement the image preview method provided in this application, Figure 1 Based on the terminal device shown, this application provides an implementation of an image preview method. This image preview method can be implemented by... Figure 1 The terminal device shown executes the command. For example... Figure 3 As shown, Figure 3 A flowchart illustrating an image preview method provided in this application. Figure 1 The image preview method includes the following steps:

[0071] S301, in response to the user's operation of opening the camera application, the terminal device acquires multiple frames of images, and the multiple frames of images correspond one-to-one with multiple sets of exposure parameters.

[0072] The user can open the camera app by clicking the camera app icon or by enabling the shooting function on a third-party application such as a communication or social media app; there are no specific restrictions.

[0073] In other words, the terminal device can acquire multiple frames of images during the preview process. These multiple frames are images captured by the terminal device in the same scene under different exposure parameters. It should be noted that after the terminal device acquires these multiple frames, it does not directly display them. Instead, it processes them using the image preview method provided in this application to obtain a second image (see details below) and then directly displays the second image.

[0074] In one alternative implementation, the multi-frame images are obtained by capturing images from different cameras with different exposure parameters. In another alternative implementation, the multi-frame images can also be obtained by capturing images multiple times consecutively within a short period of time using a single camera with different exposure parameters, wherein the time interval between each capture is as small as possible.

[0075] Since each of these multiple images corresponds to a set of exposure parameters, the exposure values ​​of the multiple images are not the same. For example, as shown... Figure 4AAs shown, the multi-frame images may include Image 1 and Image 2. Image 1 was captured by camera 1 using exposure parameter 1, and Image 2 was captured by camera 2 using exposure parameter 2. Camera 1 and camera 2 can be the same camera or different cameras. It can be seen that the EV value of Image 1 is lower than the EV value of Image 2. Image 1 is underexposed, resulting in relatively clear outlines in the highlight areas, but blurry shadow areas due to lack of exposure. Image 2 is overexposed, causing distortion in the highlight areas due to overexposure, while details and outlines in the shadow areas are clearly visible thanks to exposure compensation.

[0076] It should be noted that, Figure 4A Taking images under EV- and EV+ conditions as an example, mobile phones can actually capture images under many more exposure conditions, such as EV0, EV-1, EV-2, EV+1, EV+2, etc., without making specific limitations here.

[0077] S302, Obtain the first image based on multiple frames.

[0078] The first image is obtained by fusing multiple frames of images using a terminal device. Specifically, the terminal device can fuse multiple frames into the first image using tone mapping. Tone mapping can include global tone mapping and local tone mapping. Global tone mapping can use histograms, gamma functions, sigmoid nonlinear functions, etc. Global tone mapping can preserve global contrast well, but it will lose some local details. Local tone mapping, on the other hand, first divides the multiple frames into regions, and then processes each region in a similar way to global tone mapping, ultimately preserving the relative contrast between adjacent regions and thus preserving local details well.

[0079] For example, such as Figure 4A As shown, the terminal device can fuse Image 1 and Image 2 to obtain Image 3 (i.e., the first image). Compared with a single frame image (i.e., Image 1 or Image 2), Image 3 has more obvious details and contours in both the dark and highlight areas, and has a higher dynamic range.

[0080] S303, acquire the pixel information and brightness information of the first image.

[0081] The pixel information includes the pixel value of each pixel in the first image. Depending on the image sensor type used to capture the image, the pixel value of each pixel includes, but is not limited to, RGB, RGGB, RGBW, and RYYB values. RGB indicates that the color of each pixel is composed of three components: red (R), green (G), and blue (B). RGGB indicates that the color of each pixel is composed of four components: red, green, green, and blue. RGBW indicates that the color of each pixel is composed of four components: red, green, blue, and white (W). RYYB indicates that the color of each pixel is composed of four components: red, yellow (Y), yellow, and blue. The pixel value of each pixel can be obtained through the image sensor.

[0082] The brightness information includes the brightness value of each pixel in the first image under the target exposure parameters. In one optional implementation, the target exposure parameters can be any one of multiple sets of exposure parameters, or a combination of at least two sets of exposure parameters. It should be noted that if the target exposure parameter is greater than a first value, the dark details of the first image are relatively clear; if the target exposure parameter is less than a second value (the second value is less than the first value), the highlight areas of the first image are relatively clear and there is no overexposure; if the target exposure parameter is between the first and second values, the first image has relatively clear contrast and there is no overexposure or underexposure. In one optional implementation, the target exposure parameter can be a parameter obtained by combining multiple sets of exposure parameters, i.e., the exposure parameters corresponding to the first image. For example, the target exposure parameters include exposure time and ISO sensitivity. The terminal device will perform a weighted summation of the exposure time and ISO sensitivity of at least two sets of exposure parameters to obtain the exposure time and ISO sensitivity as the target exposure parameters.

[0083] For example, multiple exposure parameters include EV-1, EV0, EV+1, and EV+2. The terminal device can directly select any one of EV-1, EV0, EV+1, and EV+2 as the target exposure parameter. Alternatively, the terminal device can change parameters such as exposure time and ISO to make EV fall between EV+1 and EV+2 to obtain the target exposure parameter.

[0084] In another alternative implementation, the terminal device can input multiple exposure parameters into a pre-trained neural network model to obtain target exposure parameters. For example, the terminal device or server can iteratively train an initial model using a large number of training samples until the initial model converges to obtain a trained neural network model. Each set of training samples includes multiple exposure parameters and target exposure parameters labeled as true (correct) or false (incorrect). Thus, the trained neural network model can be used to obtain the target exposure parameters based on the input multiple exposure parameters.

[0085] In summary, the target exposure parameters can affect the brightness of the first image, and the specific method for determining them can be set and maintained in advance by the operation and maintenance personnel in the background according to the brightness effect required for the first image.

[0086] S304, adjust the first image according to the pixel information and brightness information to obtain the second image.

[0087] The first image comprises multiple regions, including at least a first region and a second region. The first region is the dark area of ​​the first image, and the second region is the highlight area of ​​the first image. Specifically, the first region includes pixels in the first image whose brightness value is less than a first threshold under the target exposure parameters, and the second region includes pixels in the first image whose brightness value is greater than a second threshold under the target exposure parameters, wherein the second threshold is greater than or equal to the first threshold.

[0088] In this embodiment, the terminal device can determine the first threshold and the second threshold based on the first average brightness value, and the first threshold and the second threshold are positively correlated with the first average brightness value (including linear or non-linear correlation). The first average brightness value is the average brightness value of all pixels under the target exposure parameters, reflecting the true brightness level of the first image. For example, if the bit width of the brightness value is 8 bits, after digitization, the brightness value ranges from 0 to 255. The first average brightness value is obtained by averaging the digitized brightness values.

[0089] In one optional implementation, the first threshold is equal to the second threshold (e.g., both are the first average brightness value). In this case, the first image includes two regions, namely the first region and the second region. Specifically, the terminal device can assign pixels with brightness values ​​less than the first threshold (second threshold) under the target exposure parameters to the first region, and pixels with brightness values ​​greater than or equal to the first threshold (second threshold) under the target exposure parameters to the second region. This allows the first region to contain pixels from the darker areas of the first image, and the second region to contain pixels from the brighter areas of the first image.

[0090] For example, the first threshold can be 165. If the brightness value of pixel 1 under the target exposure parameters is 100, then since 100 < 165, pixel 1 is assigned to the first region. If the brightness value of pixel 2 under the target exposure parameters is 188, then since 188 > 165, pixel 2 is assigned to the second region.

[0091] In one optional implementation, the second threshold is greater than the first threshold. For example, the second threshold is a value obtained by increasing the first average brightness value by a first value, or a value obtained by increasing the first average brightness value by a second value (the second value is less than the first value); or, the second threshold is a value obtained by increasing the first average brightness value by a first value, or a value obtained by decreasing the first average brightness value by a second value (both the second and first values ​​are positive). In this case, the first image includes a first region, a second region, and a third region. The third region is a transition region between the first and second regions. Specifically, the terminal device can assign pixels with brightness values ​​less than the first threshold under the target exposure parameters to the first region, pixels with brightness values ​​greater than or equal to the second threshold under the target exposure parameters to the second region, and pixels with brightness values ​​greater than or equal to the first threshold and less than the second threshold under the target exposure parameters to the third region. This allows the first region to include pixels in darker areas of the first image, and the second region to include pixels in brighter areas of the first image.

[0092] In one alternative implementation, the first threshold is less than the first average brightness value, and the second threshold is greater than the first average brightness value.

[0093] It should be noted that the above only shows two ways of dividing image regions. In this application embodiment, a more refined partitioning method can also be used to divide the first image into more image regions, and no specific limitation is made here.

[0094] The pixels in the first image correspond one-to-one with the pixels in the second image, and the second image also includes a first region and a second region. Specifically, the pixel value of a pixel in the first region of the first image is greater than the pixel value of its corresponding pixel in the second image, and the pixel value of a pixel in the second region of the first image is less than or equal to the pixel value of its corresponding pixel in the second image. In other words, the terminal device can obtain the second image by reducing the pixel value of the pixels in the first region of the first image and increasing or maintaining the pixel value of the pixels in the second region of the first image.

[0095] For example, such as Figure 4B As shown, the terminal device can divide the first image into multiple regions based on the brightness information of the first image. Figure 4B Taking a first image comprising three regions as an example, the first image is then adjusted according to the brightness capability of the display screen and the region division of the first image to obtain a second image. The contrast between the highlight and shadow areas in the second image is greater than that in the first image.

[0096] S305 increases the screen brightness and displays a second image on the display.

[0097] Understandably, a pixel possesses an observed brightness. The observed brightness of a pixel indicates its brightness on the display screen. The observed brightness of a pixel is related to the screen brightness and the pixel value. In one optional embodiment, the observed brightness of a pixel can satisfy the formula: Lg = Gray * Lp, where Lg is the observed brightness, Lp is the screen brightness, and Gray is the pixel grayscale. The pixel grayscale can be determined based on the pixel value, where a larger pixel value results in a larger pixel grayscale. For example, the pixel grayscale and pixel value can satisfy the formula: Gray = 0.299R + 0.587G + 0.114B.

[0098] As can be seen, when displaying an image on a screen, both the screen brightness and the pixel value of each pixel affect the brightness of that pixel on the screen. Specifically, with a fixed pixel value, the higher the screen brightness, the higher the observed brightness of that pixel, meaning the pixel appears brighter; conversely, with a fixed screen brightness, the higher the pixel value, the higher the observed brightness of that pixel, meaning the pixel appears brighter.

[0099] Understandably, since the pixel values ​​of pixels in the first region of the second image are smaller than those in the first image, increasing the screen brightness makes the observed brightness of pixels in the first region of the second image approach the observed brightness before adjusting the screen brightness. Conversely, since the pixel values ​​of pixels in the first region of the second image are greater than or equal to those in the second region of the first image, increasing the screen brightness makes the observed brightness of pixels in the second region of the second image greater than the observed brightness before adjusting the screen brightness. In other words, increasing the screen brightness and displaying the second image on the screen keeps the observed brightness of the first region of the second image unchanged while increasing the observed brightness of the second region of the first image, thus increasing the contrast between the first and second regions in the second image and expanding the dynamic range of the second image.

[0100] In this embodiment, the terminal device can adjust the screen brightness of the display from a first screen brightness to a second screen brightness. The second screen brightness is greater than the first screen brightness, but less than or equal to the maximum screen brightness of the display. The maximum screen brightness is the maximum brightness supported by the display.

[0101] Understandably, the first screen brightness is the screen brightness before the display brightness is adjusted, or it can be understood as the current screen brightness of the display. The terminal device can directly read the relevant parameters of the display to obtain the first screen brightness.

[0102] The second screen brightness is the screen brightness after the display brightness has been adjusted. In one optional implementation, the second screen brightness is associated with the first screen brightness and the maximum screen brightness of the display. Specifically, the terminal device can determine a first brightness threshold based on the first screen brightness. For example, the terminal device can use a preset multiple of the first screen brightness as the first brightness threshold, where the preset multiple can be any value greater than 1, such as 3. Then, the terminal device can compare the first brightness threshold with the maximum screen brightness. If the first brightness threshold is less than or equal to the maximum screen brightness, then the second screen brightness is determined to be the first brightness threshold; if the first brightness threshold is greater than the maximum screen brightness, then the second screen brightness is determined to be the maximum screen brightness. That is, the second screen brightness is the smaller value between the maximum screen brightness and the first brightness threshold.

[0103] In another alternative implementation, the second screen brightness can be fixed at the maximum screen brightness. That is, regardless of the current screen brightness, the terminal device always uses the maximum screen brightness as the second screen brightness and adjusts the screen brightness of the display to the maximum screen brightness.

[0104] In one optional implementation, the terminal device can multiply the pixel value of a pixel in the first region by a first adjustment coefficient to obtain the pixel value of a pixel in the first region in the second image, and multiply the pixel value of a pixel in the second region by a second adjustment coefficient to obtain the pixel value of a pixel in the second region in the second image. The first adjustment coefficient is greater than 0 and less than 1, and the second adjustment coefficient is greater than or equal to 1.

[0105] Understandably, a first adjustment coefficient greater than 0 and less than 1 can reduce the pixel value of a pixel in the first region of the first image, so that the pixel value of a pixel in the first region of the second image is less than the pixel value of a pixel in the first region of the first image; a second adjustment coefficient greater than or equal to 1 can increase or maintain the pixel value of a pixel in the second region of the first image, so that the pixel value of a pixel in the first region of the second image is greater than or equal to the pixel value of a pixel in the second region of the first image.

[0106] In one alternative implementation, the first adjustment factor is the ratio of the first screen brightness to the second screen brightness. Since the first screen brightness is always less than the second screen brightness, the first adjustment factor is greater than 0 and less than 1. This reduces the pixel value of pixels in the first region of the first image, making the observed brightness of pixels in the first region smaller, i.e., appearing darker.

[0107] In one alternative implementation, the second adjustment coefficient can be 1, in which case the pixel values ​​of the pixels in the second region of the first image can be kept unchanged so that the observed brightness of the pixels in the second region remains unchanged, that is, the brightness appears unchanged.

[0108] In another alternative implementation, the second adjustment coefficient is a variable value and is related to the brightness value of each pixel. The second adjustment coefficient for each pixel is related to the brightness value of that pixel under the target exposure parameters. Specifically, if the second region includes N pixels, then the second adjustment coefficient of the i-th pixel satisfies the formula: Q2 i =1+L i / L max Among them, Q2 i L represents the second adjustment factor for the i-th pixel. i L represents the brightness value of the i-th pixel under the target exposure parameters. max This represents the maximum brightness value of a pixel. For example, taking an 8-bit width for the brightness value, the range is 0 to 255. If the brightness value of a pixel is C, then the corresponding second adjustment coefficient Q2 = 1 + C / 255. This method allows different pixel values ​​to have different second adjustment coefficients, preserving the brightness relationship between different pixels within the second region as much as possible.

[0109] In one alternative implementation, in Figure 3 Based on the image preview method shown, this embodiment provides a way to obtain the brightness information of the first image.

[0110] like Figure 5 As shown, Figure 5 A flowchart illustrating an image preview method provided in this application. Figure 2 .like Figure 5 As shown, obtaining the brightness information of the first image may include the following steps:

[0111] S501, acquire the target exposure image corresponding to the target exposure parameters.

[0112] The image corresponding to the target exposure parameters is the target exposure image. The target exposure image can be understood as the exposure image that the terminal device should obtain when shooting with the target exposure parameters. If the target exposure parameters are one set of exposure parameters from multiple sets, the target exposure image can be the image captured by the terminal device under that set of exposure parameters. If the target exposure parameters are parameters obtained by combining at least two sets of exposure parameters from multiple sets, the target exposure image can be an image obtained by fusing the image frames corresponding to those at least two sets of exposure parameters. For example, multiple sets of exposure parameters include EV0, EV-, and EV+, and correspond to EV0 image frames, EV- image frames, and EV+ image frames, respectively. If the target exposure parameter is EV0, then the EV0 image frame is used as the target exposure image; if the target exposure parameter is a combination of EV- and EV+, then the image obtained by fusing the EV- and EV+ image frames is used as the target exposure image. As another example, if the target exposure parameters are parameters obtained by combining the above multiple exposure parameters, then the first image obtained by fusing the multiple frames corresponding to the multiple exposure parameters is used as the target exposure image.

[0113] It should be noted that the target exposure image and the first image can be the same or different. For example, the phone captures an EV0 image, an EV- image, and an EV+ image, and obtains the first image based on these three images. If the phone uses EV0 as the target exposure parameter, the first image will be different from the target exposure image; the brightness value of a pixel in the first image under the target exposure parameter will be the brightness value of that pixel in the EV0 image. If the target exposure parameter is a combination of EV-, EV0, and EV+, then the first image will be the same as the target exposure image.

[0114] In this system, each pixel in the target exposure image corresponds one-to-one with a pixel in the first image. The correspondence between pixel 1 in the target exposure image and pixel 2 in the first image can be understood as the coordinates of pixel 1 in the target exposure image being the same as the coordinates of pixel 2 in the first image.

[0115] S502, the pixels in the target exposure image are grouped according to a preset grouping strategy, and the average brightness value of all pixels in each group is used as the brightness value of each pixel in the corresponding group in the first image under the target exposure parameters.

[0116] The grouping strategy can be configured according to actual needs. For example, the grouping strategy can divide a single pixel into a group, or it can divide a pixel matrix consisting of n×m pixels into a group. For instance, it can divide a pixel matrix consisting of 2×2 or 3×2 pixels into a group. No specific restrictions are imposed here.

[0117] If the terminal device divides a pixel into a group, the terminal device can use the brightness value of that pixel as the brightness value of the corresponding pixel in the first image under the target exposure parameters. If the terminal device divides a pixel matrix consisting of n×m pixels into a group, the terminal device can use the average brightness value of that group of pixels as the brightness value of each pixel in the corresponding group of pixels in the first image under the target exposure parameters. Alternatively, the terminal device can use the average brightness value remaining after removing outliers from the brightness values ​​of that group of pixels as the brightness value of each pixel in the corresponding group of pixels in the first image under the target exposure parameters. No specific restrictions are imposed here.

[0118] For example, Figure 6 A grouping strategy is shown. Figure 6 In this system, the terminal device treats a single pixel as a pixel group. Pixel A1 has a pixel value of R1G1B1, and pixel A2 has a pixel value of R2G2B2; pixel A1 and pixel A2 correspond to each other. The brightness value of pixel A2 under the target exposure parameters is the brightness value of pixel A1. Therefore, the brightness value L1 of pixel A1 can be calculated from its pixel values ​​R1, G1, and B1, and used as the brightness value of pixel A2 under the target exposure parameters.

[0119] The brightness value and pixel value can satisfy the formula: L = 0.299R + 0.587G + 0.114B, where L is the brightness value. For example, if the pixel value of pixel A1 is (R100, G100, B100), then the brightness value of pixel A1 can be determined as 0.299R + 0.587G + 0.114B = 29.9 + 58.7 + 11.4 = 100. Therefore, the brightness value of pixel A2 under the target exposure parameters is 100.

[0120] For example, Figure 7 Another grouping strategy is shown. Figure 7In the image, both the first image and the target exposure image consist of 9×4 pixels. The terminal device divides these 9×4 pixels into 12 groups, with each group containing 3×1 pixels. Pixel group 1 includes pixels M1, M2, and M3. Pixel group 2 includes pixels N1, N2, and N3. Pixels M1, M2, and N3 correspond to each other. The pixel values ​​of M1 are R3, G3, B3, and W3; the pixel values ​​of M2 are R4, G4, B4, and W4; and the pixel values ​​of M3 are R5, G5, B5, and W5. The pixel values ​​of N1 are R6, G6, B6, and W6; the pixel values ​​of N2 are R7, G7, B7, and W7; and the pixel values ​​of N3 are R8, G8, B8, and W8. The brightness value of each pixel in pixel group 2 (i.e., pixel N1, pixel N2, and pixel N3) under the target exposure parameters is the average brightness value of each pixel in pixel group 1 (i.e., pixel M1, pixel M2, and pixel M3). The terminal device can calculate the brightness value L3 based on the pixel values ​​(R3, G3, B3, W3) of pixel M1, the brightness value L4 based on the pixel values ​​(R4, G4, B4, W4) of pixel M2, and the brightness value L5 based on the pixel values ​​(R5, G5, B5, W5) of pixel M3. Then, the average value L6 of the brightness values ​​L3, L4, and L5 is used as the brightness value of each pixel in pixel group 2 (i.e., pixel N1, pixel N2, and pixel N3) under the target exposure parameters.

[0121] In one optional implementation, the terminal device may further encode the pixel information of the first image to obtain an image video stream, and encode the brightness information of the first image to obtain a brightness information video stream.

[0122] In this embodiment, the terminal device can use the Joint Photographic Experts Group (JEPG) standard, high efficiency video coding (HEVC), portable network graphics (PNG), run-length encoding (RLE) and other methods to encode pixel information to obtain an image video stream.

[0123] The terminal device can use linear or non-linear encoding methods to encode the luminance information to obtain the second encoded data. Each encoded luminance value can have a bit width of 8 bits, 10 bits, or higher. Non-linear encoding can include methods such as encoding using gamma functions, without specific limitations. In addition, when encoding luminance information, the pixel grouping method can also be encoded into the luminance information video stream.

[0124] By encoding the pixel information and brightness information of the first image separately, brightness information that reflects the actual brightness of the first image can be retained, which facilitates the adjustment of the brightness of the first image during subsequent display.

[0125] In one optional implementation, the terminal device may also perform decoding operations on the image video stream and the brightness information video stream respectively to obtain pixel information and brightness information.

[0126] For example, let's take the adjustment of a mobile phone screen brightness from a first screen brightness A to a second screen brightness C, with a first adjustment coefficient of A / C and a second adjustment coefficient of 1, to illustrate the specific implementation process of the image preview method provided in this embodiment. The mobile phone can first generate a second image based on the first and second adjustment coefficients. During the generation of the second image, the pixel values ​​of pixels in the first region of the first image are reduced by a factor of A / C, resulting in a reduction of the pixel grayscale of pixels in the first region by a factor of A / C; the pixel values ​​of pixels in the second region of the first image remain unchanged. When the mobile phone adjusts the screen brightness from the first screen brightness A to the second screen brightness C, the screen brightness of all pixels in the first image is increased by a factor of C / A. It can be seen that the observed brightness of pixels in the first region is first reduced by a factor of A / C, then increased by a factor of C / A, becoming the same as its original observed brightness; the observed brightness of pixels in the second region is increased by a factor of C / A, exceeding its original observed brightness. This increases the contrast between the first and second regions in the second image, expanding the dynamic range of the second image.

[0127] For example, the first image can be as follows: Figure 8 As shown in (a), the first image 801 includes a first region 801a and a second region 801b. If the mobile phone directly increases the screen brightness and displays the first image, the display effect can be as follows: Figure 8 In image 802 (b), the observed brightness of both the first region 802a and the second region 802b is increased, but the contrast ratio of image 802 remains unchanged, the same as that of the first image 801. After obtaining the second image from the first image, the mobile phone increases the screen brightness and displays the second image, achieving the same display effect. Figure 8Image 803 is shown in (c). It can be seen that the observed brightness of the first region 803a in image 803 is close to that of the first region 801a in the first image 801. The observed brightness of the second region 803b in image 803 is significantly higher than that of the second region 801b in the first image 801. Compared with the first image 801, the first region 803a and the second region 803b in image 803 have higher contrast, and image 803 has a larger dynamic range.

[0128] Regarding the image preview method provided in the above embodiments, this embodiment provides a possible specific example, such as... Figure 9 As shown, this specific example includes the following steps: The electronic device captures an image, acquiring multiple frames of images, then acquires the pixel information and brightness information of the first image obtained by fusing these multiple frames; then, the pixel information of the first image is encoded to obtain an image video stream, and the brightness information of the first image is encoded to obtain a brightness information video stream. During the display process, the image video stream and the brightness information video stream need to be decoded separately to obtain the first image (standard dynamic image) and the brightness information of the first image. Then, the pixel values ​​of the first image are adjusted based on the maximum screen brightness (which can also be understood as brightness capability) of the display screen. Finally, the screen brightness of the display screen is increased, and the adjusted first image (i.e., the second image) is displayed on the display screen. It should be noted that... Figure 9 The process of encoding the pixel information of the first image to obtain an image video stream, encoding the brightness information of the first image to obtain a brightness information video stream, and decoding the image video stream and the brightness information video stream to obtain the first image (standard dynamic image) and the brightness information of the first image are optional. In other embodiments, after the electronic device obtains the pixel information and brightness information of the first image, it can directly adjust the pixel value of the first image based on the maximum screen brightness of the display screen, increase the screen brightness of the display screen, and display the adjusted first image (i.e., the second image) on the display screen.

[0129] In summary, the image preview method provided in this application, during the display of the first image, increases the observed brightness of each pixel by increasing the screen brightness of the terminal device; simultaneously, it decreases the observed brightness of pixels in the first region by decreasing the pixel value of pixels in the first region, and increases or maintains the pixel value of pixels in the second region to increase or maintain the observed brightness of pixels in the second region, thereby achieving the effect of increasing the observed brightness of pixels in the second region without changing it. In other words, during the display of the SDR image (first image), bright areas in the SDR image can be made brighter, and dark areas can be made darker or remain unchanged, increasing the contrast of the SDR image and expanding its dynamic range.

[0130] Some embodiments of this application provide a terminal device, which may include a memory, a display screen, and one or more processors. The memory, display screen, and processors are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the terminal device can perform various functions or steps performed by the terminal device in the above method embodiments. The structure of the terminal device can be referred to... Figure 1 The structure of the terminal device shown is illustrated.

[0131] This application also provides a chip system (e.g., a system-on-a-chip (SoC)). Figure 10 As shown, the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 are interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (e.g., the memory of a terminal device). As another example, the interface circuit 1002 can be used to send signals to other devices (e.g., the processor 1001 or the touchscreen of the terminal device). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send those instructions to the processor 1001. When the instructions are executed by the processor 1001, the terminal device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete components, which are not specifically limited in this application embodiment.

[0132] This application also provides a computer-readable storage medium including computer instructions that, when executed on the terminal device, cause the terminal device to perform various functions or steps performed by the terminal device in the above method embodiments.

[0133] This application also provides a computer program product that, when run on a terminal device, causes the terminal device to perform various functions or steps performed by the terminal device in the above method embodiments.

[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0135] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0136] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0137] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0138] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0139] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image preview method, characterized by, Applied to a terminal device including a display screen, the method includes: After opening the camera application, multiple frames of images and a target exposure image are acquired. The multiple frames of images correspond to multiple sets of exposure parameters, and each frame of the multiple frames of images corresponds to a different exposure parameter. The target exposure image is obtained based on the target exposure parameter, which is any one of the multiple sets of exposure parameters or a combination of at least two sets of exposure parameters. The multiple frames of images are fused to obtain a first image. The first image and the target exposure image have the same size, and the pixels of the first image correspond to the pixels of the target exposure image. The pixel values ​​of pixels in the first region of the first image are reduced, and the pixel values ​​of pixels in the second region of the first image are increased or maintained to obtain a second image; the first region and the second region are divided according to the brightness values ​​of pixels at corresponding positions in the target exposure image, the brightness value of the third region of the target exposure image is less than the brightness value of the fourth region of the target exposure image, the third region corresponds to the position of the first region of the first image, and the fourth region corresponds to the position of the second region of the first image; Increase the screen brightness of the display and display the second image.

2. The method of claim 1, wherein, The method further includes: The pixels in the target exposure image are grouped according to a preset grouping strategy, and the average brightness value of all pixels in each group is used as the brightness value of each pixel in that group.

3. The method according to claim 1 or 2, characterized in that, The step of reducing the pixel values ​​of pixels in a first region of the first image and increasing or maintaining the pixel values ​​of pixels in a second region of the first image to obtain a second image includes: The pixel values ​​of the pixels in the first region are multiplied by a first adjustment coefficient to obtain the pixel values ​​of the pixels in the first region in the second image; wherein the first adjustment coefficient is greater than 0 and less than 1; The pixel values ​​of the pixels in the second region are multiplied by a second adjustment coefficient to obtain the pixel values ​​of the pixels in the second region in the second image; wherein the second adjustment coefficient is greater than or equal to 1.

4. The method of claim 3, wherein, The second region includes N pixels, each of which corresponds to a second adjustment coefficient. The step of multiplying the pixel values ​​of the pixels within the second region by the second adjustment coefficient to obtain the pixel values ​​of the pixels within the second region in the second image includes: The second adjustment coefficient of the i-th pixel is calculated based on the brightness value of the i-th pixel; wherein the second adjustment coefficient of the i-th pixel is positively correlated with the brightness value of the i-th pixel, the second adjustment coefficient of the i-th pixel is greater than 1, i≤N, and i and N are both positive integers; Multiply the pixel value of the i-th pixel by the second adjustment coefficient of the i-th pixel to obtain the pixel value of the i-th pixel in the second image.

5. The method of claim 4, wherein, The first adjustment coefficient is the ratio of the first screen brightness to the second screen brightness. The first screen brightness is the screen brightness of the display before brightness adjustment, and the second screen brightness is the screen brightness of the display after brightness adjustment. The second screen brightness is greater than the first screen brightness and less than or equal to the maximum screen brightness of the display.

6. The method of claim 5, wherein, The second screen brightness is the maximum screen brightness.

7. The method of claim 5, wherein, The second screen brightness is the smaller value between the maximum screen brightness and the first brightness threshold, and the first brightness threshold is the product of the first screen brightness and a preset multiple, where the preset multiple is a natural number greater than 1.

8. The method according to any one of claims 1-2 or 4-7, characterized in that, The third region includes pixels in the target exposure image whose brightness value is less than a first threshold, and the fourth region includes pixels in the target exposure image whose brightness value is greater than a second threshold. The second threshold is greater than or equal to the first threshold. The first threshold and the second threshold are determined based on a first average brightness value, which is the average brightness value of all pixels in the target exposure image. The first threshold and the second threshold are positively correlated with the first average brightness value.

9. The method of claim 8, wherein, The first threshold is less than the first average brightness value, and the second threshold is greater than the first average brightness value.

10. A terminal device, comprising: The terminal device includes: a memory, a display screen, and one or more processors; the memory and the display screen are coupled to the processors. The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the processor, the terminal device performs the method as described in any one of claims 1-9.

11. A computer readable storage medium, characterized in that, Includes computer instructions; When the computer instructions are executed on a terminal device, the terminal device causes the terminal device to perform the method as described in any one of claims 1-9.