Shooting method and related device

By combining the gallery and camera applications of electronic devices, the problem of inconvenient group photo taking is solved, and efficient and convenient high-quality group photos are achieved. It supports real-time preview and flexible adjustment and is suitable for group photo taking of various objects.

CN120786178APending Publication Date: 2025-10-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510798794.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

During group photo taking, existing technologies require external equipment or personnel, which results in inconvenient operation, poor results, and a long time consumption, and cannot achieve high-quality real-time preview and adjustment.

Method used

By combining the gallery application and camera application of the electronic device, real-time preview and fitting of objects can be achieved, allowing users to adjust the shooting distance and camera without the help of external equipment or personnel to generate high-quality group photo effects.

Benefits of technology

It enables efficient and convenient group photo taking of multiple subjects without the help of external equipment or personnel, supports real-time preview and flexible adjustment to achieve high-quality group photo effects, and is suitable for continuous and large-scale group photo shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120786178A_ABST
    Figure CN120786178A_ABST
Patent Text Reader

Abstract

The invention discloses a shooting method and a related device, and the method comprises the steps: starting a camera application after electronic equipment starts a joint shooting function for a selected picture containing an object A, displaying the indication information of the picture in a preview interface, and displaying an image collected by a camera of the electronic equipment at the same time. Afterwards, the electronic equipment can receive a photographing instruction input by a user, and the picture and an image collected by the camera are fitted into a composite image containing the object A and the object B at the same time. According to the method, the high-quality group photo of the object A and the object B can be realized without other equipment or other personnel.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application, the original application number is 202211037891.9, the original application date is August 26, 2022, and the entire contents of the original application are incorporated into the present application by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of terminals, and in particular to a photographing method and related apparatus. BACKGROUND

[0003] When multiple people go out, there is usually a need for a group photo. The methods for taking a group photo of multiple people include the following:

[0004] 1. Ask a passerby to take a group photo. This method not only needs to bother others, but also may result in a general shooting effect due to the insufficient understanding of the shooting device by the passerby.

[0005] 2. Use a selfie stick, a tripod, or directly place the shooting device on the ground to take a photo. However, the selfie stick increases the weight of the user when going out, cannot control the shooting distance, and the shooting clarity of the front camera is low. The tripod also increases the weight and cannot preview in real time, and there is a risk of damage to the shooting device. Placing the shooting device on the ground to take a photo cannot preview in real time and cannot control the shooting distance.

[0006] 3. Multiple people take photos separately and then use photo software to generate a group photo later. The method of generating a group photo later is time-consuming, does not support real-time preview of the group photo, and the group photo effect is also general. SUMMARY

[0007] The present application provides a photographing method and related apparatus, which can achieve high-quality group photos of multiple objects without the aid of other devices or other personnel.

[0008] In a first aspect, an embodiment of the present application provides a photographing method, which is applied to an electronic device. The method can include: the electronic device starts a gallery application and displays a first user interface, and the first user interface displays a first picture, and the first picture contains a first object; the electronic device receives a first operation for the first picture; the electronic device starts a camera application and displays a second user interface, and the second user interface displays a preview frame, and the preview frame displays an image collected by a camera of the electronic device and indication information of the first picture; the electronic device receives a second operation for taking a photo; and the electronic device stores a second picture, and the second picture is obtained by fitting the image collected by the camera and the first picture, the image collected by the camera contains a second object, and the second picture contains the first object and the second object.

[0009] The method provided by the first aspect can be implemented by the electronic device calling the camera application through the gallery application, and the method can complete the group photo of the first object and the second object without the aid of other devices or other persons, and can preview and adjust the relative positions between the first object and the second object in real time during the group photo, and can flexibly adjust the shooting distance and the camera used for shooting, so as to achieve a high-quality group photo effect. Moreover, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large group photo shooting.

[0010] In combination with the first aspect, in some embodiments, the first object or the second object is any one of the following: a person, an animal, a landmark, a building, and a doll.

[0011] In combination with the first aspect, in some embodiments, the number of the first objects or the second objects can be multiple.

[0012] In combination with the first aspect, in some embodiments, the indication information of the first picture displayed by the electronic device in the preview frame can be the first picture with transparency or blurring. In this way, the user can see the first picture through the preview frame, and can see the image collected by the camera displayed by the electronic device through the first picture with transparency or blurring, so as to achieve the effect of real-time previewing the relative positions between the object in the first picture and the object in the image collected by the camera.

[0013] In combination with the first aspect, in some embodiments, after receiving the second operation, the electronic device can obtain the second picture by any one of the following methods:

[0014] Method 1: fitting the region where the second object is located in the image collected by the camera to the first picture, so as to obtain the second picture.

[0015] In specific implementation, the electronic device identifies the second object in the image collected by the camera; determines a main region containing the second object in the image collected by the camera, the main region being a region determined based on the second object; determines a homologous region in the first picture, the part of the first picture other than the homologous region, and the part of the image collected by the camera other than the main region having a correlation greater than a second value; and fits the main region to the homologous region in the first picture, so as to obtain the second picture.

[0016] Method 2: fitting the region where the first object is located in the first picture to the image collected by the camera, so as to obtain the second picture.

[0017] The electronic device identifies a first object in the first picture; determines a main region containing the first object in the first picture, the main region being a region determined based on the first object; determines a homologous region in the image captured by the camera, a part of the image captured by the camera other than the homologous region, and a part of the first picture other than the main region having a correlation greater than a second value; and fits the main region to the homologous region in the image captured by the camera to obtain a second picture.

[0018] In the above manner 1 or manner 2, the main region can be a region obtained by extending outward from the corresponding object (such as the first object or the second object) by a first value, or a region obtained by extending outward from the corresponding object and having a color or pixels similar to or the same as the corresponding object. The first value can be preset by the electronic device. The first value can be related to the camera model configured by the electronic device.

[0019] Determining the main region based on the corresponding object (such as the first object or the second object) can ensure the integrity of the object in the main region and avoid over-expanding the range, thereby ensuring the subsequent fitting effect.

[0020] In the above manner 1 or manner 2, the homologous region has the same position in the first picture as the main region in the image captured by the camera. In this way, the effect of the user adjusting the content in the preview frame in real time can directly affect the final fitting effect, achieving the purpose of the user adjusting the group photo effect in real time.

[0021] In the above manner 1 or manner 2, the homologous region in the first picture has the same size and shape as the main region in the image captured by the camera.

[0022] In combination with the first aspect, in some embodiments, the second picture is a frame of image having the highest quality in a synthesized image obtained by fitting the image captured by the camera and the first picture, and the image captured by the camera includes images captured by the camera at the time when the second operation is received and before the time, and the number of the images is preset by the electronic device. In this way, the high-quality group photo effect can be ensured.

[0023] In combination with the first aspect, in some embodiments, the second picture is a frame of image obtained by fitting the image captured by the camera at the time when the second operation is received and the first picture.

[0024] In combination with the first aspect, in some embodiments, the first user interface displays a first control, and before the electronic device receives the first operation on the first picture, the method further includes: the electronic device receives a user operation on the first control; the electronic device displays a second control in the first user interface; and the first operation includes a user operation on the second control.

[0025] In some embodiments of the first aspect, after the electronic device stores the second picture, the electronic device can receive a third operation for viewing the second picture, and display the second picture. In other words, after the first object and the second object are combined, the user can also view the combined picture on the electronic device.

[0026] In the second aspect, the embodiments of the present application provide a photographing method, which is applied to an electronic device. The method can include: starting a gallery application by the electronic device, and displaying a first user interface, wherein the first user interface displays a first picture, and the first picture contains a first object; receiving a first operation for the first picture by the electronic device; starting a camera application by the electronic device, and displaying a second user interface, wherein the second user interface displays a preview frame, and the preview frame displays a combined image, the combined image is obtained by fitting an image captured by a camera of the electronic device and the first picture, and the image captured by the camera contains a second object; receiving a second operation for photographing by the electronic device; and storing a second picture by the electronic device, wherein the second picture is the combined image displayed in the preview frame when the second operation is received, and the second picture contains the first object and the second object.

[0027] By implementing the method provided in the second aspect, the electronic device can call the camera application through the gallery application, and can display the combined picture effect to the user in real time in the preview frame, so that the user can more intuitively feel the combined picture effect, and the combined picture of the first object and the second object can be completed without the help of other devices or other personnel. In addition, the relative positions between the first object and the second object can be previewed and adjusted in real time during the combined picture process, and the photographing distance and the camera used for photographing can also be flexibly adjusted, so as to achieve a high-quality combined picture effect. In addition, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large combined picture photographing.

[0028] In some embodiments of the second aspect, the first object or the second object is any one of the following: a person, an animal, a landmark, a building, and a doll.

[0029] In some embodiments of the second aspect, the number of the first object or the second object can be multiple.

[0030] In some embodiments of the second aspect, the electronic device can obtain the combined image displayed in the preview frame by any one of the following methods:

[0031] Method 1: fitting the region where the second object is located in the image captured by the camera to the first picture, so as to obtain the second picture.

[0032] Method 2: fitting the region where the first object is located in the first picture to the image captured by the camera, so as to obtain the second picture.

[0033] The specific implementation and technical effects of the above-mentioned manner 1 and manner 2 can refer to the generation manner of the second picture in the first aspect, which will not be described here again.

[0034] With reference to the second aspect, in some embodiments, the first user interface displays the first control, and before the electronic device receives the first operation on the first picture, the electronic device can also receive a user operation on the first control and display a second control in the first user interface; the first operation includes the user operation on the second control.

[0035] With reference to the second aspect, in some embodiments, after the electronic device stores the second picture, the electronic device can receive a third operation for viewing the second picture and display the second picture. That is, after the first object and the second object are combined, the user can also view the combined picture on the electronic device.

[0036] In a third aspect, an embodiment of the present application provides a photographing method, which is applied to an electronic device. The method can include: the electronic device displays a second user interface, the second user interface displays a preview frame and a third control, the preview frame displays an image collected by a camera of the electronic device; the electronic device detects a fourth operation on the third control; the electronic device displays one or more pictures; the electronic device detects a fifth operation on a first picture in the one or more pictures, the first picture contains a first object; the electronic device displays, in the preview frame of the second user interface, the image collected by the camera of the electronic device and indication information of the first picture; the electronic device receives a second operation for photographing; and the electronic device stores a second picture, the second picture is obtained by fitting the image collected by the camera and the first picture, the image collected by the camera contains a second object, and the second picture contains the first object and the second object.

[0037] The electronic device can start the combination photographing function through the preview interface, and can complete the combination photographing of the first object and the second object without the help of other devices or other personnel, and can also preview and adjust the relative positions between the first object and the second object in real time during the combination photographing, and can also flexibly adjust the photographing distance and the camera used for photographing, so as to achieve a high-quality combination photographing effect. Moreover, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large combination photographing.

[0038] With reference to the third aspect, the second user interface (i.e., the preview interface) can be provided by a camera application or an interface provided by a camera interface called by other applications. The other applications can be social applications, shopping applications, and the like. That is, the combination photographing function can be started through the camera application or the other applications.

[0039] The first object, the second object, and the indication information of the first picture in the third aspect can refer to the related description of the first aspect.

[0040] In combination with the third aspect, in some embodiments, the manner and technical effects in which the electronic device fits the second picture can refer to the related description in the first aspect.

[0041] In combination with the third aspect, in some embodiments, the second picture is a frame of image with the highest quality in the synthesized images obtained by fitting the plurality of frames of images captured by the camera and the first picture, and the plurality of frames of images include images captured by the camera at the time when the second operation is received and before the time, and the number of the plurality of frames of images is set by the electronic device in advance. In this way, the high-quality photo effect can be ensured.

