Photographing method, electronic device and storage medium

In the multi-exposure mode, the user can adjust the background image and fusion parameters to fuse the foreground image, which solves the problem of poor user experience in the existing technology and achieves photo production with unique visual effects.

CN117676314BActive Publication Date: 2024-10-18HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410114602.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-10-18
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

Existing multiple exposure technology requires professional knowledge for complex settings and post-processing, has a poor user experience, and cannot view the fusion effect in real time.

Method used

In the multi-exposure mode, the user can input background image photography instructions and adjustment operations to determine the target background image and fusion parameters, and fuse the foreground image and background image based on these parameters to obtain the target image. Users do not need professional technical knowledge. Achieve unique visual effects.

Benefits of technology

Improved user experience, users can directly adjust the background image and fusion parameters to obtain photos with unique visual effects without post-processing, making the experience more friendly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117676314B_ABST
    Figure CN117676314B_ABST
Patent Text Reader

Abstract

The present application provides a photographing method, an electronic device and a storage medium, which relate to the field of intelligent terminals. Through the user inputting an adjustment operation on the to-be-fused background image, the fusion parameters of the target background image and the target background image are determined, and then the target background image and the foreground image are fused according to the fusion parameters of the target background image to obtain the target image. No professional technical knowledge or post-processing is required, so the user-friendliness is good. The method includes: in response to the multi-exposure mode setting operation input by the user in the camera application, turning on the multi-exposure photographing function; in response to the background image photographing instruction input by the user, obtaining the background image to be fused; in response to the user inputting an adjustment operation on the to-be-fused background image, determining the target background image and the fusion parameters of the target background image; in response to the foreground image photographing instruction input by the user, obtaining the foreground image; based on the fusion parameters of the target background image, the foreground image and the target background image are fused to obtain the target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart terminals, and in particular to a photographing method, an electronic device and a storage medium. Background Art

[0002] At present, with the development of electronic equipment technology, electronic equipment can meet more and more user needs for taking pictures. In order to obtain photos with unique visual effects, users can use multiple exposure technology to expose the subject twice or more times, and post-process the images obtained by the two or more exposures to obtain double-image or multi-image photos. Generally, the multiple exposure technology requires photographers with professional knowledge to perform more complicated settings on the camera for taking pictures, and post-process the images or photos obtained, which is less user-friendly and leads to poor user experience. Summary of the invention

[0003] In the related art, a photographer with professional knowledge is required to perform relatively complicated settings on the camera and perform post-processing on the captured images or photos to obtain photos with unique visuals. This is less user-friendly and leads to a poor user experience.

[0004] The embodiment of the present application provides a photographing method, an electronic device, and a storage medium. After photographing a background image to be fused, the fusion parameters of the target background image and the target background image can be determined by inputting an adjustment operation on the background image to be fused, and the photographed foreground image and the target background image are fused based on the fusion parameters of the target background image to obtain a target image. The user can directly adjust the fusion parameters of the background image to be fused and the background image to be fused, and no professional technical knowledge or post-processing is required. Therefore, the user-friendliness is good and the user experience is improved.

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

[0006] In a first aspect, the present application provides a photographing method, which is applied to an electronic device, the electronic device including a camera application, and the method includes:

[0007] In response to a multi-exposure mode setting operation input by a user in a camera application, a multi-exposure photo taking function is enabled;

[0008] In response to a background image photographing instruction input by a user, obtaining a background image to be fused;

[0009] In response to the user's input adjustment operation on the background image to be fused, determining the target background image and the fusion parameters of the target background image;

[0010] In response to a foreground image photographing instruction input by a user, acquiring a foreground image;

[0011] Based on the fusion parameters of the target background image, the foreground image and the target background image are fused to obtain the target image.

[0012] In the embodiment of the present application, in the multi-exposure mode operation, the target background image and the fusion parameters of the target background image are obtained in response to the background image shooting instruction input by the user, the background image to be fused, and the adjustment operation of the background image to be fused by the user. After obtaining the foreground image, the foreground image and the target background image are fused based on the fusion parameters of the target background image to obtain the target image. In this way, the user can directly adjust the fusion parameters of the fusion background image and the background image to be fused, and no professional technical knowledge or post-processing is required. Therefore, the user-friendliness is good and the user experience is improved.

[0013] In a possible design of the first aspect, before obtaining the background image to be fused in response to a background image photo taking instruction input by the user, the method also includes: determining a first zoom factor and a first camera corresponding to the first zoom factor in response to a first zoom operation input by the user.

[0014] Based on the above technical solution, the first zoom factor can be adjusted through the first zoom operation, thereby adjusting the camera used by the user to take a photo of the background image, so as to meet the user's requirements for the size and proportion of the fused background image.

[0015] In a possible design manner of the first aspect, in response to a background image photographing instruction input by a user, obtaining a background image to be fused includes:

[0016] In response to a background image photographing instruction input by a user, capturing a background image based on a first camera;

[0017] Perform subject detection on the background image to obtain the background image to be fused.

[0018] Based on the above technical solution, the background image can be collected by the first camera, and the subject detection can be performed on the background image, so that the background image to be fused with a display ratio that meets the requirements can be obtained.

[0019] In a possible design of the first aspect, in response to a user's input adjustment operation on the background image to be fused, determining a fusion parameter of the target background image includes:

[0020] In response to the fusion parameter adjustment operation input by the user, the fusion weight of the background image to be fused is adjusted to obtain the fusion parameter of the target background image;

[0021] The adjustment operation includes a fusion parameter adjustment operation.

[0022] Based on the above technical solution, the user can easily adjust the fusion weight of the fused background image without the need for professional technical knowledge, and the user experience is good.

[0023] In a possible design manner of the first aspect, in response to a fusion parameter adjustment operation input by a user, adjusting a fusion weight of the background image to be fused to obtain a fusion parameter of the target background image includes:

[0024] In response to a subject fusion parameter adjustment operation input by a user, determining a fusion parameter corresponding to the subject in the target background image;

[0025] In response to a slave body fusion parameter adjustment operation input by a user, determining a fusion parameter corresponding to the slave body in the target background image;

[0026] The fusion parameter adjustment operation includes a main fusion parameter adjustment operation and a slave fusion parameter adjustment operation.

[0027] Based on the above scheme, the fusion parameters of the subject in the background image to be fused can be easily adjusted through the subject fusion parameter adjustment operation input by the user, and the fusion parameters corresponding to the subject in the target background image can be obtained. The fusion parameters of the slave body in the background image to be fused can be easily adjusted through the slave body fusion parameter adjustment operation input by the user, and the fusion parameters corresponding to the slave body in the target background image can be obtained, which provides a good user experience.

[0028] In a possible design manner of the first aspect, in response to a user's input adjustment operation on the background image to be fused, determining the target background image includes:

[0029] In response to a subject adjustment operation input by a user, the size and / or position of the subject in the background image to be fused is adjusted to obtain a target background image;

[0030] Among them, the adjustment operation includes the main body adjustment operation.

[0031] Based on the above scheme, the size and / or position of the subject in the background image to be fused can be conveniently adjusted by the user inputting the subject adjustment operation, so as to obtain the target background that meets the user's requirements and improve the user experience.

[0032] In a possible design manner of the first aspect, before acquiring the foreground image in response to a foreground image photographing instruction input by the user, the method further includes:

[0033] In response to a second zoom operation input by a user, determining a second zoom factor and a second camera corresponding to the second zoom factor;

[0034] Collecting a foreground preview image based on the second camera;

[0035] Based on the fusion parameters of the target background image, the foreground preview image and the target background image are fused to obtain a fused preview image.

[0036] Based on the above technical solution, the second zoom factor can be adjusted through the second zoom operation input by the user, thereby adjusting the camera for the user to take a picture of the foreground preview image. In this way, the user's requirements for the size and proportion of the foreground preview image can be met. At the same time, based on the fusion parameters of the target background image, the background preview image and the target background image are fused to obtain a real-time fused preview image, that is, the fusion effect of the foreground image and the background image can be viewed in real time, and the user experience is good.

[0037] In a possible design of the first aspect, based on a fusion parameter of the target background image, the foreground image and the target background image are fused to obtain a target image, including:

[0038] Determine the fusion parameters of the foreground image based on the fusion parameters of the target background image;

[0039] Based on the fusion parameters of the target background image and the fusion parameters of the foreground image, the foreground image and the target background image are fused through a fusion algorithm to obtain a target image.

[0040] Based on the above technical solution, a target image with unique visual effects can be obtained.

[0041] In a second aspect, the present application provides an electronic device, comprising: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; 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 photographing method provided in the first aspect and any possible design thereof.

[0042] In a third aspect, 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 photographing method provided in the first aspect and any possible design thereof.

[0043] In a fourth aspect, the present application provides a computer program product, which includes executable instructions. When the computer program product runs on an electronic device, the electronic device executes the photo-taking method provided in the first aspect and any possible design thereof.

[0044] In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the second aspect. In a possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

[0045] 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

[0046] Figure 1 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a process of photographing a method provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a camera start-up response provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of entering a background preview mode provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of adjusting the zoom factor provided in an embodiment of the present application;

[0052] Figure 7 A schematic diagram of another method for adjusting the zoom factor provided in an embodiment of the present application;

