Light spot display method, device and electronic equipment
By using the high -saturation pixels in MEF images in the background blur processing processing in the background blur process to replace the point optical source pixels in the first image, the problem of lack of light sources in the existing technology in the existing technology has achieved a more vivid color and more colorful color and more color and more color and more color and more color and more color and more color and more color and more color and The number of light spots improves the visual experience.
Patent Information
- Application Number
- CN202410600123.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-05-14
AI Technical Summary
In the prior art, during background blurring, the spot effect of the point light source has problems of color and quantity missing, which affects the user's visual experience.
By obtaining the first image and its corresponding multi -exposure fusion MEF images, determine the first pixel and replace it with a second pixel with higher saturation in MEF images to obtain the target image. Then, the background blurring of the target image is used to display the light spots based on the second pixel.
The light spots effect of the light source after the background blur is improved. The color is more vivid and the number is significantly increased, which improves the user's visual experience.
Smart Images

Figure CN118509715B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a light spot display method, device and electronic equipment. Background Art
[0002] When users take pictures, there may be one or more point light sources in the background of the image. Point light source is an optical term used to describe light emitted from a very small area or point. Point light sources can be, for example, street lights, car lights, lights inside buildings in city night scenes, or sunlight shining through gaps between leaves and branches in tree shade scenes.
[0003] Background blur is a common photography technique that can enhance the visual effect of an image by reducing the clarity and details of the background to highlight the subject.
[0004] When blurring the background of an image, point light sources in the image are usually displayed as light spot effects. However, the current background blurring processing method does not perform special processing on point light sources, resulting in color and quantity missing in the light spot effects presented by the point light sources, affecting the user's visual experience. Summary of the invention
[0005] The embodiments of the present application provide a light spot display method, device and electronic device, which can solve the problem of color loss and quantity loss of light spots when the point light source in the image is displayed as a light spot effect after background blur processing, thereby improving the user's visual experience.
[0006] In a first aspect, an embodiment of the present application provides a light spot display method, including: an electronic device acquires a first image, the first image includes a first background, the first background includes at least one first pixel, and the saturation of the first pixel is less than or equal to a first threshold; the electronic device acquires a multi-exposure fusion MEF image corresponding to the first image, the MEF image includes at least one second pixel, wherein, based on the same pixel position, the first pixel corresponds to at least a part of the second pixels, and the saturation of the first pixel is less than the saturation of the corresponding second pixel; the electronic device replaces the first pixel in the first background with the corresponding second pixel to obtain a target image; the electronic device performs background blur processing on the target image to display a light spot formed based on the second pixel.
[0007] The light spot display method provided in the embodiment of the present application can determine the first pixel from the first background of the first image to distinguish the point light source area in the first background, and after acquiring the MEF image, replace the first pixel with the second pixel with higher saturation in the MEF image to obtain the target image. In this way, the point light sources in the background of the target image have higher saturation. When the target image is subjected to background blur processing, the light spot effect presented by the point light sources in the target image has brighter colors and significantly increased number, thereby improving the user's visual experience.
[0008] In one implementation, the electronic device includes a first camera and a second camera, and the electronic device acquires a first image, including: the electronic device acquires a first processed image through the first camera, and acquires a second processed image through the second camera; the electronic device performs image fusion processing on the first processed image and the second processed image to obtain the first image. This implementation is used to illustrate a specific method for acquiring the first image.
[0009] In one implementation, the first image has a first image format, and the first image format includes a color-coded YUV format. After the electronic device acquires the first image, it also includes: the electronic device performs brightness Y channel separation processing on the first image based on its YUV format to obtain a first brightness image, and each pixel position in the first brightness image corresponds to a first brightness value; the electronic device performs depth calculation processing on the first processed image and the second processed image to obtain a first depth image, and each pixel position in the first depth image corresponds to a first depth value. With this implementation, a first brightness image and a first depth image can be obtained based on the first image, so that the first brightness image and the first depth image can be used for subsequent background blur processing.
[0010] In one implementation, an electronic device performs background blur processing on a target image, including: the electronic device determines a first brightened area in a first brightness image, the first brightened area includes at least one first target brightness value, and the first target brightness value is the same as the first pixel position of the first pixel; the electronic device performs brightness enhancement processing on the first target brightness value to obtain a second brightness image, and each pixel position in the second brightness image corresponds to a second brightness value; the electronic device obtains a first weight image according to the second brightness image and the first depth image, and each pixel position in the first weight image corresponds to a first weight value, and the first weight value is calculated based on the second brightness value and the first depth value based on the weight function; the electronic device performs filtering calculation on the target image and the first weight image to complete the background blur processing of the target image, wherein the filtering calculation includes multiplying the pixel value of each pixel in the target image with each first weight value in the first weight image based on the same pixel position. In this implementation, by determining the first brightened area in the first brightness image, the weight value corresponding to the area can be increased, so that the pixels with larger weight values in the target image have a greater influence on the brightness of the pixels around them during the filtering calculation process, which can make the color of the light spot effect more vivid and the number significantly increased.
[0011] In one implementation, after the electronic device obtains the multi-exposure fused MEF image corresponding to the first image, it also includes: the electronic device converts the MEF image into a YUV format; the electronic device performs brightness Y channel separation processing on the MEF image based on its YUV format to obtain a candidate brightness value corresponding to each pixel position in the MEF image; the electronic device determines the pixel whose candidate brightness value is greater than or equal to the second threshold as the second pixel. With this implementation, the second pixel, i.e., the point light source area, can be determined from the MEF image. Since the overall brightness of the MEF image is low, the point light source area in the MEF image is smaller than the point light source area in the first image in terms of light source area, but the number and distribution of point light sources in the MEF image will be more and more accurate. In this way, further background blur processing based on the second pixel can increase the number of point light sources.
[0012] In one implementation, an electronic device performs background blur processing on a target image, including: the electronic device determines a second brightened area in a first brightness image, the second brightened area includes at least one second target brightness value, and the second target brightness value is the first brightness value that is the same as the pixel position of the second pixel; the electronic device performs brightness enhancement processing on the second target brightness value to obtain a third brightness image, and each pixel position in the third brightness image corresponds to a third brightness value; the electronic device obtains a second weight image according to the third brightness image and the first depth image, and each pixel position in the second weight image corresponds to a second weight value, and the second weight value is calculated based on the weight function of the third brightness value and the first depth value; the electronic device performs filtering calculation on the target image and the second weight image to complete the background blur processing of the target image, wherein the filtering calculation includes multiplying the pixel value of each pixel in the target image by each second weight value in the second weight image based on the same pixel position. In this implementation, by determining the second brightened area in the first brightness image, the weight value corresponding to the area can be increased, so that the pixel with a larger weight value in the target image has a greater influence on the brightness of the pixels around it during the filtering calculation process, which can make the color of the light spot effect more vivid and the number significantly increased.
[0013] In one implementation, an electronic device acquires a first processed image through a first camera, and acquires a second processed image through a second camera, including: the electronic device acquires a first image optical signal through the first camera, and acquires a second image optical signal through the second camera; the electronic device inputs the first image optical signal into an image signal processor ISP to obtain a first image, and inputs the second image optical signal into the ISP to obtain a second image; the electronic device inputs the first image into a digital signal processor DSP to obtain a first processed image, and inputs the second image into the DSP to obtain a second processed image. This implementation shows a specific method for acquiring the first processed image and the second processed image.
[0014] In one implementation, after the electronic device acquires the first image, the method further includes: the electronic device determines a first background from the first image based on a portrait blur algorithm; and the electronic device selects a first pixel from the first background. This implementation shows a method for acquiring the first pixel.
[0015] In one implementation, the electronic device selects the first pixel from the first background, including: the electronic device obtains the saturation corresponding to each candidate pixel in the first background; the electronic device compares the saturation corresponding to each candidate pixel with a first threshold; when the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device determines the candidate pixel as the first pixel. This implementation shows a specific method for determining the first pixel, so that the point light source area can be determined by the first pixel.
[0016] In one implementation, the first background has a first image format, and the first image format includes a color-coded YUV format. The electronic device obtains the saturation corresponding to each candidate pixel in the first background, including: the electronic device performs chromaticity UV channel separation processing on the first background based on its YUV format to obtain the U channel chromaticity value and the V channel chromaticity value corresponding to each candidate pixel; the electronic device sums the square of the U channel chromaticity value and the square of the V channel chromaticity value corresponding to each candidate pixel to generate a first sum value corresponding to each candidate pixel; the electronic device determines the saturation corresponding to each candidate pixel based on the square root of the first sum value corresponding to each candidate pixel. This implementation shows a method for determining the saturation of candidate pixels, so that the first pixel can be further determined based on the saturation to determine the point light source area.
[0017] In one implementation, when the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device determines the candidate pixel as the first pixel, including: when the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device assigns the candidate pixel a first value; when the candidate pixel is the first value, the electronic device determines the candidate pixel as the first pixel. This implementation shows a method of determining the first pixel by a binary method, so that the point light source area can be determined by the first pixel.
[0018] In one implementation, an electronic device obtains a multi-exposure fusion MEF image corresponding to a first image, including: the electronic device processes the first image through a preset exposure fusion algorithm, wherein the exposure fusion algorithm includes at least one of a weighted average algorithm, a pixel fusion algorithm, and a regional information fusion algorithm; the electronic device performs image preprocessing on the first image processed by the exposure fusion algorithm to obtain a MEF image, wherein the image preprocessing includes at least one of bad pixel correction processing, unprocessed RAW domain noise reduction processing, black level correction processing, optical shading correction processing, automatic white balance processing, color interpolation processing, color correction processing, tone mapping processing, gamma correction processing, and image conversion processing. This implementation shows how to obtain a MEF image.
[0019] In the second aspect, an embodiment of the present application provides a light spot display device, including: a first acquisition module, the first acquisition module is used to acquire a first image, the first image includes a first background, the first background includes at least one first pixel, and the saturation of the first pixel is less than or equal to a first threshold; a second acquisition module, the second acquisition module is used to acquire a multi-exposure fusion MEF image corresponding to the first image, the MEF image includes at least one second pixel, wherein, based on the same pixel position, each first pixel corresponds to at least a part of the second pixels, and the saturation of the first pixel is less than the saturation of the corresponding second pixel; a replacement module, the replacement module is used to replace the first pixel in the first background with the corresponding second pixel to obtain a target image; a processing module, the processing module is used to perform background blur processing on the target image to display a light spot formed based on the second pixel.
[0020] The light spot display device provided in the embodiment of the present application can determine the first pixel from the first background of the first image to distinguish the point light source area in the first background, and after acquiring the MEF image, replace the first pixel with the second pixel with higher saturation in the MEF image to obtain the target image. In this way, the point light sources in the background of the target image have higher saturation. When the target image is subjected to background blur processing, the light spot effect presented by the point light sources in the target image has brighter colors and significantly increased number, thereby improving the user's visual experience.
[0021] In a third aspect, an embodiment of the present application provides an electronic device, which includes a touch screen, a memory and one or more processors; the touch screen, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the light spot display method provided in the first aspect and any possible design method thereof.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the light spot display method provided in the first aspect and any possible design thereof.
[0023] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the light spot display method provided in the first aspect and any possible design thereof.
[0024] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 It is a schematic diagram of a scene in which a user takes an image of a person;
[0027] Figure 2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of the software structure of the electronic device provided in the embodiment of the present application;
[0029] Figure 4 It is a schematic diagram of a use scenario of the light spot display method provided in an embodiment of the present application;
[0030] Figure 5 This is the first flow chart of the light spot display method provided in the embodiment of the present application;
[0031] Figure 6 This is a first interactive schematic diagram of the light spot display method provided in an embodiment of the present application;
[0032] Figure 7 is a schematic diagram of a scenario in which an electronic device determines a first background provided by an embodiment of the present application;
[0033] Figure 8 is a schematic diagram of a scenario in which an electronic device determines a first target pixel provided by an embodiment of the present application;
[0034] Fig. 9 This is the first comparative schematic diagram of the light spot optimization effect provided by the embodiment of the present application;
[0035] Fig.10 is a second flow chart of the light spot display method provided in an embodiment of the present application;
[0036] Fig.11 is a flow chart of a method for an electronic device to determine a second target pixel provided by an embodiment of the present application;
[0037] Fig.12 is a schematic diagram of a scenario in which an electronic device determines a second target pixel provided by an embodiment of the present application;
[0038] Fig.13 is a second comparative schematic diagram of the light spot optimization effect provided by the embodiment of the present application;
[0039] Fig.14is a third comparative schematic diagram of the light spot optimization effect provided by another embodiment of the present application;
[0040] Fig.15 is the third flow chart of the light spot display method provided in the embodiment of the present application;
[0041] Fig.16 is a schematic structural diagram of a light spot display device provided in an embodiment of the present application;
[0042] Fig.17 It is a structural schematic diagram of a light spot display device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0043] The technical scheme of the embodiment of the present application will be clearly described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is a part of the embodiment of the present application, not all of the embodiments. Based on the embodiment of the present application, other embodiments obtained by ordinary technicians in this field without making creative work are all within the scope of protection of the present application.
[0044] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0045] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0046] In order to make the description of the following embodiments clear and concise, a brief introduction to related concepts or technologies is first given.
[0047] Depth of field is a photography term that refers to the clear range of the image captured by the camera, that is, the range in which the foreground, midground and background can be clearly presented. When a camera captures an image, usually only some areas of the image presented are clear, while other areas may appear blurred.
[0048] Aperture refers to the device used in a camera lens to control the amount of light that enters. Usually, electronic devices can use the aperture value F to indicate the aperture size. For example, the smaller the aperture value F, the larger the aperture, the more light that passes through per unit time, the smaller the depth of field, and the stronger the image blur effect. The larger the aperture value F, the smaller the aperture, the less light that passes through per unit time, the larger the depth of field, and the weaker the image blur effect.
[0049] The following first describes the application scenarios of the embodiments of the present application.
[0050] Electronic devices usually have a shooting function to allow users to obtain images. Based on the user's shooting scene and shooting purpose, the image types may include portrait images, landscape images, macro images, night scene images, and dynamic images. In the process of users shooting images, the use of background blur is involved.
[0051] Background blur is a common photography technique that can highlight the subject by reducing the clarity and details of the background, thereby improving the visual effect of the image. Background blur can be applied in a variety of scenarios such as when users take pictures of people, take pictures of landscapes, and take pictures of macros. This application is exemplified by the scenario of users taking pictures of people.
[0052] Figure 1 It is a schematic diagram of a scene in which a user takes an image of a person.
[0053] like Figure 1 As shown, when a user takes a person image, the lens of the electronic device presents a person 10 and a background area 11. In order to improve the visual effect of the person image, the electronic device can use a portrait blur algorithm to highlight the person 10 in the person image and blur the background area 11.
[0054] In some cases, there are one or more point light sources in the background area 11. Point light source is an optical term used to describe light emitted from a very small area or point. For example, when the background area 11 is a city night scene, the point light source is usually a street lamp, a car lamp, a light in a building, etc. When the background area 11 is a tree-shaded scene, the point light source is usually sunlight that shines through the gaps between leaves or branches. In this embodiment, the background area 11 is a colored light setting under the night scene, and each colored light is a point light source 12. Different colored lights have different colors and different brightness. Therefore, these point light sources 12 can be light sources with bright colors.
[0055] Since the portrait blur algorithm processes the entire image area of the person image captured by the electronic device, and the portrait blur algorithm usually does not perform special processing on the point light source 12 in the background area 11, after the background blur processing of the background area 11 based on the portrait blur algorithm, the point light source 12 appears as a light spot, and there are overexposed areas in these light spots, resulting in such light spots being darker in color and losing their original colors, and the number of these light spots is lower than the number of light spots captured by a SLR camera in the same scene. For example, when the point light source 12 in area A is displayed as a light spot after the background blur processing, the light spot is almost invisible to the naked eye and is not counted in the number of light spots.
[0056] It should be noted here that this application only uses the portrait blur algorithm for illustrative purposes. Other algorithms may also be involved in the process of background blurring of images, and this application does not limit the algorithm type.
[0057] That is to say, when the point light source in the image is displayed as a light spot effect after the background blur processing, the light spot has problems of missing color and missing quantity.
[0058] In order to solve the above problems, an embodiment of the present application provides a light spot display method.
[0059] The light spot display method provided in the embodiment of the present application can be applied to electronic devices. Among them, electronic devices include but are not limited to mobile phones, tablet computers, personal computers, workstation devices, large-screen devices (for example, smart screens, smart TVs, etc.), wearable devices (for example, smart bracelets, smart watches), handheld game consoles, home game consoles, virtual reality devices, augmented reality devices, mixed reality devices, in-vehicle smart terminals, etc. The embodiment of the present application does not limit the specific technology and specific device form used by the electronic device.
[0060] Figure 2 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application.
[0061] like Figure 2As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0062] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0063] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0064] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0065] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.
[0066] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0067] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also power the electronic device through the power management module 141 .
[0068] 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 to power the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0070] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0071] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0072] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0073] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0074] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0075] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, Microled, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0076] In the embodiment of the present application, the ability of the electronic device 100 to display the original image captured by the camera and the blurred image after the background blurring process depends on the display function provided by the above-mentioned GPU, display screen 194, and application processor.
[0077] The electronic device 100 can realize the shooting function through ISP, camera 193, GPU, display screen 194 and application processor.
[0078] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0079] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0080] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0081] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0082] In the embodiment of the present application, the electronic device 100 implements the light spot display method provided in the embodiment of the present application, which firstly depends on the images output by the ISP and DSP, and secondly depends on the image calculation and processing capabilities provided by the GPU. Among them, the electronic device 100 can implement neural network algorithms such as face recognition, body recognition, and re-identification (ReID) through the computing and processing capabilities provided by the NPU.
[0083] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0084] Random access memory may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.
[0085] Non-volatile memory can include disk storage devices and flash memory. Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle. It can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the potential level of the storage cell. It can be divided into universal flash storage (UFS), embedded Multi Media Card (eMMC), etc. according to the storage specification.
[0086] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data, etc. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
[0087] In the embodiment of the present application, the code for implementing the light spot display method described in the embodiment of the present application may be stored in a non-volatile memory. When running the camera application, the electronic device 100 may load the executable code stored in the non-volatile memory into the random access memory.
[0088] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function.
[0089] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0090] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0091] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
[0092] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0093] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.
[0094] The acceleration sensor 180E can detect the magnitude of acceleration in various directions (generally three axes) of the electronic device 100. When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected.
[0095] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0096] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
[0097] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0098] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
[0099] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0100] In the embodiment of the present application, the electronic device 100 may utilize the touch sensor 180K to detect operations such as clicks and slides performed by the user on the display screen 194 to achieve image capture.
[0101] The bone conduction sensor 180M can obtain vibration signals. The buttons 190 include a power button, a volume button, etc. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function controls of the electronic device 100. The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
[0102] Figure 3 It is a schematic diagram of the software structure of the electronic device provided in the embodiment of the present application.
[0103] like Figure 3 As shown, the layered architecture divides the system into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer, the driver layer, and the hardware layer.
[0104] The application layer may include a series of application packages. In the embodiment of the present application, the application package may include applications such as a camera and a gallery. In the embodiment of the present application, the camera application may be used by a user to perform an operation of taking a person's image.
[0105] The application framework layer provides an application programming interface (API) and a programming framework for the application of the application layer. The application framework layer includes some predefined functions. In an embodiment of the present application, the application framework layer may include a camera access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide an application programming interface and a programming framework for camera applications.
[0106] The hardware abstraction layer is an interface layer located between the application framework layer and the driver layer, and provides a virtual hardware platform for the operating system. In the embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer and a camera algorithm library.
[0107] The camera hardware abstraction layer may provide virtual hardware for the first camera device, the second camera device, or more camera devices. The camera algorithm library may include operating codes and data for implementing the light spot display method provided in the embodiment of the present application.
[0108] The driver layer is a layer between hardware and software. The driver layer includes drivers for various hardware. The driver layer may include camera device drivers, digital signal processor drivers, and image processor drivers.
[0109] Among them, the camera device driver is used to drive the camera sensor to collect images and drive the ISP to pre-process the images. The digital signal processor driver is used to drive the DSP to process images. The image processor driver is used to drive the graphics processor GPU to process images.
[0110] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0111] Figure 4 It is a schematic diagram of the use scenario of the light spot display method provided in the embodiment of the present application.
[0112] like Figure 4 As shown in A in FIG. 1 , in one implementation, a user can click on a camera application icon 20. In response to the user clicking on the camera application icon 20, the electronic device 100 displays a shooting preview interface 21. The shooting preview interface 21 may include a viewfinder 22 and a control panel 23. The viewfinder 22 may include a person 24 and a background area 25. The background area 25 may include at least one point light source 26. The control panel 23 may include a standard mode control 27, a portrait mode control 28, a large aperture mode control, and a night scene mode control. These different mode controls can enable the electronic device 100 to present different image effects in the viewfinder 22. The control panel 23 also includes a shooting button 29, which can enable the electronic device 100 to shoot the current image in the viewfinder 22.
[0113] like Figure 4 As shown in B in FIG. 1 , the user can click the standard mode control 27. In response to the user clicking the standard mode control 27, the electronic device 100 displays the first viewfinder image 30 in the viewfinder window 22. The first viewfinder image 30 can be a clear image without special effects. In response to the user clicking the capture button 29, the electronic device 100 can capture the first viewfinder image 30.
[0114] like Figure 4 As shown in C in FIG. 1 , the user can click on the portrait mode control 28. In response to the user clicking on the portrait mode control 28, the electronic device 100 displays the second viewfinder image 31 in the viewfinder window 22. The second viewfinder image 31 can be an image with a background blur effect. In response to the user clicking on the capture button 29, the electronic device can capture the second viewfinder image 31.
[0115] It should be noted here that the second viewfinder image 31 can be obtained by adding a background blur effect to a clear image such as the first viewfinder image 30. The light spot display method shown in the embodiment of the present application can be applied to the portrait mode, large aperture mode, night scene mode and other modes of the camera application of the electronic device 100 that can use the background blur effect. When the image obtained in such a mode uses the method of the embodiment of the present application to display at least one point light source 26, the light spot effect presented is more vivid in color and more accurate in quantity.
[0116] The following is a detailed description of the embodiments of the present application.
[0117] Figure 5 This is the first flow chart of the light spot display method provided in the embodiment of the present application. Figure 6 This is the first interactive schematic diagram of the light spot display method provided in the embodiment of the present application.
[0118] like Figure 5 and Figure 6 As shown, in some embodiments, the method includes the following steps S101-S113.
[0119] Step S101: the electronic device 100 acquires a first image.
[0120] In the following embodiments of the present application, the first image is taken as an image of a person with a point light source in the background for exemplary description. In fact, the first image can be any image that can perform background blur processing, and the embodiments of the present application do not limit the image type of the first image.
[0121] Further Figure 3 and Figure 4 As shown, in one implementation, in response to the user clicking the camera application icon 20, the electronic device 100 calls the camera access interface of the application framework layer, starts the camera application, and then sends an instruction to start the camera by calling the camera device (first camera device, second camera device and / or other camera devices) in the camera hardware abstraction layer. The camera hardware abstraction layer sends the instruction to the camera device driver of the driver layer, and the camera device driver can start the corresponding camera sensor and collect image light signals through the camera sensor. Among them, a camera device in the camera hardware abstraction layer corresponds to a camera sensor in the hardware layer.
[0122] Furthermore, the camera sensor can transmit the collected image light signal to the ISP for preprocessing to obtain an image electrical signal. This electrical signal is the original image collected by the camera sensor. The ISP outputs these original images to the DSP for processing to obtain processed images in RGB or YUV format. These processed images can be driven by the digital signal processor and transmitted to the camera algorithm library. The camera algorithm library can further process the DSP-processed image at the hardware abstraction layer to obtain the first image. The first image is a clear image visible to the naked eye that the electronic device 100 obtains during the framing process. Its image effect can be compared with Figure 4 It should be noted that, in this embodiment, the first image is used for subsequent processing and is not displayed on the display screen 194 like the first viewfinder image 30.
[0123] RGB format is an image format that represents image color information with a combination of three color channels: red (Red, R), green (Green, G), and blue (Blue, B). In the RGB format, each pixel of the image is composed of three components, representing the intensity of the red, green, and blue channels respectively, and the value range of each channel can be [0, 255], i.e., an 8-bit RGB format, wherein 0 represents the minimum intensity of the channel, for example, there is no red in the channel, and 255 represents the maximum intensity of the channel, for example, there is pure red in the channel. Since each pixel has three components, the RGB information of each pixel can be expressed as (x, y, z), where x is the red pixel intensity, y is the green pixel intensity, and z is the blue pixel intensity, for example, (255, 0, 0) is represented as a pure red pixel. In fact, there are also 16-bit and 32-bit RGB formats, and such RGB formats can provide better color depth and precision, as well as a wider range of colors. The embodiment of the present application is only exemplified with an 8-bit RGB format.
[0124] The YUV format is an image format that uses two components, brightness Y and chrominance UV, to represent the grayscale information and color information of an image. In the YUV format, the Y component represents the brightness information of the image, which determines the brightness of the image, and the UV component represents the color information of the image, which is independent of the brightness. The change of the UV component determines the saturation and hue of the color in the image. In the embodiment of the present application, the U component may be a blue chrominance (Cb) component, and the Cb component may represent the difference between blue and brightness. This component measures the movement from grayscale to blue, that is, the distribution of blue in the image. The higher the Cb component value, the more blue is contained in the color. The V component may be a red chrominance (Cr) component, and the Cr component may represent the difference between red and brightness. This component measures the movement from grayscale to red, that is, the distribution of red in the image. The higher the Cr component value, the more red is contained in the color. The YUV format can ensure the clarity and quality of the image.
[0125] Among them, the YUV format and the RGB format can be converted to each other. For example, when converting an image in RGB format to an image in YUV format, the weighted sum of the intensities of the three colors red R, green G, and blue B in the RGB format can obtain the Y component in the YUV format, and the difference between the intensity of blue G in the RGB format and the brightness Y in the YUV format can be obtained to obtain the U component in the YUV format. The difference between the intensity of red R in the RGB format and the brightness Y in the YUV format can be obtained to obtain the V component in the YUV format.
[0126] In the embodiment of the present application, the first image has a first image format, and the first image format includes at least one of a YUV format and an RGB format. The embodiment of the present application does not limit the format type of the first image format.
[0127] In one implementation, step S101 includes steps S1011 - S1022 .
[0128] Step S1011, in response to the user clicking on the portrait mode control, the camera application sends a request for starting the camera sensor to the camera access interface.
[0129] Step S1012: The camera access interface sends a request for starting a camera sensor to the camera device.
[0130] The camera device may include a first camera device and a second camera device.
[0131] Step S1013: The camera device sends a request for starting the camera sensor to the camera device driver.
[0132] The camera sensor may include a first camera and a second camera, the first camera device may correspond to the first camera, and the second camera device may correspond to the second camera, so that the camera device can send a start request to the corresponding camera sensor.
[0133] In the embodiment of the present application, the first camera may be at least one of a wide-angle lens, a standard lens, a telephoto lens, a periscope zoom lens, and a depth of field lens. The second camera may be at least one of a wide-angle lens, a standard lens, a telephoto lens, a periscope zoom lens, and a depth of field lens. The embodiment of the present application does not limit the lens types of the first camera and the second camera.
[0134] Step S1014: the camera device starts the camera sensor.
[0135] Step S1015: The camera sensor acquires a first image light signal and a second image light signal.
[0136] The first camera may acquire a first image light signal, and the second camera may acquire a second image light signal.
[0137] Step S1016: The camera sensor sends the first image light signal and the second image light signal to the ISP.
[0138] Step S1017: The ISP preprocesses the first image light signal to obtain a first channel of images, and preprocesses the second image light signal to obtain a second channel of images.
[0139] The first image is actually a first image electrical signal converted from a first image optical signal, and the first image can be in RAW format. Correspondingly, the second image is actually a second image electrical signal converted from a second image optical signal, and the second image can be in RAW format.
[0140] Step S1018: The ISP sends the first channel of images and the second channel of images to the DSP.
[0141] Step S1019: DSP processes the first channel of images to obtain a first processed image, and processes the second channel of images to obtain a second processed image.
[0142] Both the first processed image and the second processed image may be in the first image format.
[0143] Step S1020: The DSP sends the first processed image and the second processed image to the digital signal processor driver.
[0144] Step S1021: The digital signal processor drives the camera algorithm library to send the first processed image and the second processed image.
[0145] Step S1022: The camera algorithm library performs image fusion processing on the first processed image and the second processed image to obtain a first image.
[0146] In one implementation, the first processed image and the second processed image may both be in RGB format, and after image fusion processing is performed, a first image in RGB format is obtained. The first image in RGB format may be further converted into a first image in YUV format. The first processed image and the second processed image may both be in YUV format, and after image fusion processing is performed, a first image in YUV format is obtained. The embodiment of the present application is only exemplified by taking the first image in YUV format.
[0147] It should be noted here that, according to the different spacings between the first camera and the second camera on the electronic device 100, the effects of the obtained first image are different, so that the first images with different effects may cause the final imaging in the subsequent processing process to have corresponding differences. Specifically, when the spacing between the first camera and the second camera is small, the difference between the framing ranges of the first camera and the second camera is small, so that the first image obtained after the image fusion processing is less misaligned, so the image has richer details and better image quality. When the spacing between the first camera and the second camera is large, the difference between the framing ranges of the first camera and the second camera is large, so that the difference between the framing ranges of the first camera and the second camera is large, so that the first image obtained after the image fusion processing is large, so the depth of field information of the image is richer.
[0148] The embodiment of the present application may also apply more camera sensors to collect image light signals, and obtain the first image based on more processed image fusion. The embodiment of the present application does not limit the number of camera sensors.
[0149] Furthermore, step S101 also includes steps S1023-S1025.
[0150] Step S1023: The camera application sends a request for invoking a portrait blur algorithm to the camera access interface.
[0151] Step S1024: The camera access interface sends a request for invoking a portrait blur algorithm to the camera device.
[0152] Step S1025: The camera device sends a request for invoking a portrait blur algorithm to the camera algorithm library.
[0153] It should be noted that the embodiment of the present application does not limit the execution order of steps S1023-S1025. In some embodiments, step S1023 may be executed before step S1012 or after step S1012. Of course, steps S1011-S1025 may also have other combination orders, which are not described in detail in this application.
[0154] In this way, after the camera algorithm library acquires the first image, the camera algorithm library can further process the first image through a portrait blur algorithm, in which the light spot display method provided in an embodiment of the present application is applied.
[0155] In step S102 , the electronic device 100 determines a first background from the first image based on a portrait blur algorithm.
[0156] The portrait blur algorithm is an image blur processing technology that can achieve the effect of blurring the background to highlight the person based on the combination of multiple algorithms. For example, the portrait blur algorithm can include face detection algorithm, human posture estimation algorithm, portrait segmentation algorithm, circular filtering, etc.
[0157] Figure 7 It is a schematic diagram of a scenario in which an electronic device determines a first background provided in an embodiment of the present application.
[0158] like Figure 7 As shown, the image effect of the first image 40 is Figure 4 The first viewing image 30 in FIG. 1 is also exemplified for explanation.
[0159] The electronic device 100 can determine the position and boundaries of the person 41 in the first image 40 through a face detection algorithm, a human posture estimation algorithm, or a portrait segmentation algorithm. Furthermore, the electronic device 100 creates a circular filter 42 around the person 41 and sets different blur radii. In this way, the circular filter 42 is applied to the background area around the person 41. According to the set blur radius, the electronic device 100 can determine the first background 43.
[0160] It should be noted here that the electronic device 100 may also determine the first background 43 based on other algorithm combinations in the portrait blur algorithm, and the embodiment of the present application does not limit the specific method in which the electronic device 100 determines the first background 43.
[0161] In step S103 , the electronic device 100 selects a first pixel from the first background.
[0162] In the case where the shooting scene of the electronic device 100 includes at least one point light source, since the brightness of the point light source is very high, when the point light source falls on the center of the camera lens, a very bright light spot will be generated. This bright light spot may exceed the dynamic range of the camera sensor, resulting in loss of details in the area where it is located and overexposure of the point light source. Overexposure means that the saturation of the pixel is close to 0. In the process of image processing, when a pixel reaches an overexposed state, its brightness will be very high, causing the value of the color channel to approach the maximum brightness level, making the difference between the color channels smaller and the saturation lower. In this way, the first pixel in the overexposed area used to present the point light source in the first background has a low saturation and a dim color. Therefore, the electronic device 100 needs to screen out the first pixels of these overexposed areas and process them to enhance the user's visual effect.
[0163] Further Figure 7 As shown, for example, Figure 7 In the point light source of area B, there may be a plurality of first pixels 44 in the overexposed area C. The first pixels 44 in this area have a low saturation.
[0164] It should be noted here that the embodiments of the present application are only based on Figure 7 The method of determining the first pixel 44 in other point lights can refer to the method of determining the first pixel 44 in the point light source in area B.
[0165] In one implementation, step S103 includes steps S1031 - S1033 .
[0166] In step S1031, the electronic device 100 obtains the saturation corresponding to each candidate pixel in the first background.
[0167] Further Figure 7 As shown, when the first image 40 is in YUV format, the first background 43 is in YUV format, so the electronic device 100 can perform chromaticity UV channel separation processing on the first background 43 based on its YUV format, and obtain the U channel chromaticity value and V channel chromaticity value corresponding to each candidate pixel. Each pixel in the first background 43 is a candidate pixel.
[0168] It should be noted here that different YUV formats can have different quantization ranges. Taking the standard 8-bit YUV format as an example, the quantization range of the Y channel brightness value can be 0 to 255, indicating a brightness level from black to white, and the quantization range of the U channel chrominance value and the V channel chrominance value can be -128 to 127, indicating a different tone from white. In other YUV formats, such as the YUV format in a JPEG image, the quantization range of the U channel chrominance value and the V channel chrominance value can be simplified to 0 to 255. In the embodiment of the present application, the quantization range of the U channel chrominance value and the V channel chrominance value is not limited.
[0169] The electronic device 100 sums the square of the U channel chromaticity value and the square of the V channel chromaticity value corresponding to each candidate pixel to generate a first sum value corresponding to each candidate pixel. Further, the electronic device 100 determines the saturation corresponding to each candidate pixel according to the square root of the first sum value corresponding to each candidate pixel.
[0170] That is, the electronic device 100 may determine the saturation corresponding to each candidate pixel according to the following formula 1.
[0171] Formula 1:
[0172]
[0173] Among them, S is the saturation corresponding to each candidate pixel, U is the U channel chromaticity value corresponding to each candidate pixel, and V is the V channel chromaticity value corresponding to each candidate pixel.
[0174] For example, in the point light source in area B, the U channel chromaticity value corresponding to the first candidate pixel 401 is 100, and the corresponding V channel chromaticity value is 100, then the first sum value corresponding to the first candidate pixel 401 is 20000, and the corresponding saturation is approximately 141. The U channel chromaticity value corresponding to the second candidate pixel 402 in the point light source is 2, and the corresponding V channel chromaticity value is 2, then the first sum value corresponding to the second candidate pixel 402 is 8, and the corresponding saturation is approximately 3. It should be noted here that in order to improve the accuracy of the electronic device 100 in screening the first pixel 44, the saturation can be set to a higher precision, and the embodiment of the present application does not limit the precision of the saturation.
[0175] In step S1032 , the electronic device 100 compares the saturation corresponding to each candidate pixel with a first threshold.
[0176] The first threshold may be a saturation threshold, for example, the first threshold may be 5, and the specific value of the first threshold is not limited in the embodiment of the present application. It should be noted that the first threshold may be adjusted according to different quantization ranges of the U channel chromaticity value and the V channel chromaticity value.
[0177] Further Figure 7 As shown, for example, the electronic device 100 compares the saturation corresponding to the first candidate pixel 401 with the first threshold, that is, compares the saturation value 141 with the value 5 of the first threshold, and compares the saturation corresponding to the second candidate pixel 402 with the first threshold, that is, compares the saturation value 3 with the value 5 of the first threshold.
[0178] In one implementation, the electronic device 100 compares the saturation and the first threshold by traversing the saturation and the first threshold corresponding to each candidate pixel based on a computer program language.
[0179] Step S1033: When the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device 100 determines the candidate pixel as the first pixel.
[0180] Further Figure 7 As shown, for example, when the saturation corresponding to the second candidate pixel 402 is less than the first threshold, that is, when the saturation value 3 is less than the first threshold value 5, the electronic device 100 can determine the second candidate pixel 402 as the first pixel 44.
[0181] In one implementation, when the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device 100 assigns the candidate pixel a first value, and for example, the first value is 1. In this way, when the candidate pixel is the first value, the electronic device 100 determines the candidate pixel as the first pixel. The first pixel is a pixel in a point light source area, that is, a light source pixel.
[0182] It should be noted here that not all pixels in the point light source area necessarily have color loss, and the first threshold may only be used to filter out some pixels in the point light source area, that is, the first pixel is the light source pixel, but the light source pixel is not necessarily the first pixel.
[0183] Correspondingly, when the saturation corresponding to the candidate pixel is greater than the first threshold, the electronic device 100 assigns the candidate pixel to a second value, and for example, the second value is 0. In this way, when the candidate pixel is the second value, the electronic device 100 determines the candidate pixel as a non-light source pixel. In the embodiment of the present application, the non-light source pixel is used to characterize pixels other than the first pixel. In fact, the non-light source pixel may include pixels in a point light source area.
[0184] Specifically, after assigning values to all candidate pixels in the first background, the electronic device 100 can obtain a binary image. By performing morphological operations, connected domain analysis, circle detection, circle screening and other processing on the binary image, the first pixel located in the point light source area can be determined.
[0185] Further Figure 7 As shown, for example, when the saturation corresponding to the first candidate pixel 401 is greater than the first threshold, that is, when the saturation value 141 is greater than the first threshold value 5, the electronic device 100 can assign the first candidate pixel 401 a value of 0, and when the saturation corresponding to the second candidate pixel 402 is less than the first threshold, that is, when the saturation value 3 is less than the first threshold value 5, the electronic device 100 can assign the second candidate pixel 402 a value of 1.
[0186] In one implementation, the electronic device 100 may first set a brightness threshold to locate the point light source area in the first image, and then further determine the first pixel in the point light source area based on the first threshold. In this way, the electronic device 100 may more accurately screen out the first pixel.
[0187] In one implementation, the electronic device 100 may also determine the first pixel based on a neural network algorithm. The embodiment of the present application does not limit the specific method in which the electronic device 100 determines the first pixel.
[0188] In this way, the electronic device 100 completes the screening of the first pixel in the point light source area in the first image.
[0189] Step S104: the electronic device 100 acquires a first brightness image corresponding to the first image.
[0190] In one implementation, the electronic device 100 performs brightness Y channel separation processing on the first image based on its YUV format to obtain a first brightness image.
[0191] The first brightness image is a grayscale image, and each pixel position in the first brightness image corresponds to a first brightness value, and the first brightness value indicates the brightness level of the pixel position. The first brightness image displays the scene information of the first image in grayscale form, and the structural information, spatial resolution, file format, and geometric attributes of the first brightness image can be the same as those of the first image. Among them, the geometric attributes include attributes such as the center point, corner point, boundary position, image size, image outline, and image orientation of the image.
[0192] It should be noted here that when the first image is an image in RGB format, the first brightness image can also be obtained by performing G channel separation processing based on the RGB format. This is because the G channel is the brightest channel in the RGB color space, which can effectively reflect the brightness of each pixel and has a similar effect to the Y channel. In addition, the brightness image obtained by separation according to the G channel can also be converted with the brightness image obtained by separation according to the Y channel. The conversion method can refer to the aforementioned embodiment. In the case where the first brightness image is obtained by separation according to the G channel, the subsequent embodiments need to be adaptively adjusted, which is not elaborated in the embodiments of the present application. The embodiment of the present application only exemplifies the first brightness image as a grayscale image obtained by separation according to the Y channel.
[0193] Step S105: The electronic device 100 obtains a first depth image corresponding to the first image.
[0194] In one implementation, the electronic device 100 performs depth calculation processing on the first processed image and the second processed image to obtain a first depth image, wherein each pixel position in the first depth image corresponds to a first depth value.
[0195] In one implementation, the electronic device 100 performs depth calculation processing on the first processed image and the second processed image based on the disparity to obtain a first depth image. Specifically, since the first processed image and the second processed image capture the same scene from different angles, there are multiple pairs of matching pixels between the first processed image and the second processed image. The electronic device 100 can determine the horizontal distance between each pair of matching pixels in the first processed image and the second processed image, which is the disparity. The size of the disparity is inversely proportional to the depth. In this way, based on the camera parameters between the first camera and the second camera, and the disparity value of each pixel, based on the triangulation method, the first depth value corresponding to each pixel position in the first depth image can be obtained.
[0196] In an embodiment of the present application, the electronic device 100 may further perform depth calculation processing on the first processed image and the second processed image based on other depth estimation algorithms. The depth estimation algorithm may include at least one of a sum of absolute pixel differences (Sum of Absolute Differences, SAD) algorithm, a sum of squares of corresponding pixel differences (Sum of Squared Differences, SSD) algorithm, and a semi-global matching (Semi Global Matching, SGM) algorithm. In an embodiment of the present application, the specific method for obtaining the first depth image is not limited.
[0197] In step S106, the electronic device 100 obtains a multi-exposure fusion (MEF) image corresponding to the first image.
[0198] MEF images are also called High Dynamic Range (HDR) images. MEF is an image processing technology that can combine multiple images of the same scene with different exposure settings to generate an HDR image. HDR images can retain more color information under high exposure and richer dark information under low exposure.
[0199] In one implementation, step S106 includes steps S1061 - S1062 .
[0200] In step S1061 , the electronic device 100 processes the first image using a preset exposure fusion algorithm.
[0201] Specifically, the electronic device 100 can obtain the first image under different exposure intensities, and the exposure intensity can be determined by the electronic device 100 measuring the current scene. In this way, the electronic device 100 can obtain three images, namely, a first image with low exposure, a first image with normal exposure, and a first image with high exposure. Since the exposure levels of the three images are different, there may be slight alignment differences between the three images. Therefore, the electronic device 100 needs to align the three images to ensure that the three images can overlap accurately. After the three images overlap, the electronic device 100 performs an exposure fusion algorithm on the three images.
[0202] The exposure fusion algorithm includes at least one of a weighted average algorithm, a pixel fusion algorithm, and a regional information fusion algorithm. The embodiment of the present application does not limit the algorithm type of the exposure fusion algorithm.
[0203] In step S1062 , the electronic device 100 performs image preprocessing on the first image processed by the exposure fusion algorithm to obtain a MEF image.
[0204] The image preprocessing includes at least one of bad pixel correction processing, unprocessed RAW domain noise reduction processing, black level correction processing, optical shading correction processing, automatic white balance processing, color interpolation processing, color correction processing, tone mapping processing, gamma correction processing, and image conversion processing. The present application embodiment does not limit the processing method of image preprocessing.
[0205] This way, point light source areas in the MEF image are able to capture both very bright and very dark details.
[0206] Step S107 : the electronic device 100 determines a first target pixel from the MEF image.
[0207] The MEF image has a wider dynamic range and a higher color depth than the first image. The spatial resolution, file format, and geometric properties of the MEF image may be the same as those of the first image.
[0208] Figure 8 It is a schematic diagram of a scenario in which an electronic device determines a first target pixel according to an embodiment of the present application.
[0209] like Figure 8 As shown, in one implementation, since the geometric properties of the MEF image 50 are the same as those of the first image 40, the pixel coordinates of the first target pixel 51 correspond one-to-one to the pixel coordinates of the first pixel 44. In this way, based on the same pixel coordinates, the electronic device 100 can determine the first target pixel 51 according to the first pixel 44.
[0210] For example, in the point light source in the B region of the first image 40, the first pixel 44 in the overexposed region C includes a first sub-pixel 441 with pixel coordinates (X1, Y1), a second sub-pixel 442 with pixel coordinates (X2, Y2), a third sub-pixel 443 with pixel coordinates (X3, Y3), ..., and the electronic device 100 maps these pixel coordinates to the MEF image 50, and can determine the first sub-target pixel 511 with pixel coordinates (X1, Y1), the second sub-target pixel 512 with pixel coordinates (X2, Y2), the third sub-target pixel 513 with pixel coordinates (X3, Y3), etc. in the first target pixel 51. This example is only illustrated with three pixels. In fact, all the first pixels 44 in the overexposed region C can be mapped to obtain the corresponding first target pixels 51.
[0211] It should be noted here that the first image 40 and the MEF image 50 are usually colored images. Due to the limitations of the drawings in the specification, colors cannot be displayed, and the saturation difference between the first pixel 44 and the first target pixel 51 cannot be shown. In fact, the saturation of the first target pixel 51 is greater than that of the first pixel 44 at the corresponding pixel position.
[0212] In step S108 , the electronic device 100 replaces the first pixel in the first background with the first target pixel corresponding thereto to obtain a first target image.
[0213] In one implementation, the electronic device 100 can replace the first pixel with the first target pixel by a computer program language (e.g., Python) or an image processing library (e.g., OpenCV). The electronic device 100 can also replace the pixel by image superposition, image mixing, etc. The specific method of pixel replacement is not limited in the embodiment of the present application. Among them, the geometric properties of the first target image after pixel replacement are the same as those of the first image.
[0214] That is to say, the electronic device 100 uses the first target pixel with color information in the MEF image to color the first pixel, and obtains a first target image with a point light source area with bright colors. In this way, subsequent processing of the first target image can further obtain a light spot area with bright colors.
[0215] In step S109, the electronic device 100 determines a first brightened area in the first brightness image, where the first brightened area includes at least one first target brightness value, and the first target brightness value is a first brightness value having the same pixel position as the first pixel.
[0216] In one implementation, since the geometric properties of the first brightness image are the same as those of the first image, the pixel position corresponding to the first target brightness value may correspond to the pixel coordinates of the first pixel one by one. Thus, based on the same pixel coordinates, the electronic device 100 may determine the first target brightness value according to the first pixel.
[0217] For example, the first pixel in the overexposed area C in the first image includes a first sub-pixel with pixel coordinates (X1, Y1), a second sub-pixel with pixel coordinates (X2, Y2), a third sub-pixel with pixel coordinates (X3, Y3), ..., and the electronic device 100 maps these pixel coordinates to the first brightness image, and it can be determined that the first brightened area includes the first target brightness value corresponding to the pixel coordinates (X1, Y1), the first target brightness value corresponding to the pixel coordinates (X2, Y2), the first target brightness value corresponding to the pixel coordinates (X3, Y3), etc. The mapping method between the first image and the first brightness image is similar to the mapping method between the first image and the MEF image in the aforementioned embodiment, and this embodiment of the present application will not be repeated.
[0218] In step S110 , the electronic device 100 performs brightness enhancement processing on the first target brightness value to obtain a second brightness image.
[0219] Each pixel position in the second brightness image corresponds to a second brightness value.
[0220] For example, in the first brightness image, the first target brightness value corresponding to the pixel coordinate (X1, Y1) is 25, and the electronic device 100 can increase it to 50. Correspondingly, the electronic device 100 can also increase the first target brightness value corresponding to the pixel coordinate (X2, Y2) from 25 to 50, and the first target brightness value corresponding to the pixel coordinate (X3, Y3) from 25 to 50. In this example, the numerical value of the first target brightness value is only used for exemplary description and is not its actual numerical value.
[0221] In this way, in the second brightness image, the second brightness value corresponding to the pixel position of the first pixel is a brightness value after brightness enhancement, and the second brightness values of the remaining pixel positions are original brightness values.
[0222] In step S111 , the electronic device 100 obtains a first weight image according to the second brightness image and the first depth image.
[0223] Each pixel position in the first weighted image corresponds to a first weight value, and the first weight value is calculated based on the weight function using the second brightness value and the first depth value.
[0224] Specifically, since the geometric properties of the second brightness image and the first depth image are the same as those of the first image, and the geometric properties of the first target image are the same as those of the first image, the geometric properties of the first weight image obtained based on the second brightness image and the first depth image are the same as those of the first image. In this way, the first weight image can be used to adjust the weight of each pixel position in the first target image, so that the spot area corresponding to the first pixel has a higher weight, so as to optimize the display effect of the spot area.
[0225] In one implementation, the weight function may include at least one of a linear weight function, a Gaussian weight function, an exponential weight function, a power-law weight function, and a cosine weight function. The embodiment of the present application does not limit the specific form of the weight function.
[0226] In step S112 , the electronic device 100 performs filtering calculation on the first target image and the first weight image to complete background blur processing of the first target image.
[0227] The filtering calculation includes multiplying the pixel value of each pixel in the first target image by each first weight value in the first weight image based on the same pixel position.
[0228] In one implementation, when the first target image is in YUV format, the pixel values in the first target image may be grayscale values. When the first target image is in other image formats, such as RGB format, the pixel values may be RGB values. In an embodiment of the present application, the pixel values may be adaptively adjusted according to the image format of the first target image.
[0229] In one implementation, step S112 includes step S1121.
[0230] After the electronic device 100 completes the background blur processing of the first target image in the camera algorithm library, it sends the first target image after the background blur processing for display.
[0231] That is, steps S102-S112 can be performed as follows. Figure 3 and Figure 6 As implemented in the camera algorithm library shown, after the electronic device 100 completes the background blur processing of the first target image in the camera algorithm library, the first target image can be sent for display.
[0232] Step S113 , after completing the background blur processing of the first target image, the electronic device 100 displays a light spot formed based on the first target pixel in the first target image.
[0233] Fig. 9 This is the first comparative schematic diagram of the light spot optimization effect provided in the embodiment of the present application.
[0234] like Fig. 9 As shown in A in FIG. 1 , the first comparison image 60 is an image without applying the light spot display method provided in the embodiment of the present application. The M region can be displayed as a light yellow point light source, and the N region can be displayed as a light blue point light source.
[0235] like Fig. 9 As shown in B in FIG. 1 , the second comparison image 61 is an image using the light spot display method provided by the embodiment of the present application, wherein the M1 region can be displayed as an orange point light source, and the N1 region can be displayed as a dark blue point light source.
[0236] It can be seen that the color of the point light source in the M1 area is brighter than the color of the point light source in the M area, and the color of the point light source in the N1 area is brighter than the color of the point light source in the N area. It should be noted here that since the drawings in the specification are grayscale images, the light and dark changes in the grayscale in the figure do not represent changes in chromaticity. The embodiment of the present application only exemplifies the changes in chromaticity in the above two areas. The specific chromaticity changes are subject to the description in the specification. In fact, the colors corresponding to more point light sources in the second comparison image 61 are brighter than the colors corresponding to the point light sources in the first comparison image 60.
[0237] In this embodiment, since the first target pixel is a pixel with a higher saturation used to replace the first pixel, in the second comparison image 61, the number of light spots formed based on the first target pixel may not be significantly increased compared to the light spots in the first comparison image 60, and only the color effect is greatly improved, thereby enhancing the user's visual experience.
[0238] In other embodiments, since the point light source area of the first target image after pixel replacement already has brighter colors, the electronic device 100 can omit the brightness enhancement process in step S110 and still enable the light spot area in the final image to have bright colors.
[0239] The embodiment of the present application does not limit the execution order of steps S101-S113. In some embodiments, after steps S101-S103 are executed, steps S106-S107 can be directly executed, and steps S104-S105 can be executed after step S107. Of course, S101-S113 can also have other combination orders to ensure that the electronic device 100 can display the light spot formed based on the first target pixel, and this application will not be repeated here.
[0240] Fig.10 This is the second flow chart of the light spot display method provided in the embodiment of the present application.
[0241] like Fig.10 As shown, in some other embodiments, the method may include the following steps S201-S213.
[0242] Among them, steps S201-S206 can refer to steps S101-S106 in the aforementioned embodiment, and will not be described in detail in the embodiment of the present application.
[0243] After step S206, steps S207-S213 are also included.
[0244] Step S207 : the electronic device 100 determines a second target pixel from the MEF image.
[0245] Fig.11 It is a flow chart of a method for an electronic device to determine a second target pixel provided in an embodiment of the present application.
[0246] like Fig.11 As shown, in one implementation, step S207 includes steps S2071-S2073.
[0247] Step S2071, the electronic device 100 converts the MEF image into a YUV format.
[0248] It should be noted that, when the first image is in RGB format, the initial image format of the MEF image may be in RGB format, and the electronic device 100 needs to convert the MEF image in RGB format into a MEF image in YUV format. If the initial image format of the MEF image is in YUV format, step S2071 may be omitted.
[0249] In step S2072, the electronic device 100 performs brightness Y channel separation processing on the MEF image based on its YUV format to obtain a candidate brightness value corresponding to each pixel position in the MEF image.
[0250] Among them, after the electronic device 100 performs brightness Y channel separation processing on the MEF image, a first grayscale image can be obtained. Each pixel position in the first grayscale image corresponds to a candidate brightness value, and the candidate brightness value represents the brightness level of the pixel position. The first grayscale image displays the scene information of the MEF image in grayscale form. The structural information, spatial resolution, file format, and geometric properties of the first grayscale image can be the same as those of the MEF image.
[0251] In step S2073 , the electronic device 100 determines a pixel whose candidate brightness value is greater than or equal to a second threshold as a second target pixel.
[0252] Among them, the brightness value of the point light source in the MEF image is very high, and its brightness value can be close to the maximum brightness value. In this way, the electronic device 100 can identify the point light source in the MEF image by detecting the pixel distribution in the high-brightness area.
[0253] For example, if the candidate brightness value corresponding to a pixel of the MEF image is 250, when the second threshold is 240, since 250 is greater than 240, the electronic device 100 can determine the pixel as the second target pixel. A point light source area has multiple second target pixels. Therefore, the electronic device 100 can determine the point light source area in the MEF image.
[0254] It should be noted here that the value of the above-mentioned second threshold is only used for exemplary description, and the embodiment of the present application does not limit the specific value of the second threshold.
[0255] Since the overall brightness of the MEF image is low, the point light sources presented in the MEF image are smaller in light source area than the point light sources in the first image. However, the point light sources presented in the MEF image are more accurate in terms of the number and distribution of light sources than those in the first image. By determining the point light sources in the MEF image and using the brightness values of these point light sources for subsequent processing, the electronic device 100 can present more light spots in the final imaging to enhance the user's visual experience.
[0256] Fig.12 It is a schematic diagram of a scenario in which an electronic device determines a second target pixel according to an embodiment of the present application.
[0257] like Fig.12As shown, for example, there is a point light source in the P area of the first image 40, but due to the high brightness of the area, the point light source therein is almost invisible to the naked eye. Since the overall brightness of the MEF image 50 is relatively low, the MEF image 50 can display visible point light sources in the P area mapped to the P1 area in the MEF image 50, so that the MEF image 50 can intuitively display more point light sources than the first image 40. The electronic device 100 can filter the point light sources in the MEF image 50 based on the first grayscale image. For example, the pixels in the P1 area, the P2 area, and the P3 area can be filtered out by the second threshold value to determine the pixels in these areas as the second target pixels.
[0258] In one implementation, the electronic device 100 may also determine the second target pixel through contrast analysis, saturation analysis, etc. The embodiment of the present application does not limit the specific method in which the electronic device 100 determines the second target pixel.
[0259] In this way, the electronic device 100 completes the screening of the second target pixels in the point light source area in the MEF image.
[0260] Step S208: The electronic device 100 replaces the first pixel in the first background with the second target pixel corresponding thereto to obtain a second target image.
[0261] Since the overall brightness of the MEF image is low, the point light source area determined in the MEF image may correspond to a non-point light source area in the first image. The total number of second target pixels may be higher than the number of first pixels, and only a part of the second target pixels may be used to replace all the first pixels.
[0262] The specific method of replacing the pixels in step S208 can refer to step S108 in the aforementioned embodiment, and will not be described in detail in this embodiment of the present application.
[0263] In step S209, the electronic device 100 determines a second brightened area in the first brightness image, where the second brightened area includes at least one second target brightness value, and the second target brightness value is the first brightness value having the same pixel position as the second target pixel.
[0264] In one implementation, since the geometric properties of the first brightness image are the same as those of the MEF image, the pixel position corresponding to the second target brightness value can correspond to the pixel coordinates of the second target pixel one by one. In this way, based on the same pixel coordinates, the electronic device 100 can determine the second target brightness value according to the second target pixel.
[0265] In step S210 , the electronic device 100 performs brightness enhancement processing on the second target brightness value to obtain a third brightness image.
[0266] Each pixel position in the third brightness image corresponds to a third brightness value.
[0267] In this way, in the third brightness image, the third brightness value corresponding to the pixel position of the second target pixel is a brightness value after brightness enhancement, and the third brightness values of the remaining pixel positions are original brightness values.
[0268] In step S211 , the electronic device 100 obtains a second weight image according to the third brightness image and the first depth image.
[0269] Each pixel position in the second weighted image corresponds to a second weight value, and the second weight value is calculated based on the weight function using the third brightness value and the first depth value.
[0270] It should be noted here that the third brightness value includes the second target brightness value after brightness enhancement processing and the original brightness value. Among these second target brightness values after brightness enhancement processing, the pixel positions of one part correspond to the pixel positions of the first pixel, and the pixel positions of the other part correspond to the pixel positions of the non-light source pixels in the first image. Then, by performing brightness enhancement on these non-light source pixels, the weights of these non-light source pixels can be further increased to display these non-light source pixels as light spots, thereby increasing the number of light spots.
[0271] In step S212, the electronic device 100 performs filtering calculation on the second target image and the second weighted image to complete background blur processing of the second target image.
[0272] The filtering calculation includes multiplying the pixel value of each pixel in the second target image by each second weight value in the second weight image based on the same pixel position.
[0273] Step S213: After completing the background blur processing of the second target image, the electronic device displays a light spot formed based on the second target pixel in the second target image.
[0274] The specific implementation of steps S211-S213 can be found in the aforementioned embodiments, and this application will not elaborate on it.
[0275] It should be noted here that the light spot display method provided in this embodiment is actually an optimization of the current portrait blur algorithm. In the current portrait blur algorithm, first, each pixel in the first image needs to be assigned different weights based on its corresponding depth information and brightness information. Secondly, the pixel values of each pixel and its surrounding pixels need to be summed using the blur radius. Finally, the obtained sum is divided by the sum of the weight values to obtain the pixel values of each position in the blurred image, and then the final image is obtained. In this process, the principle of light spot generation is to assign a higher weight to the highlighted pixels in the first image. In this way, when performing subsequent filtering calculations, the pixel values of the highlighted area in the first image have a greater impact on the brightness of the pixels in the blurred image. If the pixel value of the highlighted area in the first image is low, the weight value is small, so the pixels with high brightness in the area have less impact on the surrounding pixels during filtering calculations, and no light spots can be formed.
[0276] In the present embodiment, the electronic device 100 first screens the second target pixels in the MEF image to more accurately determine the number and distribution of point light sources, and then increases the second target brightness value corresponding to the second target pixels. In this way, the second weight value of the point light source area is further increased. Then, the pixels with high brightness in the point light source area have a greater impact on the surrounding pixels during filtering calculation, and light spots can be formed. Therefore, the number of light spots in the present embodiment is significantly increased.
[0277] Fig.13 This is a second comparative schematic diagram of the light spot optimization effect provided in the embodiment of the present application.
[0278] like Fig.13 As shown in A in FIG. 1 , the third comparison image 70 is an image without applying the light spot display method provided in the embodiment of the present application. In which, the K region does not display a point light source visible to the naked eye.
[0279] like Fig.13 As shown in B in FIG. 1 , the fourth comparison image 71 is an image using the light spot display method provided by the embodiment of the present application. The K1 region can display a point light source visible to the naked eye.
[0280] In the present embodiment, based on the fact that the aforementioned embodiment can enhance the color effect of the point light source area, since the total number of the second target pixels is higher than the first pixel, the brightness area corresponding to the second target pixels can also be brightened to display a larger number of light spots in the final image, thereby enhancing the user's visual experience.
[0281] It should be noted that the embodiment of the present application does not limit the execution order of steps S201-S213. In some embodiments, after steps S201-S203 are executed, steps S206-S207 can be directly executed, and steps S204-205 can be executed after step S207. Of course, S201-S213 can also have other combination orders to ensure that the electronic device 100 can display the light spot formed based on the second target pixel, and this application will not be repeated here.
[0282] Fig.14 This is the third comparative schematic diagram of the light spot optimization effect provided by another embodiment of the present application.
[0283] like Fig.14 As shown in A in FIG. 8 , the fifth comparison image 80 is an image to which the light spot display method provided in the embodiment of the present application is not applied.
[0284] like Fig.14 As shown in B in FIG. 8 , the sixth comparison image 81 is an image obtained by applying the light spot display method provided in an embodiment of the present application.
[0285] In a tree-shaded scene with more point light sources, the sixth comparison image 81 can intuitively show the increase in the number of light spots compared to the fifth comparison image 80 , thereby enhancing the user's visual experience.
[0286] Fig.15 This is the third flow chart of the light spot display method provided in the embodiment of the present application.
[0287] like Fig.15 As shown, in some other embodiments, the method may include the following steps S301-S304.
[0288] Step S301: The electronic device 100 acquires a first image, where the first image includes a first background, where the first background includes at least one first pixel, and where the saturation of the first pixel is less than or equal to a first threshold.
[0289] In step S302, the electronic device 100 obtains a MEF image corresponding to the first image, wherein the MEF image includes at least one second pixel, wherein, based on the same pixel position, the first pixel corresponds to at least a portion of the second pixel, and the saturation of the first pixel is less than the saturation of the corresponding second pixel.
[0290] In this embodiment, the second pixel may include at least one of the first target pixel and the second target pixel in the aforementioned embodiment.
[0291] Step S303: the electronic device replaces the first pixel with the corresponding second pixel in the first background to obtain a target image.
[0292] In this embodiment, the target image may include at least one of the first target image and the second target image in the aforementioned embodiment.
[0293] In step S304, the electronic device performs background blur processing on the target image to display a light spot formed based on the second pixel.
[0294] Steps S301-S304 and their implementation methods may be specifically implemented with reference to the above examples, and will not be described in detail here.
[0295] In the light spot display method provided in the embodiment of the present application, the electronic device 100 can determine the first pixel from the first background of the first image to distinguish the point light source area in the first background, and after acquiring the MEF image, replace the first pixel with the second pixel with higher saturation in the MEF image to obtain the target image. In this way, the point light sources in the background of the target image have higher saturation. When the target image is blurred, the light spot effect presented by the point light sources in the target image is brighter in color and significantly increased in number, thereby improving the user's visual experience.
[0296] In the above-mentioned embodiments provided by the present application, various schemes of the light spot display method provided by the present application are introduced from the perspective of the electronic device 100. It is understandable that, in order to realize the above-mentioned functions, the electronic device 100 includes a hardware structure and / or software module corresponding to each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0297] Fig.16 It is a schematic diagram of the structure of the light spot display device provided in an embodiment of the present application.
[0298] like Fig.16 As shown, the light spot display device 200 provided in the embodiment of the present application can be applied to the electronic device 100, including:
[0299] The first acquisition module 201 is used to acquire a first image, the first image includes a first background, the first background includes at least one first pixel, and the saturation of the first pixel is less than or equal to a first threshold.
[0300] The second acquisition module 202 is used to acquire a multi-exposure fused MEF image corresponding to the first image, wherein the MEF image includes at least one second pixel, wherein each first pixel corresponds to at least a portion of the second pixels based on the same pixel position, and the saturation of the first pixel is less than the saturation of the corresponding second pixel.
[0301] The replacement module 203 is used to replace the first pixel with the corresponding second pixel in the first background to obtain a target image.
[0302] The processing module 204 is used to perform background blur processing on the target image to display the light spot formed based on the second pixel.
[0303] The light spot display device 200 provided in the embodiment of the present application can determine the first pixel from the first background of the first image to distinguish the point light source area in the first background, and after acquiring the MEF image, replace the first pixel with the second pixel with higher saturation in the MEF image to obtain the target image. In this way, the point light sources in the background of the target image have higher saturation. When the target image is subjected to background blur processing, the light spot effect presented by the point light sources in the target image has brighter colors and a significantly increased number, thereby improving the user's visual experience.
[0304] Fig.17 It is a structural schematic diagram of a light spot display device provided in another embodiment of the present application.
[0305] like Fig.17As shown, the light spot display device provided in the embodiment of the present application may include: a display screen 1001, a memory 1002, a processor 1003 and a communication module 1004. The above-mentioned devices may be connected through one or more communication buses 1005. The display screen 1001 may include a display panel 10011 and a touch sensor 10012, wherein the display panel 10011 is used to display an image, and the touch sensor 10012 may pass the detected touch operation to the application processor to determine the type of touch event, and provide a visual output related to the touch operation through the display panel 10011. The processor 1003 may include one or more processing units, for example: the processor 1003 may include an application processor, a modem processor, a graphics processor, an image signal processor, a controller, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor, etc. Among them, different processing units may be independent devices or integrated in one or more processors. The memory 1002 is coupled to the processor 1003 for storing various software programs and / or computer instructions, and the memory 1002 may include a volatile memory and / or a non-volatile memory. When the processor executes the computer instructions, the data transmission device can execute each function or step executed by the electronic device 100 in the above method embodiment.
[0306] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: acquiring a first image, the first image includes a first background, the first background includes at least one first pixel, and the saturation of the first pixel is less than or equal to a first threshold; acquiring a multi-exposure fused MEF image corresponding to the first image, the MEF image includes at least one second pixel, wherein, based on the same pixel position, the first pixel corresponds to at least a part of the second pixel, and the saturation of the first pixel is less than the saturation of the corresponding second pixel; replacing the first pixel in the first background with the corresponding second pixel to obtain a target image; and performing background blur processing on the target image to display a light spot formed based on the second pixel.
[0307] The present application also provides an electronic device, which may include: a touch screen, a memory, and one or more processors. The touch screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 2 The structure of the electronic device 100 is shown.
[0308] The embodiment of the present application also provides a chip system, for example, a system on a chip (System on a chip, SoC), which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor or a touch screen of an electronic device). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0309] 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 electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.
[0310] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0311] 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.
[0312] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0313] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0314] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0315] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0316] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A light spot display method, characterized in that: include: The electronic device acquires a first image, wherein the first image includes a first background, the first background includes at least one first pixel, the saturation of the first pixel is less than or equal to a first threshold, wherein the first image has a first image format, and the first image format includes a color-coded YUV format; The electronic device performs brightness Y channel separation processing on the first image based on the YUV format thereof to obtain a first brightness image, wherein each pixel position in the first brightness image corresponds to a first brightness value; The electronic device performs depth calculation processing on the first image to obtain a first depth image, wherein each pixel position in the first depth image corresponds to a first depth value; The electronic device acquires a multi-exposure fused MEF image corresponding to the first image; The electronic device converts the MEF image into a YUV format; The electronic device performs brightness Y channel separation processing on the MEF image based on its YUV format to obtain a candidate brightness value corresponding to each pixel position in the MEF image; The electronic device determines the pixel whose candidate brightness value is greater than or equal to the second threshold as the second pixel, wherein, based on the same pixel position, the first pixel corresponds to at least a part of the second pixel, and the saturation of the first pixel is less than the saturation of the second pixel corresponding thereto; the electronic device replaces the first pixel with the second pixel corresponding thereto in the first background to obtain a target image; The electronic device determines a second brightened area in the first brightness image, where the second brightened area includes at least one second target brightness value, where the second target brightness value is the first brightness value at the same pixel position as the second pixel; The electronic device performs brightness enhancement processing on the second target brightness value to obtain a third brightness image, wherein each pixel position in the third brightness image corresponds to a third brightness value; The electronic device obtains a second weight image according to the third brightness image and the first depth image, wherein each pixel position in the second weight image corresponds to a second weight value, and the second weight value is calculated by the third brightness value and the first depth value based on a weight function; The electronic device performs filtering calculation on the target image and the second weight image to complete the background blur processing of the target image, and then displays the light spot formed based on the second pixel, wherein the filtering calculation includes multiplying the pixel value of each pixel in the target image by each of the second weight values in the second weight image based on the same pixel position.
2. The light spot display method according to claim 1, characterized in that: The electronic device comprises a first camera and a second camera, and the electronic device acquires a first image, comprising: The electronic device acquires a first processed image through the first camera, and acquires a second processed image through the second camera; The electronic device performs image fusion processing on the first processed image and the second processed image to obtain the first image.
3. The light spot display method according to claim 2, characterized in that: The electronic device performs depth calculation processing on the first image, including: The electronic device performs depth calculation processing on the first processed image and the second processed image to obtain the first depth image.
4. The light spot display method according to claim 3, characterized in that: After the electronic device replaces the first pixel with the second pixel corresponding to the first pixel in the first background to obtain a target image, the electronic device further includes: The electronic device determines a first brightened area in the first brightness image, where the first brightened area includes at least one first target brightness value, where the first target brightness value is the first brightness value at the same pixel position as the first pixel; The electronic device performs brightness enhancement processing on the first target brightness value to obtain a second brightness image, wherein each pixel position in the second brightness image corresponds to a second brightness value; The electronic device obtains a first weight image according to the second brightness image and the first depth image, wherein each pixel position in the first weight image corresponds to a first weight value, and the first weight value is calculated based on a weight function by using the second brightness value and the first depth value; The electronic device performs filtering calculation on the target image and the first weight image to complete background blur processing of the target image, wherein the filtering calculation includes multiplying the pixel value of each pixel in the target image by each of the first weight values in the first weight image based on the same pixel position.
5. The light spot display method according to claim 2, characterized in that: The electronic device acquires a first processed image through the first camera, and acquires a second processed image through the second camera, including: The electronic device acquires a first image light signal through the first camera, and acquires a second image light signal through the second camera; The electronic device inputs the first image light signal into an image signal processor ISP to obtain a first image, and inputs the second image light signal into the ISP to obtain a second image; The electronic device inputs the first image into a digital signal processor DSP to obtain the first processed image, and inputs the second image into the DSP to obtain the second processed image.
6. The light spot display method according to claim 2, characterized in that: After the electronic device acquires the first image, the electronic device further includes: The electronic device determines the first background from the first image based on a portrait blur algorithm; The electronic device filters the first pixel from the first background.
7. The light spot display method according to claim 6, characterized in that: The electronic device screening the first pixel from the first background includes: The electronic device acquires the saturation corresponding to each candidate pixel in the first background; The electronic device compares the saturation corresponding to each of the candidate pixels with the first threshold; When the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device determines the candidate pixel as the first pixel.
8. The light spot display method according to claim 7, characterized in that: The first background has a first image format, the first image format includes a color-coded YUV format, and the electronic device obtains the saturation corresponding to each candidate pixel in the first background, including: The electronic device performs chromaticity UV channel separation processing on the first background based on its YUV format to obtain a U channel chromaticity value and a V channel chromaticity value corresponding to each candidate pixel; The electronic device sums the square of the U channel chromaticity value and the square of the V channel chromaticity value corresponding to each candidate pixel to generate a first sum value corresponding to each candidate pixel; The electronic device determines the saturation corresponding to each of the candidate pixels according to the square root of the first sum value corresponding to each of the candidate pixels.
9. The light spot display method according to claim 7, characterized in that: When the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device determines the candidate pixel as the first pixel, including: When the saturation corresponding to the candidate pixel is less than or equal to the first threshold, the electronic device assigns a first value to the candidate pixel; When the candidate pixel is the first value, the electronic device determines the candidate pixel as the first pixel.
10. The light spot display method according to claim 1, characterized in that: The electronic device acquires a multi-exposure fused MEF image corresponding to the first image, including: The electronic device processes the first image through a preset exposure fusion algorithm, wherein the exposure fusion algorithm includes at least one of a weighted average algorithm, a pixel fusion algorithm, and a regional information fusion algorithm; The electronic device performs image preprocessing on the first image processed by the exposure fusion algorithm to obtain the MEF image, wherein the image preprocessing includes at least one of bad pixel correction processing, unprocessed RAW domain noise reduction processing, black level correction processing, optical shading correction processing, automatic white balance processing, color interpolation processing, color correction processing, tone mapping processing, gamma correction processing, and image conversion processing.
11. A light spot display device, characterized in that: include: A first acquisition module, the first acquisition module is used to acquire a first image, the first image includes a first background, the first background includes at least one first pixel, the saturation of the first pixel is less than or equal to a first threshold, wherein the first image has a first image format, and the first image format includes a color-coded YUV format; a second acquisition module, wherein the second acquisition module is used to perform brightness Y channel separation processing on the first image based on its YUV format to obtain a first brightness image, wherein each pixel position in the first brightness image corresponds to a first brightness value, and to perform depth calculation processing on the first image to obtain a first depth image, wherein each pixel position in the first depth image corresponds to a first depth value, and to obtain a multi-exposure fused MEF image corresponding to the first image; a replacement module, the replacement module being used to convert the MEF image into a YUV format, and to perform brightness Y channel separation processing on the MEF image based on its YUV format to obtain a candidate brightness value corresponding to each pixel position in the MEF image, and to determine a pixel whose candidate brightness value is greater than or equal to a second threshold as a second pixel, wherein, based on the same pixel position, the first pixel corresponds to at least a part of the second pixel, the saturation of the first pixel is less than the saturation of the second pixel corresponding thereto, and to replace the first pixel with the second pixel corresponding thereto in the first background to obtain a target image; A processing module, the processing module is used to determine a second brightened area in the first brightness image, the second brightened area includes at least one second target brightness value, the second target brightness value is the first brightness value that is the same as the pixel position of the second pixel; and, perform brightness enhancement processing on the second target brightness value to obtain a third brightness image, each pixel position in the third brightness image corresponds to a third brightness value; obtain a second weighted image according to the third brightness image and the first depth image, each pixel position in the second weighted image corresponds to a second weight value, and the second weight value is calculated based on the weight function of the third brightness value and the first depth value; perform filtering calculation on the target image and the second weighted image to complete the background blur processing of the target image, and then display the light spot formed based on the second pixel, wherein the filtering calculation includes multiplying the pixel value of each pixel in the target image by each of the second weight values in the second weighted image based on the same pixel position.
12. An electronic device, characterized in that: The electronic device comprises a touch screen, a memory and one or more processors; the touch screen and the memory are coupled to the processor; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the light spot display method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the light spot display method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Image processing method, mobile terminal and computer readable storage medium
CN107635093A
Image processing method and device, electronic equipment and computer readable storage medium
CN112866655A
Image processing method and device, electronic equipment and computer readable storage medium
CN113888437A