[0042] In combination with the third aspect, in some embodiments, the second picture is a frame of synthesized image obtained by fitting the image captured by the camera at the time when the second operation is received and the first picture.

[0043] In combination with the third aspect, in some embodiments, after the electronic device stores the second picture, the electronic device can receive a third operation for viewing the second picture, and display the second picture. That is, after the photo of the first object and the second object is completed, the user can still view the photo on the electronic device.

[0044] In the fourth aspect, the embodiments of the present application provide a photographing method, which is applied to an electronic device. The method can include: the electronic device displays a second user interface, the second user interface displays a preview frame and a third control, and the preview frame displays an image captured by a camera of the electronic device; the electronic device detects a fourth operation acting on the third control; the electronic device displays one or more pictures; the electronic device detects a fifth operation acting on a first picture in the one or more pictures, and the first picture contains a first object; the electronic device displays a synthesized image in the preview frame of the second user interface, and the synthesized image is obtained by fitting the image captured by the camera of the electronic device and the first picture, and the image captured by the camera contains a second object; the electronic device receives a second operation for photographing; and the electronic device stores a second picture, and the second picture is the synthesized image displayed in the preview frame when the second operation is received, and the second picture contains the first object and the second object.

[0045] In the method provided by the fourth aspect, the electronic device can start the group photo function through the preview interface, and can show the group photo effect to the user in real time in the preview frame, so that the user can more intuitively feel the group photo effect, and the group photo of the first object and the second object can be completed without the help of other devices or other personnel. In addition, the relative positions between the first object and the second object can be previewed and adjusted in real time during the group photo, and the shooting distance and the camera used for shooting can be flexibly adjusted to achieve a high-quality group photo effect. In addition, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large group photo shooting.

[0046] In combination with the fourth aspect, in some embodiments, the second user interface (i.e., the preview interface) can be provided by a camera application or an interface provided by other applications calling a camera interface. The other applications can be social applications, shopping applications, etc. In other words, the group photo function can be started through the camera application or other applications.

[0047] In combination with the fourth aspect, in some embodiments, the first object or the second object is any one of the following: a person, an animal, a landmark, a building, and a doll.

[0048] In combination with the fourth aspect, in some embodiments, the number of the first object or the second object can be multiple.

[0049] In combination with the fourth aspect, in some embodiments, the electronic device can obtain the synthesized image displayed in the preview frame in any one of the following ways:

[0050] In the first way, the region where the second object is located in the image captured by the camera is fitted into the first picture, so as to obtain the second picture.

[0051] In the second way, the region where the first object is located in the first picture is fitted into the image captured by the camera, so as to obtain the second picture.

[0052] The specific implementation and technical effects of the above-mentioned first way and second way can refer to the generation method of the second picture in the first aspect, which will not be described here.

[0053] In combination with the fourth aspect, in some embodiments, after the electronic device stores the second picture, the electronic device can receive a third operation for viewing the second picture, and display the second picture. In other words, after the group photo of the first object and the second object is completed, the user can view the group photo on the electronic device.

[0054] In a fifth aspect, an electronic device is provided, including: a memory, one or more processors; the memory is coupled to the one or more processors, and is configured to store computer program codes, the computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform any one of the methods performed by the electronic device in the first aspect or the second aspect or the third aspect or the fourth aspect.

[0055] In a sixth aspect, a computer readable storage medium is provided, including instructions, when the instructions are run on an electronic device, causing the electronic device to perform any one of the methods performed by the electronic device in the first aspect or the second aspect or the third aspect or the fourth aspect.

[0056] In a seventh aspect, a computer program product is provided, when the computer program product is run on a computer, causing the computer to perform any one of the methods performed by the electronic device in the first aspect or the second aspect or the third aspect or the fourth aspect.

[0057] In an eighth aspect, a chip system is provided, including at least one processor, configured to implement any one of the methods performed by the electronic device in the first aspect or the second aspect or the third aspect or the fourth aspect.

[0058] By implementing the technical solutions provided in the present application, the electronic device can complete the group photo of the first object and the second object without the aid of other devices or other personnel, and can also preview and adjust the relative positions between the first object and the second object in real time during the group photo process, and can also flexibly adjust the shooting distance and the camera used for shooting, so as to achieve a high-quality group photo effect. Moreover, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large group photo shooting. BRIEF DESCRIPTION OF DRAWINGS

[0059] FIG. 1A A hardware structure schematic diagram of the electronic device 100 provided in the embodiments of the present application is shown in FIG. 1;

[0060] FIG. 1B A software structure schematic diagram of the electronic device 100 provided in the embodiments of the present application is shown in FIG. 2;

[0061] FIG. 1C Another software structure schematic diagram of the electronic device 100 provided in the embodiments of the present application is shown in FIG. 3;

[0062] FIG. 2A-FIG. 2H A group of user interfaces for group photo provided in the electronic device 100 in the embodiments of the present application is shown in FIG. 4;

[0063] FIG. 3A-FIG. 3FAnother set of user interfaces for group photo provided by the electronic device 100 in the embodiments of the present application;

[0064] FIG. 4A-FIG. 4B The user interface provided by the gallery application after the electronic device 100 in the embodiments of the present application saves the fitted picture;

[0065] FIG. 5 Flowchart of the photographing method provided by the embodiments of the present application;

[0066] FIG. 6A-FIG. 6B Examples of several image processing processes provided by the embodiments of the present application. DETAILED DESCRIPTION

[0067] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; "and / or" in the text only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0068] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0069] In the following embodiments of the present application, the term "user interface (user interface, UI)" is the medium interface for interaction and information exchange between an application program or an operating system and a user, which realizes the conversion between the internal form of information and the form that the user can accept. The user interface is the source code written in a specific computer language such as Java, extensible markup language (extensible markup language, XML), and the interface source code is parsed, rendered on the electronic device, and finally presented as content that the user can recognize. The commonly used form of user interface is graphic user interface (graphic user interface, GUI), which refers to the user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icon, button, menu, tab, text box, dialog box, status bar, navigation bar, Widget, etc. displayed in the display screen of the electronic device.

[0070] The following embodiments of the present application provide a photographing method and related device. In the photographing method, an electronic device can start a "photo combining" function for a selected picture containing an object A, and then start a camera application. The camera application displays the picture with transparency or blurring in a preview interface, and simultaneously displays an image captured by a camera of the electronic device. After the image captured by the camera includes an object B, the electronic device can receive a photographing instruction input by a user, and then fit the picture and the image captured by the camera to generate a combined image containing both the object A and the object B.

[0071] The object A or the object B described above can include, but is not limited to, a person, an animal, a landmark, a building, a doll, and the like. The number of the object A or the object B can be multiple.

[0072] The photographing method described above can realize a group photo of the object A and the object B. The method can complete the group photo without the aid of other devices or other personnel, and can also preview and adjust the relative positions of the object B and the object A in real time during the group photo, and can flexibly adjust the photographing distance and the camera used for photographing to achieve a high-quality group photo effect. Moreover, the method has low operation difficulty, short time, and is convenient and fast, and can support continuous and large group photo shooting.

[0073] The photographing method described above can be applied to scenarios with group photo needs, including but not limited to multiple group photos of the same person at the same location, and group photos of a new person and a person in an old photo, which realizes multiple group photos of different people at the same location at different times.

[0074] In some embodiments, the electronic device can extract a region in which the object B is located in the image captured by the camera, and fit the region to the picture containing the object A, and the remaining part of the picture remains unchanged to generate a combined image containing both the object A and the object B. Through image fitting, the object B can be smoothly and naturally integrated into the corresponding region of the picture containing the object A, and a natural and high-quality group photo effect is obtained. In other embodiments, the electronic device can also extract a region in which the object A is located in the picture, and fit the region to the image captured by the camera. The specific way of generating a combined image can be referred to the detailed description of subsequent method embodiments.

[0075] In some embodiments, the electronic device can select N frames of images captured by the camera at the moment when the photographing instruction is received and before the moment, perform fitting processing on each of the N frames of images and the picture containing object A, obtain N frames of composite images, and then select one frame with the best quality from the N frames of composite images as the final result of the group photo and store the frame.

[0076] In some embodiments, after the electronic device starts the camera application, the electronic device can directly perform fitting processing on the image captured by the camera and the selected picture containing object A, and directly display the composite image in the preview interface provided by the camera application.

[0077] In the embodiments of the present application, the "group photo" function is provided by the electronic device, which supports the electronic device to display the picture containing object A with transparency or blurring in the preview interface provided by the camera application, and simultaneously display the image captured by the camera of the electronic device. The electronic device receives a photographing instruction input by a user, performs fitting processing on the picture and the image captured by the camera, and generates a composite image containing object A and object B. Alternatively, the "group photo" function supports the electronic device to directly perform fitting processing on the image captured by the camera and the picture containing object A, and directly display the composite image in the preview interface provided by the camera application.

[0078] The "group photo" function is only a term used in the embodiments of the present application, and the meaning represented by the term has been described in the embodiments. The name of the function does not constitute any limitation on the embodiments. For example, the "group photo" function can also be referred to as other terms, such as "group photo" function, multi-person group photo, multi-person group photo, etc.

[0079] The electronic device provided by the embodiments of the present application will be introduced first.

[0080] The electronic device provided by the embodiments of the present application is configured with a camera, and can include but is not limited to a smart phone, a tablet computer, a dedicated camera (such as a single-lens reflex camera, a card-type camera), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device (such as a smart watch, smart glasses), a personal digital assistant (PDA), etc. The exemplary embodiments of the electronic device include but are not limited to a mobile phone, a tablet computer, a camera, an AR device, a VR device, an AI device, a wearable device, and a PDA. The electronic device can be a portable electronic device such as a mobile phone, a tablet computer, a laptop computer, or the like running a Linux or other operating system. The electronic device can also be another portable electronic device such as a laptop computer.

[0081] FIG. 1A A structure diagram of an electronic device 100 is shown.

[0082] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.

[0083] The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0084] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0085] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0086] The controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions.

[0087] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0088] In some embodiments, the processor 110 such as the controller or GPU can be used to perform transparency processing or virtualization processing on the picture containing object A, and superimpose it on the image captured by the camera 193 to synthesize a preview image displayed in the viewfinder.

[0089] In some embodiments, the processor 110 such as the controller or GPU can be used to fit the image captured by the camera and the picture containing object A to generate a preview image displayed in the viewfinder, so that the composite effect can be presented to the user. The specific implementation of the fitting operation performed by the processor 110 can refer to the detailed description of the subsequent method embodiment.

[0090] For convenience of use, electronic devices usually take pictures in a user's hand-held mode, and the user's hand-held mode usually causes the picture obtained by shooting to shake. In some embodiments, the processor 110 such as the controller or GPU can also be used to perform anti-shake processing on the image captured by the camera in the composite scene, and then superimpose or fit the anti-shake processed image corresponding to the camera and the picture containing object A to provide a preview image to the display screen 194 for display.

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

[0092] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.

[0093] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert the signals into electromagnetic waves radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be arranged in the same device.

[0094] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the loudspeaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be an independent device. In some other embodiments, the modem processor can be independent of the processor 110, and arranged in the same device as the mobile communication module 150 or other functional modules.

[0095] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, demodulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.