[0053] Figure 8 A schematic diagram of another method for adjusting the zoom factor provided in an embodiment of the present application;

[0054] Fig. 9 A schematic diagram of adjusting a background image to be fused provided in an embodiment of the present application;

[0055] Fig.10 A schematic diagram of a fusion preview image provided in an embodiment of the present application;

[0056] Fig.11 A schematic diagram of taking a foreground picture provided in an embodiment of the present application;

[0057] Fig.12A schematic diagram of another method for taking photos provided in an embodiment of the present application;

[0058] Fig.13 A schematic diagram of entering a background preview mode provided in an embodiment of the present application;

[0059] Fig.14 A flowchart of another photographing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of an association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0061] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0062] The terms "first" and "second" in the following embodiments of the present application are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0063] In the related art, in order to obtain double-image or multi-image photos with unique visual effects to enhance the atmosphere, you can choose to expose twice or more times with different focal lengths to express the content that is difficult to express in one photo, and this photography method is called multiple exposure.

[0064] At present, the main method is to use multiple exposure technology to perform two or more exposures and superimpose the images obtained by the two or more exposures to obtain photos with unique visual effects. Usually, the multiple exposure technology requires photographers with professional knowledge to perform relatively complex settings on the camera and perform post-processing on the images or photos obtained. It is less user-friendly and cannot view the fusion effect in real time, resulting in a poor user experience.

[0065] Based on the above technical problems, an embodiment of the present application provides a photographing method, which can be applied to electronic devices. The present application obtains a target background image and a fusion parameter of the target background image by responding to a background image photographing instruction input by a user, a background image to be fused, and a user's adjustment operation on the background image to be fused in a multi-exposure mode. Thus, after obtaining the foreground image, the foreground image and the target background image are fused based on the fusion parameters of the target background image to obtain a target image. In this way, the user can directly adjust the fusion parameters of the fused background image and the background image to be fused, without the need for professional technical knowledge or post-processing, so it is user-friendly and improves the user experience.

[0066] The technical solution provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0067] In the present application, the above-mentioned electronic device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., which adopts a multi-battery series system to supply power. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0068] Take the example of a mobile phone being an electronic device. Figure 1 A schematic diagram of the hardware architecture of an electronic device provided in this application.

[0069] Reference Figure 1As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display screen 193, a subscriber identification module (SIM) card interface 194, and a camera 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0070] The processor 110 may include one or more processing units, for example, the processor 110 may include an AP, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0071] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0072] A memory may also be provided in the processor 110 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 circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In the embodiment of the present application, the processor may be a SOC.

[0073] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an 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.

[0074] The charging management module 140 is used to receive charging input from a power supply device (such as a charger, a laptop, etc.). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device.

[0075] While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141. The battery 142 can be composed of multiple batteries connected in series. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.

[0076] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to monitor the voltage, current, battery cycle number, battery health status (leakage, impedance) and other parameters of the battery 142. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device, for example, the power management module 141 and the charging management module 140 can be different functional modules in the same chip.

[0077] In the embodiment of the present application, the power management module 141 and / or the charging management module 140 may include a fast charging chip. The power management module 141 and / or the charging management module 140 may use the fast charging chip to realize high-power charging of the battery. In the fast charging chip, there will be corresponding multiple registers for different types of data to store corresponding ADC data.

[0078] 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. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0079] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). 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. The non-volatile memory can also store executable programs and store user and application data, and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.

[0080] A touch sensor is also called a "touch control device". The touch sensor can be arranged on the display screen 193. The touch sensor and the display screen 193 form a touch screen, also called a "touch control screen". The touch sensor is used to monitor touch operations acting on or near it. The touch sensor can pass the monitored touch operations 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 193. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device, which is different from the position of the display screen 193.

[0081] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 193. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. When a touch operation is applied to the display screen 193, the electronic device monitors the touch operation intensity according to the pressure sensor. The electronic device can also calculate the touch position based on the monitoring signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0082] A temperature sensor is a device used to measure the temperature of an environment or object. It can convert temperature into electrical signals or digital signals so that the temperature can be read and processed by computers or other electronic devices.

[0083] Gyroscope (GYRO-sensor), also known as ground sensor or gyro sensor, has a traditional structure with a gyroscope inside. A three-axis gyroscope can simultaneously measure the position, movement trajectory, and acceleration in six directions. A single-axis gyroscope can only measure quantities in two directions, that is, a system requires three gyroscopes, and a three-axis gyroscope can replace three single-axis gyroscopes. The working principle of a three-axis gyroscope is to measure the angle between the vertical axis of the gyroscope rotor and the device in a three-dimensional coordinate system, and calculate the angular velocity, and use the angle and angular velocity to determine the motion state of an object in three-dimensional space. A three-axis gyroscope can simultaneously measure six directions, including up, down, left, right, front, and back (the composite direction can also be decomposed into three-axis coordinates), and finally determine the movement trajectory and acceleration of the device. In other words, a three-axis gyroscope determines the current motion state of the device by measuring its own rotation state, such as forward, backward, upward, downward, left, or right; whether it is accelerating (angular velocity) or decelerating (angular velocity), etc. In the embodiment of the present application, the gyro sensor in the electronic device is a three-axis gyro sensor. The electronic device can determine the position or area on the electronic device corresponding to the heating feedback operation performed by the user based on the detection data of the gyro sensor.

[0084] The electronic device implements the display function through a GPU, a display screen 193, and an application processor. The GPU is a microprocessor for image editing, connecting the display screen 193 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.

[0085] The electronic device can realize the shooting function through ISP, camera 195, video codec, GPU, display screen 193 and application processor.

[0086] ISP is used to process data fed back by camera 195. For example, when taking a photo, the shutter is opened, and 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 the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, ISP can be set in camera 195. Camera 195 is used to capture still images or videos. In some embodiments, the electronic device may include 1 or N cameras, where N is a positive integer greater than 1. Camera 195 can be a front camera or a rear camera.

[0087] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0088] The display screen 193 is used to display images, videos, etc. The display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), 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, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 193, where N is a positive integer greater than 1.

[0089] In an embodiment of the present application, the display screen 193 can be used to display the interface of the electronic device (for example, a camera preview interface, a video preview interface, a finished film preview interface, etc.), and display images captured by any one or more cameras 195 in the interface.

[0090] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.

[0091] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.

[0092] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, and 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. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0093] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0094] The wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, 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 it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0095] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device by inserting it into or removing it from the SIM card interface 194. The electronic device can support one or more SIM card interfaces. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The SIM card interface 194 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.

[0096] 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 of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0097] Of course, it is understandable that the above figure is only an exemplary description of the electronic device in the form of a mobile phone. If the electronic device is a tablet computer, a handheld computer, a personal computer (PC), a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include more than Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.

[0098] It is understandable that, in general, the mutual benefit of electronic device functions requires not only hardware support but also software cooperation. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android® system with a layered architecture as an example to illustrate the software structure of the electronic device.

[0099] Figure 2 A schematic diagram of a layered architecture of a software system of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces (such as APIs).

[0100] In some examples, reference Figure 2 As shown, in an embodiment of the present application, the software of the electronic device is divided into four layers, namely, from top to bottom, an application layer, a framework layer (or called an application framework layer), a HAL layer (hardware abstraction layer) and a driver layer (or called a kernel layer).

[0101] The application layer can include a series of applications. Figure 2 As shown, the application layer may include applications (APP) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, short message, call, contact, live broadcast, etc., which are not limited in the present application embodiment. Among them, the call application and contact may be factory preset in the electronic device, or may be a third-party application for user calls provided by the application market.

[0102] The camera APP may include a camera startup module, a configuration flow module, an initial preview request module, a background image preview request module, a background image photo request module, a background image adjustment request module, a foreground image preview request module, a foreground image photo request module and a processing result display module.

[0103] In some examples, the camera startup module is used to generate and send a camera startup request, receive camera startup return data, and trigger the configuration stream module when the camera startup return data indicates that the camera startup is complete. The configuration stream module is used to generate and send a configuration stream (for example, including scene data, number of configuration streams, configuration stream type (such as photo or preview), size and resolution, and other configuration parameters), receive configuration stream return data, and trigger the initial preview request module when the configuration stream return data indicates that the configuration is complete. The initial preview request module is used to generate and send an initial preview request. The background image preview request module is used to generate and send a background image preview request. The background image photo request module is used to generate and send a background image photo request. The background image adjustment request module is used to generate and send a background image adjustment request. The foreground image preview request module is used to generate and send a foreground image preview request. The foreground image photo request module is used to generate and send a foreground image photo request. The processing result display module is used to receive the initial preview processing results, background image preview processing results, background image photo processing results, background image adjustment processing results, foreground image preview processing results and foreground image photo processing results in sequence, and display the initial preview processing results, background image preview processing results, background image photo processing results, background image adjustment processing results, foreground image preview processing results and foreground image photo processing results in sequence.

[0104] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. In some examples, the application framework layer may include a camera service, an activity manager, a window manager, an audio service, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., and the embodiments of the present application do not impose any restrictions on this.

[0105] In some examples, the camera service may include a connection device service module, a configuration stream service module, an initial preview request service module, a background image preview request service module, a background image photo request service module, a background image adjustment request service module, a foreground image preview request service module, a foreground image photo request service module and an output stream service module.

