Image preview method and terminal device
By adjusting the image pixel value and display brightness, the problem in the existing technology that the contrast of HDR images does not change when displayed on a higher dynamic range device is solved, and a visual effect closer to the real scene is achieved.
Patent Information
- Application Number
- PCT/CN2023/133796
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-01-11
- Filing Date
- 2023-11-23
- Publication Date
- 2025-08-14
AI Technical Summary
The existing technology cannot make full use of display devices with higher dynamic range, causing the contrast between highlight areas and dark areas to remain unchanged when displaying HDR images, failing to achieve visual effects closer to real-world scenes.
By obtaining the pixel information and brightness information of the multi-frame image, the image is adjusted to increase the pixel value of the highlight area and reduce the pixel value of the dark area, combined with the display brightness adjustment, to generate a second image to improve the dynamic range.
It realizes displaying images in a higher dynamic range, making the highlight areas brighter and the dark areas darker, increasing the contrast and approaching the visual effect of real scenes.
Smart Images

Figure CN2023133796_14082025_PF_FP_ABST
Abstract
Description
Image preview method and terminal device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 11, 2023, with application number 202310068071.4 and invention name “An Image Preview Method and Terminal Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to an image preview method and terminal device. Background Art
[0003] With the development of the terminal industry, most terminal devices support high dynamic range (HDR) technology. HDR technology can capture and display the huge dynamic range of the real world, despite 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 and minimum values of a variable. In digital images, dynamic range represents the ratio between the maximum and minimum brightness within the image's displayable range, that is, the number of grayscale levels from "brightest" to "darkest" in the image. The larger the dynamic range of an image, the richer the brightness levels it can represent, and the more realistic the image's visual effect.
[0004] Currently, HDR technology is typically implemented by capturing multiple images of the same scene at different exposures, blending them into a single image, and then applying some form of tone mapping to bring the resulting image into the dynamic range of a standard dynamic range (SDR) display. The resulting image is typically stored as an 8-bit image, resulting in a dynamic range of approximately 255:1.
[0005] However, with the continuous improvement of display technology, most current display devices can provide a higher dynamic range than 255:1. However, when displaying the fused image, these display devices cannot display the image with a higher dynamic range.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide an image preview method and a terminal device for displaying an image with a smaller dynamic range with a higher dynamic range, thereby obtaining a visual range closer to a real-world scene.
[0008] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0009] In a first aspect, the present application provides an image preview method, which is applied to a terminal device including a display screen, and the method includes: in response to a user's operation of starting a camera application, obtaining multiple frames of images, wherein the multiple frames of images correspond one to one with multiple sets of exposure parameters; obtaining pixel information and brightness information of a first image obtained by fusing the multiple frames of images; wherein the pixel information includes a pixel value of each pixel point in the first image, and the brightness information includes a brightness value of each pixel point in the first image under a target exposure parameter, and 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 in the multiple sets of exposure parameters; adjusting the first frame of the image according to the pixel information and the brightness information An image is obtained, wherein pixels of the first image correspond one-to-one to pixels of the second image, pixel values of pixels within a first area in the first image are greater than pixel values of corresponding pixels in the second image, pixel values of pixels within a second area in the first image are less than or equal to pixel values of corresponding pixels in the second image, the first area includes pixels in the first image whose brightness values under target exposure parameters are less than a first threshold, the second area includes pixels in the first image whose brightness values under target exposure parameters are greater than a second threshold, and 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.
[0010] It can be understood that since the pixel value of the pixel point in the first area in the first image is greater than the pixel value of the corresponding pixel point in the second image, the pixel value of the pixel point in the second area in the first image is less than or equal to the pixel value of the corresponding pixel point in the second image, that is, in the process of the terminal device displaying the first image, the pixel value of the highlight area (that is, the second area) of the first image is increased or maintained, and the pixel value of the dark area (that is, the first area) is reduced. Therefore, after the screen brightness of the display screen is increased, the highlight area of the first image is brighter, the dark area of the first image is darker or close to the original brightness of the dark area of the first image, the contrast between the highlight area and the dark area is increased, and the first image is displayed with a higher dynamic range, so that the image displayed by the terminal device in the preview scene is closer to the real scene.
[0011] In one embodiment of the first aspect, obtaining brightness information of a first image includes: obtaining a target exposure image corresponding to a target exposure parameter; wherein the target exposure image is an image captured by a terminal device based on the target exposure parameter; grouping pixels in the target exposure image according to a preset grouping strategy, and taking the average brightness value of all pixels in each group of pixels as the brightness value of each pixel in the corresponding group of pixels in the first image under the target exposure parameter. In this manner, the obtained brightness information can reflect the actual brightness of the first image.
[0012] In an embodiment provided in the first aspect, if the target exposure parameter is the first parameter among multiple sets of exposure parameters, the target exposure image is the image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined based on at least two sets of exposure parameters among the multiple sets of exposure parameters, the target exposure image is an image obtained by fusing the image frames corresponding to the at least two sets of exposure parameters, and the pixels of the first image correspond one-to-one to the pixels of the target exposure image.
[0013] In an embodiment provided in the first aspect, a first image is adjusted according to pixel information and brightness information to obtain a second image, including: multiplying the pixel values of the pixel points in the first area by a first adjustment coefficient to obtain the pixel values of the pixel points in the first area in the second image; wherein the first adjustment coefficient is greater than 0 and less than 1; multiplying the pixel values of the pixel points in the second area by a second adjustment coefficient to obtain the pixel values of the pixel points in the second area in the second image; wherein the second adjustment coefficient is greater than or equal to 1.
[0014] In one embodiment provided in the first aspect, the second region includes N pixels, each of the N pixels corresponds to a second adjustment coefficient, and multiplying the pixel values of the pixels in the second region by the second adjustment coefficient to obtain the pixel values of the pixels in the second region in the second image includes: calculating the second adjustment coefficient of the i-th pixel 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; and multiplying 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. By setting different second adjustment coefficients for different pixels, the light and dark relationship between different pixels in the second region can be preserved.
[0015] In an 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 screen adjusts the brightness, the second screen brightness is the screen brightness after the display screen adjusts the brightness, 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 screen.
[0016] In an implementation provided in the first aspect, the second screen brightness is the maximum screen brightness.
[0017] In an embodiment provided in the first aspect, the second screen brightness is the smaller value between 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.
[0018] In an embodiment provided in the first aspect, the first threshold and the second threshold are determined based on the first brightness average, the first brightness average is the average of the brightness values of all pixels under the target exposure parameters, and the first threshold and the second threshold are positively correlated with the first brightness average.
[0019] In an implementation provided by 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.
[0020] In a second aspect, the present application provides a terminal device, comprising: a memory, a display screen, and one or more processors; the memory and the display screen are coupled to the processor; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the terminal device executes a method as described in any one of the first aspects.
[0021] In a third aspect, the present application provides a computer-readable storage medium comprising computer instructions; when the computer instructions are executed on a terminal device, the terminal device executes any one of the methods in the first aspect.
[0022] In a fourth aspect, the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the method of the first aspect and any possible design thereof.
[0023] In a fifth aspect, the present application provides a chip system comprising one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via a circuit. The chip system can be applied to a terminal device comprising a communication module and a memory. The interface circuit is configured to receive a signal from the memory of the terminal device and send the received signal to the processor, the signal comprising a computer instruction stored in the memory. When the processor executes the computer instruction, the terminal device can perform the method of the first aspect and any possible design thereof.
[0024] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;
[0026] FIG2 is an interface diagram of a terminal device provided in an embodiment of the present application;
[0027] FIG3 is a flowchart of an image preview method according to an embodiment of the present application;
[0028] FIG4A is a schematic diagram of fusing multiple frames of images to obtain a first image according to an embodiment of the present application;
[0029] FIG4B is a schematic diagram of obtaining a second image based on a first image according to an embodiment of the present application;
[0030] FIG5 is a second flow chart of an image preview method provided in an embodiment of the present application;
[0031] FIG6 is a schematic diagram of a grouping strategy provided in an embodiment of the present application;
[0032] FIG7 is a schematic diagram of another grouping strategy provided in an embodiment of the present application;
[0033] FIG8 is a comparison diagram of display effects provided by an embodiment of the present application;
[0034] FIG9 is a third flow chart of an image preview method provided in an embodiment of the present application;
[0035] FIG10 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality of" means two or more than two. In addition, in order to facilitate the clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0037] To make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:
[0038] Dynamic range is used in many fields to express the ratio of a variable's maximum to minimum values. In digital images, dynamic range represents the ratio between the maximum and minimum brightness levels within the image's displayable range, or the number of grayscale levels from "brightest" to "darkest." The greater the dynamic range of an image, the richer the brightness levels it can represent, and the more realistic the image's visual quality.
[0039] Generally, signals with a dynamic range of image light signal values exceeding 0.01 to 1000 nits are referred to as high dynamic range light signal values, and signals with a dynamic range of image light information values less than 0.1 to 400 nits are referred to as standard dynamic range (SDR) light signal values. Images with a high dynamic range are referred to as HDR images, and images with a standard dynamic range are referred to as SDR images. HDR images can be used to describe the full visual range of real-world scenes. HDR images can display detailed information in extremely dark and bright areas that may be lost by traditional camera equipment but can be perceived by the human visual system.
[0040] Exposure values (EV) can reflect the exposure level of an image. By adjusting the exposure parameters of the camera, the image can have different EVs. Among them, exposure parameters refer to parameters used to affect the exposure amount of the camera, including but not limited to aperture, shutter, exposure time, and sensitivity (ISO), etc. In the embodiment of the present application, the exposure value of normal exposure is expressed as EV0, the exposure value of underexposure is expressed as EV-, and the exposure value of overexposure is expressed as EV+. In addition, the exposure value EV0×2 n Expressed as EVn. For example, EV-1 means half of EV0, and EV-2 means half of EV-1. For another example, EV1 means twice of EV0, and EV2 means twice of EV1.
[0041] One solution provided by existing technology involves a terminal device capturing multiple images of the same scene at different exposure values and fusing them together to create an "HDR image." However, these "HDR images" are typically 8-bit images, resulting in a dynamic range of approximately 255:1. This means the dynamic range of the "HDR image" remains within the standard dynamic range. In other words, these "HDR images" are actually SDR images.
[0042] 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 device's screen brightness. However, during this change, the brightness of the highlight and shadow areas of the HDR image can change proportionally, which means the contrast between the highlight and shadow areas does not change. 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.
[0043] In view of this, an embodiment of the present application provides an image preview method, which is applied to a terminal device. The terminal device can obtain multiple frames of images after turning on the camera application and fuse the multiple frames of images to obtain a first image, which is equivalent to an SDR image. The terminal device can then obtain pixel information and brightness information of the first image. The brightness information includes the brightness value of each pixel in the first image under the target exposure parameters, which can be used to reflect the actual brightness of the first image. The first image is then adjusted according to the pixel information and the brightness information to obtain a second image, wherein the pixel value of the pixel point in the first area of the first image is greater than the pixel value of the corresponding pixel point in the second image, and the pixel value of the pixel point in the second area of the first image is less than or equal to the pixel value of the corresponding pixel point in the second image. The terminal device then increases the screen brightness of the display screen and displays the second image on the display screen.
[0044] It can be seen that 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 reduce the pixel value of the dark area (i.e., the first area). Therefore, after increasing the screen brightness of the display screen, the highlight area of the SDR image is brighter, the dark area of the SDR image is darker or close to the original brightness of the dark area of the SDR image, thereby increasing the contrast between the highlight area and the dark area, thereby displaying the SDR image with a higher dynamic range, so that the SDR image displayed by the terminal device in the image preview scene is closer to the real scene.
[0045] Among them, the terminal device provided in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, etc., which have a camera and a display screen. The embodiment of the present application does not impose any special restrictions on the specific type of the terminal device.
[0046] Figure 1 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. As shown in Figure 1, 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc.
[0047] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
[0048] It should be 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 shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0049] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0050] The controller can be the nerve center and command center of the terminal device. The controller can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
[0051] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0052] In some embodiments, the processor 110 may include one or more interfaces. The 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, and a processor interface.
[0053] (Mobile Industry Processor Interface, MIPI), general-purpose input / output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (USB) interface, etc.
[0054] It is understood that the interface connection relationship between the modules illustrated in this embodiment is only for illustrative purposes and does not constitute a structural limitation on the terminal device. In other embodiments, the terminal device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0055] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also power the terminal device through the power management module 141.
[0056] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be provided in the same device.
[0057] 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, so that the terminal device can communicate with the network and other devices through wireless communication technology.
[0058] 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 a single or multiple 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 other embodiments, the antennas can be used in conjunction with a tuning switch.
[0059] Mobile communication module 150 can provide wireless communication solutions for terminal devices, including 2G / 3G / 4G / 5G. It can include at least one filter, switch, power amplifier, and low-noise amplifier (LNA). Mobile communication module 150 receives electromagnetic waves from antenna 1, filters and amplifies the received electromagnetic waves, and transmits them to the modem processor for demodulation.
[0060] 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 of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0061] The wireless communication module 160 can provide wireless communication solutions applied to terminal devices, including WLAN (such as wireless fidelity, Wi-Fi network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0062] Wireless communication module 160 can be one or more devices that integrate at least one communication processing module. Wireless communication module 160 receives electromagnetic waves via antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to processor 110. Wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0063] The terminal device implements display functionality through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0064] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.
[0065] The terminal device can implement a camera function through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP is responsible for processing data fed back by camera 193. Camera 193 is responsible for capturing 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.
[0066] 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 terminal device. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0067] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area.
[0068] The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 can include a high-speed random access memory and a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0069] The terminal device can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, etc. For example, music playback, recording, etc. Buttons 190 include a power button, volume button, etc. Buttons 190 can be mechanical buttons. Or they can be touch buttons. Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts or for touch vibration feedback. Indicator 192 can be an indicator light that can be used to indicate charging status, power changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device by inserting or removing it from the SIM card interface 195. The terminal device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0070] The image preview method provided by this application is described in detail below with reference to the accompanying drawings.
[0071] An image preview method provided in an embodiment of the present application can be applied to a terminal device including a display screen. For example, taking a mobile phone as the terminal device, an application with a shooting function (hereinafter referred to as a camera APP) can be installed in the mobile phone, and the user can use the camera APP to take pictures and videos. In the process of the user using the camera APP to shoot, the mobile phone collects multiple frames of images with different exposure values, and can obtain the pixel information and brightness information of the first image obtained by fusing the multiple frames of images. Then, based on the current screen brightness and maximum screen brightness of the display screen, the first image is tone mapped to obtain a second image, and finally the second image is displayed on the display screen after the screen brightness is increased. Among them, the second image is an image obtained by the mobile phone using the image preview method provided by the present application. For details, see Figure 3 and related text descriptions, which will not be described here for the time being.
[0072] For example, as shown in FIG2(a), the main interface 201 (also referred to as the desktop) of a mobile phone includes a camera application icon 202. The mobile phone can receive a user click operation on the camera application icon 202 (i.e., the user launches the camera application). In response to the click operation, as shown in FIG2(b), the mobile phone increases the screen brightness of the display screen and displays an image 203, which is the second image.
[0073] In order to implement the image preview method provided by this application, based on the terminal device shown in Figure 1, this application provides an implementation method of the image preview method. The image preview method can be executed by the terminal device shown in Figure 1. As shown in Figure 3, Figure 3 is a flow chart of an image preview method provided by this application. The image preview method includes the following steps:
[0074] S301, in response to a user's operation of starting a camera application, the terminal device obtains multiple frames of images, and the multiple frames of images correspond to multiple sets of exposure parameters one by one.
[0075] Among them, the user's operation of opening the camera application can be an operation of clicking the camera application icon, or an operation of enabling the shooting function on a third-party application such as communication and social networking, and there is no specific restriction here.
[0076] That is, the terminal device can obtain multiple frames of images during the preview process. These multiple frames of images are images captured by the terminal device in the same scene under different exposure parameters. It should be noted that after the terminal device captures these multiple frames of images, it will not directly display the multiple frames of images. Instead, after processing the second image obtained through the image preview method provided by this application (see below for details), the second image is directly displayed.
[0077] In an optional embodiment, the multiple frames of images are obtained by capturing images using different cameras with different exposure parameters. In another optional embodiment, the multiple frames of images can also be obtained by capturing images multiple times in a short period of time using a single camera with different exposure parameters, with the time interval between each capture being as small as possible.
[0078] Since the multiple frames of images correspond to a set of exposure parameters respectively, the exposure values of the multiple frames of images are not the same. For example, as shown in Figure 4A, the multiple frames of images may include image 1 and image 2. Among them, image 1 is taken by camera 1 based on exposure parameter 1, and image 2 is taken by camera 2 based on exposure parameter 2. Camera 1 and camera 2 can be the same camera or different cameras. It can be seen that the EV value corresponding to image 1 is smaller than the EV value corresponding to image 2. Image 1 is underexposed, which results in a clearer outline in the highlight area of the picture, but the dark area is blurred due to lack of exposure. Image 2 is overexposed, which causes the highlight area in the picture to be distorted due to overexposure, while the dark area can clearly see the details and outline due to the compensation of the exposure value.
[0079] It should be noted that Figure 4A only takes images under EV- and EV+ as an example. In fact, the mobile phone can also obtain images under more exposure conditions, such as images under EV0, EV-1, EV-2, EV+1, EV+2, etc., and no specific restrictions are made here.
[0080] S302: Acquire a first image based on multiple frames of images.
[0081] Among them, the first image is an image obtained by the terminal device by fusing multiple frames of images. Specifically, the terminal device can fuse multiple frames of images into the first image in a tone mapping manner. Among them, the tone mapping may include global tone mapping and local tone mapping. Global tone mapping can be mapped using a histogram, a gamma function, a Sigmoid nonlinear function, etc. Global tone mapping can well preserve the global contrast, but will lose some local details. Local tone mapping can first divide the multiple frames of images into regions, and then process each divided region in a manner similar to global tone mapping, and finally preserve the relative contrast between adjacent regions, which can well preserve local details.
[0082] For example, as shown in FIG4A , the terminal device may fuse image 1 and image 2 to obtain image 3 (i.e., the first image). Compared to a single-frame image (i.e., image 1 or image 2), image 3 has more obvious details and contours in both dark and highlight areas, and has a higher dynamic range.
[0083] S303: Obtain pixel information and brightness information of the first image.
[0084] The pixel information includes the pixel value of each pixel in the first image. Depending on the type of image sensor that captures the image, the pixel value of each pixel includes but is not limited to RGB value, RGGB value, RGBW value, RYYB value, etc. RGB indicates that the color of each pixel is composed of three components: red (red, R), green (green, G), and blue (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 (white, W). RYYB indicates that the color of each pixel is composed of four components: red, yellow (yellow, Y), yellow, and blue. The pixel value of each pixel can be obtained by the image sensor.
[0085] The brightness information includes the brightness value of each pixel in the first image under the target exposure parameter. In an optional embodiment, the target exposure parameter is any one of a plurality of exposure parameter groups, or a combination of at least two exposure parameter groups. It should be noted that if the target exposure parameter is greater than the first value, the dark details of the first image are relatively clear; if the target exposure parameter is less than the second value (the second value is less than the first value), the highlight area of the first image is relatively clear and there is no overexposure; if the target exposure parameter is between the first value and the second value, the first image has a relatively clear light-dark contrast and there is no overexposure or underexposure. In an optional embodiment, the target exposure parameter can be a parameter obtained by combining multiple exposure parameter groups, that is, the exposure parameter corresponding to the first image. For example, the target exposure parameter includes exposure time and sensitivity. The terminal device performs a weighted summation on the exposure time and sensitivity of at least two exposure parameter groups to obtain the exposure time and sensitivity as the target exposure parameter.
[0086] For example, the 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 adjust the exposure time, sensitivity, and other parameters to adjust the EV between EV+1 and EV+2 to obtain the target exposure parameter.
[0087] In another optional embodiment, the terminal device may input multiple exposure parameters into a pre-trained neural network model to obtain the target exposure parameters. For example, the terminal device or server may iteratively train the initial model based on a large number of training samples until the initial model converges, thereby obtaining a trained neural network model. Each set of training samples includes multiple exposure parameters and a target exposure parameter labeled as true or false. In this way, the trained neural network model can be used to obtain the target exposure parameter based on the multiple input exposure parameters.
[0088] In short, the target exposure parameter can affect the brightness and darkness effect of the first image, and its specific determination method can be set and maintained in advance in the background by the operation and maintenance personnel according to the brightness and darkness effect required for the first image.
[0089] S304: Adjust the first image according to the pixel information and the brightness information to obtain a second image.
[0090] The first image includes multiple regions, including at least a first region and a second region, where the first region is a dark region in the first image and the second region is a highlight region in the first image. Specifically, the first region includes pixels in the first image whose brightness values under target exposure parameters are less than a first threshold, and the second region includes pixels in the first image whose brightness values under the target exposure parameters are greater than a second threshold, where the second threshold is greater than or equal to the first threshold.
[0091] In an embodiment of the present application, the terminal device may determine the first threshold and the second threshold based on the first brightness mean, and the first threshold and the second threshold are positively correlated with the first brightness mean (including linear or nonlinear). The first brightness mean is the average of the brightness values of all pixels under the target exposure parameters, which is used to reflect the true brightness level of the first image. For example, if the bit width of the brightness value is 8 bits, after digitizing it, the brightness value ranges from 0 to 255. After digitizing each brightness value, taking the average value can obtain the first brightness mean.
[0092] In an optional embodiment, the first threshold is equal to the second threshold (for example, both are first brightness mean values). In this case, the first image includes two regions, namely the first region and the second region. Specifically, the terminal device may divide the pixels whose brightness values under the target exposure parameters are less than the first threshold (second threshold) into the first region, and divide the pixels whose brightness values under the target exposure parameters are greater than or equal to the first threshold (second threshold) into the second region. In this way, the first region may include pixels in the darker region of the first image, and the second region may include pixels in the brighter region of the first image.
[0093] For example, the first threshold value may be 165. If the brightness value of pixel 1 under the target exposure parameters is 100, since 100 < 165, pixel 1 is classified into the first region. If the brightness value of pixel 2 under the target exposure parameters is 188, since 188 > 165, pixel 2 is classified into the second region.
[0094] In an optional embodiment, the second threshold is greater than the first threshold. For example, the second threshold is a value obtained by increasing the first value based on the first average brightness value, or a value obtained by increasing the second value based on the first average brightness value (the second value is less than the first value); or, the second threshold is a value obtained by increasing the first value based on the first average brightness value, or a value obtained by decreasing the second value based on the first average brightness value (both the second value and the first value 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 may classify pixels whose brightness values under the target exposure parameters are less than the first threshold into the first region, pixels whose brightness values under the target exposure parameters are greater than or equal to the second threshold into the second region, and pixels whose brightness values under the target exposure parameters are greater than or equal to the first threshold and less than the second threshold into the third region. In this way, the first region can include pixels in the darker region of the first image, and the second region can include pixels in the brighter region of the first image.
[0095] In an optional implementation, the first threshold is smaller than the first average brightness value, and the second threshold is larger than the first average brightness value.
[0096] It should be noted that the above only shows two ways of dividing the image areas. The embodiment of the present application can also use a more sophisticated partitioning method to divide the first image into more image areas, and no specific limitation is made here.
[0097] The pixels of the first image correspond one-to-one to the pixels of the second image, and the second image also includes a first region and a second region. The pixel values of the pixels within 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 within the second region of the first image are less than or equal to the pixel values of the corresponding pixels in the second image. In other words, the terminal device reduces the pixel values of the pixels within the first region of the first image and increases or maintains the pixel values of the pixels within the second region of the first image to obtain the second image.
[0098] For example, as shown in FIG4B , the terminal device may divide the first image into multiple regions based on the brightness information of the first image ( FIG4B takes the first image including three regions as an example), and then adjust the first image based on 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 region and the dark region of the second image is greater than the contrast between the highlight region and the dark region of the first image.
[0099] S305: Increase the screen brightness of the display screen and display the second image on the display screen.
[0100] It can be understood that the pixel points have an observed brightness. The observed brightness of the pixel point can indicate the brightness and darkness of the pixel point on the display screen. Among them, the observed brightness of the pixel point is related to the screen brightness of the display screen and the pixel value of the pixel point. In an optional embodiment, the observed brightness of a pixel point may satisfy the formula: Lg=Gray*Lp, wherein Lg is the observed brightness, Lp is the screen brightness, and Gray is the pixel grayscale. The pixel grayscale of the pixel point can be determined according to the pixel value of the pixel point, wherein the larger the pixel value, the larger the pixel grayscale. For example, the pixel grayscale and the pixel value may satisfy the formula: Gray=0.299R+0.587G+0.114B.
[0101] It can be seen that when an image is displayed on a display screen, both the screen brightness and the pixel value of the display screen affect the brightness of the pixel on the screen. Specifically, when the pixel value of a pixel is constant, the higher the screen brightness of the display screen, the higher the observed brightness of the pixel, that is, the brighter the pixel appears. When the screen brightness of the display screen is constant, the higher the pixel value of the pixel, the higher the observed brightness of the pixel, that is, the brighter the pixel appears.
[0102] It can be understood that, because the pixel values of the pixels in the first area of the second image are smaller than the pixel values of the pixels in the first area of the first image, increasing the screen brightness of the display screen can make the observed brightness of the pixels in the first area of the second image closer to the observed brightness before the screen brightness was adjusted; and because the pixel values of the pixels in the first area of the second image are greater than or equal to the pixel values of the pixels in the second area of the first image, increasing the screen brightness of the display screen can make the observed brightness of the pixels in the second area of the second image greater than the observed brightness before the screen brightness was adjusted. In other words, increasing the screen brightness of the display screen and displaying the second image on the display screen can keep the observed brightness of the first area of the second image unchanged, while increasing the observed brightness of the second area of the first image, i.e., increasing the contrast between the first and second areas of the second image and expanding the dynamic range of the second image.
[0103] In an embodiment of the present application, the terminal device can adjust the screen brightness of the display screen from a first screen brightness to a second screen brightness. The second screen brightness is greater than the first screen brightness and less than or equal to the maximum screen brightness of the display screen. The maximum screen brightness is the maximum brightness supported by the display screen.
[0104] It can be understood that the first screen brightness is the screen brightness before the display screen adjusts the brightness, and can also be understood as the current screen brightness of the display screen. The terminal device can directly read the relevant parameters of the display screen to obtain the first screen brightness.
[0105] The second screen brightness is the screen brightness after the display screen adjusts its brightness. In an optional embodiment, the second screen brightness is associated with the first screen brightness and the maximum screen brightness of the display screen. Specifically, the terminal device may determine the first brightness threshold based on the first screen brightness. For example, the terminal device may use a preset multiple of the first screen brightness as the first brightness threshold, and the preset multiple may be any value greater than 1, such as 3. Then, the terminal device may compare the first brightness threshold with the maximum screen brightness. If the first brightness threshold is less than or equal to the maximum screen brightness, the second screen brightness is determined to be the first brightness threshold; if the first brightness threshold is greater than the maximum screen brightness, 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.
[0106] In another optional embodiment, the second screen brightness can be fixed to the maximum screen brightness, that is, no matter what the current screen brightness is, the terminal device always uses the maximum screen brightness as the second screen brightness and adjusts the screen brightness of the display screen to the maximum screen brightness.
[0107] In an optional embodiment, the terminal device may multiply the pixel values of the pixels in the first area by a first adjustment coefficient to obtain the pixel values of the pixels in the first area in the second image, and multiply the pixel values of the pixels in the second area by a second adjustment coefficient to obtain the pixel values of the pixels in the second area 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.
[0108] It can be understood that the first adjustment coefficient is greater than 0 and less than 1, which can reduce the pixel value of the pixel points in the first area in the first image, so that the pixel value of the pixel points in the first area in the second image is less than the pixel value of the pixel points in the first area in the first image; the second adjustment coefficient is greater than or equal to 1, which can increase or maintain the pixel value of the pixel points in the second area in the first image, so that the pixel value of the pixel points in the first area in the second image is greater than or equal to the pixel value of the pixel points in the second area in the first image.
[0109] In an optional embodiment, the first adjustment coefficient is a ratio of the first screen brightness to the second screen brightness. Since the first screen brightness is always lower than the second screen brightness, the first adjustment coefficient is greater than 0 and less than 1. This can reduce the pixel values of the pixels in the first region of the first image, so that the observed brightness of the pixels in the first region becomes smaller, that is, they appear darker.
[0110] In an optional embodiment, the second adjustment coefficient can be 1. In this case, the pixel values of the pixels in the second area of the first image can be kept unchanged, so that the observed brightness of the pixels in the second area remains unchanged, that is, the brightness appears unchanged.
[0111] In another optional embodiment, the second adjustment coefficient is a variable value and is related to the brightness value of each pixel. The second adjustment coefficient of each pixel is related to the brightness value of the pixel under the target exposure parameters. Specifically, if the second area includes N pixels, the second adjustment coefficient of the i-th pixel satisfies the formula: Q2 i =1+L i / L max Among them, Q2 i Indicates the second adjustment coefficient of the i-th pixel, L i Indicates the brightness value of the i-th pixel under the target exposure parameters, L max Represents the maximum brightness value of a pixel. For example, assuming a brightness value with an 8-bit bit width, the brightness value ranges from 0 to 255. If the brightness value of a pixel is C, then the second adjustment coefficient corresponding to that pixel is Q2 = 1 + C / 255. This method allows different pixel values to have different second adjustment coefficients, preserving the brightness and darkness relationship between different pixels in the second region as much as possible.
[0112] In an optional implementation, based on the image preview method shown in FIG3 , this embodiment provides a method for obtaining brightness information of a first image.
[0113] As shown in Figure 5, Figure 5 is a flow chart of an image preview method provided by the present application. As shown in Figure 5, obtaining brightness information of the first image may include the following steps:
[0114] S501: Acquire a target exposure image corresponding to a target exposure parameter.
[0115] The image corresponding to the target exposure parameter is the target exposure image. The target exposure image can be understood as the exposure image that should be obtained when the terminal device captures the image using the target exposure parameter. If the target exposure parameter is one of multiple exposure parameter sets, the target exposure image may be the image captured by the terminal device using that exposure parameter set. If the target exposure parameter is a parameter obtained by combining at least two of the multiple exposure parameter sets, the target exposure image may be an image obtained by fusing the image frames corresponding to the at least two exposure parameter sets. For example, the multiple exposure parameter sets include EV0, EV-, and EV+, corresponding to EV0 image frames, EV- image frames, and EV+ image frames, respectively. If the target exposure parameter is EV0, the EV0 image frame is used as the target exposure image. If the target exposure parameter is a parameter obtained by combining EV- and EV+, the image obtained by fusing the EV- and EV+ image frames is used as the target exposure image. For another example, if the target exposure parameter is a parameter obtained by combining multiple exposure parameters, the first image obtained by fusing multiple image frames corresponding to the multiple exposure parameters is used as the target exposure image.
[0116] It should be noted that the target exposure image and the first image can be the same or different. For example, the mobile phone captures an EV0 image, an EV- image, and an EV+ image, and obtains the first image based on the EV0 image, the EV- image, and the EV+ image. If the mobile phone uses EV0 as the target exposure parameter, the first image and the target exposure image are different. The brightness value of a pixel in the first image under the target exposure parameter is the brightness value of the pixel in the EV0 image. If the target exposure parameter is a parameter obtained by combining EV-, EV0, and EV+, the first image and the target exposure image are the same.
[0117] The pixels of the target exposure image correspond one-to-one with the pixels of the first image. The correspondence between pixel 1 of the target exposure image and pixel 2 of 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.
[0118] S502: Group the pixels in the target exposure image according to a preset grouping strategy, and use the average of the brightness values of all pixels in each 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.
[0119] The grouping strategy can be set according to actual needs. For example, the grouping strategy can divide a pixel into a group, or can divide a pixel matrix consisting of n×m pixels into a group. For example, a pixel matrix consisting of 2×2 or 3×2 pixels can be divided into a group, without specific limitation here.
[0120] If the terminal device divides a pixel into a group, the terminal device may use the brightness value of the 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 may use the average brightness value of the group of pixels as the brightness value of each pixel in the group of pixels corresponding to the first image under the target exposure parameters, or the terminal device may use the average brightness value remaining after removing outliers in the brightness values of the group of pixels as the brightness value of each pixel in the group of pixels corresponding to the first image under the target exposure parameters. No specific restrictions are imposed herein.
[0121] For example, Figure 6 illustrates a grouping strategy. In Figure 6, the terminal device treats a pixel as a pixel group. The pixel value of pixel A1 is R1G1B1, and the pixel value of pixel A2 is R2G2B2, and pixel A1 corresponds to pixel A2. 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 using the pixel values R1, G1, and B1 of pixel A1, and used as the brightness value of pixel A2 under the target exposure parameters.
[0122] The luminance value and pixel value satisfy the equation: L = 0.299R + 0.587G + 0.114B. L is the luminance value. For example, if the pixel value of pixel A1 is (R100, G100, B100), the luminance value of pixel A1 can be determined to be 0.299R + 0.587G + 0.114B = 29.9 + 58.7 + 11.4 = 100. Therefore, the luminance value of pixel A2 under the target exposure parameters is 100.
[0123] For example, Figure 7 shows another grouping strategy. In Figure 7, the first image and the target exposure image both include 9×4 pixels. The terminal device divides the 9×4 pixels into 12 groups, each group of pixels includes 3×1 pixels. Among them, pixel group 1 includes pixel M1, pixel M2, and pixel M3. Pixel group 2 includes pixel N1, pixel N2, and pixel N3. Among them, pixel M1 corresponds to pixel N1, pixel M2 corresponds to pixel N2, and pixel M3 corresponds to pixel N3. The pixel values of pixel M1 are R3, G3, B3, and W3, the pixel values of pixel M2 are R4, G4, B4, and W4, and the pixel values of pixel M3 are R5, G5, B5, and W5. The pixel values of pixel N1 are R6, G6, B6, and W6, the pixel values of pixel N2 are R7, G7, B7, and W7, and the pixel values of pixel 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 value (R3, G3, B3, W3) of pixel point M1, calculate the brightness value L4 based on the pixel value (R4, G4, B4, W4) of pixel point M2, and calculate the brightness value L5 based on the pixel value (R5, G5, B5, W5) of pixel point M3, and then use the average value L6 of the brightness value L3, the brightness value L4, and the brightness value L5 as the brightness value of each pixel point in pixel group 2 (i.e., pixel point N1, pixel point N2, pixel point N3) under the target exposure parameters.
[0124] In an optional implementation, the terminal device may further perform an encoding operation on pixel information of the first image to obtain an image video stream, and perform an encoding operation on brightness information of the first image to obtain a brightness information video stream.
[0125] In an embodiment of the present application, the terminal device can encode pixel information using the Joint Photographic Experts Group (JPEG) standard, high efficiency video coding (HEVC), portable network graphics (PNG), run-length encoding (RLE), etc. to obtain an image video stream.
[0126] The terminal device may encode the brightness information using a linear encoding or nonlinear encoding method to obtain the second encoded data. Each encoded brightness value may have a bit width of 8 bits, 10 bits, or even higher. Nonlinear encoding may include encoding using a gamma function, etc., which is not specifically limited here. Furthermore, when encoding the brightness information, the grouping method of the pixel groups may also be encoded into the brightness information video stream.
[0127] By encoding the pixel information and brightness information of the first image separately, the brightness information that can reflect the actual brightness of the first image can be retained, which facilitates the subsequent adjustment of the brightness of the first image during the display of the first image.
[0128] In an optional implementation, the terminal device may further perform decoding operations on the image video stream and the brightness information video stream respectively to obtain pixel information and brightness information.
[0129] As an example, the specific implementation process of the image preview method provided in this embodiment is described by taking a mobile phone as adjusting its screen brightness from a first brightness A to a second brightness C, with a first adjustment coefficient of A / C and a second adjustment coefficient of 1. 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 the pixels in the first region of the first image are reduced by a factor of A / C, resulting in a reduction in the grayscale of the pixels in the first region by a factor of A / C; the pixel values of the pixels in the second region of the first image remain unchanged. When the mobile phone adjusts the screen brightness from the first brightness A to the second brightness C, the screen brightness of all pixels in the first image is increased by a factor of C / A. This shows that the observed brightness of the pixels in the first region is first reduced by a factor of A / C and then increased by a factor of C / A, reaching the same level as the original observed brightness; while the observed brightness of the pixels in the second region is increased by a factor of C / A, exceeding the original observed brightness. This increases the contrast between the first and second regions of the second image, broadening the dynamic range of the second image.
[0130] For example, the first image can be as shown in Figure 8(a), where 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 shown in Figure 8(b) for image 802. In image 802, the observed brightness of first region 802a and second region 802b are both increased, but the light-dark contrast of image 802 does not change and remains the same as that of first image 801. After obtaining the second image of the first image, the mobile phone increases the screen brightness and displays the second image. The display effect can be as shown in Figure 8(c) for image 803. It can be seen that the observed brightness of the first area 803a in image 803 is close to the observed brightness of the first area 801a in the first image 801, and the observed brightness of the second area 803b in image 803 is significantly higher than the observed brightness of the second area 801b in the first image 801. Compared with the first image 801, the first area 803a and the second area 803b in image 803 have a higher light-dark contrast, and image 803 has a larger dynamic range.
[0131] With respect to the image preview method provided in the above embodiment, this embodiment provides a possible specific example, as shown in FIG9 , which includes the following steps: an electronic device performs image capture to obtain multiple frames of images, and then obtains pixel information and brightness information of a first image obtained by fusion of the multiple frames of images; 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, it is necessary to first decode the image video stream and the brightness information video stream separately to obtain the first image (standard dynamic image) and the brightness information of the first image, and then adjust the pixel value of the first image based on the maximum screen brightness of the display screen (which can also be understood as the brightness capability), and finally increase the screen brightness of the display screen, and display the adjusted first image (i.e., the second image) on the display screen. It should be noted that 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 in Figure 9 is 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.
[0132] In summary, the image preview method provided in the embodiment of the present application increases the observed brightness of each pixel by increasing the screen brightness of the terminal device during the display of the first image; simultaneously, the observed brightness of the pixels in the first area is reduced by reducing the pixel values of the pixels in the first area, and the observed brightness of the pixels in the second area is increased or maintained by increasing or maintaining the pixel values of the pixels in the second area, thereby achieving the effect of not changing the observed brightness of the pixels in the second area but increasing the observed brightness of the pixels in the second area. In other words, during the display of the SDR image (the first image), the bright areas in the SDR image can be made brighter, and the dark areas can be made darker or remain unchanged, thereby increasing the brightness-darkness contrast of the SDR image and expanding the dynamic range of the SDR image.
[0133] Some embodiments of the present application provide a terminal device, which may include a memory, a display, and one or more processors. The memory, display, and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the terminal device can perform the various functions or steps performed by the terminal device in the above-described method embodiments. The structure of the terminal device can refer to the structure of the terminal device shown in Figure 1.
[0134] An embodiment of the present application also provides a chip system (e.g., a system on a chip (SoC)). As shown in FIG10 , the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (e.g., a memory of a terminal device). For another example, the interface circuit 1002 can be used to send signals to other devices (e.g., the processor 1001 or a touch screen of a terminal device). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the terminal device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiment of the present application.
[0135] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned terminal device, the terminal device executes each function or step executed by the terminal device in the above-mentioned method embodiment.
[0136] An embodiment of the present application further provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute each function or step executed by the terminal device in the above method embodiment.
[0137] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.
[0138] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0142] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An image preview method, It is characterized in that Applied to a terminal device including a display screen, the method comprises: In response to a user's operation of starting a camera application, a plurality of frames of images are acquired, where the plurality of frames of images correspond one to one to a plurality of sets of exposure parameters; Obtaining pixel information and brightness information of a first image obtained by fusing the multiple frames of images; wherein the pixel information includes a pixel value of each pixel in the first image, and the brightness information includes a brightness value of each pixel in the first image under a target exposure parameter, and the target exposure parameter is any one of the multiple groups of exposure parameters or a combination of at least two of the multiple groups of exposure parameters; The first image is adjusted according to the pixel information and the brightness information to obtain a second image; wherein the pixels of the first image correspond to the pixels of the second image one by one, the pixel values of the pixels in a first area of the first image are greater than the pixel values of the corresponding pixels in the second image, the pixel values of the pixels in a second area of the first image are less than or equal to the pixel values of the corresponding pixels in the second image, the first area includes the pixels in the first image whose brightness values are less than a first threshold under the target exposure parameters, the second area includes the pixels in the first image whose brightness values are greater than a second threshold under the target exposure parameters, and 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.
2. The method according to claim 1, It is characterized in that Obtaining brightness information of the first image, including: Acquire a target exposure image corresponding to the target exposure parameter; wherein the target exposure image is an image captured by the terminal device based on the target exposure parameter; The pixels in the target exposure image are grouped according to a preset grouping strategy, and the average of the brightness values of all pixels in each group of pixels is used as the brightness value of each pixel in a corresponding group of pixels in the first image under the target exposure parameters.
3. The method according to claim 2, It is characterized in that If the target exposure parameter is the first parameter among the multiple sets of exposure parameters, the target exposure image is the image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two sets of exposure parameters among the multiple sets of exposure parameters, the target exposure image is an image obtained by fusing the image frames corresponding to the at least two sets of exposure parameters, and the pixels of the first image correspond one-to-one to the pixels of the target exposure image.
4. The method according to any one of claims 1 to 3, It is characterized in that The step of adjusting the first image according to the pixel information and the brightness information to obtain a second image includes: Multiplying the pixel values of the pixels in the first area by a first adjustment coefficient to obtain the pixel values of the pixels in the first area in the second image; wherein the first adjustment coefficient is greater than 0 and less than 1; Multiply the pixel values of the pixels in the second area by a second adjustment coefficient to obtain the pixel values of the pixels in the second area in the second image; wherein the second adjustment coefficient is greater than or equal to 1.
5. The method according to claim 4, It is characterized in that The second area includes N pixels, each of the N pixels corresponds to a second adjustment coefficient, and multiplying the pixel values of the pixels in the second area by the second adjustment coefficient to obtain the pixel values of the pixels in the second area in the second image includes: Calculating a second adjustment coefficient of the i-th pixel according to 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, and the second adjustment coefficient of the i-th pixel is greater than 1, i≤N, and i and N are both positive integers; The pixel value of the i-th pixel point is multiplied by the second adjustment coefficient of the i-th pixel point to obtain the pixel value of the i-th pixel point in the second image.
6. The method according to claim 4 or 5, It is characterized in that 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 screen adjusts the brightness, the second screen brightness is the screen brightness after the display screen adjusts the brightness, the second screen brightness is greater than the first screen brightness and less than or equal to the maximum screen brightness of the display screen.
7. The method according to claim 6, It is characterized in that The second screen brightness is the maximum screen brightness.
8. The method according to claim 6, It is characterized in that The second screen brightness is the smaller value between 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.
9. The method according to any one of claims 1 to 8, It is characterized in that The first threshold and the second threshold are determined based on a first brightness mean, where the first brightness mean is the mean of the brightness values of all pixels under the target exposure parameters, and the first threshold and the second threshold are positively correlated with the first brightness mean.
10. The method according to claim 9, It is characterized in that The first threshold is smaller than the first average brightness value, and the second threshold is larger than the first average brightness value.
11. A terminal device, It is characterized in that The terminal device comprises: a memory, a display screen and one or more processors; the memory and the display screen are coupled to the processor; The memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the terminal device executes the method as described in any one of claims 1-10.
12. A computer-readable storage medium, It is characterized in that including computer instructions; When the computer instructions are executed on a terminal device, the terminal device is caused to execute the method according to any one of claims 1 to 10.