[0096] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0097] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0098] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured by using an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniled, a microled, a micro-oled, a quantum dot light emitting diode (QLED), and the like. In some embodiments, the electronic device can include one or N display screens 194, where N is a positive integer greater than 1.

[0099] In some embodiments, in the photo combining scenario, the display screen 194 can display a preview interface provided by a camera application, and display a picture containing the object A with transparency or blurring in the preview interface, and simultaneously display an image captured by the camera 193 of the electronic device.

[0100] In some other embodiments, in the photo combining scenario, the display screen 194 can display a synthesized image obtained by fitting the image captured by the camera and the picture containing the object A by the processor 110, so that the photo combining effect can be presented to the user.

[0101] The electronic device 100 can implement the photographing function by using the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0102] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing, and converts the electric signal into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be arranged in the camera 193.

[0103] The camera 193 is configured to capture still images or videos. An object projects an optical image through a lens to a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, or the like format image signal. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than one.

[0104] The electronic device 100 can have multiple cameras 193, such as front-facing cameras and rear-facing cameras. The number of front-facing cameras and rear-facing cameras can each be multiple. The types of cameras 193 can include, but are not limited to, wide-angle cameras, ultra-wide-angle cameras, telephoto cameras, and the like.

[0105] The hardware configurations and physical locations of the cameras 193 can be different, and thus the sizes, ranges, contents, or resolutions of the images captured by different cameras can be different.

[0106] The output image sizes of the cameras 193 can be different or the same. The output image size of a camera refers to the length and width of the image captured by the camera. Both the length and the width of the image can be measured in terms of the number of pixels. The output image size of a camera can also be referred to as the image size, the image dimension, the pixel size, or the image resolution. Common output image ratios of cameras can include 4:3, 16:9, or 3:2, and the like. The output image ratio refers to the approximate ratio of the number of pixels in the length to the number of pixels in the width of the image captured by the camera.

[0107] The cameras 193 can correspond to the same focal length or different focal lengths. The larger the focal length corresponding to a camera, the smaller the field of view (FOV) of the camera. The FOV refers to the range of angles that can be imaged by the optical system.

[0108] The cameras 193 can be disposed on both sides of the electronic device. A camera that is located in the same plane as the display screen 194 of the electronic device can be referred to as a front-facing camera, and a camera that is located in the plane of the back cover of the electronic device can be referred to as a rear-facing camera. The front-facing camera can be used to capture images of the photographer facing the display screen 194, and the rear-facing camera can be used to capture images of the photographic subject (such as a person, a landscape, or the like) facing the photographer.

[0109] In some embodiments, the camera 193 can be used to collect depth data. For example, the camera 193 can have a time of flight (TOF) 3D sensing module or a structured light 3D sensing module for obtaining depth information. The camera used to collect depth data can be a front-facing camera or a rear-facing camera.

[0110] The digital signal processor is used to process digital signals, which can be used to process not only digital image signals but also other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0111] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0112] The NPU is a neural-network (NN) computing processor, which is used to quickly process input information by referring to the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also be self-learned constantly. Through the NPU, the electronic device 100 can implement intelligent cognition applications, such as image recognition, face recognition, speech recognition, text understanding, etc.

[0113] In some embodiments, in the photo combining scenario, the processor 110 (such as the controller or the GPU) can fit the image captured by the camera and the picture containing the object A, and store the fitting result in the memory. The specific implementation of the fitting operation performed by the processor 110 can refer to the detailed description of the subsequent method embodiment. In this way, the synthesized image obtained by fitting contains both the object A and the object B captured by the camera, and the photo combining of multiple objects is achieved.

[0114] In some embodiments, the processor 110 (such as the controller or the GPU) can fit the moment when the electronic device 100 receives the photographing instruction and the N frames of images captured by the camera 193 before that moment, respectively, with the picture containing the object A, to obtain N frames of synthesized images, and then select the best one from the N frames of synthesized images in terms of quality, and store the selected one as the photo combining result in the memory.

[0115] In some embodiments, in the case of a retouching scenario, the processor 110 (e.g., a controller or a GPU) can fit each of the multiple images captured by the camera to the picture containing the object A, and store the fitting results in the memory. For example, the video encoder in the processor 110 can encode the multiple images composed by fitting the multiple images captured by the camera to the picture containing the object A, to generate a video file. In this way, each frame of the video file can contain the object A and the object in the newly captured image.

[0116] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The internal memory 121 is used to store the fitting results of the processor 110.

[0117] The random access memory can include a static random-access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation DDR SDRAM commonly referred to as DDR5 SDRAM), and the like; the non-volatile memory can include a magnetic disk storage device, a flash memory.

[0118] The flash memory can include a NOR FLASH, a NAND FLASH, a 3D NAND FLASH, and the like according to the operation principle, can include a single-level cell (SLC), a multi-level cell (MLC), a triple-level cell (TLC), a quad-level cell (QLC), and the like according to the storage unit potential order, and can include a universal flash storage (UFS), an embedded multi media Card (eMMC), and the like according to the storage specification.

[0119] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (e.g., machine instructions) of an operating system or other programs running, and can also be used to store data of users and application programs, and the like.

[0120] The non-volatile memory can also store executable programs and store data of users and application programs, and the like, and can be loaded in advance into the random access memory for direct reading and writing by the processor 110.

[0121] The external memory interface 120 can be used to connect an external non-volatile memory to realize the expansion of the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, files such as music and video are saved in the external non-volatile memory.

[0122] The electronic device 100 can realize audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0123] The touch sensor 180K is also called a "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect a touch operation acting on or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the touch event type. The display screen 194 can provide visual output related to the touch operation. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0124] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes a mobile operating system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0125] FIG. 1B The software structure diagram of the electronic device 100 of the embodiment of the present application.

[0126] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom, the application program layer, the program framework layer / core service layer, the bottom library and runtime, and the kernel layer.

[0127] The application program layer can include a series of application program packages.

[0128] As FIG. 1B shown, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0129] The program framework layer provides application programming interface (API) and programming framework for the applications of the application layer. The program framework layer includes some pre-defined functions.

[0130] As FIG. 1B shown, the program framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

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

[0132] The content provider is used to store and acquire data, and make the data accessible by the applications. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.

[0133] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, 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 short message notification icon can include a view for displaying text and a view for displaying pictures.

[0134] The phone manager is used to provide the communication function of the electronic device. For example, the management of call status (including call connection, call hang-up, etc.).

[0135] The resource manager provides various resources for the applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0136] The notification manager makes the applications display notification information in the status bar, which can be used to convey messages of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of download, message reminder, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, or a notification in the form of a dialog window appearing on the screen. For example, the text information is prompted in the status bar, a prompt sound is emitted, the electronic device vibrates, the indicator light flashes, etc.

[0137] The runtime can refer to all code libraries, frameworks, etc. required by the program runtime. For example, for C language, the runtime includes a series of function libraries required by C program running. For Java language, in addition to the core library, the runtime also includes a virtual machine required by Java program running, etc. The above core library can include a function function required to be called by Java language.

[0138] The underlying library can include a plurality of function modules. For example, a surface manager, media libraries, a three-dimensional graphics processing library (for example, OpenGL ES), a 2D graphics engine (for example, SGL), etc.

[0139] The surface manager is used for managing the display subsystem, and provides a plurality of application programs with fusion of 2D and 3D layers.

[0140] The media library supports a plurality of commonly used audio, video format playback and recording, and static image files, etc. The media library can support a plurality of audio and video coding formats, for example, MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0141] The three-dimensional graphics processing library is used for realizing three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.

[0142] The 2D graphics engine is a drawing engine for 2D drawing.

[0143] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0144] The working flow of the software and hardware of the electronic device will be described below in combination with a capturing and photographing scene.

[0145] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, a timestamp of the touch operation, etc. information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer, and identifies a control corresponding to the input event. Taking the touch operation as a touch single click operation, and the control corresponding to the single click operation as a control of a camera application icon as an example, the camera application calls an interface of the application framework layer, starts the camera application, and then starts the camera driver through the kernel layer, and captures a static image or a video through the camera 193.

[0146] FIG. 1C is another software structure block diagram of the electronic device 100 provided by the embodiment of the application.

[0147] As FIG. 1CAs shown, the electronic device 100 comprises a gallery module, a photographing module, a display module, an identification module, and a synthesis module. Among them:

[0148] The gallery module is configured to store a plurality of pictures, including a picture containing object A. The gallery module can also provide an entry to start the "photo-fit" function, and can be configured to store the fitting result of the electronic device 100.

[0149] The photographing module is configured to take pictures.

[0150] The display module is configured to display the picture with transparency or blurring, and simultaneously display the image taken by the photographing module. Alternatively, the display module is configured to display the image taken by the photographing module and the synthesized image obtained by fitting the picture containing object A.

[0151] The identification module is configured to identify the region where object B is located in the image taken by the photographing module, and the background region other than object B. Alternatively, the identification module is configured to identify the region where object A is located in the picture containing object A, and the background region other than the region where object A is located.

[0152] The synthesis module is configured to fit the region where object B is located in the image taken by the photographing module into the picture containing object A. Alternatively, the synthesis module is configured to fit the region where object A is located in the picture containing object A into the image taken by the photographing module.

[0153] The user interface provided by the embodiments of the present application is described below.

[0154] FIG. 2A-FIG. 2H A set of user interfaces for photo-fit provided by the electronic device 100 in the embodiments of the present application is exemplarily shown.

[0155] FIG. 2A An exemplary user interface 21 for displaying installed applications on the electronic device 100 is exemplarily shown.

[0156] The user interface 21 displays a status bar 201, a calendar and time indicator 202, a weather indicator 203, a page indicator 204, a tray 205 with icons of commonly used applications, and icons of other applications. Among them:

[0157] The status bar 201 can include one or more signal strength indicators of mobile communication signals (also referred to as cellular signals), a Bluetooth indicator, one or more signal strength indicators of Wi-Fi signals, a battery status indicator, a time indicator, and the like.

[0158] A calendar and time indicator 202 is used to indicate the calendar and the current time. A weather indicator 203 is used to indicate the weather.

[0159] A page indicator 204 can be used to indicate which page of application icons the user is currently browsing. In the embodiment of the present application, the application icons can be distributed in multiple pages, and the user can swipe left or right to browse the application icons in different pages.

[0160] A tray 205 with commonly used application icons can display a phone icon, a message icon, a camera icon 205a, a contacts icon, and the like.

[0161] Other application icons can include, for example, an icon of a video application, an icon of an online meeting application, an icon of a calendar, an icon of a game application, an icon of a map application, an icon of a settings application, an icon of a gallery application 206a, and the like.

[0162] The camera is an APP for calling a camera to take an image on the electronic device 100, and the name of the application is not limited in the embodiment. The camera APP of the embodiment of the present application also provides a “collaborative shooting” function. The camera APP can be a system application provided by the electronic device 100, or a third-party application.

[0163] The gallery is an APP for managing pictures on the electronic device 100 such as a smart phone or a tablet computer, and can also be referred to as an “album”. The name of the application is not limited in the embodiment. The APP can support various operations of the user on the pictures stored on the electronic device 100, such as browsing, editing, deleting, selecting, and the like. That is, the object managed by the “gallery” is a picture. In some other cases, the APP can also support the above-mentioned various operations of the user on the pictures stored on a cloud server. It can be understood that in the embodiment, the pictures can be captured by the camera 193 of the electronic device 100, or obtained from other application programs or downloaded from a webpage. The gallery of the embodiment of the present application also provides an entry of the “collaborative shooting” function. The gallery can be a system application provided by the electronic device 100, or a third-party application.