[0106] Among them, the connection device service module is used to receive and generate and issue a request to access camera resources based on the camera startup request issued by the camera startup module, and receive and transparently transmit the camera startup return data to the camera startup module. The configuration stream service module is used to receive and issue the configuration stream data issued by the configuration stream module, and receive and transparently transmit the configuration stream return data to the configuration stream module. The initial preview request service module is used to receive and issue the initial preview request issued by the initial preview request module. The background image preview request service module is used to receive and issue the background image preview request issued by the background image preview request module. The background image photo request service module is used to receive and issue the background image photo request issued by the background image photo request module. The background image adjustment request service module is used to receive and issue the background image adjustment request issued by the background image adjustment request module. The foreground image preview request service module is used to receive and issue the foreground image preview request issued by the foreground image preview request module. The foreground image photo request service module is used to receive and issue the foreground image photo request issued by the foreground image photo request module. The output stream service module is used to receive and transparently transmit the initial preview processing result, background image preview processing result, background image photo processing result, background image adjustment processing result, foreground image preview processing result and foreground image photo processing result to the processing result display module.

[0107] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0108] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0109] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0110] The phone manager is used to provide communication functions of the electronic device. For example, the phone manager can manage the call status of the call application (including initiation, connection, hang up, etc.).

[0111] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0112] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer provides a standard interface to display device hardware functions to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple hardware HALs. Each hardware HAL implements an interface for a specific type of hardware component.

[0113] In some examples, the HAL layer includes a camera HAL, an audio HAL, a bluetooth HAL, a sensor HAL (or an Isensor service, sensor service), etc., which is not limited in the embodiments of the present application. The camera HAL may include a startup module, a stream distribution module, an initial preview request processing module, a background image preview request processing module, a background image photo request processing module, a background image adjustment request processing module, a foreground image preview request processing module, a foreground image photo request processing module, and a processing result capture module.

[0114] The startup module is used to receive and send requests to access camera resources, and receive and transparently transmit the camera startup return data to the connection device service module. The stream allocation module is used to receive the configuration stream data sent by the configuration stream service module, cooperate with the lower-level camera driver to implement stream allocation based on the configuration stream data, and generate and transparently transmit the configuration stream return data to the configuration stream service module.

[0115] The initial preview request processing module is used to receive the initial preview request sent by the initial preview request service module, process the initial preview request, and output the initial preview processing result.

[0116] The background image preview request processing module is used to receive the background image preview request sent by the background image preview request service module, process the background image preview request, and output the background image preview processing result.

[0117] The background image photo request processing module is used to receive the background image photo request sent by the background image photo request service module, and respond to the background image photo request, process the background image obtained by taking the photo through the subject detection algorithm, and output the background image to be fused (the background image photo processing result).

[0118] The background image adjustment request processing module is used to receive the background image adjustment request sent by the background image adjustment request service module, and respond to the background image adjustment request, adjust the background image to be fused through the background image adjustment algorithm (such as adjusting the background image position and size), and obtain and output the target background image to be fused (background image adjustment processing result).

[0119] In some examples, the background image adjustment request processing module is further used to parse the background image adjustment request, obtain the fusion weight of the background image, and send the fusion weight of the background image to the foreground image preview request processing module.

[0120] The foreground image preview request processing module is used to receive the fusion weight of the background image and the foreground image preview request issued by the foreground image preview service module, process the foreground image preview request, and fuse the obtained real-time preview image with the target background image to be fused based on the fusion weight of the background image, and output the foreground preview image (foreground image preview processing result).

[0121] In some examples, the foreground image preview request processing module is also used to send the fusion weight of the background image to the foreground image photo processing module.

[0122] The foreground image photographing processing module is used to receive the fusion weight of the background image and the foreground image photographing request issued by the foreground image photographing service module, process the foreground image photographing request, and fuse the obtained foreground image with the target background image to be fused based on the fusion weight of the background image, and output the target image (foreground image photographing result).

[0123] The processing result capture module is used to obtain the initial preview processing result output by the initial preview request processing module, and pass the initial preview processing result to the output stream service module. The processing result capture module is used to obtain the background image preview processing result output by the background image preview request processing module, and pass the background image preview processing result to the output stream service module. The processing result capture module is also used to obtain the background image photo processing result output by the background image photo request processing module, and pass the background image photo processing result to the output stream service module. The processing result capture module is also used to obtain the background image adjustment processing result output by the background image adjustment request processing module, and pass the background image adjustment processing result to the output stream service module. The processing result capture module is also used to obtain the foreground image preview processing result output by the foreground image preview request processing module, and pass the foreground image preview processing result to the output stream service module. The processing result capture module is also used to obtain the foreground image photo processing result output by the foreground image photo processing module, and pass the foreground image photo processing result to the output stream service module.

[0124] The kernel layer (or driver layer) is a layer between hardware and software. In some examples, the kernel layer includes a camera driver (or camera driver), a display driver, an audio driver, a sensor driver, a battery driver, etc., which is not limited in the embodiments of the present application. The camera driver is used to receive a request for accessing camera resources issued by the startup module, and based on the request for accessing camera resources, start the camera hardware (including hardware operations such as powering on the camera), after the camera hardware is started, generate camera startup return data, and transmit the camera startup return data to the startup module.

[0125] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure.

[0126] Based on the above hardware architecture and software architecture, a photo taking method provided in an embodiment of the present application is introduced.

[0127] Based on the above hardware architecture and software structure, the following combination Figure 3 , a photographing method provided in an embodiment of the present application is described in detail, and the method can be used in an electronic device. Figure 3 As shown, the photographing method provided in the embodiment of the present application may include steps 301 to S311:

[0128] Step S301 , in response to a start instruction input by a user to the camera application of the electronic device, start the camera application.

[0129] For example, the start instruction may be a voice start instruction or a start operation, and the present application embodiment does not limit the implementation method of starting the camera application. The following embodiment takes the start instruction as a start operation as an example for exemplary description.

[0130] For example, take the startup instruction as the startup operation as an example, Figure 4 As shown in (a), the electronic device displays a desktop, and the desktop includes an icon of a camera application. The user can click the icon of the camera application on the desktop, and the electronic device receives and responds to the user's click operation on the camera application icon (i.e., the start operation) to start the camera application of the electronic device. It should be noted that the photographing method in the embodiment of the present application can be applied to any application that supports the photographing function. For example, the above-mentioned camera application can be a system camera application or a third-party application, and the embodiment of the present application does not limit this.

[0131] Exemplarily, when a user starts a camera application, the camera startup module in the camera application generates and sends a camera startup request to the connection device service module in the framework layer. The connection device service module sends a request to access camera resources to the startup module in the camera HAL based on the camera startup request. The startup module sends the request to access camera resources to the camera driver to drive the camera hardware startup (e.g., hardware operations such as powering on the camera of the electronic device). After the camera hardware is started, the camera startup return data is generated, and the camera startup return data is transparently transmitted to the camera startup module in the camera application through the connection device service module of the framework layer to indicate that the camera startup is complete.

[0132] In some examples, after the camera is started, the configuration stream module in the camera application can be triggered to generate a configuration stream, and the configuration stream is transparently transmitted to the configuration stream module of the camera HAL through the configuration stream service module of the framework layer, so as to cooperate with the lower-level camera driver to realize the configuration stream. After the configuration stream is completed, the configuration stream return data is generated, and the configuration stream return data is transparently transmitted to the configuration stream module in the camera application through the configuration stream service module to indicate that the configuration is complete.

[0133] In some examples, after the configuration is completed, the initial preview request module in the camera application can be triggered to generate an initial preview request, and the initial preview request service module of the framework layer can be transparently transmitted to the initial preview request processing module of the camera HAL. The initial preview request processing module of the camera HAL can drive the camera on the electronic device to collect light signals and convert light signals into electrical signals through the camera driver to output the original image (also called raw image), and pass the raw image to the camera HAL through the camera driver. The camera HAL can generate a preview image based on the raw image. The preview image is captured through the processing result capture module, and the preview image is transparently transmitted to the output stream service module of the framework layer, and the preview image is transparently transmitted to the processing result display module in the camera application through the output stream service module to display the preview image. The raw image is the image obtained after the photosensitive element in the camera converts the captured light source signal into an electrical signal, which can also be called the original image.

[0134] Exemplarily, the implementation method of the camera HAL generating a preview image based on the raw image may include sequentially processing the raw image through an image processing front end (Image Front End, IFE) and an image processing engine (Image Processing Engine, IPE) in the camera HAL to obtain the preview image.

[0135] For example, the preview image can refer to Figure 4 The preview interface 401 shown in (b) in FIG.

[0136] Step S302, in response to the multi-exposure mode setting instruction input by the user, generating a background image photo taking prompt and entering a background image preview mode.

[0137] Exemplarily, the camera application may include multiple shooting modes, such as portrait mode, night scene mode, snapshot mode, and multiple exposure mode. Among them, the facial features of the characters in the image taken in the portrait mode are obvious; the image taken in the night scene mode has a higher definition; the image taken in the snapshot mode can capture the movement of the subject at the moment of motion; the image taken in the multiple exposure mode can present a specific visual effect. The shooting method provided in the embodiment of the present application can be applied in the multiple exposure mode. The following embodiment takes the multiple exposure mode as an example to exemplify the shooting method provided in the embodiment of the present application.