[0164] Without limitation, more applications can also be installed in the electronic device 100, and the icons of the applications can be displayed on the display screen. For example, a shopping application, a ticket booking application, and the like can also be installed in the electronic device 100. The shopping application can be used to purchase items online. The ticket booking application can be used to book various tickets, such as an airplane ticket, a train ticket, a ship ticket, and the like.

[0165] The names of the above-mentioned applications are merely terms used in the embodiments of this application. Their meanings have been recorded in this embodiment, and their names do not constitute any limitation to this embodiment.

[0166] Not limited to this, FIG. 2A The user interface 21 shown may also include a navigation bar, a sidebar, etc. In some embodiments, FIG. 2A The exemplary user interface 21 may be referred to as a home screen.

[0167] FIG. 2B The user interface 22 provided by the gallery APP of the electronic device 100 is exemplarily shown.

[0168] FIG. 2B It can be that the electronic device 100 detects the action on FIG. 2A After a user operates (such as a click operation or a touch operation) on the icon 206a of the gallery application, a user interface is displayed in response to the user operation.

[0169] like FIG. 2B As shown, the user interface 22 may include: a status bar, an application title bar, and a picture area 207. Among them:

[0170] The status bar can be referenced FIG. 2A The status bar 201 in the user interface 21 is shown and will not be described in detail here.

[0171] The application title bar may include a back button and a current page indicator. The back button is an app-level back button and can be used to return to the previous level in the menu. Those skilled in the art will understand that the logical previous level of a page is fixed and determined during application design. The current page indicator can be used to indicate the current page, such as the text message "Gallery". The current page indicator is not limited to text information and can also be an icon.

[0172] One or more pictures, such as picture 207a, may be displayed in the picture area 207. When the electronic device detects an upward or downward sliding operation in the picture area 207, in response to the sliding operation, the electronic device may update the picture displayed in the picture area 207 so that the user can browse the pictures. In other words, the user can slide up or down in the picture area 207 to browse more pictures. Not limited to the upward or downward sliding operation, the user can also slide left or right in the picture area 207 to browse more pictures. The pictures displayed in the picture area 207 may be thumbnails. At this time, the original picture corresponding to the picture displayed in the picture area 207 may be stored on the electronic device or on a cloud server. Unless otherwise specified, the pictures referred to in the following embodiments may be stored in the electronic device or on a cloud server.

[0173] As shown in FIG. 2B , the electronic device 100 can detect a user operation (such as a click operation, a touch operation, etc.) of the user acting on the picture 207a in the user interface 22. In response to the operation, the electronic device 100 can display the user interface 23 as shown in FIG. 2C .

[0174] As shown in FIG. 2C , the electronic device 100 can display the original picture corresponding to the picture 207a in a larger area in the user interface 23, and the user interface 23 displays the picture 208, which can be the original picture of the picture 207a. In some embodiments, the picture 208 can be obtained by the electronic device 100 at a certain location (for example, location 1), or can be obtained by the electronic device 100 from the network. The picture 208 contains a person object and a background area, the person object can be referred to as object A, and the picture 208 can be referred to as a picture containing the object A. The background area shows the location where the object A is located, for example FIG. 2C , the background area of the picture 208 displays a coconut tree, a seagull, a hillside, and the sun. The user interface 23 can also display a share control, a collection control, an edit control, a delete control, a more control 209, etc. Among them, the share control, the collection control, the edit control, and the delete control are used to receive user operations, and the electronic device 100 can respond to the user operations to perform sharing, collection, editing, and deleting operations on the picture 208. The more control 209 can be used to receive user operations (such as click operations, touch operations, etc.), and the electronic device 100 can respond to the user operations to display a function list 210 as shown in FIG. 2D .

[0175] As shown in FIG. 2D , the function list 210 displays a plurality of function controls, such as controls for copying the picture 208 to the album, moving to the album, screen projection, printing, etc. Among the plurality of function controls displayed by the function list 210, there is a control 210a for starting the "collaborative shooting" function for the picture 208. The control 210a is used to receive user operations (such as click operations, touch operations, etc.), and the electronic device 100 can respond to the user operations to start the "collaborative shooting" function for the picture 208.

[0176] Through the above FIG. 2B-FIG. 2D example, the user can click on the picture to view the picture, and then start the "collaborative shooting" function for the picture through the entry provided by the user interface displaying the picture.

[0177] Not limited to clicking the control 210a in the user interface displaying a picture, the electronic device 100 can also start the "collaborative shooting" function for the picture in response to other user operations. For example, the electronic device 100 can also start the "collaborative shooting" function for the picture in response to a user operation of clicking the picture in the user interface displaying the picture.FIG. 2B The displayed picture 207a receives a long press operation to start the "collage" function for the picture, or the electronic device 100 can also receive a circle-drawing gesture on the displayed picture 207a to start the "collage" function for the picture. FIG. 2B The displayed picture 207a receives a long press operation to start the "collage" function for the picture, or the electronic device 100 can also receive a circle-drawing gesture on the displayed picture 207a to start the "collage" function for the picture. FIG. 2C The displayed picture 208 receives a long press operation to start the "collage" function for the picture, or the electronic device 100 can also be a voice control instruction. The present application does not limit the specific implementation of the operation that triggers the electronic device 100 to start the "collage" function for the picture.

[0178] Not limited to the pictures in the "gallery", the scenario in which the user triggers the "collage" function for the picture can also include the user triggering the "collage" function for the picture when viewing the picture in the network, the user triggering the "collage" function for the picture in the file explorer and other application programs, and the like.

[0179] FIG. 2E-FIG. 2H Exemplarily shows a set of user interfaces provided by the camera application after the electronic device 100 starts the "collage" function for the picture 208.

[0180] After the electronic device 100 starts the "collage" function for the picture 208, the camera application can be automatically started.

[0181] FIG. 2E The user interface 24 displayed after the electronic device 100 starts the camera application.

[0182] FIG. 2E The exemplarily shown user interface 24 can be displayed by the electronic device 100 detecting a user operation (such as a click operation, a touch operation, etc.) acting on the control 210a as shown. FIG. 2D The user interface 24 can be the user interface of the default shooting mode of the camera application, which can be used for the user to take a picture through the default rear camera.

[0183] As shown in FIG. 2E The user interface 24 can include: a region 211, a shooting mode list 212, a control 213, a control 214, and a control 215.

[0184] Among them:

[0185] The region 211 can be called a preview frame 211 or a viewfinder frame 211. The preview frame 211 can be used to display the picture 208 with a certain transparency or blurring.

[0186] After the camera 193 of the electronic device is started and an image is captured, the preview frame 211 can also display the image captured by the camera 193 in real time. The electronic device 100 can refresh the display content therein in real time, so as to facilitate the user to preview the image currently captured by the camera 193. The electronic device 100 can superimpose the picture 208 with a certain transparency or blurring on the image captured by the camera 193 in real time. Since the picture 208 has a certain transparency and / or blurring, the user can not only see the picture 208 in the preview frame 211, but also see the image captured by the camera 193 in real time under the picture 208.

[0187] In some embodiments, after the electronic device 100 starts the “collaborative shooting” function and starts the camera application, the electronic device 100 can first only display the picture 208 with a certain transparency or blurring in the preview frame 211, as shown in FIG. 2B, and then start the camera 193 and display the image captured in real time in the preview frame 211 as well, as shown in FIG. 2C. FIG. 2E FIG. 2F

[0188] In another embodiment, after the electronic device 100 starts the “collaborative shooting” function and starts the camera application, the electronic device 100 can directly start the camera 193 to capture an image. At this time, the electronic device 100 can directly display the picture 208 with a certain transparency or blurring and the image captured by the camera 193 in real time in the preview frame 211 at the same time. That is, after the electronic device 100 receives the user operation on the control 210a in FIG. 2E , the electronic device 100 can directly display the user interface shown in FIG. 2C without displaying the user interface shown in FIG. 2B. FIG. 2F FIG. 2E

[0189] One or more shooting mode options can be displayed in the shooting mode list 212. The one or more shooting options can include: a photographing mode option 212A, a video recording mode option 212B, a portrait mode option 212C, a panorama mode option 212D, and a more option 212E. The one or more shooting options can be displayed as text information on the interface, such as “photograph”, “video record”, “portrait”, “panorama”, and “more”. Without limitation, the one or more shooting options can also be displayed as icons or other forms of interactive elements (IE) on the interface.

[0190] ​​​​Control 213 can be used to receive user actions that trigger shooting (photographing or recording). The electronic device can detect user actions on control 213 (such as a click on control 213). In response to this action, the electronic device 100 can save the image captured by camera 193 and fit it to image 208, thereby generating an image in the gallery. When the user switches to video recording mode, control 213 can be changed to a corresponding video recording control. The electronic device can detect user actions on the video recording control. In response to this action, the electronic device 100 can save multiple frames of images captured by camera 193 and fit them to image 208, thereby generating a video in the gallery. In addition, the electronic device 100 can also display a thumbnail of the saved image in control 214. This image can be generated by the electronic device 100 with the "matching" function enabled or without the "matching" function enabled. In other words, the user can click control 213 or the video recording control to trigger shooting. Control 213 or the video recording control can be a button or other form of control. In this application, control 213 can be referred to as a photo control. The photo taking controls and video recording controls may be collectively referred to as shooting controls.

[0191] Control 215 can be used to receive a user operation that triggers the flipping of the camera. The electronic device 100 can detect a user operation acting on the control 215 (such as a click operation on the control 215), and in response to the operation, the electronic device 100 can flip the camera, for example, switching the rear camera to the front camera.

[0192] The electronic device 100 can detect a user operation on a shooting mode option, which can be used to select a shooting mode. In response to the operation, the electronic device 100 can start the shooting mode selected by the user. In particular, when the user operation acts on the more shooting mode option 212E, the electronic device 100 can further display more other shooting mode options, such as a slow motion shooting mode option, etc., to show the user more abundant camera functions. FIG. 2E As shown, the more shooting mode options 212E may not be displayed in the shooting mode list 212 , and the user may browse other shooting mode options by sliding left / right in the shooting mode list 212 .

[0193] like FIG. 2F As shown, the preview box 211 displays a lighter image and a darker image at the same time, wherein the lighter image is a picture 208 with a certain degree of transparency or blur, and the darker image is an image captured in real time by the camera 193.

[0194] In the preview frame 211, the position of the image 208 with a certain degree of transparency or blurred remains unchanged. At the same time, when the user uses the electronic device 100 to shoot, the user can change the framing of the currently used camera in the preview frame by moving the electronic device. That is, the user can change the framing of the camera 193 by moving the electronic device, thereby changing the image captured in real time by the camera 193 displayed in the preview frame 211. For example, the user can move the electronic device left or right or forward or backward, or walk around holding the electronic device. In some other embodiments, the user can also adjust the focal length of the currently used camera (such as electronic focus), or change the currently used camera (for example, replacing the rear camera with the front camera), etc., thereby changing the image captured by the camera displayed in real time in the preview frame 211. In some other embodiments, the user can also instruct the camera 193 to change its position, thereby adjusting the framing in the preview frame 211.

[0195] Preview frame 211 can show the user the relative positions of various objects in image 208 and the image captured in real time by camera 193. Based on the content displayed in preview frame 211, the user can adjust the image captured by the camera in real time, so that the image captured by the camera includes object B and that object B is positioned relative to object A in image 208 in a satisfactory manner. The object that needs to be photographed with object A is called object B.