[0138] Exemplarily, the multi-exposure mode setting instruction can be a voice setting instruction or a multi-exposure mode setting operation. The embodiment of the present application does not limit the implementation method of setting the multi-exposure mode. The following embodiment takes the multi-exposure mode setting instruction as a mode setting operation as an example for exemplary description.

[0139] For example, the background image photo taking prompt may be a voice prompt or a text prompt, and the present application embodiment does not limit the implementation form of the background image photo taking prompt. The present application embodiment takes the background image photo taking prompt as a text prompt as an example for exemplary description.

[0140] For example, continue to refer to Figure 5 As shown in (a) in the figure, the menu bar below the preview interface 501 includes a multi-exposure mode control 51. The user can click the multi-exposure mode control 51 (the clicking operation is the multi-exposure mode setting operation). In response to the user's clicking operation on the multi-exposure mode control 51, the multi-exposure function is turned on.

[0141] In some examples, users can also Figure 5 A sliding operation (ie, a multi-exposure mode setting operation) is input in the preview interface 501 shown in (a) in FIG. 5 , so as to slide the focus position onto the multi-exposure mode control 51 , thereby turning on the multi-exposure function.

[0142] For example, after the multi-exposure function is turned on, refer to Figure 5 As shown in (b) of FIG. 5 , a prompt message 52 for prompting the user to take a photo of the background image may pop up at the upper left corner of the preview interface 501 . The prompt message 52 includes a confirmation control 520 that the user can click.

[0143] For example, continue to refer to Figure 5 As shown in (b) in FIG. 1 , a background image preview request may be triggered after the user clicks the confirmation control 520, and a background image preview mode is started, and a display such as Figure 5 The interface shown in (c) in the reference Figure 5 As shown in (c) in FIG. 5 , the upper right corner of the preview interface 501 may include a logo 502 for previewing the background image. Therefore, the preview interface 501 may also be referred to as a background image preview interface. Figure 5 The multi-exposure mode shown in (c) may also be referred to as a background image preview mode in the multi-exposure mode.

[0144] In some examples, the implementation manner in which the electronic device triggers and processes a background image preview request may be similar to the implementation manner in which the initial preview request is triggered and processed, and this embodiment of the present application will not be described in detail.

[0145] Exemplarily, in the background image preview mode, the background image preview request module in the camera application can issue a background image preview request, and transmit the background image preview request to the background image preview request processing module of the camera HAL through the background image preview request service module of the framework layer. The background image preview request processing module can receive the transmitted background image preview request, process the background image preview request, obtain the background raw image collected by the camera in real time through the camera driver, and process the background raw image through IFE and IPE to obtain a real-time background preview image.

[0146] Step S303: In response to a first zoom operation input by the user, a first zoom factor and a first camera corresponding to the first zoom factor are determined, and a background preview image captured by the first camera is obtained.

[0147] For example, the first zoom operation can be a user's voice operation or a user's manual operation. The implementation method of the first zoom operation is not limited in the present application. The following embodiments are described by taking the first zoom operation as a manual operation as an example.

[0148] In some examples, the first zoom operation may include zoom operations such as the user sliding the zoom bar with a single finger on the preview interface, the user clicking the zoom value option included in the zoom control on the preview interface, or the user sliding the preview area on the preview interface with two fingers. The embodiments of the present application do not limit the method for manually implementing the first zoom operation.

[0149] For example, Figure 6 As shown, the preview interface 601 of the camera application also includes a zoom control 602. The zoom control 602 may include a plurality of different zoom value options (e.g., 0.6x, 1x, 2x, and 3.5x, etc.). Different zoom value options correspond to different zoom factors, that is, the zoom factor may be 0.6, 1, 2, and 3.5, etc. It is understandable that the zoom factor may be the display ratio of the preview image in the preview interface 601.

[0150] like Figure 6 As shown in (a) in FIG. 6 , before the user inputs the first zoom operation, the zoom control 602 may display the default zoom factor, that is, the zoom factor before zooming is 1x, and the display ratio of the preview image in the preview interface 601 is also 1x. After the user inputs the first zoom operation, the camera application may display the zoom factor corresponding to the first zoom operation to the user.

[0151] like Figure 6 As shown in (b) in FIG. 6 , when the first zoom operation input by the user is clicking on the zoom value option 3.5x in the zoom control 602 , after the user inputs the first zoom operation, the zoom control 602 may display the zoom factor 3.5 after the first zoom operation, and the display ratio of the preview image in the preview interface 601 also increases from 1x to 3.5x.

[0152] like Figure 6 As shown in (c) in the figure, when the first zoom operation input by the user is to click the zoom value selection line 0.6x in the zoom control 602, after the user inputs the first zoom operation, the zoom control 602 can display the zoom factor 0.6 after the first zoom operation, and the display ratio of the preview image in the preview interface 601 is also reduced from 1x to 0.6x.

[0153] For example, Figure 7 As shown, the preview interface 701 of the camera application may include a zoom bar 702. The zoom bar 702 may display multiple zoom factors such as 0.6x, 1x, 1x, 3.5x, and 7x. The user may slide left and right on the zoom bar 702 with a single finger to adjust the zoom factor, so that the display ratio of the preview or captured image will be enlarged or reduced accordingly.

[0154] like Figure 7 As shown in (a) in FIG. 1 , before the user inputs the first zoom operation, the zoom bar 702 may display the zoom multiple (e.g., the default zoom multiple) before the first zoom operation, that is, the zoom multiple before the first zoom operation is 1x. And the display ratio of the preview image in the preview interface 701 is also 1x. After the user inputs the first zoom operation, the camera application may display the zoom multiple corresponding to the first zoom operation to the user.

[0155] like Figure 7As shown in (b) in the figure, when the first zoom operation input by the user is to slide the zoom bar 702 to the right until the triangular arrow indicating the zoom ratio points to 3.5 in the zoom bar 702, then after the user inputs the first zoom operation, the zoom bar 702 can display the zoom ratio 3.5 after the first zoom operation, and the display ratio of the preview image in the preview interface 701 is also increased from 1x to 3.5x.

[0156] like Figure 7 As shown in (c) in the figure, when the first zoom operation input by the user is to slide the zoom bar 702 to the left until the triangular arrow indicating the zoom ratio points to 0.6 in the zoom bar 702, then after the user inputs the first zoom operation, the zoom bar 702 can display the zoom ratio after the first zoom operation, which is 0.6x, and the display ratio of the preview image in the preview interface 701 is also reduced from 1x to 0.6x.

[0157] For example, Figure 8 As shown in (a) in FIG. 8 , if the magnification of the preview image is to be increased, that is, the display ratio of the preview image is to be enlarged, the first zoom operation may be that the user moves two fingers in the preview interface 801 toward the first direction indicated by the dotted arrow; Figure 8 As shown in (b) in FIG. 1 , if the magnification of the preview image is to be reduced, that is, the display ratio of the preview image is to be reduced, the first zoom operation may be that the user moves two fingers toward the second direction indicated by the solid arrow.

[0158] Exemplarily, the first zoom ratio corresponds to the first zoom operation and can be any value within a preset zoom ratio range. The zoom ratio range can be determined according to parameters of multiple cameras on the electronic device. In some examples, the first zoom ratio can be any value between 0.4 and 10, and the embodiment of the present application does not specifically limit the value of the first zoom ratio.

[0159] Exemplarily, the first camera may be any camera provided on the electronic device, and may be determined according to the first zoom factor. In some examples, the first camera may be any one of a wide-angle camera, a main camera lens, and a telephoto camera. If the first zoom factor is within the first zoom range corresponding to the wide-angle camera, the first camera is determined to be a wide-angle camera; if the first zoom factor is within the second zoom range corresponding to the main camera, the first camera is determined to be the main camera; if the first zoom factor is within the third zoom range corresponding to the telephoto camera, the first camera is determined to be a telephoto camera. The embodiment of the present application does not specifically limit the first zoom range, the second side zoom range, and the third zoom range. In some examples, the first zoom range may correspond to a zoom factor less than 1, the second zoom range may correspond to a zoom factor greater than or equal to 1 and less than 2, and the third zoom range may correspond to a zoom range greater than or equal to 2.

[0160] For example, when the user inputs a first zoom operation, the electronic device can determine a first zoom factor corresponding to the first zoom operation, and then determine a corresponding first camera according to the first zoom factor. Finally, the background preview image is captured through the first camera.

[0161] In some examples, when the user inputs the first zoom operation, the camera application sends a first zoom operation request, and transmits the first zoom operation request to the camera HAL through the framework layer. The camera HAL processes the first zoom operation request, determines the first zoom factor corresponding to the first zoom operation request and the first camera corresponding to the first zoom factor. The camera driver drives the first camera to collect the background preview raw image, and processes the background preview raw image uploaded by the camera driver through IFE and IPE to obtain a real-time background preview image.