[0196] like FIG. 2F As shown, the picture 208 includes an object A and a background area, and the background area shows the location of the object A, for example FIG. 2F The background area of ​​the picture 208 displayed in the middle preview frame 211 shows that the location of the object A includes coconut trees, seagulls, a hillside, and the sun.

[0197] In some embodiments, the control 213 can be activated only when the position indicated by the background area of the real-time image captured by the camera displayed in the preview frame 211 has a certain correlation with the position indicated by the picture 208 (for example, but not limited to, the position indicated by the background area of the picture 208), and in other cases, the electronic device 100 will not perform subsequent responses even if the control 213 receives a user operation. After the control 213 is activated, the user can click the control 213 when the object B is included in the image captured by the camera and the object B is in a satisfactory relative position with the object A in the picture 208, so as to trigger the electronic device 100 to save the image captured by the camera 193 and perform a fitting operation on the image and the picture 208. That is, only when the position indicated by the picture 208 has a certain correlation with the position indicated by the real-time image captured by the camera 193 of the electronic device 100, the user can trigger the electronic device 100 to take a picture and perform a subsequent fitting operation.

[0198] In other embodiments, the control 213 can be activated at all times, and as long as the user includes the object B in the image captured by the camera and the object B is in a relative position with the object A in the picture 208 that is satisfactory to the user, the user can click the control 213, so as to trigger the electronic device 100 to save the image captured by the camera 193 and perform a fitting operation on the image and the picture 208.

[0199] Reference FIG. 2F , the image captured by the camera 193 includes a person object, which can be the object B. Since the user is not satisfied with the relative position of the object B and the object A in the picture 208, the user adjusts the viewfinder of the camera 193 in the preview frame 211, so as to adjust the object B and the object A in the preview frame 211 to a relative position that is satisfactory to the user as shown in FIG. 2F . FIG. 2F FIG. 2G As shown in , the electronic device 100 can detect a user operation (for example, a click operation, a touch operation, etc.) acting on the control 213, and in response to the operation, the electronic device 100 can save the image captured by the camera 193 and perform a fitting operation on the image and the picture 208, so as to generate a picture in the gallery. The specific implementation of the fitting operation can be referred to the detailed description in subsequent method embodiments. In addition, referring to

[0200] , the electronic device 100 can also display a thumbnail of the picture generated after the fitting operation in the control 214, so as to be clicked and viewed by the user. FIG. 2G FIG. 2H

[0201] ​​In some embodiments, the electronic device 100 may fail to fit the image captured by the camera 193 and the picture 208, and thus fail to generate a corresponding composite image. For example, when the background region of the image captured by the camera 193 has low correlation with the picture 208, the electronic device 100 may fail to successfully perform the fitting operation.

[0202] After the electronic device 100 takes a picture and performs the fitting operation in response to the user operation on the control 213, the electronic device 100 can keep the “photo-fit” function enabled, so that the user can take multiple pictures to achieve the purpose of multiple photo-fit. In some other embodiments, after the electronic device 100 takes a picture and performs the fitting operation in response to the user operation on the control 213, the electronic device 100 can also disable the “photo-fit” function and enter the normal photographing mode.

[0203] Not limited to FIG. 2E-FIG. 2G In the photographing mode shown, the user can also select a video recording mode or other modes, and the electronic device 100 can also take pictures in the video recording mode or other modes to achieve the purpose of photo-fit in the video or other modes.

[0204] FIG. 3A-FIG. 3F An exemplary user interface 32 provided by the camera application of the electronic device 100 in the embodiments of the present application is shown.

[0205] FIG. 3A-FIG. 3E And FIG. 2A-FIG. 2G The difference between the two photo-fit modes is that the entry of the “photo-fit” function is different.

[0206] FIG. 3A The user interface 31 shown is the same as the user interface 21 shown in FIG. 2A Please refer to the foregoing FIG. 2A and related descriptions.

[0207] FIG. 3B An exemplary user interface 32 provided by the camera application of the electronic device 100 is shown.

[0208] FIG. 3B The user interface 32 can be a user interface displayed by the electronic device 100 in response to detecting a user operation (e.g., a click operation, a touch operation) on the icon 205a of the camera application in FIG. 3A The user interface 32 can be a user interface of a default photographing mode of the camera application, and can be used for the user to take pictures through the default rear camera.

[0209] As shown in FIG. 3B The user interface 32 can include a region 301, a photographing mode list 302, a control 303, a control 304 and a control 305, and a control 306 for starting the “photo-fit” function. Among them:

[0210] The area 301 can be referred to as a preview frame 301 or a viewfinder frame 301. The preview frame 301 can be used to display an image captured in real time by the camera 193 of the electronic device 100. The electronic device 100 can refresh the display content therein in real time so as to allow the user to preview the image currently captured by the camera 193.

[0211] One or more shooting mode options can be displayed in the shooting mode list 302. The one or more shooting options can include a photo mode option 302A, a video mode option 302B, a portrait mode option 302C, a panorama mode option 302D, and a more option 302E.

[0212] The control 303 can be used to receive a user operation for triggering shooting (photographing or video recording). The electronic device can detect a user operation (e.g., a tapping operation on the control 303) acting on the control 303, and in response to the operation, the electronic device 100 can save the image displayed in the preview frame 211. When the user switches to the video recording mode, the control 303 can be changed to a corresponding video recording control, and the electronic device can detect a user operation acting on the video recording control, and in response to the operation, the electronic device 100 can save the image displayed in the preview frame 211. In addition, the electronic device 100 can also display a thumbnail of the saved image in the control 304. That is, the user can click the control 303 or the video recording control to trigger shooting. The control 303 or the video recording control can be a button or other forms of controls. In this application, the control 303 can be referred to as a photo control. The photo control and the video recording control can be collectively referred to as a shooting control.

[0213] The control 305 can be used to receive a user operation for triggering flipping of the camera. The electronic device 100 can detect a user operation (e.g., a tapping operation on the control 305) acting on the control 305, and in response to the operation, the electronic device 100 can flip the camera, for example, switching the rear camera to the front camera.

[0214] The electronic device 100 can detect a user operation acting on the shooting mode option, which can be used to select a shooting mode, and in response to the operation, the electronic device 100 can start the shooting mode selected by the user.

[0215] The control 306 can be used to receive a user operation (e.g., a tapping operation, a touch operation, etc.), and the electronic device 100 can display, in response to the user operation, a menu in the user interface 33, such as FIG. 3CThe picture area 307 is shown. One or more pictures, such as the picture 307a, can be displayed in the picture area 307. When the electronic device detects an upward or downward sliding operation in the picture area 307, the electronic device can update the pictures displayed in the picture area 307 in response to the sliding operation, so that the user can browse the pictures. That is, the user can slide upward or downward in the picture area 307 to browse more pictures. Without being limited to the upward or downward sliding operation, the user can also slide left or right in the picture area 307 to browse more pictures. The pictures displayed in the picture area 307 can be thumbnails. At this time, the original pictures corresponding to the pictures displayed in the picture area 307 can be stored on the electronic device or on a cloud server.

[0216] The picture area 307 can also display a prompt information 307b. The prompt information 307b is used to prompt the user to select a picture from the pictures displayed in the picture area 307 as the photo to be combined.

[0217] The electronic device 100 can detect a user operation (such as a click operation, a touch operation, etc.) acting on the picture 307a, and in response to the operation, start the “combine” function for the original picture corresponding to the picture 307a, and display FIG. 3D the user interface 34.

[0218] As FIG. 3D shown, after starting the “combine” function, the electronic device 100 can change the display form of the control 306 (such as changing the display color thereof, changing the display shape thereof, or changing the hollow circle to a solid circle, etc.), to prompt the user that the electronic device 100 has currently started the “combine” function. FIG. 3D

[0219] In FIG. 3D the user interface 34 shown, after the electronic device 100 starts the “combine” function, the preview frame 301 displays the picture 208 with a certain transparency or blurring, and the image captured by the camera 193 in real time. The picture 208 can be the original picture corresponding to the picture 307a. The electronic device 100 can refresh the display content therein in real time, so as to preview the image currently captured by the camera 193 for the user. The electronic device 100 can superimpose and display the picture 208 with a certain transparency or blurring on the image captured by the camera 193 in real time. Since the picture 208 has a certain transparency and / or blurring, the user can not only see the picture 208 in the preview frame 211, but also see the image captured by the camera 193 in real time under the picture 208. FIG. 3C

[0220] FIG. 3D ​​The role of the preview frame 301 in the user interface 34, the role of the shooting mode list 302, the role of the controls 304-305 can refer to the role of the corresponding controls in FIG. 2F It can be considered that, FIG. 3D and FIG. 2G Except for the difference of the control 306, other areas or controls are the same.

[0221] Referring to FIG. 3D , in the image captured by the camera 193 in FIG. 3D , there is a person object, which can be object B. Since the user is not satisfied with the relative position of the object B and the object A in FIG. 3D , the user adjusts the viewfinder of the camera 193 in the preview frame 301, so as to adjust the object B and the object A in the preview frame 301 to a relative position that the user is satisfied with, as shown in FIG. 3E .

[0222] As shown in FIG. 3E , the electronic device 100 can detect a user operation (such as a click operation, a touch operation, etc.) acting on the control 303, and in response to the operation, the electronic device 100 can save the image captured by the camera 193 and perform a fitting operation on the original image corresponding to the picture 307a, so as to generate a picture in the gallery. The specific implementation of the fitting operation can refer to the detailed description in the subsequent method embodiment. In addition, referring to FIG. 3F , the electronic device 100 can also display a thumbnail of the picture generated after the fitting operation in the control 304, so as to be clicked and viewed by the user.

[0223] In some embodiments, when the electronic device 100 performs fitting on the image captured by the camera 193 and the original image corresponding to the picture 307a, it is possible that the fitting fails and a corresponding synthesized image cannot be generated. For example, when the background area of the image captured by the camera 193 has low correlation with the original image corresponding to the picture 307a, the electronic device 100 will not be able to successfully perform the fitting operation.

[0224] FIG. 4A-FIG. 4B An exemplary user interface provided by the gallery application after the electronic device 100 saves the fitted picture in the embodiment of the present application is shown.

[0225] FIG. 4A It can be a user interface displayed in response to a user operation (such as a click operation, a touch operation) acting on the icon 206a of the gallery application in FIG. 2A or FIG. 3A . The user interface shown in FIG. 4A is similar to the user interface 22 shown in FIG. 2B , and the related description can be referred to. As FIG. 4AAs shown, a new picture 207 b is added to the picture area 207 shown in the user interface 41 . The picture 207 b may be a thumbnail or original picture of the fitted picture saved by the electronic device 100 .

[0226] like FIG. 4A As shown, after the electronic device 100 detects a user operation (such as a click operation or a touch operation) on the image 207b, it can respond to the operation by FIG. 4B In the user interface shown, the original image corresponding to the image 207b is displayed in a larger area, such as the image 401. In some other embodiments, FIG. 4B The user interface 43 shown can also be a display of the electronic device 100 in response to the FIG. 2H The control 214 shown, or, in FIG. 3F Displayed in response to user operation on the control 304 shown.

[0227] In some embodiments, FIG. 4A 207b shown in, or, FIG. 4B The displayed picture 401 may also be displayed with a "co-shoot" logo to indicate that the picture was taken by the electronic device 100 with the "co-shoot" function enabled. The embodiment of the present application does not limit the implementation form of the "co-shoot" logo, which may be text, an icon, or the like.

[0228] Based on the electronic device 100 and the user interface implemented on the electronic device 100 introduced above, the shooting method provided in the embodiment of the present application is introduced below.

[0229] refer to FIG. 5 , FIG. 5 The flow of the photographing method is exemplarily shown. FIG. 5 The shooting method shown is described using a photo-taking scene as an example.

[0230] like FIG. 5 As shown, the shooting method may include the following steps:

[0231] S101, the electronic device 100 detects a first operation for enabling a "take a photo together" function for a first picture.

[0232] S102 , in response to the first operation, the electronic device 100 turns on the “take a photo together” function for the first picture, where the first picture includes object A.

[0233] Specifically, the first picture can be a picture taken by the camera 193 of the electronic device 100, can be a picture downloaded from a network by the electronic device 100, or can be a picture shared by another device received by the electronic device 100. The first picture can be a picture taken a long time ago or a picture taken by the electronic device 100 just now. The first picture contains an object that the user wants to take a picture with, which can be referred to as object A. The number of object A can be one or more. Object A can include, but is not limited to, a person, an animal, a landmark, a building, a doll, and the like. For example, the first picture can also be an old picture of a relative taken many years ago, and the like.

[0234] Exemplarily, the first picture can be, for example, FIG. 2C a picture 207a shown in FIG. 2A, a corresponding original picture of the picture 207a shown in FIG. 2B, FIG. 2C a picture 208 shown in FIG. 2C, FIG. 3C a picture 307a shown in FIG. 3A, a corresponding original picture of the picture 307a shown in FIG. 3B, or FIG. 3D a picture 301 shown in FIG. 3C. Object A can be a person object in the pictures described above.

[0235] The electronic device 100 provides a “picture-taking” function, which supports the electronic device 100 to display the first picture with transparency or blurring in a preview interface provided by a camera application, and simultaneously display an image collected by the camera 193 of the electronic device 100. The electronic device 100 receives a photographing instruction input by a user, fits the first picture and the image collected by the camera, and generates a composite image. After the “picture-taking” function is started, the electronic device will perform subsequent operations.

[0236] In some embodiments, referring to the foregoing FIG. 2A-FIG. 2D and related descriptions, the first operation for starting the “picture-taking” function for the first picture can be, for example, a user operation on a control 210a in a function list 210 displayed by the electronic device 100 after inputting a control 209 on a user interface 23 displaying the picture 208 shown in FIG. 2C. The control 209 can also be referred to as a first control, and the control 210a can also be referred to as a second control. FIG. 2C In some embodiments, the first operation for starting the “picture-taking” function for the first picture can be, for example, a long press operation received by the electronic device 100 on the picture 207a shown in FIG. 2A, or a circle-drawing gesture received by the electronic device 100 on the picture 207a shown in FIG. 2A, or a long press operation received by the electronic device 100 on the picture 208 shown in FIG. 2C.

[0237] FIG. 2B FIG. 2B FIG. 2C

[0238] ​​​​In the embodiments of the present application, the user interface provided by the gallery application for displaying the first picture can be referred to as a first user interface, for example FIG. 2C , FIG. 2D All of them can be referred to as the first user interface.

[0239] In some embodiments, referring to the foregoing FIG. 3A-FIG. 3C and related descriptions, the first operation for starting the "collage" function for the first picture may, for example, be that the electronic device 100 receives a user operation acting on the control 306 in the first user interface shown in FIG. 3B The control 306 can also be referred to as a third control, the user operation acting on the control 306 can also be referred to as a fourth operation, and the user operation acting on the picture 307a can also be referred to as a fifth operation.

[0240] Among them, FIG. 3B The user interface shown in the above-mentioned user interface can not only be provided by the camera application, but also be provided by the camera interface called by other applications (such as social applications, shopping applications, etc.) in the electronic device. In other words, other applications in the electronic device can call the camera interface, and then enable the "collage" function. The user interface for starting the "collage" function provided by the camera application or by the camera interface called by other applications, such as the user interface shown in FIG. 3B , FIG. 3C The user interface can be referred to as a second user interface.

[0241] Not limited to this, the first operation for starting the "collage" function for the first picture can also be implemented as a voice control instruction, a gesture instruction in the air, a pressing operation on a physical button, and the like. The specific implementation of the first operation is not limited in the present application.

[0242] S103, the electronic device 100 starts the camera application and displays the second user interface, the second user interface displays a preview frame, the preview frame displays the first picture with transparency and / or blurring, and the image captured by the camera 193.

[0243] After the electronic device 100 starts the "collage" function for the first picture, the camera application can be automatically started. The camera application can be a system application installed in the electronic device 100, or a third-party application.

[0244] Specifically, after the camera application is started, the electronic device 100 can display a second user interface provided by the camera application, the second user interface displaying a preview frame, the preview frame displaying the first picture with transparency and / or blurring, and an image captured by the camera 193 in real time. Here, the second user interface can also be referred to as a preview interface. In some embodiments, the electronic device 100 can superimpose the first picture with transparency and / or blurring on the image captured by the camera 193 in real time.

[0245] If the first picture has transparency, the user can see the first picture and see other content displayed by the electronic device 100 through the first picture with transparency. The size of the transparency of the first picture can be pre-set, adjusted by the user according to actual needs, adjusted according to the light of the current environment in which the electronic device 100 is located, or adjusted according to the brightness of the image captured by the current camera 193, and so on.

[0246] If the first picture is blurred, the electronic device 100 can first identify the outline or content of the first picture, draw the outline or content of the first picture with a dashed line, or blur the content of the first picture to obtain the first picture after blurring. In this case, the user can see the first picture and see other content displayed by the electronic device 100 through the blurred first picture.

[0247] The image captured by the camera 193 in real time displayed in the preview frame of the second user interface is refreshed in real time. When the user moves the electronic device 100 or changes the posture of the electronic device 100, changes the used camera, or the object such as a person or an animal currently photographed by the camera 193 changes the location, and so on, the image captured by the camera 193 will change in real time, and the changed image will be displayed in the preview frame in real time.

[0248] In addition, the image captured by the camera 193 in real time displayed in the preview frame can also be obtained after processing the original image captured by the camera 193. For example, the electronic device 100 can perform anti-shake processing on the original image captured by the camera 193 and send the processed image to the display screen to be displayed in the preview frame. For another example, if the user adjusts the focal length of the camera 193, the electronic device 100 will crop the original image captured by the camera 193 and send the cropped result to the display screen to be displayed in the preview frame. For another example, the user can select the current shooting mode, and the electronic device 100 can process the original image captured by the camera 193 in different modes, such as blurring the background area in the portrait mode, and then send the cropped result to the display screen to be displayed in the preview frame.

[0249] For example, referring to FIG. 2F-FIG. 2G , the second user interface can be, for example, the user interface 22 shown in FIG. 2F-FIG. 2G , and the preview frame can be, for example, the preview frame 211 in FIG. 2F-FIG. 2G . FIG. 2F-FIG. 2G The lighter color image 208 shown in may be the first image with transparency displayed in the preview frame, and the darker color image can be the image captured by the camera 193 in real time.

[0250] For example, referring to FIG. 3D-FIG. 3E , the second user interface can be, for example, the user interface 34 shown in FIG. 3D-FIG. 3E , and the preview frame can be, for example, the preview frame 301 in FIG. 3D-FIG. 3E . FIG. 3D-FIG. 3E The lighter color image 208 shown in may be the first image with transparency displayed in the preview frame, and the darker color image can be the image captured by the camera 193 in real time.

[0251] FIG. 2F-FIG. 2G It can be seen that the preview frame in the second user interface can show the user the relative positions of each object in the first image and the image captured by the camera 193 in real time. The user can adjust the image captured by the camera 193 displayed in the preview frame according to the content presented by the preview frame, so that the relative positions of the objects contained in the image captured by the camera 193 and the object A in the first image meet the actual needs of the user. The user can adjust the image captured by the camera 193 displayed in the preview frame in various ways, including but not limited to: the user moving the electronic device 100 or changing the posture of the electronic device 100, the user changing the camera used by the electronic device 100, or the user instructing the object, such as a person or an animal, photographed by the current camera 193 to change its position, etc. For example, referring to FIG. 3D-FIG. 3E , the user can adjust the relative positions of the person object contained in the image captured by the camera 193 and the object A (i.e., the person object in the figure) in the first image.

[0252] In the embodiments of the present application, in addition to displaying the first picture with transparency or blurring in the second user interface provided by the camera application to indicate the first picture, the electronic device 100 can also display the lines of the objects contained in the first picture, the locations of the objects in the first picture, the first picture with fading, and the like, to show the first picture in the preview frame, so as to let the user know the relative positions of the objects in the first picture and the objects in the image captured by the camera 193 in real time. The information used to prompt the user about the relative positions of the objects in the first picture and the objects in the image captured by the camera 193 in real time can be referred to as the indication information of the first picture. For example, the indication information of the first picture can include the first picture with transparency or blurring displayed in the preview frame, the lines of the objects contained in the first picture, the locations of the objects in the first picture, the first picture with fading, and the like, and the embodiments of the present application do not limit this.

[0253] S104, the electronic device 100 receives the second operation.

[0254] S105, in response to the second operation, the electronic device 100 fits the first picture and the image captured by the camera 193 to generate a composite image.

[0255] The second operation can be a user operation for triggering the electronic device 100 to take a picture or record a video. The user operation for triggering the electronic device 100 to take a picture can also be referred to as a picture-taking instruction. The user operation for triggering the electronic device 100 to record a video can also be referred to as a video-recording instruction.

[0256] Exemplarily, referring to FIG. 2F-FIG. 2G , the second operation can be, for example, a user operation acting on the picture-taking control 213, or a user operation acting on the video-recording control after the user selects the video-recording mode. Referring to FIG. 3D-FIG. 3E , the second operation can also be a user operation acting on the picture-taking control 303, or a user operation acting on the video-recording control after the user selects the video-recording mode.

[0257] In some embodiments, the electronic device 100 will respond to the second operation only when the relevance between the position indicated by the image captured by the camera 193 displayed in the preview frame of the second user interface and the position indicated by the first picture is greater than a first value. The relevance between pictures refers to the degree of similarity and matching of the pictures in the relative positions. If the relevance between two pictures is large, it indicates that the contents contained in the two pictures are similar, and the two pictures can be taken at the same location with similar angles of view. The first value can be set in advance, which is not limited here. For example, referring to the foregoing FIG. 2E-FIG. 2GAccording to the related description, the control 213 can be activated only when the position indicated by the background area of the real-time image captured by the camera displayed in the preview frame 211 and the position indicated by the picture 208 (for example, but not limited to, the position indicated by the background area of the picture 208) have a certain correlation, and in other cases, the electronic device 100 will not perform subsequent responses even if the control 213 receives a user operation.

[0258] In some other embodiments, after the electronic device 100 displays the second user interface, if a second operation is received, the electronic device 100 will immediately respond to the second operation. For example, referring to the foregoing FIG. 2E-FIG. 2G According to the related description, the control 213 can be activated only when the position indicated by the background area of the real-time image captured by the camera displayed in the preview frame 211 and the position indicated by the picture 208 (for example, but not limited to, the position indicated by the background area of the picture 208) have a certain correlation, and in other cases, the electronic device 100 will not perform subsequent responses even if the control 213 receives a user operation.

[0259] In the following, several image processing processes shown in FIG. 6A-FIG. 6B will be described to introduce how the electronic device 100 fits the first picture and the image captured by the camera 193 to generate a composite image. The process can specifically include the following steps:

[0260] Step 1. Identify the object in the image captured by the camera, which can be referred to as object B.