[0162] For example, continue to refer to Figure 6 As shown in (b), when the user clicks the zoom value option 3.5x of the zoom control 602, the camera application sends a zoom request corresponding to the zoom value option 3.5x, and transmits the zoom request to the camera HAL. The camera HAL processes the zoom request, determines that the first zoom factor corresponding to the zoom request is 3.5, and determines that the first camera corresponding to the first zoom factor is a telephoto camera. Then, the telephoto camera can be driven by the camera driver to collect the background preview raw image, and the background preview raw image uploaded by the camera driver is processed through IFE and IPE to obtain a real-time background preview image.

[0163] In some examples, after the camera HAL obtains the real-time background preview image, the real-time background preview image can be uploaded to the camera application for display. For example, the real-time background preview image can be uploaded to the output stream service module of the framework layer through the processing result capture module of the camera HAL, and the real-time background preview image can be uploaded to the processing result display module of the camera application through the output service stream module to display the real-time background preview image on the preview interface.

[0164] For example, according to user needs, when collecting the background preview image, the user may not input the first zoom operation to the electronic device, that is, the user may collect the background preview image based on the default zoom multiple (such as 1x). For example, the electronic device may drive the main camera to collect the background preview image to obtain the background preview image. The embodiment of the present application does not limit whether the user inputs the zoom operation when collecting the background preview image.

[0165] Step S304, in response to a background image photographing instruction input by the user, obtaining a background image.

[0166] Exemplarily, the background image refers to one or more images in the multiple images that serve as the background when the multiple images are superimposed. The embodiment of the present application is exemplified by taking the background image including an image as an example. In some examples, the background image may include a prominent main object (subject) and other secondary objects (subjects). The subject may be a person (such as a portrait, a human head), an animal (such as a rabbit, a tiger, etc.), a plant (such as a flower or grass) or an object (such as a building, a pavilion, a bridge, etc.), etc., which is not limited in the embodiment of the present application. The slave may be all other objects in the background image that will not participate in subsequent fusion except the main object. For example, if the user wants to use a cow eating grass with its head down as the background image, the cow in the background image can be used as the subject, and the grass, blue sky, etc. other than the cow can be used as the slave. The embodiment of the present application is exemplified by taking the subject in the background image as a portrait as an example.

[0167] For example, the background image photographing instruction can be a voice background image photographing instruction or a background image photographing operation. The present application embodiment does not limit the implementation method of starting the background image photographing. The following embodiment takes the background image photographing instruction as a background image photographing operation as an example for exemplary description.

[0168] In some examples, the background image photographing instruction is taken as an example of a background image photographing operation, such as Fig. 9 As shown in (a), when the user sees the background object in the preview interface 901, he clicks the photo control 902 in the preview interface 901 (the user clicks the photo control 902 in the preview interface 901, which triggers the background image photo command). In response to the user clicking the photo control 902, the camera application sends a background image photo request, and the background image photo request service module of the framework layer transmits the background image photo request to the background image photo request processing module in the camera HAL. The background image photo request processing module processes the background image photo request, and can drive the first camera to capture images through the camera driver. The first camera outputs the background raw image, and uploads the background raw image to the camera HAL through the camera driver. The camera HAL processes the background raw image through IFE and IPE to obtain the background image and save the background image.

[0169] In some examples, after the camera HAL obtains the background image, the background image can be captured by the processing result capture module, and the background image can be uploaded to the output stream service module of the framework layer, and the background image can be uploaded to the processing result display module of the camera application through the output service stream module to display the background image on the preview interface 901. The background image may not be captured by the processing result capture module, that is, the background image is not displayed on the preview interface 901, and this embodiment of the application is not limited to this. The embodiment of the application takes the example of not displaying the background image on the preview interface 901 as an example for exemplary description.

[0170] Step S305, performing subject recognition on the background image to obtain the background image to be fused.

[0171] Exemplarily, after the camera HAL obtains the background image, the camera HAL can perform subject recognition on the background image through a subject detection algorithm to obtain the background image to be fused. The background image to be fused is obtained through the processing result capture module, and the background image to be fused is uploaded to the output stream service module of the framework layer. The background image to be fused is uploaded to the processing result display module of the camera application through the output service stream module to display the background image to be fused on the preview interface 901.

[0172] like Fig. 9 As shown in (b), the background image to be fused displayed in the preview interface 901 may include a subject 91 (e.g., the identified photographic object) and a subordinate body 92 (in some examples, corresponding to the background image and the foreground preview image or the non-fused area of ​​the foreground image) of a default fixed color (e.g., white, black or gray, which is not limited in the embodiment of the present application) other than the subject 91. The preview interface 901 may also include a background control 9011, a foreground control 9012, a first fusion weight adjustment control 9013, and a second fusion weight adjustment control 9014.

[0173] In some examples, a user clicking on the background control 9011 may trigger the operation permissions of the subject 91 (e.g., permissions to move, resize, etc.) and the operation permissions of the first fusion weight adjustment control 9013 (e.g., permissions to slide left and right). A user clicking on the foreground control 9012 may trigger the operation permissions of the second fusion weight adjustment control 9014 (e.g., permissions to slide up and down).

[0174] Step S306: determining a target background image in response to a subject adjustment operation input by the user.

[0175] For example, Fig. 9 As shown in (b) in FIG. 1 , the user can click the background control 9011 before inputting the subject adjustment operation to trigger the operation permission of the subject 91. After the operation permission of the subject 91 is opened, the subject adjustment operation is input.

[0176] Exemplarily, when the main body adjustment operation is an operation that can adjust the position and size of the main body, the main body adjustment operation may include a main body position adjustment operation and a main body size adjustment operation. In some examples, the main body position adjustment operation and the main body size adjustment operation may be the same operation or different operations, which is not limited in the embodiments of the present application.

[0177] Exemplarily, the subject position adjustment operation may be a drag operation of the user on the subject. Fig.10As shown in (a) in the preview interface 1001 , the user can click any position on the subject 1002 to select the subject 1002 , and then drag the subject 1002 to move so as to adjust the position of the subject 1002 .

[0178] For example, reference Fig.10 As shown in (b) of FIG. 1 , if the subject size adjustment operation is that the user moves two fingers in the preview interface 1001 toward the first direction indicated by the dotted arrow, the subject 1002 can be enlarged. Fig.10 As shown in (c) in FIG. 1 , if the subject size adjustment operation is that the user moves two fingers in the preview interface 1001 toward the second direction indicated by the solid arrow, the subject 1002 can be reduced. In some examples, the position of the user's two fingers can be on the subject 1002 or outside the subject 1002, which is not limited in the embodiments of the present application.

[0179] Exemplarily, after the user inputs the subject adjustment operation, the camera application sends a subject adjustment request, and transmits the subject adjustment request to the camera HAL through the framework layer. The camera HAL processes the subject adjustment request, processes the background image to be fused through the subject adjustment algorithm, obtains the adjusted background image (target background image), obtains the adjusted background image through the processing result capture module, and uploads the adjusted background image to the processing result display module of the camera application through the output stream service module of the framework layer to be displayed on the preview interface 1001.

[0180] Step S307 , in response to the fusion parameter adjustment operation input by the user, determining the fusion parameters of the target background image and the fusion parameters of the foreground image, and entering the foreground image preview mode.

[0181] Exemplarily, the fusion parameter refers to the fusion ratio of the pixels of each image when multiple images are fused, which can also be called the fusion weight. Taking the fusion of the background image and the foreground preview image as an example, the fusion weight of the background image refers to the ratio of each pixel in the background image when the background image and the foreground preview image are fused. The fusion weight of the foreground preview image refers to the ratio of each pixel in the foreground preview image when the background image and the foreground preview image are fused. If the background image includes a main body and a subordinate body, the fusion weight of the background image may include the main body fusion weight and the subordinate body fusion weight, and the fusion weight of the foreground preview image may include the foreground fusion weight fused with the main body and the foreground fusion weight fused with the subordinate body. The main body fusion weight corresponds to the ratio of each pixel of the main body in the background image; the subordinate body fusion weight corresponds to the ratio of each pixel of the subordinate body; the foreground fusion weight fused with the main body corresponds to the ratio of each pixel fused with the main body in the foreground preview image; the foreground fusion weight fused with the subordinate body corresponds to the ratio of each pixel fused with the subordinate body in the foreground preview image. In some examples, the main body fusion weight, the slave body fusion weight, the foreground fusion weight fused with the main body, and the foreground fusion weight fused with the slave body can all be any value between 0% and 100%, which is not limited in the embodiments of the present application.

[0182] In some examples, the fusion parameters of the target background image may include a main fusion parameter corresponding to the main fusion weight and a slave fusion parameter corresponding to the slave fusion weight. The fusion parameters of the foreground image may include a first foreground fusion parameter corresponding to the foreground fusion weight of the main fusion and a second foreground fusion parameter corresponding to the foreground fusion weight of the slave fusion.

[0183] For example, reference Fig. 9 As shown in (b), after clicking the background control 9011 to trigger the operation permission of the first fusion weight adjustment control 9013, the user can slide the first fusion weight adjustment control 9013 to the left or right to reduce or increase the main fusion weight.

[0184] For example, reference Fig. 9 As shown in (b) in FIG. 1 , after clicking the foreground control 9012 to trigger the operation permission of the second fusion weight adjustment control 9014 , the user can slide the second fusion weight adjustment control 9014 upward or downward to increase or decrease the slave fusion weight.