[0261] Specifically, the electronic device 100 can identify a relatively iconic object such as a person, an animal, a landmark, a building, a doll, etc. in the image captured by the camera as the object B. In some other embodiments, the electronic device 100 can also identify the object closest to the camera as the object B according to the distance between each object in the image captured by the camera and the camera. In some other embodiments, the user can also select an object in the image captured by the camera displayed in the preview frame as the object B, for example, the user can click the position where the desired object is located in the preview frame, and then the electronic device 100 can automatically enclose the human body or the scene at the position without the user manually drawing the contour of the human body or the object to select the object B.

[0262] In some embodiments, the electronic device 100 can identify the object B contained in the image captured by the camera through an image recognition algorithm. The image recognition algorithm can be, for example, an artificial intelligence (AI) algorithm.

[0263] In the embodiments of the present application, the number of the object B identified by the electronic device 100 can be one or multiple, which is not limited here.

[0264] Exemplarily, referring to the foregoingFIG. 6A-FIG. 6B , FIG. 6A-FIG. 6B Each (a) in FIG. 1 shows a frame of image captured by the camera of the electronic device 100. The object B in the image recognized by the electronic device 100 is a male character object as shown in the figure. FIG. 6B The focal length used in (a) is greater than that used to collect FIG. 6A The focal length used in (a).

[0265] Step 2: In the image captured by the camera, determine the main area containing object B based on object B.

[0266] In some embodiments, the main area may be an area including the object B obtained by extending a distance M around the object B in an image captured by the camera.

[0267] M can be an empirical value obtained through testing. In some embodiments, the value of M can be the same for the same electronic device, different for different electronic devices, or different for different cameras on the same electronic device. This ensures that a main area containing object B is captured in images captured by different electronic devices or cameras.

[0268] Setting the M value through empirical values ​​can ensure that the electronic device finds an accurate main area, which can not only ensure the integrity of the object B in the main area, but also avoid excessive expansion of the range, thereby ensuring the effect of subsequent fitting.

[0269] In some embodiments, M can be a single value or a set of values. When M is a set of values, each value in the set can be different. That is, the electronic device 100 can expand different distances around different locations based on the object B to obtain a main area containing the object B.

[0270] For example, refer to FIG. 6A-FIG. 6B (b) in the figure, the area enclosed by the dotted line is a possible main area containing object B. FIG. 6A-FIG. 6B The size and position of the content contained in the images collected by the cameras can be different.

[0271] In other embodiments, the main area may be an area with similar or identical colors or pixels to object B, which is obtained by expanding around object B in the image captured by the camera.

[0272] Step 3: Perform a correlation search for the main area in the first image to find a co-located area with a correlation greater than a second value.

[0273] Specifically, performing the correlation search for the main region in the first picture means that a background region in the image captured by the camera except the main region is found first, and then a region in the first picture having a correlation greater than a second value and / or a region having the highest correlation with the background region is identified, and the remaining part of the first picture except the region is the homologous region. In other words, the remaining part of the first picture except the homologous region has a correlation greater than the second value with the remaining part of the image captured by the camera except the main region. The second value can be set in advance, and embodiments of the present application do not limit this.

[0274] The present application does not limit the size, shape, and position of the homologous region in the first picture. The position of the homologous region in the first picture is the same as the position of the main region containing the object B in the image captured by the camera, so that the relative positions of the object A and the object B presented to the user in the preview frame by the electronic device 100 are the same as the relative positions of the object A and the object B in the synthesized image after fitting, so that the user can adjust the photo effect in real time according to the content in the preview frame. In some embodiments, the size and shape of the homologous region in the first picture can be the same as or different from the size and shape of the main region containing the object B in the image captured by the camera.

[0275] For example, referring to (b) and (c) of FIG. 6A , the size, shape, and position of the homologous region in the first picture are the same as those of the main region in the image captured by the camera.

[0276] For example, referring to (b) and (c) of FIG. 6B , the shape and position of the homologous region in the first picture are the same as those of the main region in the image captured by the camera, and the size of the homologous region in the first picture is greater than that of the main region in the image captured by the camera.

[0277] Through step 3, if the electronic device 100 can find the homologous region corresponding to the main region in the first picture, it means that the geographical position where the first picture is taken is the same as or similar to the geographical position where the image is currently captured by the electronic device 100, which realizes the photo in the same place or similar place. Moreover, since it is in the same place or similar place, the light and background in the first picture are similar to those of the image captured by the camera, which can greatly improve the fitting effect in step 4, thereby achieving a better photo effect. This makes the shooting method provided by the embodiments of the present application different from the simple cutout photo, which can bring a more natural photo effect.

[0278] In some embodiments, after the electronic device 100 displays the second user interface, if the second operation is received and responded to immediately, the step 3 can fail due to the uncertainty of the image captured by the current camera, i.e., the electronic device 100 cannot find the corresponding homochromatic area in the first picture. In this case, the electronic device 100 can output a prompt information to prompt the user that the current synthesis fails.

[0279] Step 4. Fit the main area into the homochromatic area of the first picture, keep the rest of the first picture unchanged, and generate a synthesized image.

[0280] Specifically, the electronic device can magnify or reduce the main area containing object B captured by the camera, then fuse the main area into the homochromatic area of the first picture, and perform a transitional smoothing processing on the boundary. In other words, the electronic device replaces the homochromatic area in the first picture with the magnified or reduced main area or the original main area, and also performs a transitional smoothing processing on the boundary between the main area and the first picture, so that the final synthesized image looks natural.

[0281] For example, referring to FIG. 6A If the size of the homochromatic area and the main area is the same, the electronic device 100 replaces the homochromatic area in (c) with the main area, and performs a transitional smoothing processing on the boundary, to generate a synthesized image as shown in (d).

[0282] For example, referring to FIG. 6B The electronic device 100 magnifies the main area, replaces the homochromatic area in (c) with the magnified main area, and performs a transitional smoothing processing on the boundary, to generate a synthesized image as shown in (d).

[0283] Through the above steps 1-4, object B can be smoothly and naturally fused into the first picture containing object A, to generate a synthesized object containing both object A and object B, thereby obtaining a natural and high-quality photo effect.

[0284] When the electronic device 100 performs S104-S105 in the shooting mode, it can fit the image captured at the moment when the shooting instruction is received with the first picture, to generate a synthesized image. In other embodiments, the electronic device 100 can save N frames of images captured by the camera 193 before the moment when the shooting instruction is received, and fit each of the N frames of images with the first picture, to generate N frames of synthesized images.

[0285] When the electronic device 100 performs S104-S105 in the video recording mode, the electronic device 100 can respectively fit the plurality of images captured by the camera 193 to the first image to generate a plurality of composite images, starting from a time when the video recording instruction is received to a time when the video recording instruction is received.

[0286] The above process shows the relative positions of the object A and the object B to the user in the preview interface by the superimposed display, and performs the fitting operation of the first image and the image captured by the camera only after receiving the first operation. This way can save the power consumption and processing capacity of the electronic device.

[0287] In S106, the electronic device 100 saves the composite image.

[0288] If the electronic device 100 performs S104-S105 in the photographing mode and fits only the image captured at the time when the photographing instruction is received to the first image to generate a composite image, the electronic device 100 can save the generated one frame of the composite image in the picture format to the storage. If the electronic device fits the N frames of images captured by the camera 193 before the time when the photographing instruction is received to the first image to generate N frames of composite images, the electronic device 100 can select the best one frame of the N frames of composite images in the picture format to save to the storage. Here, the electronic device 100 can select the best one frame of the N frames of composite images by artificial intelligence learning. The quality of the composite image can be evaluated by, but not limited to, any one or more of the following parameters: peak-signal to noise ratio (PSNR) and mean square error (MSE), mean absolute error (MAE), and signal to noise ratio (SNR).

[0289] In some other embodiments, if the electronic device 100 performs S104-S105 in the photographing mode, the electronic device fits the N frames of images captured by the camera 193 before the time when the photographing instruction is received to the first image to generate N frames of composite images, the user can select a satisfactory composite image from the N frames of composite images to save to the storage, and delete the remaining composite images.

[0290] In the above embodiments, the composite image (i.e., the composite picture) maintained by the electronic device 100 when performing S104-S106 in the photographing mode can also be referred to as a second picture.

[0291] If the electronic device 100 executes S104-S105 in the video recording mode, the multiple frames of images captured by the video recording device camera 193 can be stored in the memory in the video format after being fitted with the multiple frames of synthesized images generated from the first image respectively, i.e., the multiple frames of synthesized images are saved as video files.

[0292] After the electronic device 100 saves the synthesized image, the synthesized image can be viewed, and the synthesized image can also be edited, moved, shared, etc. The operation for viewing the synthesized image can also be referred to as a third operation.

[0293] Exemplarily, referring to FIG. 4A-FIG. 4B , the electronic device 100 generates a synthesized image in the photographing mode, FIG. 4B , the gallery application provides a picture area 207 in which a thumbnail 207b of the synthesized image is displayed. After the electronic device 100 receives a user operation acting on the thumbnail 207b, the original picture of the thumbnail 207b, i.e., the synthesized image generated by the electronic device 100, can be displayed as shown in FIG. 4B .

[0294] In some embodiments, after the synthesized image is generated, the electronic device 100 can also execute the photographing method described in S101-S106 one or more times again by taking the synthesized object as the first picture, so that the purpose of multiple photos can be achieved. For example, a same user can first use his own photo as the first picture, and then take multiple photos with himself and the first picture, so that multiple photos of the same person at the same place can be achieved.

[0295] In some embodiments, if the first picture is an old photo of a relative taken many years ago, the user can take multiple photos with the relative at the same place but at different times by using the photographing method described in S101-S106.

[0296] In steps 1-4 included in S105, the electronic device 100 specifically fits the region in which the object B is located in the image captured by the camera 193 to the first picture, so as to obtain the synthesized image. Without limitation, in some other embodiments of the present application, the electronic device 100 can also fit the region in which the object A is located in the first picture to the image captured by the camera 193, so as to obtain the synthesized image. Specifically, the embodiment can include the following steps:

[0297] Step 1. Identify the object in the first picture, which can be referred to as object A;

[0298] Step 2. Determine the main region containing the object A in the first picture based on the object A;

[0299] Step 3. Perform a correlation search for the main region in the image captured by the camera, and find a homologous region with a correlation greater than a second value;

[0300] Step 4. Fit the main region into the homologous region of the image captured by the camera, and keep the remaining region of the image captured by the camera unchanged to generate a synthesized image.

[0301] The specific implementation of each of the above steps can refer to the implementation of each of the steps in S105 described above, and will not be described here.

[0302] Through the above implementation, the region where the object A in the first image is fitted into the image captured by the camera 193 to obtain a synthesized image. If the first picture is an old photo, the object in the old photo can be extracted and integrated into a newly taken image to realize the renovation of the old photo.

[0303] In the above embodiments of the present application, the object A in the first picture can also be referred to as the first object, and the object B in the image taken by the camera can also be referred to as the second object.

[0304] In the above FIG. 5 In the photographing method shown in the above embodiments of the present application, the electronic device 100 displays the first picture and the image captured by the camera in the preview interface, and then generates a synthesized image after receiving the first operation. Not limited to this, in some other embodiments of the present application, the electronic device 100 can directly perform the operation of fitting and generating a synthesized image after starting the camera application, and directly display the synthesized image in the preview interface. Specifically, after the electronic device 100 performs S101-S103 of the above method, the camera application is started, and the image is captured in real time by the camera 193. The electronic device 100 fits each frame of image captured by the camera 193 with the first picture respectively to obtain a plurality of frames of synthesized images, and displays the plurality of frames of synthesized images in the preview frame of the preview interface (i.e. the second user interface described above) in chronological order. Then if a photographing instruction is received, the synthesized image displayed in the preview frame is saved as a picture, and if a video recording instruction is received, the plurality of frames of synthesized images displayed in the preview frame during video recording are saved as a video. This real-time synthesis and real-time display of the synthesized image requires the electronic device 100 to have strong processing capability. This way can show the photo effect to the user in real time in the preview frame, and can make the user more intuitively feel the photo effect.

[0305] It should be understood that each step in the above method embodiment can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor.

[0306] The application further provides an electronic device, which can include a memory and a processor. The memory can be used to store a computer program, and the processor can be used to call the computer program in the memory to enable the electronic device to perform the method of the electronic device 100 in any one of the above embodiments.

[0307] The application further provides a chip system, which includes at least one processor for implementing the functions related to the electronic device 100 in any one of the above embodiments.

[0308] In a possible design, the chip system further includes a memory for storing program instructions and data, and the memory is located in or outside the processor.

[0309] The chip system can be composed of a chip, or can include a chip and other discrete devices.

[0310] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, or the like. When implemented by software, the processor can be a general-purpose processor, which is enabled by reading software codes stored in the memory.

[0311] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor, or can be arranged separately from the processor, and the embodiments of the application do not make any limitation in this aspect. For example, the memory can be a non-transient processor, such as a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be arranged on different chips respectively, and the embodiments of the application do not make any limitation on the type of the memory, or the arrangement of the memory and the processor.

[0312] Exemplarily, the chip system can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processor unit (CPU), can also be a network processor (NP), can also be a digital signal processor (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chip.

[0313] The present application also provides a computer program product, which comprises a computer program (also referred to as code or instruction), which, when executed, causes a computer to perform the method executed by the electronic device 100 in any one of the above embodiments.

[0314] The present application also provides a computer readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, it causes a computer to perform the method executed by the electronic device 100 in any one of the above embodiments.

[0315] The embodiments of the present application can be combined in any manner to achieve different technical effects.

[0316] In the above embodiments, all or part of the processes can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the processes can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes described in the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.

[0317] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above embodiments. The storage medium includes ROM or random access memory (RAM), magnetic disk or optical disk, and other media that can store program codes.

[0318] In summary, the above only describes the embodiments of the technical scheme of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present application shall be included in the protection scope of the present application.

Claims

1. A shooting method, characterized in that: The method comprises: Displaying a user interface of a camera application, wherein the user interface of the camera application displays a preview box, wherein the preview box displays an image captured by the camera of the electronic device and indication information of a first picture, wherein the first picture includes a first object; The electronic device receives an operation for taking a photo; The electronic device stores a second picture, where the second picture is obtained by fitting the image captured by the camera and the first picture, the image captured by the camera contains a second object, and the second picture contains the first object and the second object.

2. The method according to claim 1, characterized in that The indication information of the first picture includes: a first picture with transparency and / or a blurred first picture.

3. The method according to claim 1, characterized in that After the electronic device receives the operation for taking a photo and before storing the second picture, the method further includes: The electronic device recognizes the second object in the image captured by the camera; Determining a main area containing the second object in the image captured by the camera, the main area being an area determined based on the second object; Determine a co-located area in the first image, wherein a correlation between a portion of the first image outside the co-located area and a portion of the image captured by the camera outside the main area is greater than a second value; The main region is fitted to the co-located region in the first image to obtain the second image.

4. The method according to claim 1, wherein After the electronic device receives the operation for taking a photo and before storing the second picture, the method further includes: Recognizing, by the electronic device, the first object in the first picture; determining, in the first picture, a main area containing the first object, the main area being an area determined based on the first object; Determine a co-located area in the image captured by the camera, wherein a correlation between a portion outside the co-located area in the image captured by the camera and a portion outside the main area in the first picture is greater than a second value; The main area is fitted to the co-located area in the image captured by the camera to obtain the second image.

5. The method according to claim 3 or 4, characterized in that The position of the co-located area in the first picture is the same as the position of the main area in the image captured by the camera.

6. The method according to claim 1, characterized in that The second image is a frame of image with the highest quality among the composite images obtained by fitting the first image with the multiple frames of images captured by the camera; The multiple frames of images captured by the camera include: images captured by the camera at the moment when the electronic device receives the operation for taking a photo and at previous moments, and the number of the multiple frames of images is pre-set by the electronic device.

7. The method according to any one of claims 1 to 6, characterized in that A first control is displayed in the user interface of the camera application. Before the electronic device receives an operation for the first image, the method further includes: The electronic device receives an operation acting on the first control; The electronic device displays a second control in the user interface of the camera application; the operation on the first picture includes a user operation acting on the second control.

8. The method according to any one of claims 1 to 7, characterized in that After the electronic device stores the second picture, the method further includes: The electronic device receives an operation for viewing the second picture; The electronic device displays the second picture.

9. A shooting method, characterized in that: The method comprises: Displaying a user interface of a camera application, wherein the user interface of the camera application displays a preview box, wherein the preview box displays a composite image, wherein the composite image is obtained by fitting an image captured by the camera of the electronic device and a first picture, wherein the first picture includes a first object, and the image captured by the camera includes a second object; The electronic device receives an operation for taking a photo; The electronic device stores a second picture, where the second picture is a composite image displayed in the preview box when the operation for taking a photo is received, and the second picture includes the first object and the second object.

10. The method according to claim 9, characterized in that Before the electronic device displays the composite image in the preview frame, the method further includes: The electronic device recognizes the second object in the image captured by the camera; Determining a main area containing the second object in the image captured by the camera, the main area being an area determined based on the second object; Determine a co-located area in the first image, wherein a correlation between a portion of the first image outside the co-located area and a portion of the image captured by the camera outside the main area is greater than a second value; The main region is fitted to the co-located region in the first image to obtain the composite image.

11. The method according to claim 9, characterized in that Before the electronic device displays the composite image in the preview frame, the method further includes: Recognizing, by the electronic device, the first object in the first picture; determining, in the first picture, a main area containing the first object, the main area being an area determined based on the first object; Determine a co-located area in the image captured by the camera, wherein a correlation between a portion outside the co-located area in the image captured by the camera and a portion outside the main area in the first picture is greater than a second value; The main area is fitted to the co-located area in the image captured by the camera to obtain the composite image.

12. The method according to claim 10 or 11, characterized in that The position of the co-located area in the first picture is the same as the position of the main area in the image captured by the camera.

13. The method according to any one of claims 9 to 12, characterized in that: A first control is displayed in the user interface of the camera application. Before the electronic device receives an operation for the first image, the method further includes: The electronic device receives a user operation acting on the first control; The electronic device displays a second control in the user interface of the camera application; the operation on the first picture includes a user operation acting on the second control.

14. The method according to any one of claims 9 to 13, characterized in that: After the electronic device stores the second picture, the method further includes: The electronic device receives an operation for viewing the second picture; The electronic device displays the second picture.

15. A shooting method, characterized in that: The method comprises: The electronic device displays a user interface of a camera application, wherein the user interface of the camera application displays a preview box and a third control, and the preview box displays an image captured by the camera of the electronic device; The electronic device detects an operation performed on the third control; The electronic device displays one or more pictures; The electronic device detects an operation performed on a first picture among the one or more pictures, where the first picture includes a first object; The electronic device displays, in the preview frame of the user interface of the camera application, the image captured by the camera of the electronic device and the indication information of the first picture; The electronic device receives an operation for taking a photo; The electronic device stores a second picture, where the second picture is obtained by fitting the image captured by the camera and the first picture, the image captured by the camera contains a second object, and the second picture contains the first object and the second object.

16. The method according to claim 15, characterized in that After the electronic device receives the operation for taking a photo and before storing the second picture, the method further includes: The electronic device recognizes the second object in the image captured by the camera; Determining a main area containing the second object in the image captured by the camera, the main area being an area determined based on the second object; Determine a co-located area in the first image, wherein a correlation between a portion of the first image outside the co-located area and a portion of the image captured by the camera outside the main area is greater than a second value; The main region is fitted to the co-located region in the first image to obtain the second image.

17. The method according to claim 15, characterized in that After the electronic device receives the operation for taking a photo and before storing the second picture, the method further includes: Recognizing, by the electronic device, the first object in the first picture; determining, in the first picture, a main area containing the first object, the main area being an area determined based on the first object; Determine a co-located area in the image captured by the camera, wherein a correlation between a portion outside the co-located area in the image captured by the camera and a portion outside the main area in the first picture is greater than a second value; The main area is fitted to the co-located area in the image captured by the camera to obtain the second image.

18. The method according to claim 16 or 17, characterized in that The position of the co-located area in the first picture is the same as the position of the main area in the image captured by the camera.

19. The method according to claim 15, characterized in that The second image is a frame of image with the highest quality among the composite images obtained by fitting the first image with the multiple frames of images captured by the camera; The multiple frames of images captured by the camera include: images captured by the camera at the moment when the electronic device receives the operation for taking a photo and at previous moments, and the number of the multiple frames of images is pre-set by the electronic device.

20. The method according to any one of claims 16 to 19, characterized in that: After the electronic device stores the second picture, the method further includes: The electronic device receives an operation for viewing the second picture; The electronic device displays the second picture.

21. A shooting method, characterized in that: The method comprises: The electronic device displays a user interface of a camera application, wherein the user interface of the camera application displays a preview box and a third control, and the preview box displays an image captured by the camera of the electronic device; The electronic device detects an operation performed on the third control; The electronic device displays one or more pictures; The electronic device detects an operation performed on a first picture among the one or more pictures, where the first picture includes a first object; The electronic device displays a composite image in the preview frame of the user interface of the camera application, where the composite image is obtained by fitting an image captured by the camera of the electronic device and the first picture, and the image captured by the camera includes a second object; The electronic device receives an operation for taking a photo; The electronic device stores a second picture, where the second picture is a composite image displayed in the preview box when the operation for taking a photo is received, and the second picture includes the first object and the second object.

22. The method according to claim 21, characterized in that Before the electronic device displays the composite image in the preview frame, the method further includes: The electronic device recognizes the second object in the image captured by the camera; Determining a main area containing the second object in the image captured by the camera, the main area being an area determined based on the second object; Determine a co-located area in the first image, wherein a correlation between a portion of the first image outside the co-located area and a portion of the image captured by the camera outside the main area is greater than a second value; The main region is fitted to the co-located region in the first image to obtain the composite image.

23. The method according to claim 21, characterized in that Before the electronic device displays the composite image in the preview frame, the method further includes: Recognizing, by the electronic device, the first object in the first picture; determining, in the first picture, a main area containing the first object, the main area being an area determined based on the first object; Determine a co-located area in the image captured by the camera, wherein a correlation between a portion outside the co-located area in the image captured by the camera and a portion outside the main area in the first picture is greater than a second value; The main area is fitted to the co-located area in the image captured by the camera to obtain the composite image.

24. The method according to claim 22 or 23, characterized in that The position of the co-located area in the first picture is the same as the position of the main area in the image captured by the camera.

25. The method according to any one of claims 21 to 24, characterized in that After the electronic device stores the second picture, the method further includes: The electronic device receives an operation for viewing the second picture; The electronic device displays the second picture.

26. An electronic device, characterized in that: The electronic device includes: a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in any one of claims 1-25.

27. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 25.

28. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the method according to any one of claims 1 to 25.