[0185] In some embodiments, when the user clicks the background control 9011, the preview interface 901 may only display the first fusion weight adjustment control 9013, or may simultaneously display the first fusion weight adjustment control 9013 and the second fusion weight adjustment control 9014; for example, referring to Fig. 9As shown in (b) in FIG. 1 , when the user clicks the background control 9011, the operation permission of the first fusion weight adjustment control 9013 in the preview interface 901 is enabled, and the operation permission of the second fusion weight adjustment control 9014 is not enabled, and the user can only slide the first fusion weight adjustment control 9013. When the user clicks the foreground control 9012, the preview interface 901 can only display the second fusion weight adjustment control 9014, or can display the first fusion weight adjustment control 9013 and the second fusion weight adjustment control 9014 at the same time. For example, referring to Fig. 9 As shown in (c), when the user clicks the foreground control 9012, the operation permission of the second fusion weight adjustment control 9014 in the preview interface 901 is enabled, and the operation permission of the first fusion weight adjustment control 9013 is not enabled, and the user can only slide the second fusion weight adjustment control 9014.

[0186] In some examples, the user may first click on the foreground control 9012 to adjust the slave fusion weight, and then click on the background control 9011 to adjust the size of the subject and the subject fusion weight; or first click on the background control 9011 to adjust the size of the subject and the subject fusion weight, and then click on the foreground control 9012 to adjust the slave fusion weight; or first click on the background control 9011 to adjust the size of the subject, then click on the foreground control 9012 to adjust the slave fusion weight, and finally click on the background control 9011 to adjust the subject fusion weight. The embodiment of the present application does not limit the order of adjusting the subject fusion weight and the size of the subject, nor does it limit the order of adjusting the slave fusion weight and the subject fusion weight. The embodiment of the present application takes the example of first clicking on the background control 9011, then adjusting the size of the subject, and then adjusting the subject fusion weight by sliding the first fusion weight adjustment control 9013, and then clicking on the foreground control 9012 and sliding the second fusion weight adjustment control 9014 to adjust the slave fusion weight as an example for exemplary description.

[0187] In some examples, the user slides the first fusion weight adjustment control 9013 to the left to reduce the main fusion weight, and the user slides the first fusion weight adjustment control 9013 to the right to increase the main fusion weight. The user slides the second fusion weight adjustment control 9014 upward to reduce the slave fusion weight, and the user slides the second fusion weight adjustment control 9014 downward to increase the slave fusion weight.

[0188] Exemplarily, when the user slides the first fusion weight adjustment control 9013, the camera application may issue a subject fusion weight adjustment request. The subject fusion weight request is transparently transmitted to the background image adjustment request processing module in the camera HAL through the background image adjustment request service module of the framework layer. The background image adjustment request processing module processes the subject fusion weight adjustment request, determines the corresponding subject fusion weight and the foreground fusion weight fused with the subject through the subject fusion weight algorithm, and saves the subject fusion weight and the foreground fusion weight fused with the subject.

[0189] In some examples, the relationship between the main fusion weight and the foreground fusion weight fused with the main body can be determined according to the fusion algorithm, and after the main fusion weight is determined, the foreground fusion weight fused with the main body is determined according to the relationship. For example, if the fusion algorithm is an alpha algorithm, it can be determined that the sum of the main fusion weight and the foreground fusion weight fused with the main body is 1. Therefore, when the main fusion weight is determined to be 50%, the foreground fusion weight fused with the main body can be determined to be 50%. When the main fusion weight is determined to be 30%, the foreground fusion weight fused with the main body can also be determined to be 70%.

[0190] Exemplarily, when the user slides the second fusion weight adjustment control 9014, the camera application may issue a slave fusion weight adjustment request. The slave fusion weight request is transparently transmitted to the background image adjustment request processing module in the camera HAL through the background image adjustment request service module of the framework layer. The background image adjustment request processing module processes the slave fusion weight adjustment request, determines the corresponding slave fusion weight and the foreground fusion weight fused with the slave through the slave fusion weight algorithm, and saves the slave fusion weight and the foreground fusion weight fused with the slave.

[0191] In some examples, the relationship between the slave fusion weight and the foreground fusion weight fused with the slave may also be determined according to the fusion algorithm, and after the slave fusion weight is determined, the foreground fusion weight fused with the slave may be determined according to the relationship. For example, if the fusion algorithm is an alpha algorithm, the sum of the slave fusion weight and the foreground fusion weight fused with the slave may be determined to be 1. Therefore, when the slave fusion weight is determined to be 100%, the foreground fusion weight fused with the slave may also be determined to be 0%. When the slave fusion weight is determined to be 10%, the foreground fusion weight fused with the slave may also be determined to be 90%.

[0192] For example, the camera HAL can send the processing result to the camera application through the framework layer after the fusion parameters corresponding to the background image to be fused are obtained. When the processing result indicates that the fusion parameters corresponding to the background image to be fused have been obtained, the foreground image preview request module in the camera application is automatically triggered to send a foreground image preview request, thereby entering the foreground image preview mode.

[0193] Exemplarily, in the foreground image preview mode, the foreground image preview request processing module of the camera HAL can receive the foreground image preview request transmitted through the camera, and process the foreground image preview request, obtain the foreground preview raw image collected by the camera through the camera driver in real time, and process the foreground preview raw image through IFE and IPE to obtain a real-time foreground preview image.

[0194] Exemplarily, the photographing method provided in the embodiment of the present application may include the fusion between multiple background images and a foreground image. In some examples, the multiple background images may include a first background image and a second background image. And steps S303 to S307 are steps for obtaining the first background image to be fused, and step S308 is a step for determining the fusion parameters corresponding to the first background image to be fused.

[0195] For example, after determining the fusion parameters corresponding to the first background image to be fused, a reminder to take a photo of the background image again can be generated, and a preview mode corresponding to the second background image can be entered. Then, step S303 to step S306 are continued to obtain a third background image, and step S307 is continued to determine the fusion parameters corresponding to the second background image.

[0196] In some examples, the preview mode corresponding to the second background image is a mode of previewing the second background image on the first background image. The third background image is a background image obtained by superimposing the second background image on the first background image, and may include the subject on the first background image and the subject on the second background image.

[0197] In some examples, the background image re-photographing prompt is implemented in a similar manner to the background image photo taking prompt. Figure 5 The difference is that the prompt information of the background image re-photographing prompt can be whether to continue to take the background image photo, and the prompt information of the background image re-photographing prompt can include not only a confirmation control but also a confirmation cancel control. If the user clicks the confirmation control, steps S303 to S307 can be executed again; if the user clicks the confirmation cancel control, step S308 can be entered.

[0198] Step S308, in response to a second zoom operation input by the user, determining a second zoom factor and a second camera corresponding to the second zoom factor, and acquiring a foreground preview image captured by the second camera.

[0199] Exemplarily, the second zoom operation may correspond to the foreground preview image and / or the foreground image. The implementation method of the second zoom operation may be similar to the implementation method of the first zoom operation. When the second zoom operation is a manual operation by the user, the second zoom operation may also include one of the following manual operations: the user sliding the zoom bar on the preview interface with a single finger, the user clicking on the multiple zoom value options included in the zoom control on the preview interface, and the user sliding the preview area on the preview interface with two fingers. The embodiment of the present application does not limit the method for manually implementing the second zoom operation.

[0200] Exemplarily, the second zoom operation may be the same as the first zoom operation, or may be different, and this is not limited in the present embodiment of the application. Figures 6 to 8 As shown, different zoom operations may correspond to the same zoom multiple. For example, the user clicks the zoom value option 3.5x in the zoom control 602 (refer to Figure 6 ) and the user slides the zoom bar 702 to the right until the triangle arrow indicating the zoom ratio points to 3.5 in the zoom bar 702 (refer to Figure 7 The corresponding zoom factors are all 3.5.

[0201] Exemplarily, the second zoom factor corresponds to a second zoom operation, and may be the same as the first zoom factor or may be different from the first zoom factor. The embodiment of the present application does not specifically limit the value of the first zoom factor.

[0202] Exemplarily, the second camera may be the same as the first camera, or may be different from the first camera, which is not limited in the embodiments of the present application. In some examples, if the second zoom factor is the same as the first zoom factor, the second camera is the same as the first camera.

[0203] For example, the implementation method of determining the second zoom factor in response to the second zoom operation input by the user is similar to the implementation method of determining the first zoom factor in response to the first zoom operation input by the user, and the embodiments of the present application will not be described in detail here.

[0204] Exemplarily, the implementation method of determining the corresponding second camera based on the second zoom magnification and obtaining the foreground preview image taken by the second camera is similar to the implementation method of determining the first camera based on the first zoom magnification and obtaining the background preview image taken by the first camera, and this application will not go into details here.

[0205] For example, according to user needs, when collecting the foreground preview image, the user may not input the second zoom operation to the electronic device, that is, the user may collect the foreground preview image based on the default zoom multiple (such as 1x). For example, the electronic device may drive the main camera to capture the foreground preview image in real time to obtain the foreground preview image, which is not limited in the embodiments of the present application.

[0206] Step S309: Based on the fusion parameters, the target background image and the foreground preview image are fused to obtain a fused preview image.

[0207] Exemplarily, when the target background image and the foreground preview image are fused, the pixel points in the target background image are fused with the corresponding pixel points in the foreground preview image to obtain a fused preview image.

[0208] The camera HAL can fuse the subject and the foreground preview images through a fusion algorithm based on the subject fusion weight and the foreground fusion weight fused with the subject, and fuse the slave and foreground preview images through a fusion algorithm based on the slave fusion weight and the foreground fusion weight fused with the slave, thereby obtaining a fused preview image. Then, the fused preview image is obtained through the result capture module and uploaded to the output stream service module in the framework layer, and the fused preview image is transparently transmitted to the processing result display module through the output stream service module to display the fused preview image.

[0209] In some examples, the fusion algorithm may include an alpha algorithm, a pyramid algorithm, etc., which is not limited in the present application. The alpha algorithm corresponds to one fusion, and the pyramid algorithm may correspond to multiple fusions. Therefore, the edge effect of the fusion preview image obtained by fusion through the pyramid algorithm is better than the fusion preview image obtained by fusion through the alpha algorithm.

[0210] For example, the fusion formula corresponding to the alpha algorithm can be found in the following formula (1).

[0211] Fusion preview image = background image × fusion weight of background image + real-time preview image × (1-fusion weight of background image) (1);

[0212] Among them, (1-the fusion weight of the background image) corresponds to the fusion weight of the foreground preview image.

[0213] In some examples, if the main body fusion weight is 100%, the slave body fusion weight is also 100%, and the corresponding foreground fusion weight fused with the main body is 0%, and the foreground fusion weight fused with the slave body is also 0%, then the obtained fusion preview image may be the target background image. In other examples, if the main body fusion weight is 0%, the slave body fusion weight is also 0%, and the corresponding foreground fusion weight fused with the main body is 100%, and the foreground fusion weight fused with the slave body is also 0%, then the obtained fusion preview image may be a real-time foreground preview image. In some other examples, if the main body fusion weight is 50%, the slave body fusion weight is 100%, and the corresponding foreground fusion weight fused with the main body is 50%, and the foreground fusion weight fused with the slave body is 0%, then the obtained fusion preview image may include a preview image corresponding to the main body area (the image obtained by fusion of the corresponding main body pixels and the foreground preview image) and a preview image corresponding to the slave body area. The preview image corresponding to the main body area is an image obtained by fusion of 50% of each main body pixel in the main body area with 50% of the corresponding pixel points in the foreground preview image pixels. The preview image corresponding to the slave volume region is an image obtained by fusing 100% of the slave volume pixels with 0% of the foreground preview image.

[0214] For example, refer to Fig.10 As shown, the fused preview image 1001 includes a subject preview image 1002 and a slave preview image 1003. The slave preview image is the same as the slave in the background image.

[0215] Exemplarily, after the camera HAL obtains the real-time fused preview image, the camera HAL can obtain the real-time fused preview image through the processing result capture module, and upload the real-time fused preview image to the output stream service module of the framework layer, and upload the real-time fused preview image to the processing result display module of the camera application through the output service stream module to display the real-time fused preview image on the preview interface.

[0216] Step S310, in response to a foreground photo taking instruction input by a user, obtaining a foreground image.

[0217] Exemplarily, the foreground photo taking instruction may be similar to the background photo taking instruction, and will not be described in detail here.

[0218] Exemplarily, the foreground image refers to an image used to overlay multiple background images when multiple images are overlaid. The foreground image may include multiple main objects or may not include any main object, which is not limited in the embodiments of the present application.

[0219] In some examples, the foreground image photographing instruction is taken as an example of a foreground image photographing operation. Fig.11As shown, when the user sees the foreground object in the preview interface 1101, he can click the photo control 1102 in the preview interface 1101 (the user clicks the photo control 1102 in the preview interface 1001, which triggers the photo command). In response to the user clicking the photo control 1102, the camera application sends a foreground image photo request, and the foreground image photo request service module of the framework layer transmits the foreground image photo request to the foreground image photo request processing module in the camera HAL. The foreground image photo request processing module processes the foreground image photo request, drives the second camera to capture images through the camera driver, and the second camera outputs multiple frames of foreground raw images, and uploads the multiple frames of foreground raw images to the camera HAL through the camera driver. The camera HAL processes the multiple frames of foreground raw images through a multi-frame fusion algorithm to obtain a foreground image, and saves the foreground image.

[0220] Exemplarily, the multi-frame fusion algorithm may include one of multi-frame raw domain image processing, high dynamic imaging processing and multi-frame YUV domain image processing. The embodiment of the present application does not limit the implementation method of the multi-frame fusion algorithm.

[0221] In some examples, after the camera HAL obtains the foreground image, the foreground image may not be captured by the processing result capture module, that is, the foreground image is not displayed on the preview interface 1101. The foreground image may also be obtained by the processing result capture module, and the foreground image is uploaded to the output stream service module of the framework layer. The foreground image is uploaded to the processing result display module of the camera application through the output service stream module to display the foreground image on the preview interface. The embodiment of the present application is exemplified by taking the example of not displaying the foreground image on the preview interface 1101.

[0222] In the embodiment of the present application, since the foreground image is obtained by a multi-frame fusion algorithm, the image quality and dynamic range of the obtained foreground image are relatively good.

[0223] Step S311, based on the fusion parameters corresponding to the background image to be fused, the target background image and the foreground image are fused to obtain a target image.

[0224] In some examples, the target background image and the foreground image are fused based on the fusion parameters corresponding to the background image to be fused. The implementation method for obtaining the target image can be the same as the implementation method for obtaining the fused preview image by fusing the target background image and the foreground preview image based on the fusion parameters corresponding to the background image to be fused, and no further details are given here.

[0225] The photographing method provided in the embodiment of the present application is to set the camera to enter the multi-exposure mode after starting the camera application of the electronic device, take a background photograph in the multi-exposure mode to obtain a background image, and perform subject recognition on the background image to obtain the background image to be fused. Then, the subject is adjusted based on human-computer interaction to obtain the target background image, and the fusion parameters corresponding to the target background image are obtained based on human-computer interaction. Next, based on the fusion parameters corresponding to the target background image, the target background image and the obtained foreground preview image are fused to obtain a fused preview image. Finally, the foreground image is obtained, and the foreground image and the target background image are fused based on the fusion parameters corresponding to the target background image to obtain the target image. Since the user can directly adjust the subject and the fusion parameters in this process, no professional technical knowledge is required, and no post-processing is required, so the user-friendliness is good. And the fusion effect can be viewed in real time through the fusion preview image, which also improves the user experience.

[0226] In some embodiments, after starting the camera application, you can first shoot a foreground image, then shoot a background image, and then perform subject recognition on the background image to obtain the background image to be fused. Then, adjust the subject in the background image to be fused by human-computer interaction to obtain the target background image. Adjust the fusion parameters by human-computer interaction to obtain the fusion parameters corresponding to the target background image. Finally, based on the fusion parameters corresponding to the target background image, fuse the foreground image and the target background image to obtain the target image. In the embodiment of the present application, the shooting order of the foreground image and the background image is not limited.

[0227] Fig.12 This is a flow chart of another method for taking photos provided in an embodiment of the present application. Fig.12 As shown, the photographing method may include steps S1201 to S1210.

[0228] Step S1201, in response to a start instruction input by a user to the camera application of the electronic device, start the camera application.

[0229] For example, the implementation of step S1201 can refer to Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.

[0230] Step S1202, in response to the multi-exposure mode setting instruction input by the user, generating a foreground image photo taking prompt and entering a foreground image preview mode.

[0231] For example, the implementation method of the foreground image photo prompt can be similar to the background image photo prompt, and the present application embodiment does not limit this. Figure 5 As shown in (b) in Fig.13As shown in (a) of FIG. 1 , a prompt message 132 for prompting the user to take a photo of the foreground image may pop up at the upper left corner of the preview interface 1301 . The prompt message 132 includes a confirmation control 1320 that the user can click.

[0232] For example, continue to refer to Fig.13 As shown in (a) of FIG. 1 , a foreground image preview request may be triggered after the user clicks the confirmation control 1320, and the foreground image preview mode is started, and the foreground image preview mode is displayed. Fig.13 The interface shown in (b) in the reference Fig.13 As shown in (b) of FIG. 1 , the upper right corner of the preview interface 1301 may include an indicator 1302 for previewing the foreground image. Therefore, the preview interface 1301 may also be referred to as a foreground image preview interface. Fig.13 The multi-exposure mode shown in (b) may also be referred to as a foreground image preview mode in the multi-exposure mode.

[0233] For example, the implementation of step S1202 can refer to Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.

[0234] Step S1203, in response to a second zoom operation input by the user, determining a second zoom factor and a second camera corresponding to the second zoom factor, and acquiring a foreground preview image captured by the second camera.

[0235] For example, the implementation of step S1203 can refer to Figure 3 The step S308 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0236] Step S1204, in response to a foreground photo taking instruction input by the user, a foreground image is acquired, and a background image preview mode is entered.

[0237] For example, the implementation of step S1204 can refer to Figure 3 The step S310 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0238] In some examples, after obtaining the foreground image, the camera application may be triggered to send a background image preview request to enter the background image preview mode.

[0239] Step S1205 , in response to a first zoom operation input by the user, determining a first zoom factor and a first camera corresponding to the first zoom factor, and acquiring a background preview image captured by the first camera.

[0240] In some examples, the implementation of step S1205 can refer to Figure 3 The step S303 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0241] Step S1206, in response to the background image photographing instruction input by the user, obtaining the background image.

[0242] In some examples, the implementation of step S1206 can refer to Figure 3 The step S304 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0243] Step S1207, performing subject recognition on the background image to obtain the background image to be fused.

[0244] In some examples, the implementation of step S1207 can refer to Figure 3 The step S305 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0245] Step S1208: determining a target background image in response to a subject adjustment operation input by the user.

[0246] In some examples, the implementation of step S1208 can refer to Figure 3 The step S306 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0247] Step S1209: In response to the fusion parameter adjustment operation input by the user, the fusion parameters corresponding to the target background image are determined.

[0248] In some examples, the implementation of step S1209 can refer to Figure 3 The step S307 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0249] Step S1210, based on the fusion parameters corresponding to the target background image, the target background image and the foreground image are fused to obtain a target image.

[0250] In some examples, the implementation of step S1210 can refer to Figure 3 The step S311 of the illustrated embodiment will not be described in detail in the embodiment of the present application.

[0251] Fig.14 A flowchart of another method for taking photos provided in the embodiment of the application is shown below. Fig.13 As shown, the photographing method can be applied to an electronic device, which includes a camera application and includes steps S1401 to S1405.

[0252] Step S1401, in response to a multi-exposure mode setting operation input by a user in a camera application, a multi-exposure photography function is enabled.

[0253] For example, the implementation of step S1401 can refer to Figure 3 The step S302 of the illustrated embodiment is not described in detail in the embodiment of the present application.

[0254] Step S1402, in response to a background image photographing instruction input by a user, obtaining a background image to be fused.

[0255] For example, the implementation of step S1401 can be found in Figure 3 Step S304 and step S305 of the illustrated embodiment will not be described in detail here.

[0256] In some examples, before obtaining the background image to be fused in response to a background image photo taking instruction input by the user, the method also includes: determining a first zoom factor and a first camera corresponding to the first zoom factor in response to a first zoom operation input by the user.

[0257] In some examples, in response to a background image photo taking instruction input by a user, obtaining a background image to be fused includes: in response to the background image photo taking instruction input by the user, capturing the background image based on a first camera; performing subject detection on the background image to obtain the background image to be fused.

[0258] Step S1403 , in response to the user's input adjustment operation on the background image to be fused, determining the target background image and the fusion parameters of the target background image.

[0259] For example, the implementation of step S1403 can be found in Figure 3 Step S306 and step S307 of the illustrated embodiment will not be described in detail here.

[0260] In some examples, in response to an adjustment operation input by a user on the background image to be fused, determining the fusion parameters of the target background image includes: in response to the fusion parameter adjustment operation input by the user, adjusting the fusion weight of the background image to be fused to obtain the fusion parameters of the target background image;

[0261] The adjustment operation includes a fusion parameter adjustment operation.

[0262] In some examples, in response to a fusion parameter adjustment operation input by a user, the fusion weight of the background image to be fused is adjusted to obtain the fusion parameters of the target background image, including: in response to a subject fusion parameter adjustment operation input by a user, determining the fusion parameters corresponding to the subject in the target background image; in response to a slave fusion parameter adjustment operation input by a user, determining the fusion parameters corresponding to the slave in the target background image; wherein the fusion parameter adjustment operation includes a subject fusion parameter adjustment operation and a slave fusion parameter adjustment operation.

[0263] In some examples, in response to an adjustment operation input by a user on a background image to be fused, a target background image is determined, including: in response to a subject adjustment operation input by a user, the size and / or position of a subject in the background image to be fused is adjusted to obtain a target background image; wherein the adjustment operation includes a subject adjustment operation.

[0264] Step S1404, in response to a foreground image photographing instruction input by the user, obtaining a foreground image.

[0265] For example, the implementation of step S1404 can be found in Figure 3 Step S310 of the illustrated embodiment will not be described in detail here.

[0266] In some examples, before acquiring the foreground image in response to a foreground image photo taking instruction input by the user, the method also includes: determining a second zoom factor and a second camera corresponding to the second zoom factor in response to a second zoom operation input by the user; capturing a foreground preview image based on the second camera; and fusing the foreground preview image and the target background image based on a fusion parameter of the target background image to obtain a fused preview image.

[0267] Step S1405: Based on the fusion parameters of the target background image, the foreground image and the target background image are fused to obtain a target image.

[0268] For example, the implementation of step S1405 can be found in Figure 3 Step S311 of the illustrated embodiment will not be described in detail here.

[0269] In some examples, a foreground image and a target background image are fused based on fusion parameters of the target background image to obtain a target image, including: determining fusion parameters of the foreground image based on fusion parameters of the target background image; fusing the foreground image and the target background image through a fusion algorithm based on the fusion parameters of the target background image and the fusion parameters of the foreground image to obtain the target image.

[0270] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present invention 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 exceed the scope of the embodiments of the present application.

[0271] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0272] The present application also provides a photographing device, which can be applied to electronic devices. The functions of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, such as the photographing method provided in the above embodiments.

[0273] The present application also provides an electronic device, which includes: a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; wherein the memory stores a computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the photographing method provided in the above embodiment. The specific structure of the electronic device can be referred to Figure 1 The structure of the electronic device shown in .

[0274] An embodiment of the present application also 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 photographing method provided in the aforementioned embodiment.

[0275] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the photographing method provided in the aforementioned embodiment.

[0276] 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.

[0277] In the several embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. 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.

[0278] 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.

[0279] 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.

[0280] 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 execute all or part of the steps of the method described in each embodiment 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.

[0281] 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 photographing method, characterized in that: Applied to an electronic device, the electronic device includes a camera application, and the method includes: In response to a multi-exposure mode setting operation input by a user in the camera application, enabling a multi-exposure photo taking function; In response to a background image photographing instruction input by a user, obtaining a background image to be fused; In response to the user's adjustment operation input on the background image to be fused, determining a target background image and fusion parameters of the target background image; the fusion parameters of the target background image include fusion parameters corresponding to the main body in the target background image and fusion parameters corresponding to the subordinate body in the target background image; In response to a foreground image photographing instruction input by a user, acquiring a foreground image; Based on the fusion parameters corresponding to the main body in the target background image, the main body in the target background image is fused with the corresponding pixel points in the foreground image, and based on the fusion parameters corresponding to the subordinate body in the target background image, the subordinate body in the target background image is fused with the corresponding pixel points in the foreground image to obtain a target image; The adjustment operation includes a main adjustment operation; the step of determining a target background image in response to the adjustment operation input by the user on the background image to be fused includes: In response to the subject adjustment operation input by the user, the size and / or position of the subject in the background image to be fused is adjusted to obtain the target background image.

2. The method according to claim 1, characterized in that Before obtaining the background image to be fused in response to the background image photographing instruction input by the user, the method further includes: In response to a first zoom operation input by a user, a first zoom factor and a first camera corresponding to the first zoom factor are determined.

3. The method according to claim 2, characterized in that The step of obtaining the background image to be fused in response to a background image photographing instruction input by a user includes: In response to a background image photographing instruction input by a user, collecting a background image based on the first camera; Perform subject detection on the background image to obtain the background image to be fused.

4. The method according to claim 1, characterized in that: The step of determining the fusion parameters of the target background image in response to the user's input adjustment operation on the background image to be fused includes: In response to a fusion parameter adjustment operation input by a user, the fusion weight of the background image to be fused is adjusted to obtain a fusion parameter of the target background image; Wherein, the adjustment operation includes the fusion parameter adjustment operation.

5. The method according to claim 4, characterized in that The step of adjusting the fusion weight of the background image to be fused in response to the fusion parameter adjustment operation input by the user to obtain the fusion parameter of the target background image includes: In response to a subject fusion parameter adjustment operation input by a user, determining a fusion parameter corresponding to the subject in the target background image; In response to a slave body fusion parameter adjustment operation input by a user, determining a fusion parameter corresponding to the slave body in the target background image; The fusion parameter adjustment operation includes the main fusion parameter adjustment operation and the slave fusion parameter adjustment operation.

6. The method according to any one of claims 1 to 5, characterized in that: Before acquiring the foreground image in response to the foreground image photographing instruction input by the user, the method further includes: In response to a second zoom operation input by a user, determining a second zoom factor and a second camera corresponding to the second zoom factor; Collecting a foreground preview image based on the second camera; Based on the fusion parameters of the target background image, the foreground preview image and the target background image are fused to obtain a fused preview image.

7. The method according to any one of claims 1 to 5, characterized in that: The step of fusing the foreground image and the target background image based on the fusion parameter of the target background image to obtain a target image includes: Determining fusion parameters of the foreground image based on fusion parameters of the target background image; Based on the fusion parameters of the target background image and the fusion parameters of the foreground image, the foreground image and the target background image are fused by a fusion algorithm to obtain the target image.

8. An electronic device, characterized in that: It includes a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; 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 photographing method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: It comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the photographing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Realization method and apparatus for local double exposure, and mobile terminal

    CN105163041A

  • Image processing method and device and electronic equipment

    CN112135049A