Image fusion method and device and electronic equipment
By receiving the image fusion method of selecting input of the object area and adjusting the display attributes, the problem of cumbersome image editing operations in the prior art is solved, and fast and efficient image fusion is achieved.
Patent Information
- Application Number
- CN202510493789.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-19
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, users need to use professional image editing software when they want to adjust the display properties of objects in the image, which leads to cumbersome operations and long time-consuming.
It provides an image fusion method, which displays the object image by receiving selection inputs of the object area, and allows users to adjust display attributes, such as position, size, direction, brightness and transparency, and directly performs image fusion without cumbersome editing operations.
The image fusion process is simplified, efficiency is improved, time is shortened, and the speed and user experience of image fusion is improved.
Smart Images

Figure CN120278897A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of image processing, and particularly relates to an image fusion method, apparatus, and electronic device. Background Art
[0002] With the development of electronic device technology, users have higher and higher requirements for the image processing function of electronic devices. Currently, electronic devices can not only capture images, but also edit images according to user needs. For example, an electronic device can, according to a user's operation, fuse the subject in one image into another image to obtain a fused image.
[0003] In related technologies, when a user hopes to adjust the display attributes of an object C in an image A, generally, a professional image editing software is required to extract the object C from the image A, and then fuse the object C into the image A from which the object C has been extracted, so as to achieve the fusion of the object C and the image A from which the object C has been extracted. The above image editing operations are cumbersome and complex, and require a long time. Summary of the Invention
[0004] The objective of the embodiments of this application is to provide an image fusion method, apparatus, and electronic device, which can improve the efficiency of image fusion.
[0005] In a first aspect, the embodiments of this application provide an image fusion method, which includes: receiving a selection input for an object area in a first image on an album interface; in response to the selection input, displaying an object image, where the object image is obtained by extracting the object area in the first image; receiving an adjustment input; in response to the adjustment input, updating the display attributes of the object image and displaying a second image; the second image is obtained by performing image fusion on the object image with updated display attributes and the processed first image; the processing is to extract the image of the object area in the first image; where the display attributes include at least one of the following: display position, display size, display direction, brightness, and transparency.
[0006] Second aspect, an embodiment of the present application provides an image fusion device, which includes: a receiving module and a display module; the receiving module is configured to receive a selection input for an object area in a first image on an album interface; the display module is configured to display an object image in response to the selection input received by the receiving module, where the object image is obtained by cropping the object area in the first image; the receiving module is further configured to receive an adjustment input; the display module is further configured to update the display attribute of the object image and display a second image in response to the adjustment input received by the receiving module; the second image is obtained by performing image fusion on the object image with updated display attributes and the processed first image; the processing is to crop the image of the object area in the first image; wherein, the display attribute includes at least one of the following: display position, display size, display direction, brightness, transparency.
[0007] Third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the image fusion method described in the first aspect are implemented.
[0008] Fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the image fusion method described in the first aspect are implemented.
[0009] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the steps of the image fusion method described in the first aspect.
[0010] Sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the image fusion method described in the first aspect.
[0011] In an embodiment of the present application, a selection input for an object area in a first image on an album interface is received; in response to the selection input, an object image is displayed, where the object image is obtained by cropping the object area in the first image; an adjustment input is received; in response to the adjustment input, the display attributes of the object image are updated, and a second image is displayed; the second image is obtained by performing image fusion on the object image with updated display attributes and the processed first image; the processing is to crop the image of the object area in the first image; wherein, the display attributes include at least one of the following: display position, display size, display direction, brightness, and transparency. Through this solution, after receiving the selection input for the object area in the first image on the album interface, the image of the object area in the first image can be directly cropped to obtain the object image in the first image, and after adjusting the display attributes of the object image, the updated object image can be directly fused with the first image obtained after cropping processing, and the entire process does not require the user to manually perform cumbersome image editing operations, so that fast image fusion can be achieved. In this way, not only the time for image fusion is shortened, but also the efficiency of image fusion is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a schematic flowchart of an image fusion method provided by some embodiments of the present application;
[0013] Figure 2 is a schematic diagram of displaying an image on an album interface provided by some embodiments of the present application;
[0014] Figure 3 is a schematic diagram of cropping an object on an album interface provided by some embodiments of the present application;
[0015] Figure 4 is a schematic diagram of playing an animation effect on the contour of an object provided by some embodiments of the present application;
[0016] Figure 5 is a schematic diagram of an image fusion control provided by some embodiments of the present application;
[0017] Figure 6 is a schematic diagram of a user clicking on an image fusion control provided by some embodiments of the present application;
[0018] Figure 7 is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0019] Figure 8 is a schematic diagram of adjusting the display position of an object image provided by some embodiments of the present application;
[0020] Figure 9It is a schematic diagram for adjusting the display size of an object image provided by some embodiments of the present application;
[0021] Figure 10 It is a schematic diagram for adjusting the display orientation of an object image provided by some embodiments of the present application;
[0022] Figure 11 It is a schematic diagram of a fusion control provided by some embodiments of the present application;
[0023] Figure 12 It is a schematic diagram of an interface during the image fusion process provided by some embodiments of the present application;
[0024] Figure 13 It is a schematic diagram of a first image provided by some embodiments of the present application;
[0025] Figure 14 It is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0026] Figure 15 It is a schematic diagram of a second image provided by some embodiments of the present application;
[0027] Figure 16 It is a schematic diagram of a first image provided by some embodiments of the present application;
[0028] Figure 17 It is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0029] Figure 18 It is a schematic diagram of a second image provided by some embodiments of the present application;
[0030] Figure 19 It is a schematic diagram of a first image provided by some embodiments of the present application;
[0031] Figure 20 It is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0032] Figure 21 It is a schematic diagram of a second image provided by some embodiments of the present application;
[0033] Figure 22 It is a schematic diagram of a first image provided by some embodiments of the present application;
[0034] Figure 23 It is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0035] Figure 24 It is a schematic diagram of a second image provided by some embodiments of the present application;
[0036] Figure 25 It is a schematic diagram of a first image provided by some embodiments of the present application;
[0037] Figure 26 It is a schematic diagram of an image fusion editing interface provided by some embodiments of the present application;
[0038] Figure 27 It is a schematic diagram of a third image provided by some embodiments of the present application;
[0039] Figure 28 It is a schematic diagram of a second image provided by some embodiments of the present application;
[0040] Figure 29 It is a schematic diagram of an image fusion device provided by some embodiments of the present application;
[0041] Figure 30 It is a schematic diagram of the structure of an electronic device provided by some embodiments of the present application;
[0042] Figure 31 It is a schematic diagram of the hardware structure of an electronic device provided by some embodiments of the present application. Detailed implementation manners
[0043] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object may be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.
[0045] The terms "at least one (item)", "at least one of", etc. in the description and claims of this application refer to any one, any two or more combinations of the objects they contain. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".
[0046] The terms used in the implementation part of this application are only used to explain the specific embodiments of this application, rather than being intended to limit this application. Technical terms involved in the embodiments of this application are explained.
[0047] The identifiers in this application are for indicating information such as words, symbols, images, etc., and can use controls or other containers as the carriers for displaying information, including but not limited to text identifiers, symbol identifiers, and image identifiers.
[0048] Artificial Intelligence Generated Content (AIGC): refers to the technology of automatically generating or modifying digital content through artificial intelligence technology. Among them, artificial intelligence technology can be deep learning models, generative adversarial networks, etc., and digital content can include images, texts, audios, videos, etc.
[0049] Subject matte extraction: Subject matte extraction refers to the technical process of separating the target subject object from the original image and generating its precise transparency channel (Alpha channel).
[0050] Image fusion: Image fusion refers to the technical process of placing two images on an image fusion carrier and then fusing these two images into one image after adjusting the fusion parameters.
[0051] Foreground subject segmentation algorithm: The foreground subject segmentation algorithm belongs to the field of digital image processing technology, and specifically involves a computer vision method for realizing pixel-level foreground extraction through multi-modal data fusion. It is applicable to high-precision image segmentation and synthesis in complex scenes, and can segment the subject object in the foreground according to the depth of field distribution in the image.
[0052] Two-finger operation: refers to the interaction action that the user simultaneously applies with two fingers on the touch screen of the electronic device.
[0053] Album large image page: refers to the full-screen display mode for browsing images in the album of the electronic device, and most of the frame area on the screen shows a complete image.
[0054] The Rule of Thirds: When composing a picture, divide the picture into three equal parts or a nine - grid layout, and place the main subject in the image on the dividing lines or at the intersection points of the nine - grid.
[0055] The Golden Ratio Rule: When composing a picture, place the main subject in the image on the golden ratio line of the overall picture.
[0056] The Symmetry Rule: When composing a picture, place the main subject in the image on the symmetry line of the overall picture.
[0057] The Leading Line Rule: When composing a picture, place the main subject in the image on the lines that actually exist or are implied in the overall picture. Among them, the lines that actually exist or are implied can be rivers, roads, zebra crossings, etc. in the image.
[0058] Next, in combination with the accompanying drawings, through specific embodiments and their application scenarios, the image fusion method provided by the embodiments of the present application will be described in detail.
[0059] The image fusion method provided by the embodiments of the present application can be applied to the in - image fusion scenario. Among them, the in - image fusion scenario refers to the scenario of adjusting an object in an image to re - fuse this object in this image.
[0060] A specific in - image fusion scenario is photo retouching of defective photos. For example, the following Scenario 1.
[0061] Scenario 1: When users take some photos in daily life, such as taking creative pictures of holding the moon with their hands or lifting people with their hands, due to inappropriate shooting angles and timing, situations like "the hand didn't hold the moon" or "the hand didn't touch the person" occur, resulting in defective photos. Through the in - image fusion process, the position of the main subject in the picture can be adjusted and fused to save the defective photos.
[0062] A specific in - image fusion scenario is image refinement. For example, the following Scenario 2.
[0063] Scenario 2: When users take group photos, if the distance between the two people in the group photo is too far, the positions of the two people can be adjusted through in - image fusion.
[0064] The execution subject of the image fusion method provided by the embodiments of the present application can be an image fusion device. Exemplarily, this image fusion device can be an electronic device, or a functional component or functional entity in the electronic device. Hereinafter, taking the execution subject as an electronic device as an example, the image fusion method provided by the embodiments of the present application will be described exemplarily.
[0065] Figure 1 It is a schematic flowchart of the image fusion method provided by the embodiments of the present application, as Figure 1As shown, the image fusion method provided by the embodiments of the present application may include the following steps 101 to 103.
[0066] Step 101: The electronic device receives a selection input for an object area in a first image on the album interface.
[0067] In some embodiments of the present application, the above album interface may be a page for browsing images in the electronic device, which may be referred to as the album large image page. The album interface may display the first image completely.
[0068] In some embodiments of the present application, the above first image may be an image selected by the user that contains a main object or a foreground object. The first image may be an image saved in the album application of the electronic device, or an image received by the electronic device that can be processed by the album application.
[0069] In some embodiments of the present application, the above object area may be the image area of the object selected by the above selection input. In other words, the above object area is the area where the object to be cut out selected by the user is located in the first image.
[0070] In some embodiments of the present application, the above object may be any foreground object of the first image, or may also be the main object of the first image. For example, the above object may be a person, an animal, a plant, a table, a chair, etc., and the embodiments of the present application do not limit this.
[0071] In some embodiments of the present application, the number of the above objects may be one, two, or more, and the embodiments of the present application do not limit this.
[0072] In some embodiments of the present application, the above selection input may be any form of input by the user on the object area in the first image through the touch area of the electronic device. For example, the above touch area may be the screen of the electronic device.
[0073] In some embodiments of the present application, the above selection input includes but is not limited to: the user uses a touch device such as a finger or a stylus to perform a touch input on the object area in the first image through the touch area of the electronic device, or is a specific gesture input by the user, or is other feasible input. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0074] Exemplarily, the above touch input may include a single click input, a double click input, or a click input of any number of times, etc., or may also include a long press input, a short press input, a slide input, a drag input, a drag and drop input, etc.
[0075] Exemplarily, the above specific gesture may be any one of a single click gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double press gesture, and a double click gesture.
[0076] In some embodiments of the present application, the user can open the photo album application of the electronic device, select a first image from multiple images in the photo album application, and then the electronic device opens the photo album interface to display the first image for the user to view, and the user can make a selection input in the image area of the first image.
[0077] Exemplarily, Figure 2 is a schematic diagram of displaying an image on the photo album interface provided by an embodiment of the present application. Taking the electronic device as a mobile phone and the photo album interface as the large photo page of the photo album as an example, as Figure 2 shown, the user opens the photo album application of the mobile phone, selects a first image 11 from the photo album application. The first image 11 contains an obvious portrait. Then the mobile phone enters the large photo page a1 of the photo album and displays the complete first image 11 on the large photo page a1, and a thumbnail of the first image 11 and thumbnails of other images in the photo album application are displayed below the first image 11, such as the thumbnail of the second image, the thumbnail of Picture 1, and the thumbnail of Picture 2.
[0078] Step 102: The electronic device displays an object image in response to the selection input.
[0079] In some embodiments of the present application, the above object image is obtained by cropping the object area in the first image. Among them, the image of the object area refers to the image composed of pixels within the object area in the first image.
[0080] In some embodiments of the present application, in response to the selection input, the electronic device can crop the image of the object area in the first image, generate an object image, and display the object image. It can be understood that the above object image is the image of the object area cropped from the first image.
[0081] In some embodiments of the present application, the above selection input includes a first sub-input and a second sub-input, and the above step 102 can be specifically implemented by the following steps 1021 to 1023.
[0082] Step 1021: In response to the first sub-input to the object area, play a first special effect on the contour of the object in the object area.
[0083] Among them, the above first special effect includes at least one of the following: highlighting, flowing light special effect, breathing special effect.
[0084] In some embodiments of the present application, the contour of an object refers to the boundary line of the object in the object area or the boundary line of the object area, that is, the dividing line between the object and the background or other objects. The contour of the object can present key information such as the shape and structure of the object in a concise line form by extracting the most significant part of the gray value or color change in the image of the object area. The contour of the object is the area where the gray or color changes sharply in the image of the object area, reflecting the shape and structure of the object.
[0085] For example, in a black-and-white image, the pixel values at the edge of an object change sharply from black (0) to white (255), forming a contour.
[0086] In some embodiments of the present application, the contour of an object refers to the boundary line of the object in the object area or the boundary line of the object area, that is, the dividing line between the object and the background or other objects. The contour of the object can present key information such as the shape and structure of the object in a concise line form by extracting the most significant part of the gray value or color change in the image of the object area. The contour of the object is the area where the gray or color changes sharply in the image of the object area, reflecting the shape and structure of the object.
[0087] For example, in a black-and-white image, the pixel values at the edge of an object change sharply from black (0) to white (255), forming a contour.
[0088] In some embodiments of the present application, when the user makes a first sub-input on the first image of the album interface, the electronic device responds to the first sub-input, performs image segmentation on the first image using the foreground object segmentation algorithm, determines the object area of each object in the first image, and then determines whether the input position of the first sub-input is in the object area of a certain object. If the input position of the first sub-input is in the object area of a certain object, a first dynamic effect is played on the contour of the object in the object area. If the input position of the first sub-input is not in the object area of any object, no processing is performed and the first image continues to be displayed.
[0089] In some embodiments of the present application, the above-mentioned foreground object segmentation algorithm can achieve high-precision image segmentation and synthesis in complex scenes, achieve pixel-level matting, can clearly extract fine edges, can accurately extract the main body with hair, and has a relatively fast matting speed. In specific implementation, the foreground object segmentation algorithm can extract the contour of the object in the first image according to the depth-of-field information in the first image.
[0090] Exemplarily, the electronic device uses a foreground object segmentation algorithm to determine the depth-of-field information of each object in the first image, determines the foreground and background in the first image based on the depth-of-field information, and performs binarization processing on the foreground, that is, converts the foreground mask into a binary image, and then uses an edge detection algorithm to extract the edges of the binary image, that is, extracts the contours of each object in the first image. Then, if the input position of the first sub-input is in the object area of a certain object, the first special effect is played on the contour of the object in the object area. Among them, the edge detection algorithm can include algorithms such as Canny and Sobel.
[0091] In this way, judging whether the input position of the first sub-input is within the object area of a certain object can ensure that the overall interaction logic is more in line with the user's intuition, that is, by long-pressing an object in the first image to extract the image of the object in the long-pressed area, realizing that what is pressed is what is extracted, and at the same time, it can effectively avoid accidental touches during daily operations in the album interface.
[0092] In some embodiments of the present application, when the electronic device uses a foreground object segmentation algorithm to perform image segmentation on the first image, it may be determined that there are multiple objects in the first image. In the case where there are multiple objects in the first image, if the multiple objects are in a segmented state, each object in the first image is regarded as a separate object, and then the electronic device judges whether the input position of the first sub-input is within the object area of a certain object among the multiple objects. If so, the first special effect is played on the contour of the object in the object area.
[0093] For example, after the electronic device uses the foreground object segmentation algorithm on the first image A, it is determined that there are two people, X and Y, standing separately in the first image A. What the algorithm obtains are two objects, X and Y. At this time, the electronic device judges whether the input position of the user's first sub-input is in the area where X is located or the area where Y is located. If the input position of the first sub-input is in the area where X is located, the electronic device plays the first special effect on the contour of X; if the input position of the first sub-input is in the area where Y is located, the electronic device plays the first special effect on the contour of Y. If the input position of the first sub-input is neither in the area where X is located nor in the area where Y is located, the first image A remains unchanged.
[0094] In some embodiments of the present application, in the case where there are multiple objects in the first image, if there are two or more objects that are stuck together among the multiple objects, the two or more objects that are stuck together are regarded as one object, and the separate objects are regarded as one object, and then it is judged whether the input position of the first sub-input is within the object area of a certain object among the multiple objects. If so, the first special effect is played on the contour of the object in the object area.
[0095] For example, after the electronic device uses the foreground subject segmentation algorithm on the first image and determines that there are two people, X and Y, standing together in the first image, since there is an overlapping part of these two people in the first image, it can be determined that the first image contains a complete object. Then, the electronic device can determine whether the position of the first sub-input is included in the object area of this complete object. If so, the electronic device plays the first dynamic effect on the contour of this complete object.
[0096] In some embodiments of the present application, if an object in the first image determined by the electronic device using the foreground subject segmentation algorithm occupies a proportion of the first image ≥ 90% or ≤ 2.5%, the electronic device can mask this object, that is, not use this object as an object that can be cut out, and not play the first dynamic effect on the contour of this object. In this way, it is possible to avoid too many too small and inconvenient-to-operate objects or too large objects in the first image.
[0097] In some embodiments of the present application, in response to the first sub-input to the object area, when the input duration of the first sub-input is greater than the first duration, the electronic device plays the first dynamic effect on the contour of the object in the object area.
[0098] It should be noted that the above first duration can be set by default by the electronic device or can be set by the user according to actual needs, and the embodiments of the present application do not limit this. For example, the above first duration can be 600 ms or 500 ms, etc.
[0099] In some embodiments of the present application, the above first duration is different from the input durations of other long-press inputs that may exist in the album interface or the electronic device. In this way, the situation of functional accidental touch can be reduced.
[0100] Exemplarily, taking the first sub-input as a long-press input and the first duration being 600 ms as an example, in response to the user's long-press input on the object area, when the long-press input is greater than 600 ms, the electronic device can play the first dynamic effect on the contour of the object in the object area.
[0101] In some embodiments of the present application, the above first dynamic effect may include at least one of the following: a highlighting dynamic effect, a flowing light dynamic effect, and a breathing dynamic effect.
[0102] In some embodiments of the present application, the highlighting dynamic effect refers to an effect that makes a specific area in an image more prominent or eye-catching visually by enhancing the brightness or saturation of the specific area in the image. Specifically, it can be achieved by adjusting the brightness value of pixels or applying filters such as Gaussian blur, and combining dynamic effects to enhance the visual impact. The dynamic effects may include gradual change or flicker.
[0103] In some embodiments of the present application, the flowing light effect is a visual effect that simulates the flow or flicker of light, usually manifested as the smooth movement or flicker of light on the image surface. Specifically, gradient colors and animation effects can be used to simulate the flow of light, and the combination of transparency changes and displacement animations can be used to achieve light and shadow flicker.
[0104] In some embodiments of the present application, the breathing effect is a visual effect that simulates the "breathing" or "pulsation" of an object, usually manifested as the periodic change of the size, transparency, or color of elements in the image. Specifically, the periodic change of size or transparency can be achieved through keyframe animation, and the combination of easing functions can make the animation more natural. Among them, the easing function can be Ease In / Out.
[0105] Exemplarily, for the highlighting effect, it can be achieved by enhancing the color, that is, increasing the pixel values of the contour area to form a contrast with the background, and gradually enhancing the contour brightness through a timeline animation to form a flickering or gradient effect to achieve a dynamic effect. Among them, increasing the pixel values of the contour area includes increasing the brightness or saturation of the pixels in the contour area.
[0106] Exemplarily, for the flowing light effect, it is achieved by gradient overlay, that is, overlaying a semi-transparent gradient layer on the contour to simulate the flow of light, and making the gradient layer move along the contour through displacement animation to form a flowing light effect.
[0107] Exemplarily, for the breathing effect, it is achieved by contour scaling, that is, taking the center of the contour as a reference, periodically enlarging or shrinking the contour line, and at the same time adjusting the transparency of the contour line to enhance the sense of breathing.
[0108] Next, taking the album interface as the album large picture page, the object area as the human body area, the first sub-input as a long press input, the first duration as 600 ms, and the first effects as the highlighting effect and the flowing light effect as examples, the process of the electronic device playing the first effect on the contour of the object in the object area in response to the first sub-input to the object area will be described. As Figure 3 shown, on the album large picture page a1 of the electronic device, when the user long presses the human body area 14 in the first image 11 for 600 ms, the electronic device can use the foreground image segmentation algorithm to determine the object in the first image 11 and determine whether the area where the user long presses is within the object area of an object in the first image. Then, as Figure 4 shown, when the area where the user long presses is the area of the human body object in the first image, that is, the human body area 14, the electronic device highlights the contour line 15 of the human body in the first image and plays the flowing light effect on the contour line 15.
[0109] Step 1022: Display the image fusion control when the first sub-input ends.
[0110] In some embodiments of the present application, the end of the first sub-input means that the touch device used by the user leaves the screen of the electronic device.
[0111] Exemplarily, taking the touch device as the user's finger as an example, after the user long-presses on the object area and then releases the hand, the electronic device displays an image fusion control.
[0112] In some embodiments of the present application, when the first sub-input ends, the electronic device may display an image fusion control in the album interface. During the process of displaying the image fusion control, the electronic device still plays a first dynamic effect on the outline of the object in the object area.
[0113] For example, as Figure 5 shown, after the user long-presses on the object area to extract the object image and then releases the hand, the electronic device may display an image fusion control 61 on the album interface a1, and the name of the image fusion control 61 may be "Magic Move".
[0114] In some embodiments of the present application, when the first sub-input ends, in addition to displaying an image fusion control in the album interface, the electronic device may also display a copy control, a save control, a select all control, etc. The copy control is used to copy the object image displayed in the album interface to the clipboard, the save control is used to store the object image in the album interface, and the select all control is used to select all the images displayed in the album interface, such as the object image and the first image.
[0115] Exemplarily, as Figure 5 shown, an image fusion control 61, a copy control 62, a save control 63, and a share control 64 are displayed on the album interface a1 of the electronic device.
[0116] Step 1023: In response to a second sub-input to the image fusion control, display an image fusion editing interface, where the image fusion editing interface includes the object image and the processed first image.
[0117] In some embodiments of the present application, the second sub-input may be an input such as a single click, double click, short press, or long press on the image fusion control.
[0118] In some embodiments of the present application, after the electronic device receives a second sub-input from the user to the image fusion control, in response to the sub-input, it displays an image fusion editing interface, which includes the object image and the processed first image, and the object image is in a state allowing editing.
[0119] Exemplarily, as Figure 6 shown, the electronic device displays an image fusion control 61 on the album interface a1. After the user clicks on the image fusion control 61, as Figure 7As shown, the electronic device can display an image fusion editing interface a2, and the image fusion editing interface a2 includes a processed first image 11 and an object image 13.
[0120] Combined with the above Scenario 1, taking the electronic device as a mobile phone as an example, the user opens a photo of holding the moon on the mobile phone, then long-presses on the area where the moon is located in this photo. The electronic device plays a first special effect on the contour of the moon. Then the user releases the finger, and the electronic device displays an image fusion control. The user clicks on the image fusion control, and the electronic device displays an image fusion editing interface. The image fusion editing interface includes an image of the moon and the processed photo of holding the moon, and the image of the moon is editable.
[0121] Combined with the above Scenario 2, taking the mobile phone of the electronic device as an example, the user opens a group photo on the mobile phone, then long-presses on the portrait on the right in this photo. The electronic device plays a first special effect on the contour of the person on the right. Then the user releases the finger, and the electronic device displays an image fusion control. The user clicks on the image fusion control, and the electronic device displays an image fusion editing interface. The image fusion editing interface includes the portrait on the right and the processed group photo, and the portrait on the right is editable.
[0122] In this way, by the user long-pressing on the object in the object area of the first image, playing a first special effect on the contour of the object in the first image, then displaying an image fusion control after the user releases the finger, and triggering the electronic device to display an image fusion editing interface through the user's input to the image fusion control, an editable object image is displayed in the image fusion editing interface. In this way, the overall interaction process is relatively simple and easy to operate.
[0123] Step 103: The electronic device receives an adjustment input.
[0124] In some embodiments of the present application, the above adjustment input can be an adjustment input to the object image displayed by the electronic device, or the above adjustment input can be an adjustment input to the adjustment control displayed by the electronic device.
[0125] In some embodiments of the present application, the above object image is in an editable state, and the user can adjust the display attributes of the object image by dragging the object image.
[0126] In some embodiments of the present application, the electronic device can display an adjustment control, and the adjustment control can be used to adjust the display attributes of the object image.
[0127] Exemplarily, the electronic device can display a plurality of adjustment controls, and the plurality of adjustment controls are respectively used to adjust different display attributes of the object image.
[0128] For example, the electronic device can display position adjustment controls, size adjustment controls, brightness adjustment controls, display orientation adjustment controls, transparency adjustment controls, and so on.
[0129] Step 104: In response to the adjustment input, the electronic device updates the display attributes of the object image and displays the second image.
[0130] In some embodiments of the present application, the above-mentioned second image is obtained by fusing the object image with the updated display attributes and the processed first image; the above-mentioned processing is to remove the image of the object area in the first image.
[0131] In some embodiments of the present application, the above-mentioned display attributes include at least one of the following: display position, display size, display orientation, brightness, transparency.
[0132] In some embodiments of the present application, the user can trigger the electronic device to adjust the display position of the object image by dragging the object image, such as dragging the object image up, down, left, or right.
[0133] In some embodiments of the present application, the size adjustment control can include a shrink control and an enlarge control, and the user can trigger the electronic device to shrink or enlarge the object image by making an adjustment input to the shrink control or the enlarge control.
[0134] In some embodiments of the present application, the brightness adjustment control can include a slider, and the user can trigger the electronic device to increase or decrease the brightness of the object image by sliding the slider up or down, or left or right.
[0135] In some embodiments of the present application, the user can trigger the electronic device to adjust the display orientation of the object image by clicking on the display orientation adjustment control one or more times.
[0136] In some embodiments of the present application, the transparency adjustment control can include a slider, and the user can trigger the electronic device to increase or decrease the transparency of the object image by sliding the slider up or down, or left or right.
[0137] For the image fusion method provided by the embodiments of the present application, after the electronic device receives the selection input for the object area in the first image of the album interface, it can directly extract the image of the object area in the first image to obtain the object image in the first image, and after adjusting the display attributes of the object image, directly fuse the updated object image with the first image obtained after the matte extraction process. The entire process does not require the user to manually perform cumbersome image editing operations, and can achieve fast image fusion. In this way, not only the time for image fusion is shortened, but also the efficiency of image fusion is improved.
[0138] In some embodiments of the present application, the above step 103 can be specifically implemented through the following step 1031. And the above step 104 can be specifically implemented through the following step 1041.
[0139] Step 1031: The electronic device receives an adjustment input for the object image in the image fusion editing interface.
[0140] In some embodiments of the present application, the above adjustment input can be a drag input of the user on the object image, a two-finger zoom input, a rotation input, a sliding input on the object image, and so on.
[0141] In some embodiments of the present application, the above drag input is used to adjust the display position of the object image, the above two-finger zoom input is used to adjust the display size of the object image, and the above rotation input is used to adjust the display direction of the object image. The above sliding input on the object image is used to adjust the brightness or transparency of the object image, and so on.
[0142] Step 1041: The electronic device updates the display attributes of the object image in the image fusion interface in response to the adjustment input.
[0143] Exemplarily, the above adjustment input is a drag input in which the user drags the object image from the upper left corner to the lower right corner. The electronic device, in response to this drag input, displays the object image in the lower right corner.
[0144] Exemplarily, the above adjustment input is a two-finger zoom input in which the user enlarges the size of the object image. The electronic device, in response to this two-finger zoom input, enlarges the object image and displays the enlarged object image.
[0145] Exemplarily, the above adjustment input is a rotation input in which the user rotates the object image clockwise. The electronic device, in response to this rotation input, rotates the object image clockwise and displays the object image rotated clockwise.
[0146] Exemplarily, the above adjustment input is a brightness increase input in which the user increases the brightness of the object image. The electronic device, in response to this brightness increase input, increases the brightness of the object image and displays the object image with increased brightness.
[0147] Exemplarily, the above adjustment input is a transparency increase input in which the user increases the transparency of the object image. The electronic device, in response to this transparency increase input, increases the transparency of the object image and displays the object image with increased transparency.
[0148] In this way, before the electronic device performs image fusion on the object image and the second image, it can display an image fusion editing interface so that the user can adjust the display attributes of the object image in the image fusion editing interface, making the positional relationship, size relationship, etc. between the object image and the second image meet the user's needs during image fusion. As a result, the finally fused second image meets the user's expectations, improving the user experience.
[0149] In some embodiments of the present application, the above step 1023 can be specifically implemented through the following step 1023a. And the above step 1031 can be specifically implemented through the following step 1031a.
[0150] Step 1023a: In response to the second sub-input, the electronic device displays an editing adjustment control on the object image in the image fusion editing interface.
[0151] In some embodiments of the present application, the electronic device can display the editing adjustment control at the upper right corner or upper left corner or lower right corner or lower left corner of the object image.
[0152] In some embodiments of the present application, the electronic device can display a rectangular frame around the object image, and this rectangular frame can be understood as the smallest frame that can completely enclose the object image.
[0153] In some embodiments of the present application, the electronic device can display the editing adjustment control on the above rectangular frame.
[0154] In some embodiments of the present application, the user can adjust the display attributes of the object image through the editing adjustment control.
[0155] Step 1031a: The electronic device receives an adjustment input to the above editing adjustment control.
[0156] In some embodiments of the present application, the user can adjust the display position, display size, display orientation, brightness, transparency, etc. of the object image by adjusting the editing adjustment control.
[0157] In some embodiments of the present application, the object image and the rectangular frame can be regarded as a whole. When adjusting the display position, display size, and display orientation of the object image, the display position, display size, and display orientation of the rectangular frame will also change accordingly.
[0158] In some embodiments of the present application, the above adjustment input is a dragging input of the user to the object image. The electronic device receives the dragging input of the user to the object image on the image fusion interface, and in response to the dragging input, adjusts the display position of the object image, that is, displays the object image at the end position of the dragging input.
[0159] Exemplarily, taking the adjustment input as a drag input for an object image as an example, as Figure 8 shown, the user makes a drag input on the object image 13, such as dragging the object image 13 from the left to the right on the image fusion interface a2, and the electronic device adjusts the display position of the object image 13, that is, displays the object image 13 at the end position of the drag input.
[0160] In some embodiments of the present application, the above adjustment input is a zoom input for an editing adjustment control, and the zoom input may include a reduction input or an enlargement input. The electronic device receives the user's zoom input for the editing adjustment control on the image fusion interface, and in response to the zoom input, zooms the object image, that is, adjusts the size of the object image.
[0161] Exemplarily, taking the adjustment input as an enlargement input for an editing adjustment control as an example, as Figure 9 shown, the user drags the editing adjustment control 23 of the object image 13 towards the periphery of the border on the image fusion interface a2, and the electronic device proportionally enlarges the size of the object image 13 in response to the user's operation, and then displays the object image 13 with the enlarged size.
[0162] In some embodiments of the present application, the above adjustment input is a rotation input for an editing adjustment control. The electronic device receives the user's rotation input for the editing adjustment control on the image fusion interface, and in response to the rotation input, adjusts the display direction of the object image, that is, rotates the object image.
[0163] Exemplarily, taking the adjustment input as a rotation input for an editing adjustment control as an example, as Figure 10 shown, the user rotates the editing adjustment control 231 on the rectangular frame of the object image 13 clockwise on the image fusion interface a2, and the electronic device adjusts the display direction of the object image 13 clockwise in response to the user's operation, and displays the object image 13 that is tilted to the right after adjusting the display direction.
[0164] In some embodiments of the present application, the above adjustment input is a sliding input for a brightness adjustment control. The electronic device receives the user's sliding input for the brightness adjustment control on the image fusion interface, and in response to the sliding input, adjusts the brightness of the object image, and displays the object image after adjusting the brightness.
[0165] In some embodiments of the present application, the sliding input to the brightness adjustment control may include sliding up, sliding down, sliding left, or sliding right. Exemplarily, sliding up and sliding left increase the brightness of the object image, while sliding down and sliding right decrease the brightness of the object image; or, sliding up and sliding left decrease the brightness of the object image, while sliding down and sliding right increase the brightness of the object image; or, sliding up and sliding right increase the brightness of the object image, while sliding down and sliding left decrease the brightness of the object image; or, sliding up and sliding right decrease the brightness of the object image, while sliding down and sliding left increase the brightness of the object image.
[0166] Exemplarily, taking the adjustment input as a sliding input to the brightness adjustment control, the sliding input being sliding down, and sliding down decreasing the brightness as an example. The user slides the brightness adjustment control down on the image fusion editing interface, and the electronic device responds to the sliding input by decreasing the brightness of the object image and displaying the object image with the decreased brightness.
[0167] In some embodiments of the present application, the above adjustment input is a sliding input to the transparency adjustment control. The electronic device receives the sliding input of the user on the transparency adjustment control on the image fusion interface, and in response to the sliding input, adjusts the transparency of the object image and displays the object image with the adjusted transparency.
[0168] In some embodiments of the present application, the sliding input to the transparency adjustment control may include sliding up, sliding down, sliding left, or sliding right. Exemplarily, sliding up and sliding left increase the transparency of the object image, while sliding down and sliding right decrease the transparency of the object image; or, sliding up and sliding left decrease the transparency of the object image, while sliding down and sliding right increase the transparency of the object image; or, sliding up and sliding right increase the transparency of the object image, while sliding down and sliding left decrease the transparency of the object image; or, sliding up and sliding right decrease the transparency of the object image, while sliding down and sliding left increase the transparency of the object image.
[0169] It should be noted that increasing the transparency of the object image can make the object image more transparent, and decreasing the transparency of the object image can make the object image less transparent.
[0170] Exemplarily, taking the adjustment input as a sliding input to the transparency adjustment control, the sliding input being sliding down, and sliding down decreasing the transparency as an example. The user slides the transparency adjustment control down on the image fusion editing interface, and the electronic device responds to the sliding input by decreasing the transparency of the object image and displaying the object image with the decreased transparency.
[0171] In some embodiments of the present application, the electronic device can also display a brightness adjustment control and a transparency adjustment control to prompt the user that the brightness and transparency of the object image can be adjusted.
[0172] In some embodiments of the present application, the above adjustment input can be the user's input to the brightness adjustment control or the transparency adjustment control.
[0173] In some embodiments of the present application, the electronic device can also display a third prompt message, which can be used to prompt the user to adjust the display attributes of the object image.
[0174] In this way, before the electronic device performs image fusion on the object image and the second image, it can display an image fusion editing interface so that the user can adjust the display attributes of the object image in the image fusion editing interface, making the positional relationship, size relationship, etc. between the object image and the second image meet the user's needs during image fusion, and thus making the finally fused second image meet the user's expectations and improving the user experience.
[0175] In some embodiments of the present application, the image fusion editing interface of the electronic device can also include a fusion control, which is used to trigger the electronic device to perform image fusion. Exemplarily, as Figure 11 shown, the image fusion editing interface a2 displays a fusion control 31. When the user clicks on the fusion control 31, the electronic device can perform image fusion on the object image with updated display attributes and the processed first image to obtain a second image.
[0176] In some embodiments of the present application, the above 1023 can be specifically implemented through the following steps 1023b.
[0177] Step 1023b: The electronic device, in response to the second sub-input, displays an image fusion editing interface and a nine-grid reference line, and the above nine-grid reference line is used to assist the user in adjusting the display position of the object image.
[0178] In some embodiments of the present application, in response to the second sub-input, when the electronic device displays the image fusion editing interface, it can display a nine-grid reference line on the image fusion editing interface so that the user can adjust the display position of the object image according to the nine-grid reference line.
[0179] In some embodiments of the present application, in response to the second sub-input, the electronic device displays the image fusion editing interface, and then, when the user adjusts the position of the object image on the image fusion editing interface, the electronic device displays a nine-grid reference line on the image fusion editing interface so that the user can adjust the display position of the object image according to the nine-grid reference line.
[0180] Exemplarily, asFigure 8 As shown, when the user drags the object image 13 on the image fusion editing interface a2 to adjust the display position of the object image 13, the electronic device can display a nine-grid reference line 24 on the image fusion editing interface a2.
[0181] In this way, displaying the nine-grid reference line on the image fusion editing interface can assist the user in adjusting the position of the object image, facilitating composition. This can not only improve the adjustment efficiency but also enable the second image finally obtained by image fusion to have a better composition effect, enhancing the image fusion effect.
[0182] In some embodiments of the present application, the above-mentioned image fusion editing interface further includes a fusion control and a first cancellation control. Based on this, the image fusion method provided by the embodiments of the present application may further include the following steps 201 and 202.
[0183] Step 201: During the process of fusing the object image with updated display attributes and the processed first image, keep the fusion control and the first cancellation control in a disabled editing state, and display a second prompt message and a second cancellation control.
[0184] In some embodiments of the present application, the above-mentioned second prompt message is used to prompt the image fusion progress of the object image with updated display attributes and the processed first image. Exemplarily, the second prompt message may be a text message, such as "Image fusion progress... 20%", or "Picture fusing... 25%", or "Intelligent generating... 20%", etc.
[0185] It should be noted that the content of the second prompt message can be updated dynamically in real time according to the image fusion progress of the object image with updated display attributes and the processed first image. For example, the second prompt message is "Picture fusing... 1%", and the 1% can be updated in real time according to the image fusion progress.
[0186] In some embodiments of the present application, the above-mentioned first cancellation control can be used to cancel image editing, and the above-mentioned second cancellation control can be used to cancel image fusion.
[0187] Exemplarily, Figure 12 shows a schematic diagram of an image fusion editing interface. As Figure 12 shown, the image fusion editing interface a2 includes an object image 13 and a second image 12, and also includes a fusion control 31, a first cancellation control 24, a second prompt message 25, and a second cancellation control 26. Among them, a second dynamic effect is playing on the object image, the second prompt message 25 is "Picture fusing... 25%", the fusion control 31 and the first cancellation control 24 are both gray, indicating that they cannot be used, and the second cancellation control 26 is in an allowed editing state.
[0188] Step 201: When the image fusion progress has not reached 100% and a third input to the second cancellation control is received, cancel the image fusion of the object image after updating the display attributes and the processed first image, hide the second prompt message and the second cancellation control, and update the fusion control and the first cancellation control to an editable state.
[0189] In some embodiments of the present application, that the image fusion progress has not reached 100% means that the object image after updating the display attributes and the processed first image have not been completely fused, that is, the second image has not been generated yet.
[0190] In some embodiments of the present application, the above-mentioned third input may be a touch input, a short press input, a long press input, a click input, a single click input, a double click input, etc. on the second cancellation control.
[0191] In some embodiments of the present application, when the image fusion progress has not reached 100%, the user can perform a third input on the second cancellation control, and the electronic device hides the second prompt message and the second cancellation control, which can be understood as the electronic device cancels the displayed second prompt message and the second cancellation control.
[0192] Exemplarily, as Figure 12 shown, taking the above-mentioned third input as a single click input as an example, after the user clicks on the second cancellation control 26 on the image fusion interface a2, the electronic device can cancel the image fusion of the object image after updating the display attributes and the processed first image, hide the second prompt message 25 and the second cancellation control 26, and update the fusion control 31 and the first cancellation control 24 to an editable state.
[0193] In this way, during the process of using the image fusion model to perform image fusion on the object image after updating the display attributes and the processed first image, the user is informed of the image fusion progress through the second prompt message, and the second cancellation control is displayed, so that the user can trigger the electronic device to exit the image fusion during the image fusion process and readjust the object image on the picture fusion editing interface again. There is no need for the user to wait until the fusion is completed before making modifications, which can improve the freedom and flexibility of image fusion.
[0194] In some embodiments of the present application, before "displaying the second image" in the above step 104, the image fusion method provided by the embodiments of the present application may further include the following step 301.
[0195] Step 301: The electronic device inputs the object image after updating the display attributes and the processed first image into an image fusion model. Based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image to obtain a second image.
[0196] In some embodiments of the present application, the above image fusion model has AIGC capabilities and can achieve image fusion or image synthesis through artificial intelligence technology. The image fusion model can be a large model obtained by training a deep learning model with a large number of training samples.
[0197] In some embodiments of the present application, the above first image information may include information for characterizing the image features of the processed first image.
[0198] Exemplarily, the above first image information may include at least one of the following: the lighting information of the processed first image, the depth of field information of each object in the processed first image, the background object features of the processed first image, the image content features of the processed first image, and the image size of the processed first image.
[0199] Among them, the lighting information may include the light source position, light intensity, light direction, color light, and color tone. The background object features can be used to indicate the background objects in the processed first image, and the background objects may include objects that float in the image on a large scale, such as snowflakes, raindrops, fallen leaves, fallen flowers, catkins, pieces of paper, water splashes, etc.
[0200] In some embodiments of the present application, the above second image information may include information for characterizing the image features of the object image after updating the display attributes, or the above second image information may include information for characterizing the display position of the object image after updating the display attributes in the processed first image, or the above second image information may include information for characterizing the image features of the object image after updating the display attributes and the display position of the object image after updating the display attributes in the processed first image.
[0201] Exemplarily, the above second image information may include at least one of the following: the object contour feature information of the object image after updating the display attributes, the position information of the object image after updating the display attributes in the processed first image, and the object features of the object in the object image after updating the display attributes.
[0202] Among them, the object contour feature information of the object image after updating the display attributes can be used to indicate the contour shape of the object in the object image. The object features of the object image may include the skin color, clothing type, clothing color, actions, postures, etc. of the object in the object image.
[0203] In some embodiments of the present application, the electronic device may adjust visual attributes of the object image with updated display attributes, such as shadows, hues, brightness, etc., based on the depth-of-field information, light direction, color temperature and other frame features of the processed first image, as well as the image content features, frame position, image size and other information of the processed first image, so as to generate a second image that is physically and logically consistent with the processed first image.
[0204] In this way, through the image fusion model, by combining at least one of the first image information and the second image information, image fusion is performed on the object image and the processed first image, and a more harmonious second image can be obtained, reducing the sense of pasting and bringing a more natural and realistic image fusion effect.
[0205] Based on this, the step "The image fusion model performs image fusion on the object image with updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes to obtain a second image" in step 301 above can be specifically implemented by the following steps 3011 to 3013.
[0206] Step 3011: The electronic device adjusts the brightness of the object image with updated display attributes based on the above light information through the image fusion model.
[0207] In some embodiments of the present application, the above light information may include the light source position, light intensity, light direction, color light and hue.
[0208] In some embodiments of the present application, the image fusion model may determine the hue, color light and light intensity of the processed first image based on the overall color and frame brightness of the processed first image. And the image fusion model may determine the light source position and light direction in the processed first image based on the existing shadows in the processed first image and the light and dark distribution of the processed first image. Then, the image fusion model simulates the highlight part of the object image under the illumination of the light source in the processed first image based on the light information of the processed first image and increases the brightness of the highlight part.
[0209] For example, the brightness of the object image after updating the display attributes is lower than that of the first processed image. That is, the overall object image after updating the display attributes is dim, and the overall first processed image is bright. When fusing the object image after updating the display attributes and the first processed image, the overall brightness of the object image after updating the display attributes will increase. That is, the overall object image after updating the display attributes will be brighter. Moreover, the brightness of the highlight part of the object image under the light source of the first processed image will be higher. That is, the highlight part of the object image after updating the display attributes under the light source of the first processed image will be brighter.
[0210] Step 3012: The electronic device generates a shadow image of the object in the object image after updating the display attributes based on the above light information, the above object contour feature information, and the above position information through an image fusion model, and determines a third position. The third position is the position where the shadow image is to be displayed in the first processed image; wherein, the shadow image is an image of the shadow generated by the object under the light source in the first processed image.
[0211] In some embodiments of the present application, the third position is the position where the shadow image is to be displayed in the first processed image, and the shadow image is an image of the shadow generated by the object under the light source in the first processed image.
[0212] In some embodiments of the present application, the image fusion model can determine the position of the shadow generated by the object in the object image after updating the display attributes under the light source in the first processed image and the shadow image of the shadow based on the light information of the first processed image and the object contour feature information of the object in the object image after updating the display attributes. Moreover, the higher the position of the light source in the first processed image, the shorter the generated shadow image, and the lower the position of the light source in the first processed image, the higher the generated shadow image.
[0213] Exemplarily, assuming that the object in the object image is a little dog, the electronic device can generate a shadow image of the little dog according to the object contour feature information such as the body shape and appearance of the little dog, in combination with the light information in the first processed image. Assuming that the light source in the first processed image is a side front light, the electronic device can generate a shadow image of the little dog in the side front light source scenario.
[0214] Step 3013: The electronic device adds the shadow image at the third position through the image fusion model.
[0215] In some embodiments of the present application, the electronic device adds a shadow image at the third position of the processed first image, and then performs image fusion on the processed first image with the shadow image added and the object image with updated display attributes to obtain a second image. The second image includes not only the object image with updated display attributes, but also the shadow image generated by the object of the object image with updated display attributes under the illumination of the light source in the processed first image.
[0216] Exemplarily, Figure 13 FIG. 5 is a schematic diagram of displaying a first image on an album interface provided by some embodiments of the present application. The album interface a1 displays a first image 11, and the object in the first image 11 is a person. As Figure 14 shown, the electronic device displays the right-moved portrait 13 and the image 12 of the coconut tree by the sea after removing the portrait on the image fusion editing interface a2. Then, after the user clicks the fusion control 31, the electronic device inputs the portrait with updated display attributes and the image of the coconut tree by the sea after removing the portrait into the image fusion model. The image fusion model adjusts the brightness of the portrait with updated display attributes, generates a shadow image of the figure produced by the portrait under the illumination of the light source of the image of the coconut tree by the sea, and also fuses the shadow image during the process of performing image fusion on the portrait with updated display attributes and the image of the coconut tree by the sea after removing the portrait, to obtain a second image. Figure 15 FIG. 9 is a schematic diagram of the second image displayed on the image fusion interface provided by some embodiments of the present application. The second image is an image obtained by fusing the portrait with updated display attributes and the image of the coconut tree by the sea after removing the portrait. The second image includes not only the portrait, the coconut tree by the sea and the shadow of the coconut tree by the sea, but also the shadow image of the shadow produced by the figure under the illumination of the light source of the image of the coconut tree by the sea.
[0217] In this way, by extracting the illumination information of the processed first image and adjusting the brightness of the object image with updated display attributes based on the illumination information, the image fusion model generates a shadow image of the object image with updated display attributes under the illumination of the light source of the processed first image, which can enhance the light and shadow effect of the finally fused second image and make the second image more realistic and natural.
[0218] In some embodiments of the present application, the image fusion method provided by the embodiments of the present application may further include the following steps 3014 and 3015.
[0219] Step 3014: The electronic device deletes the image of the shadow area of the object in the first image through the image fusion model.
[0220] Step 3015: The electronic device fills the background pixels in the shadow area based on the background image features of the first image through the image fusion model.
[0221] Exemplarily, as Figure 13 shown, the electronic device deletes the shadow area 51 of the object in the first image 11 through the image fusion model. Then, the electronic device fills the background pixels in the shadow area 51 based on the background image features of the first image through the image fusion model.
[0222] In some embodiments of the present application, the above first image information includes the depth of field information of each object in the processed first image, and the above second image information includes the position information of the object image after updating the display attribute in the processed first image. Based on this, in step 301 above, "the image fusion model fuses the object image after updating the display attribute with the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attribute to obtain a second image" can be specifically implemented through the following steps 3016 to 3018.
[0223] Step 3016: The electronic device determines the depth of field information of the object in the object image after updating the display attribute in the processed first image based on the position information of the object image after updating the display attribute in the processed first image through the image fusion model.
[0224] In some embodiments of the present application, the image fusion model determines the original object at the position indicated by the position information in the processed first image based on the position information of the object image after updating the display attribute in the processed first image, and determines the depth of field information of the original object in the processed first image as the depth of field information of the object in the object image after updating the display attribute in the processed first image.
[0225] Exemplarily, assume that the processed first image is a landscape photo, and the landscape photo includes foreground grass, middle-ground path, and background mountains. If the object image after updating the display attribute is on the path in the processed first image, the depth of field information of the path in the landscape photo can be determined as the depth of field information of the object in the object image in the landscape photo.
[0226] Step 3017: The electronic device determines the occlusion relationship between the object in the object image after updating the display attribute and each object in the processed first image based on the depth of field information of each object in the processed first image and the depth of field information of the object in the object image after updating the display attribute in the processed first image through the image fusion model.
[0227] In some embodiments of the present application, the image fusion model can determine the depth of field information of each object in the processed first image based on the clarity of each object in the processed first image and the distance between the camera and each object when shooting.
[0228] In some embodiments of the present application, the image fusion model may determine the display area of the object image in the processed first image based on the position information of the object image with updated display attributes in the processed first image and the image size of the object image with updated display attributes. Then, the image fusion model sorts all the objects in the display area of the processed first image and the objects in the object image according to the depth-of-field information from smallest to largest based on the depth-of-field information of each object in the display area of the processed first image and the depth-of-field information of the objects in the object image with updated display attributes in the processed first image. According to the sorting result, the objects in the front block the objects in the back.
[0229] Exemplarily, assume that there are many flowers and plants in the foreground of the processed first image and many trees in the background, and the object image is a portrait. The image fusion model determines the depth-of-field information of the portrait in the processed first image based on the position of the portrait in the processed first image, and then determines that the portrait is between the foreground and the background based on the depth-of-field information, that is, in the display scene, the distances from the camera from near to far are "flowers and plants", "portrait", "trees" in sequence. Then the occlusion relationship among the flowers and plants, the trees and the person is that the flowers and plants will occlude the portrait to a certain extent, and the portrait will occlude the trees to a certain extent.
[0230] Step 3018: The electronic device performs image fusion on the processed first image and the object image with updated display attributes through the image fusion model according to the occlusion relationship between the objects in the object image with updated display attributes and each object in the processed first image, to obtain a second image.
[0231] Among all the objects at the same image position in the processed first image, the object with a smaller depth of field occludes the object with a larger depth of field.
[0232] Exemplarily, Figure 16 is a schematic diagram of displaying a first image on an album interface provided by some embodiments of the present application. The album interface a1 displays a first image 11, and the object in the first image 11 is a person. As Figure 17 shown, the electronic device displays the portrait 13 and the landscape photo 12 after moving to the right on the image fusion editing interface a2. Then, after the user clicks the fusion control 31, the electronic device inputs the portrait 13 and the landscape photo 12 into the image fusion model. The image fusion model determines the occlusion relationship among the flowers and plants, the trees and the person according to the depth-of-field information of the flowers and plants, the depth-of-field information of the trees, and the depth-of-field information of the person in the landscape photo, and combines this occlusion relationship to perform image fusion on the portrait and the landscape photo to obtain a second image. Figure 18It is a schematic diagram of a second image displayed on an image fusion interface provided by some embodiments of the present application. The second image 40 is an image obtained by fusing a portrait and a landscape photo. The second image 40 includes flowers, plants, trees and a portrait, and the flowers and plants partially obscure the portrait, and the portrait partially obscures the trees.
[0233] In this way, based on the original picture of the processed first image, the image fusion model can simulate the occlusion relationship between the object in the object image and the object in the processed first image in the current picture, imitate the real depth-of-field effect, and construct a real sense of spatial hierarchy, making the finally fused second image more natural and harmonious.
[0234] In some embodiments of the present application, the above first image information includes background object features. Based on this, in step 301 above, "the image fusion model fuses the object image with the updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with the updated display attributes to obtain a second image" can be specifically implemented through the following step 3019.
[0235] Step 3019: The electronic device generates at least one background object image corresponding to the background object features through the image fusion model based on the background object features, and adds the at least one background object image to the object image with the updated display attributes.
[0236] In some embodiments of the present application, the above background object features can be used to represent the background object in the processed first image, and the background object can include objects such as snowflakes, raindrops, fallen leaves, fallen flowers, catkins, pieces of paper, and water splashes that float in the image on a large scale.
[0237] In some embodiments of the present application, the image fusion model can first identify whether the processed first image includes a background object. If so, based on the background object features of the background object learned during training, it generates at least one background object image corresponding to the background object features, and adds the at least one background object image at any position of the object image with the updated display attributes.
[0238] Exemplarily, Figure 19 It is a schematic diagram of a first image displayed on an album interface provided by some embodiments of the present application. The album interface a1 displays a first image 11, and the object in the first image 11 is a portrait. As Figure 20As shown, the electronic device displays the portrait 13 after moving to the right and the image 12 of falling leaves on the image fusion editing interface a2. Then, after the user clicks the fusion control 31, the electronic device inputs the portrait and the image of falling leaves into the image fusion model. The image fusion model recognizes that the image of falling leaves includes fallen leaves, and based on the environmental feature of "fallen leaves", that is, the background object feature of the fallen leaves, generates multiple images of fallen leaves, adds the multiple images of fallen leaves to the portrait, and then fuses the portrait with the added fallen leaves and the image of falling leaves to obtain the second image. Figure 21 It is a schematic diagram of the second image displayed on the image fusion interface provided by some embodiments of the present application. The second image 40 is an image obtained by fusing the portrait and the image of falling leaves, and there are also fallen leaves on the person in the second image 40.
[0239] Exemplarily, assuming that the first image is a snow scene photo and the object image is the portrait in the snow scene photo, when the image fusion model fuses the object image with the updated display attributes and the processed first image, it can extract the environmental feature of "snowflakes", that is, the background object feature of the snowflakes, and add some snowflakes to the portrait.
[0240] In this way, the image fusion model can simulate the real environmental effect by adding the background image of the background object feature of the processed first image to the object image with the updated display attributes, making the image fusion effect more natural and vivid.
[0241] In some embodiments of the present application, the above second image information includes the object feature of the object in the object image with the updated display attributes. In the above step 301, "the image fusion model fuses the object image with the updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with the updated display attributes to obtain the second image" can be specifically implemented through the following steps 3020 to 3022.
[0242] Step 3020: When the object in the object image with the updated display attributes is incomplete, the electronic device generates an image of the missing part of the object in the object image with the updated display attributes based on the object feature of the object in the object image with the updated display attributes through the image fusion model.
[0243] In some embodiments of the present application, the object feature of the above object may include object type, skin color, clothing type, clothing color, dressing style, posture, movement, etc. Among them, the object type may include men, women, dogs, cats, etc.
[0244] In some embodiments of the present application, the image fusion model may first identify whether the object in the object image after updating the display attribute is complete. If not, then it determines whether the scene of the processed first image needs to complete the object in the object image after updating the display attribute. If so, it generates an image of the missing part of the object in the object image after updating the display attribute based on the object feature of the object in the object image after updating the display attribute and the image of the object corresponding to the object feature learned during training.
[0245] It should be noted that when the object in the object image after updating the display attribute is a living being, the image of the missing part generated by the image fusion model needs to conform to the proportion of the living being. For example, assuming that the object image after updating the display attribute is an upper-body portrait of a person, when the image fusion model generates a lower-body portrait, it needs to conform to the body proportion of a person, and the legs cannot be too long or too short.
[0246] In some embodiments of the present application, taking the object image as an upper-body portrait of a person holding a basketball and the second image as a photo of a basketball court as an example, according to the actual situation, it is more appropriate to use a full-body portrait of the person in the photo of the basketball court. In this way, the image fusion model needs to complete the lower-body portrait to obtain a complete portrait. Assuming that the person in the object image is wearing a white short-sleeved shirt and black pants and holding a basketball in his hand, the image fusion model can generate legs wearing black pants and feet wearing white sneakers for the person in the object image. Further, if the person in the object image is in a running posture while holding the basketball, the legs wearing black pants and feet wearing white sneakers generated by the image fusion model for the person in the object image are also in a running posture.
[0247] Step 3021: The electronic device synthesizes the image of the missing part and the object image after updating the display attribute through the image fusion model to generate a complete image of the object.
[0248] In some embodiments of the present application, taking the upper body of a portrait as the object image and the lower body of the portrait as the image of the missing part, the electronic device synthesizes the lower body of the portrait and the upper body of the portrait through the image fusion model to generate a complete portrait.
[0249] Step 3022: The electronic device fuses the complete image of the object and the processed first image through the image fusion model to obtain the second image.
[0250] Exemplarily, Figure 22 is a schematic diagram of displaying the first image on the album interface provided by some embodiments of the present application. The album interface a1 displays the first image 11, and the object in the first image 11 is a person. The electronic device can extract the person from the first image 11 to obtain an upper-body portrait, that is, the object image. Figure 23It is a schematic diagram of displaying an object image and a processed first image in an image fusion editing interface provided by some embodiments of the present application, wherein the object image is an upper body portrait, and the processed first image is a landscape photo with the portrait removed. Then, after the user clicks the fusion control 31, the electronic device inputs the upper body portrait moved to the upper right and the landscape photo with the portrait removed into the image fusion model, and the image fusion model generates a lower body portrait based on the upper body portrait, and synthesizes the upper body portrait and the lower body portrait to obtain a complete portrait, and fuses the complete portrait with the landscape photo with the portrait removed to obtain a second image. Figure 24 4 is a schematic diagram of a second image displayed on an image fusion interface provided by some embodiments of the present application. The second image 40 is an image obtained by fusion of an upper body portrait and a landscape photo without the portrait, and the second image 40 includes a complete portrait, in which the person is standing with one hand on his waist.
[0251] In this way, the image fusion model can complete the incomplete object image after updating the display attributes according to the object features of the object in the object image after updating the display attributes, and when completing the object image after updating the display attributes, ensure that the complete object image after updating the display attributes conforms to the object features of the object in the object image after updating the display attributes, so that the completed complete object image after updating the display attributes is coordinated and conforms to the laws of nature. In addition, through the method of the embodiment of the present application, even if the object image after updating the display attributes cut out from the first image is incomplete, the object image after updating the display attributes can be completed in the process of fusing the object image after updating the display attributes with the processed first image, so as to obtain a second image that is more in line with the actual situation.
[0252] In some embodiments of the present application, the first image information includes background image features of the background area of the first image after processing. In the above step 301, "the image fusion model fuses the object image after updating the display attributes with the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes to obtain the second image" can be specifically carried out through the following steps 3023 and 3025.
[0253] Step 3023: The electronic device generates a background area image of the object area in the processed first image based on the above-mentioned background image features through an image fusion model.
[0254] Step 3024: The electronic device synthesizes the background area image and the processed first image through an image fusion model to obtain a third image.
[0255] Step 3025: The electronic device performs image fusion on the object image with updated display attributes and a third image through an image fusion model to obtain a second image.
[0256] Exemplarily, Figure 25 FIG. 5 is a schematic diagram of displaying a first image on an album interface provided by some embodiments of the present application. The album interface a1 displays a first image 11, and the object in the first image 11 is a person. The electronic device can extract the person from the first image 11 to obtain an upper body portrait, that is, the object image. Figure 26 FIG. 7 is a schematic diagram of displaying an object image and a processed first image on an image fusion editing interface provided by some embodiments of the present application. The object image is an upper body portrait, and the processed first image is an image of a roadside. Then, after the user clicks the image fusion control 31, the electronic device inputs the portrait after moving to the right and the roadside image after removing the portrait into the image fusion model. And, based on the background image features, the image fusion model generates a background region image of the object region in the processed first image, and fills the object region of the roadside image after removing the portrait with the background region image to obtain a second image, as shown in FIG. Figure 27 shown. Figure 28 FIG. 11 is a schematic diagram of a second image displayed on an image fusion interface provided by some embodiments of the present application. The second image 40 is an image obtained by performing image fusion on the extracted upper body portrait and the roadside image after removing the portrait. The second image 40 includes an upper body portrait, and the person in the upper body portrait stands in a pose with one hand on the hip.
[0257] It should be noted that the various image fusion processes described in the above method embodiments are exemplified by fusion in a single scene. In actual implementation, the fusion of different scenes can be superimposed to implement the image fusion process. For example, the fusion in a single scene can be the scene described in the above steps 3023 to 3025, or the scene described in the above steps 3011 to 3013, and so on.
[0258] For example, the superimposed fusion of different scenes can be that the generated shadow image is fused together during the image fusion process, and the occlusion relationship between the object in the object image and the object in the processed first image is also combined during the fusion process. In some embodiments of the present application, the image fusion method provided by the embodiments of the present application may further include the following step 401.
[0259] Step 401: During the fusion of the object image with updated display attributes and the processed first image, play a second dynamic effect on the object image.
[0260] Wherein, the above second dynamic effect includes at least one of the following: highlight dynamic effect, flowing light dynamic effect, color dynamic effect, breathing dynamic effect, rotation dynamic effect.
[0261] It should be noted that for the relevant content of the highlight animation effect, the flowing light animation effect, and the breathing animation effect, reference can be made to the relevant description in step 1021 above. To avoid repetition, it will not be elaborated here.
[0262] In some embodiments of the present application, the color animation effect refers to an effect that achieves visual changes by dynamically changing the color attributes (such as hue, saturation, brightness) of an image or video. Specifically, a color mapping table or dynamic adjustment of RGB values can be used, combined with a timeline animation to achieve color gradient or pulse effects.
[0263] In some embodiments of the present application, the rotation animation effect refers to a visual effect in which an element rotates around a center point or an arbitrary axis. Specifically, the CSS transform:rotate() property or a JavaScript animation library can be used, combined with 3D transformations such as rotateX and rotateY to achieve complex rotation effects.
[0264] Exemplarily, for the color animation effect, by contour coloring, that is, filling the contour area with a specific color, or applying a color mapping table, and achieving a color gradient or pulse effect within the contour area to achieve a color gradient effect, and changing the contour color through a timeline animation to form a gradient or flickering effect.
[0265] Exemplarily, for the rotation animation effect, by contour rotation, that is, taking the contour center as the axis and periodically rotating the contour lines. For example, the CSS transform:rotate() property is used to achieve 2D rotation, or a 3D graphics library (such as Three.js) is used to achieve a 3D rotation effect, or an image processing library (such as OpenCV) is used to perform an affine transformation on the contour to simulate rotation.
[0266] In some embodiments of the present application, the electronic device can play a third animation effect on the contour of the object in the object image after updating the display attributes.
[0267] For example, taking the processed first image as a landscape photo after removing the portrait as an example, during the process of fusing the portrait after updating the display attributes and the landscape photo after removing the portrait, the electronic device increases the brightness of the contour lines of the person in the portrait to highlight the contour of the person.
[0268] In some embodiments of the present application, the electronic device can play a second animation effect on the object area of the object image after updating the display attributes.
[0269] For example, taking the processed first image as a landscape photo after removing the portrait as an example, during the process of combining the portrait with the updated display attributes and the landscape photo after removing the portrait, the electronic device can increase the brightness or saturation of the pixel values in the area where the person is located in the portrait, and overlay a layer with a gradient color on the area where the person is located in the portrait.
[0270] In some embodiments of the present application, the electronic device can play a second dynamic effect on the outline of the object in the object image with updated display attributes and on the object area in the object image with updated display attributes.
[0271] For example, taking the processed first image as a landscape photo after removing the portrait as an example, during the process of fusing the portrait with the updated display attributes and the landscape photo after removing the portrait, the electronic device increases the brightness of the contour lines of the person in the portrait with the updated display attributes and the color of the contour lines, so as to highlight the contour of the person, and overlay a semi-transparent gradient layer on the contour to simulate the flow of light. It can also increase the brightness or saturation of the pixel values in the area where the person is located in the portrait, and overlay a layer with a gradient color on the area where the person is located in the portrait to achieve a dynamic effect.
[0272] In some embodiments of the present application, the above-mentioned second dynamic effect may further include a dynamic rotating effect of colored light. The dynamic rotating effect of colored light is a semi-transparent layer with color and in a rotating state added to the object image with updated display attributes.
[0273] For example, taking the processed first image as a landscape photo after removing the portrait as an example, during the process of fusing the portrait with the updated display attributes and the landscape photo after removing the portrait, the electronic device increases the brightness or saturation of the pixel values in the portrait with the updated display attributes, increases the brightness of the contour lines of the person in the portrait with the updated display attributes, and overlays a semi-transparent gradient layer on the contour to simulate the flow of light. It can also periodically magnify or shrink the contour lines and adjust the transparency of the contour lines to enhance the breathing effect. Moreover, a semi-transparent layer with color and in a rotating state can be overlaid on the portrait with the updated display attributes to achieve the effect of dynamic rotation of colored light.
[0274] In this way, since the process of fusing the object image with the updated display attributes and the processed first image to obtain the second image takes a certain amount of time, the electronic device plays the second dynamic effect around the subject of the cut-out image during the image fusion process, and connects the technological dynamic effects of ripples and halos when the algorithm is completed according to the algorithm process. In this way, it can not only relieve the user's waiting anxiety during the generation of the second image by the electronic device, but also increase the sense of technology of the image fusion process.
[0275] In some embodiments of the present application, "displaying the second image" in step 104 can be specifically implemented through the following step 501 and step 502.
[0276] Step 501: The electronic device plays a third dynamic effect on the object image after updating the display attributes and the processed first image.
[0277] In some embodiments of the present application, the above-mentioned third dynamic effect includes at least one of the following: dynamic blur effect, image shrinkage effect, color light dynamic rotation effect, color light overflow effect, connection ripple effect, connection halo effect.
[0278] In some embodiments of the present application, the above-mentioned dynamic blur effect can be a layer with a blur effect superimposed on the picture. The blur effect of this layer is constantly changing, and the blur effects at different positions in this layer can be different. For example, the blur effect of the layer with the blur effect gradually weakens from the middle to the outside.
[0279] In some embodiments of the present application, the above-mentioned image shrinkage effect is to shrink the object image after updating the display attributes and the processed first image towards the center of the screen of the electronic device.
[0280] In some embodiments of the present application, the above-mentioned color light dynamic rotation effect is a semi-transparent layer with color and in a rotating state added to the object image after updating the display attributes and the processed first image.
[0281] In some embodiments of the present application, the above-mentioned color light overflow effect is that the color light diffuses from the center of the overall picture of the object image after updating the display attributes and the processed first image displayed on the electronic device until it overflows the overall picture, simulating the scattering phenomenon of the light source.
[0282] In some embodiments of the present application, the above-mentioned connection ripple effect is a dynamic effect that simulates the diffusion of water waves with concentric circles or wavy lines as the base. And this connection ripple effect can use gradient transparency or monochromatic highlights to create a sense of hierarchy, and superimpose weak highlights or shadows to increase the sense of three-dimensionality.
[0283] Exemplarily, the movement mode of this connection ripple effect can be to diffuse from the center point, and the speed can be linear or accelerating, such as the buffering effect of "slow → fast → slow". The movement rhythm of the ripple is that a single ripple usually lasts for 0.5 - 1.5 seconds, and it can be looped or disappear after being triggered.
[0284] In some embodiments of the present application, the above-mentioned connection halo effect is a dynamic effect that radiates blurred light spots outward with a luminous core as the center and fades gradually at the edge. The color of this connection halo effect can be warm or cold, forming a contrast with the colors of the object image after updating the display attributes and the processed first image. And this connection halo effect is superimposed with a soft light effect, which can simulate lens glare or light scattering.
[0285] Exemplarily, the movement mode of the connecting halo dynamic effect is to slowly spread outward from the center or rotate around the main body. The rhythm of the halo is that a single halo lasts for 1-3 seconds, and it can be looped or synchronized with the main body's actions.
[0286] For example, taking the above scenario 1 as an example, during the process of fusing the portrait and the landscape photo, the electronic device can play a dynamic blur dynamic effect on the overall picture of the portrait and the landscape photo, and during the playback of the dynamic blur dynamic effect, shrink the portrait and the landscape photo towards the center, and then play a color light overflow dynamic effect on the overall picture of the portrait and the landscape photo. When the color light covers the entire screen, start playing the connecting ripple dynamic effect and the connecting halo dynamic effect.
[0287] Step 502: During the playback of the above third dynamic effect, in the case where the object image after controlling the updated display attribute and the processed first image disappear synchronously with the playback of the third dynamic effect, control the second image to be displayed synchronously with the playback of the third dynamic effect.
[0288] Exemplarily, taking the above scenario 2 as an example, assuming that the group photo includes portrait 1 on the left and portrait 2 on the right, and the distance between portrait 1 and portrait 2 is relatively far, the electronic device can extract portrait 2 from the group photo and move portrait 2 towards the direction close to portrait 1. Then, during the process of fusing the moved portrait 2 with the group photo from which portrait 2 has been removed, the electronic device can play a dynamic blur dynamic effect on the overall picture of the moved portrait 2 and the group photo from which portrait 2 has been removed, and during the playback of the dynamic blur dynamic effect, shrink the moved portrait 2 and the group photo from which portrait 2 has been removed towards the center, and then play a color light overflow dynamic effect on the overall picture of the moved portrait 2 and the group photo from which portrait 2 has been removed. When the color light covers the entire screen, start playing the connecting ripple dynamic effect and the connecting halo dynamic effect. Then, during the playback of the connecting ripple dynamic effect, as the connecting ripple spreads, the electronic device controls the moved portrait 2 and the group photo from which portrait 2 has been removed to disappear, and controls the second image to be displayed.
[0289] In this way, after the image fusion is completed, adding a display dynamic effect to the display of the second image can enrich the display effect of the second image and improve the user experience.
[0290] In some embodiments of the present application, the above step 501 can be specifically implemented through the following step 501a.
[0291] Step 501a: The electronic device sequentially plays a dynamic blur dynamic effect, an image shrinkage dynamic effect, a color light dynamic rotation dynamic effect, a color light overflow dynamic effect, a connecting ripple dynamic effect, and a connecting halo dynamic effect on the object image after updating the display attribute and the processed first image.
[0292] Exemplarily, on the object image after updating the display attributes and the processed first image, the electronic device first plays a dynamic blur effect, then plays an image shrinkage effect, and plays a dynamic color light rotation effect during the playback of the image shrinkage effect. Then, during the playback of the dynamic color light rotation effect, it plays a color light overflow effect, that is, the color light overflows outward until it covers the entire screen. Then, on the object image after updating the display attributes and the processed first image, it plays a connecting ripple effect and a connecting halo effect. Then, during the playback of the connecting ripple effect, as the connecting ripple spreads, the electronic device controls the object image after updating the display attributes and the processed first image to disappear, and controls the second image to be displayed.
[0293] In some embodiments of the present application, the above step 501 can be specifically implemented through the following steps 5011 to 10411.
[0294] Step 5011: The electronic device plays a dynamic blur effect on the object image after updating the display attributes and the processed first image.
[0295] Step 5012: The electronic device shrinks the object image after updating the display attributes and the processed first image with the object area of the first image as the center, and plays a color light overflow effect on the object image after updating the display attributes and the processed first image.
[0296] Step 5013: When the color light overflow effect completely covers the object image after updating the display attributes and the processed first image, the electronic device stops playing the dynamic blur effect, and plays a connecting ripple effect and a connecting halo effect on the object image after updating the display attributes and the processed first image. The above connecting halo is of the first color.
[0297] Step 5014: During the playback of the connecting ripple effect and the connecting halo effect, the electronic device controls the connecting ripple and the connecting halo to spread, and controls the connecting halo to change from the first color to the second color.
[0298] Step 5015: During the process of the electronic device controlling the spread of the connecting ripple, when the object image after updating the display attributes and the processed first image disappear synchronously with the spread of the connecting ripple, the electronic device controls the second image to be displayed synchronously with the spread of the connecting ripple.
[0299] Exemplarily, taking the first image as a group photo and the object image as portrait 1 in the group photo as an example,
[0300] Exemplarily, taking the above-mentioned scenario 2 as an example, assume that the group photo includes Portrait 1 on the left and Portrait 2 on the right, and Portrait 1 and Portrait 2 are far apart. The electronic device can extract Portrait 2 from the group photo, move Portrait 2 towards Portrait 1, and then, when fusing the moved Portrait 2 with the group photo from which Portrait 2 has been extracted to obtain the second image, the electronic device can add an entrance animation effect for the second image, that is, the third animation effect. The following is a description of the entrance animation effect for the second image: 1) The electronic device adds a motion blur effect to the overall picture of the moved Portrait 2 and the group photo from which Portrait 2 has been extracted; 2) The electronic device shrinks the overall picture centered on the area where Portrait 2 originally was in the group photo from which Portrait 2 has been extracted, and plays a color light overflow animation effect on the overall picture. The color light brightens and overflows until it covers the entire picture; 3) When the color light covers the entire picture, the motion blur effect on the overall picture disappears. The electronic device plays a connecting ripple effect and a connecting halo effect on the overall picture. The connecting halo is white; 4) The electronic device controls the connecting ripple and the connecting halo to spread simultaneously, and the connecting halo changes from white to color; 5) During the process of playing the connecting ripple, the moved Portrait 2 and the group photo from which Portrait 2 has been extracted in the overall picture disappear synchronously with the spread of the connecting ripple, and the second image appears synchronously with the spread of the connecting ripple. Thus, the entrance animation effect for the second image is completed.
[0301] It should be noted that the embodiments of the present application illustrate the image fusion method by taking the adjustment of one object in one image as an example. Based on the image fusion method provided by the embodiments of the present application, the electronic device can adjust multiple objects in one image. For example, multiple object images can be selected and circled for in-image fusion through a selection and long-press operation. It is also possible to add prompt description words during the process of image fusion through AIGC, such as "make the weather a little clearer", etc., so that the effect of image fusion can be closer to the actual needs of users. Users can also optimize and adjust the effect of image fusion directionally through the description words.
[0302] It should be noted that each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed independently, or any two or more of them can be combined and executed. It can be specifically determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0303] For the image fusion method provided by the embodiments of the present application, the execution subject can be an image fusion device. In the embodiments of the present application, taking the image fusion device executing the image fusion method as an example, the image fusion device provided by the embodiments of the present application is described.
[0304] Figure 29FIG. 0 is a schematic structural diagram of an image fusion device provided by an embodiment of the present application. The image fusion device 800 includes: a receiving module 801 and a display module 802. The receiving module 801 is configured to receive a selection input for an object area in a first image on an album interface. The display module 802 is configured to display an object image in response to the selection input received by the receiving module 801. The object image is obtained by cropping the object area in the first image. The receiving module 801 is further configured to receive an adjustment input. The display module 802 is further configured to update the display attribute of the object image and display a second image in response to the adjustment input received by the receiving module 801. The second image is obtained by performing image fusion on the object image with updated display attributes and the processed first image. The processing is to crop the image of the object area in the first image. Wherein, the display attribute includes at least one of the following: display position, display size, display direction, brightness, and transparency.
[0305] In some embodiments of the present application, the selection input includes a first sub-input and a second sub-input. The display module 802 is specifically configured to: in response to the first sub-input for the object area, play a first dynamic effect on the contour of the object in the object area; display an image fusion control when the first sub-input ends; and display an image fusion editing interface in response to the second sub-input for the image fusion control. The image fusion editing interface includes an object image and a first image. Wherein, the first dynamic effect includes at least one of the following: highlight marking, flowing light dynamic effect, and breathing dynamic effect.
[0306] In some embodiments of the present application, the receiving module 801 is specifically configured to receive an adjustment input for the object image in the image fusion editing interface. The display module 802 is specifically configured to update the display attribute of the object image in the image fusion interface in response to the adjustment input received by the receiving module 801.
[0307] In some embodiments of the present application, the display module 802 is specifically configured to display an editing adjustment control on the object image in the image fusion editing interface in response to the second sub-input. The receiving module 801 is specifically configured to receive an adjustment input for the editing adjustment control.
[0308] In some embodiments of the present application, the display module 802 is specifically configured to: display an image fusion editing interface and a nine-grid reference line in response to the second sub-input. The nine-grid reference line is used to assist the user in adjusting the display position of the object image.
[0309] In some embodiments of the present application, the above-mentioned image fusion editing interface further includes a fusion control and a first cancellation control; the above-mentioned display module 802 is further configured to: during the process of fusing the object image after updating the display attributes with the processed first image, keep the fusion control and the first cancellation control in a state of being prohibited from editing, and display a second prompt message and a second cancellation control, where the second prompt message is used to prompt the image fusion progress of the object image after updating the display attributes and the processed first image; in the case where the image fusion progress has not reached 100% and a third input to the second cancellation control is received, cancel the image fusion of the object image after updating the display attributes and the processed first image, hide the second prompt message and the second cancellation control, and update the image fusion control and the first cancellation control to an editable state.
[0310] In some embodiments of the present application, the above-mentioned image fusion device 800 further includes: a processing module;
[0311] The above-mentioned processing module is configured to input the object image after updating the display attributes and the processed first image into an image fusion model. The image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image.
[0312] In some embodiments of the present application, the above-mentioned second image information includes object contour feature information and position information; the above-mentioned object contour feature information is the contour feature information of the object in the object image after updating the display attributes; the above-mentioned position information is the position information of the object image after updating the display attributes in the processed first image; the above-mentioned first image information includes illumination information; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0313] The image fusion model adjusts the brightness of the object image after updating the display attributes based on the above-mentioned illumination information;
[0314] The image fusion model generates a shadow image of the object in the object image after updating the display attributes based on the above-mentioned illumination information, the above-mentioned object contour feature information, and the above-mentioned position information, and determines a third position, where the third position is the position to be displayed of the shadow image in the processed first image; wherein, the above-mentioned shadow image is an image of the shadow generated by the object under the illumination of the light source in the processed first image;
[0315] The image fusion model adds the above-mentioned shadow image at the above-mentioned third position.
[0316] In some embodiments of the present application, the image fusion model deletes the image of the shadow area of the above object in the first image, and fills the background pixels in the above shadow area based on the background image features of the above first image.
[0317] In some embodiments of the present application, the above first image information includes the depth of field information of each object in the processed first image, and the above second image information includes the position information of the object image after updating the display attributes in the processed first image; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0318] The image fusion model determines the depth of field information of the object in the object image after updating the display attributes in the processed first image based on the position information of the object image after updating the display attributes in the processed first image.
[0319] The image fusion model determines the occlusion relationship between the object in the object image after updating the display attributes and each object in the processed first image based on the depth of field information of each object in the processed first image and the depth of field information of the object in the object image after updating the display attributes in the processed first image.
[0320] The image fusion model performs image fusion on the processed first image and the object image after updating the display attributes according to the occlusion relationship between the object in the object image after updating the display attributes and each object in the processed first image, to obtain a second image;
[0321] Wherein, among all the objects located at the same image position in the processed first image, the object with a smaller depth of field occludes the object with a larger depth of field.
[0322] In some embodiments of the present application, the above first image information includes background object features; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0323] The image fusion model generates at least one background object image corresponding to the above background object features based on the above background object features, and adds the above at least one background object image to the object image after updating the display attributes.
[0324] In some embodiments of the present application, the above-mentioned second image information includes the object features of the object in the object image after updating the display attributes; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes to obtain a second image, including:
[0325] When the object in the object image after updating the display attributes is incomplete, the image fusion model generates an image of the missing part of the object in the object image after updating the display attributes based on the object features of the object in the object image after updating the display attributes;
[0326] The image fusion model performs image synthesis on the image of the missing part and the object image after updating the display attributes to generate a complete image of the object;
[0327] The image fusion model performs image fusion on the complete image of the object and the processed first image to obtain a second image.
[0328] In some embodiments of the present application, the above-mentioned first image information includes the background image features of the background region of the processed first image; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes to obtain a second image, including:
[0329] The image fusion model generates a background region image of the object region in the processed first image based on the above-mentioned background image features;
[0330] The image fusion model performs image synthesis on the background region image and the processed first image to obtain a third image;
[0331] The image fusion model performs image fusion on the object image after updating the display attributes and the third image to obtain a second image.
[0332] In some embodiments of the present application, the above-mentioned display module 802 is further configured to: during the fusion of the object image with updated display attributes and the processed first image, play a second dynamic effect on the object image; wherein, the above-mentioned second dynamic effect includes at least one of the following: highlight dynamic effect, flowing light dynamic effect, color dynamic effect, breathing dynamic effect, rotation dynamic effect.
[0333] In some embodiments of the present application, the above display module 802 is specifically configured to: play a third dynamic effect on the object image after updating the display attributes and the processed first image; during the process of playing the above third dynamic effect, in the case where the object image after updating the display attributes and the processed first image disappear synchronously with the playing of the third dynamic effect, control the second image to be displayed synchronously with the playing of the third dynamic effect.
[0334] In some embodiments of the present application, the above third dynamic effect includes at least one of the following: dynamic blur effect, image shrinkage effect, colored light dynamic rotation effect, colored light overflow effect, connection ripple effect, connection halo effect.
[0335] In some embodiments of the present application, the above display module 802 is specifically configured to: sequentially play a dynamic blur effect, an image shrinkage effect, a colored light dynamic rotation effect, a colored light overflow effect, a connection ripple effect, and a connection halo effect on the object image after updating the display attributes and the processed first image.
[0336] In some embodiments of the present application, the above display module 802 is specifically configured to:
[0337] Play a dynamic blur effect on the object image after updating the display attributes and the processed first image;
[0338] Centering on the object area of the first image, shrink the object image after updating the display attributes and the processed first image, and play a colored light overflow effect on the above object image after updating the display attributes and the processed first image;
[0339] In the case where the above colored light overflow effect completely covers the object image after updating the display attributes and the processed first image, stop playing the above dynamic blur effect, and play a connection ripple effect and a connection halo effect on the object image after updating the display attributes and the processed first image, and the above connection halo is the first color;
[0340] During the process of playing the above connection ripple effect and connection halo effect, control the connection ripple and connection halo to spread, and control the connection halo to change from the first color to the second color;
[0341] During the process of controlling the spread of the above connection ripple, in the case where the object image after updating the display attributes and the processed first image disappear synchronously with the spread of the above connection ripple, control the second image to be displayed synchronously with the spread of the connection ripple.
[0342] The image fusion device provided by the embodiment of the present application can directly extract the image of the object area in the first image in the album interface after the selection input of the object area in the first image, so as to obtain the object image in the first image. After adjusting the display attributes of the object image, the updated object image can be directly fused with the first image obtained after the matte extraction process. The whole process does not require the user to manually perform cumbersome image editing operations, and can realize fast image fusion. In this way, not only the time of image fusion is shortened, but also the efficiency of image fusion is improved.
[0343] The image fusion device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device, an augmented reality / virtual reality device, a robot, a wearable device, a super mobile personal computer, a netbook or a personal digital assistant, etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc. The embodiment of the present application does not make specific limitations.
[0344] The image fusion device in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems. The embodiment of the present application does not make specific limitations.
[0345] The image fusion device provided by the embodiment of the present application can implement each process implemented by each embodiment of the above image fusion method. To avoid repetition, it will not be elaborated here.
[0346] Optionally, as Figure 30 shown, the embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902. A program or instruction that can run on the processor 901 is stored on the memory 902. When the program or instruction is executed by the processor 901, it implements each step of the embodiment of the above image fusion method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0347] It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0348] Figure 31 Schematic diagram of the hardware structure of an electronic device for implementing the embodiment of the present application.
[0349] The electronic device 1000 includes, but is not limited to, components such as a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
[0350] Those skilled in the art can understand that the electronic device 1000 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 1010 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 31 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0351] Among them, the above-mentioned user input unit 1007 is used to receive a selection input for an object area in a first image on an album interface; the above-mentioned display unit 1006 is used to display an object image in response to the selection input received by the user input unit 1007. The object image is obtained by cropping the object area in the first image; the above-mentioned user input unit 1007 is further used to receive an adjustment input; the above-mentioned display unit 1006 is further used to update the display attributes of the object image and display a second image in response to the adjustment input received by the user input unit 1007; the second image is obtained by fusing the object image with the processed first image after updating the display attributes; the processing is to crop the image of the object area in the first image; among them, the above-mentioned display attributes include at least one of the following: display position, display size, display direction, brightness, and transparency.
[0352] In some embodiments of the present application, the above-mentioned selection input includes a first sub-input and a second sub-input; the display unit 1006 is specifically used to: in response to the first sub-input for the above-mentioned object area, play a first dynamic effect on the contour of the object in the object area; when the first sub-input ends, display an image fusion control; in response to the second sub-input for the image fusion control, display an image fusion editing interface, and the image fusion editing interface includes an object image and a first image; among them, the above-mentioned first dynamic effect includes at least one of the following: highlighter marking, flowing light dynamic effect, and breathing dynamic effect.
[0353] In some embodiments of the present application, the above-mentioned user input unit 1007 is specifically configured to receive adjustment inputs for the object image in the image fusion editing interface; the above-mentioned display unit 1006 is specifically configured to update the display attributes of the object image in the image fusion interface in response to the adjustment inputs received by the user input unit 1007.
[0354] In some embodiments of the present application, the above-mentioned display unit 1006 is specifically configured to, in response to a second sub-input, display an editing adjustment control on the object image in the image fusion editing interface; the above-mentioned user input unit 1007 is specifically configured to receive adjustment inputs for the editing adjustment control.
[0355] In some embodiments of the present application, the above-mentioned display unit 1006 is specifically configured to: in response to a second sub-input, display the image fusion editing interface and a nine-grid reference line, and the nine-grid reference line is used to assist the user in adjusting the display position of the object image.
[0356] In some embodiments of the present application, the above-mentioned image fusion editing interface further includes a fusion control and a first cancellation control; the above-mentioned display unit 1006 is further configured to: during the process of fusing the object image with the updated display attributes and the processed first image, keep the fusion control and the first cancellation control in a state of being prohibited from editing, and display a second prompt message and a second cancellation control. The second prompt message is used to prompt the image fusion progress of the object image with the updated display attributes and the processed first image; in the case where the image fusion progress does not reach 100% and a third input for the second cancellation control is received, cancel the image fusion of the object image with the updated display attributes and the processed first image, hide the second prompt message and the second cancellation control, and update the image fusion control and the first cancellation control to an allowed editing state.
[0357] In some embodiments of the present application, the above-mentioned processor 1010 is configured to input the object image with the updated display attributes and the processed first image into an image fusion model. The image fusion model performs image fusion on the object image with the updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with the updated display attributes to obtain a second image.
[0358] In some embodiments of the present application, the above-mentioned second image information includes object contour feature information and position information; the above-mentioned object contour feature information is the contour feature information of the object in the object image after updating the display attributes; the above-mentioned position information is the position information of the object image after updating the display attributes in the processed first image; the above-mentioned first image information includes illumination information; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes to obtain a second image, including:
[0359] The image fusion model adjusts the brightness of the object image after updating the display attributes based on the above-mentioned illumination information;
[0360] The image fusion model generates a shadow image of the object in the object image after updating the display attributes based on the above-mentioned illumination information, the above-mentioned object contour feature information, and the above-mentioned position information, and determines a third position, where the third position is the position to be displayed of the shadow image in the processed first image; wherein, the above-mentioned shadow image is an image of the shadow generated by the object under the illumination of the light source in the processed first image;
[0361] The image fusion model adds the above-mentioned shadow image at the above-mentioned third position.
[0362] In some embodiments of the present application, the image fusion model deletes the image of the shadow area of the above-mentioned object in the first image, and fills the background pixels in the above-mentioned shadow area based on the background image features of the above-mentioned first image.
[0363] In some embodiments of the present application, the above-mentioned first image information includes the depth-of-field information of each object in the processed first image, and the above-mentioned second image information includes the position information of the above-mentioned object image after updating the display attributes in the processed first image; the image fusion model performs image fusion on the object image after updating the display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes to obtain a second image, including:
[0364] The image fusion model determines the depth-of-field information of the object in the object image after updating the display attributes in the processed first image based on the position information of the object image after updating the display attributes in the processed first image;
[0365] The image fusion model determines the occlusion relationship between the object in the object image after updating the display attributes and each object in the processed first image based on the depth-of-field information of each object in the processed first image and the depth-of-field information of the object in the object image after updating the display attributes in the processed first image;
[0366] The image fusion model fuses the processed first image with the object image after updating the display attributes according to the occlusion relationship between the objects in the object image after updating the display attributes and each object in the processed first image, to obtain a second image;
[0367] Among all the objects at the same image position in the processed first image, the object with a smaller depth of field occludes the object with a larger depth of field.
[0368] In some embodiments of the present application, the above first image information includes background object features; the image fusion model fuses the object image after updating the display attributes with the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0369] The image fusion model generates at least one background object image corresponding to the above background object features based on the above background object features, and adds the at least one background object image to the above object image after updating the display attributes.
[0370] In some embodiments of the present application, the above second image information includes object features of the objects in the object image after updating the display attributes; the image fusion model fuses the object image after updating the display attributes with the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0371] When the objects in the object image after updating the display attributes are incomplete, the image fusion model generates an image of the missing part of the objects in the object image after updating the display attributes based on the object features of the objects in the object image after updating the display attributes;
[0372] The image fusion model performs image synthesis on the image of the missing part and the object image after updating the display attributes to generate a complete image of the above objects;
[0373] The image fusion model fuses the complete image of the above objects with the processed first image to obtain a second image.
[0374] In some embodiments of the present application, the above first image information includes background image features of the background area of the processed first image; the image fusion model fuses the object image after updating the display attributes with the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image after updating the display attributes, to obtain a second image, including:
[0375] Based on the above background image features, the image fusion model generates a background region image of the object region in the processed first image;
[0376] The image fusion model synthesizes the above background region image and the processed first image to obtain a third image;
[0377] The image fusion model fuses the object image with updated display attributes and the third image to obtain a second image.
[0378] In some embodiments of the present application, the above display unit 1006 is further configured to: during the fusion of the object image with updated display attributes and the processed first image, play a second dynamic effect on the object image; wherein, the above second dynamic effect includes at least one of the following: highlight dynamic effect, flowing light dynamic effect, color dynamic effect, breathing dynamic effect, rotation dynamic effect.
[0379] In some embodiments of the present application, the above display unit 1006 is specifically configured to: play a third dynamic effect on the object image with updated display attributes and the processed first image; during the playing of the above third dynamic effect, when controlling the object image with updated display attributes and the processed first image to disappear synchronously with the playing of the third dynamic effect, control the second image to be displayed synchronously with the playing of the third dynamic effect.
[0380] In some embodiments of the present application, the above third dynamic effect includes at least one of the following: dynamic blur dynamic effect, image shrinkage dynamic effect, color light dynamic rotation dynamic effect, color light overflow dynamic effect, connection ripple dynamic effect, connection halo dynamic effect.
[0381] In some embodiments of the present application, the above display unit 1006 is specifically configured to: sequentially play a dynamic blur dynamic effect, an image shrinkage dynamic effect, a color light dynamic rotation dynamic effect, a color light overflow dynamic effect, a connection ripple dynamic effect, and a connection halo dynamic effect on the object image with updated display attributes and the processed first image.
[0382] In some embodiments of the present application, the above display unit 1006 is specifically configured to:
[0383] Play a dynamic blur dynamic effect on the object image with updated display attributes and the processed first image;
[0384] Centering on the object region of the first image, shrink the object image with updated display attributes and the processed first image, and play a color light overflow dynamic effect on the above object image with updated display attributes and the processed first image;
[0385] In the case where the object image after the above-mentioned color light overflow dynamic effect completely covers and updates the display attribute and the processed first image, stop playing the above-mentioned dynamic blur dynamic effect, and play the connecting ripple dynamic effect and the connecting halo dynamic effect on the object image after updating the display attribute and the processed first image. The above-mentioned connecting halo is of the first color;
[0386] During the process of playing the above-mentioned connecting ripple dynamic effect and the connecting halo dynamic effect, control the diffusion of the connecting ripple and the connecting halo, and control the connecting halo to change from the first color to the second color;
[0387] During the process of controlling the diffusion of the above-mentioned connecting ripple, in the case where the object image after updating the display attribute and the processed first image disappear synchronously with the diffusion of the above-mentioned connecting ripple, control the second image to be displayed synchronously with the diffusion of the connecting ripple.
[0388] The electronic device provided by the embodiment of the present application can directly extract the image of the object area in the first image in the album interface after the selection input of the object area in the first image, so as to obtain the object image in the first image, and directly perform image fusion on the updated object image and the first image obtained after the matte extraction process after adjusting the display attribute of the object image. The entire process does not require the user to manually perform cumbersome image editing operations, and can achieve rapid image fusion. In this way, not only the time for image fusion is shortened, but also the efficiency of image fusion is improved.
[0389] It should be understood that in the embodiment of the present application, the input unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042. The graphics processor 10041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. The other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0390] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), 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), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.
[0391] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 1010 either.
[0392] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned embodiments of the image fusion method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0393] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs.
[0394] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions to implement each process of the above image fusion method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0395] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip.
[0396] The embodiments of the present application provide a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above image fusion method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0397] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0398] Through the description of the above embodiments, those skilled in the art can clearly understand that the above method of the embodiment can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0399] The embodiments of the present application have been described above with reference to the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. An image fusion method, characterized in that, The method includes: Receiving a selection input for an object area in a first image on an album interface; In response to the selection input, displaying an object image, which is obtained by cropping the object area in the first image; Receiving an adjustment input; In response to the adjustment input, updating the display attributes of the object image and displaying a second image; the second image is obtained by image fusion of the object image with the updated display attributes and the processed first image; the processing is to crop the image of the object area in the first image; Wherein, the display attributes include at least one of the following: display position, display size, display orientation, brightness, transparency.
2. The method according to claim 1, wherein The selection input includes a first sub-input and a second sub-input; The displaying of the object image in response to the selection input includes: In response to the first sub-input for the object area, playing a first dynamic effect on the contour of the object in the object area; When the first sub-input ends, displaying an image fusion control; In response to the second sub-input for the image fusion control, displaying an image fusion editing interface, which includes the object image and the first image; Wherein, the first dynamic effect includes at least one of the following: highlighting, flowing light effect, breathing effect.
3. The method according to claim 2, wherein The receiving of the adjustment input includes: Receiving an adjustment input for the object image in the image fusion editing interface; The updating of the display attributes of the object image in response to the adjustment input includes: In response to the adjustment input, updating the display attributes of the object image in the image fusion interface.
4. The method according to claim 3, wherein The displaying of the image fusion editing interface in response to the second sub-input includes: In response to the second sub-input, displaying an editing adjustment control on the object image in the image fusion editing interface; The receiving of the adjustment input for the object image in the image fusion editing interface includes: Receiving an adjustment input for the editing adjustment control.
5. The method according to claim 2, wherein The displaying of the image fusion editing interface in response to the second sub-input includes: In response to the second sub-input, displaying an image fusion editing interface and a nine-grid reference line, which is used to assist the user in adjusting the display position of the object image.
6. The method according to any one of claims 2 to 5, characterized in that The image fusion editing interface further includes a fusion control and a first cancel control; the method further includes: During the fusion of the object image with the updated display attributes and the processed first image, keeping the fusion control and the first cancel control in a disabled editing state, and displaying a second prompt message and a second cancel control, the second prompt message is used to prompt the image fusion progress of the object image with the updated display attributes and the processed first image; When the image fusion progress does not reach 100% and a third input for the second cancel control is received, canceling the image fusion of the object image with the updated display attributes and the processed first image, hiding the second prompt message and the second cancel control, and updating the fusion control and the first cancel control to an enabled editing state.
7. The method according to claim 1, characterized in that, Before displaying the second image, the method further includes: Inputting the object image with updated display attributes and the processed first image into the image fusion model. Based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes, the image fusion model fuses the object image with updated display attributes and the processed first image to obtain a second image.
8. The method according to claim 7, wherein The second image information includes object contour feature information and position information; the object contour feature information is the contour feature information of the object in the object image with updated display attributes; The position information is the position information of the object image with updated display attributes in the processed first image; The first image information includes illumination information; The image fusion model fuses the object image with updated display attributes and the processed first image to obtain the second image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes, including: The image fusion model adjusts the brightness of the object image with updated display attributes based on the illumination information; The image fusion model generates a shadow image of the object in the object image with updated display attributes based on the illumination information, the object contour feature information, and the position information, and determines a third position, where the third position is the position to be displayed of the shadow image in the processed first image; wherein, the shadow image is the image of the shadow generated by the object under the light source in the processed first image; The image fusion model adds the shadow image at the third position.
9. The method according to claim 8, wherein The method further includes: The image fusion model deletes the image of the shadow area of the object in the first image; Based on the background image features of the first image, background pixels are filled in the shadow area.
10. The method according to claim 7, characterized in that, The first image information includes the depth of field information of each object in the processed first image, and the second image information includes the position information of the object image with updated display attributes in the processed first image; The image fusion model fuses the object image with updated display attributes and the processed first image to obtain the second image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes, including: The image fusion model determines the depth of field information of the object in the object image with updated display attributes in the processed first image based on the position information of the object image with updated display attributes in the processed first image; The image fusion model determines the occlusion relationship between the objects in the object image with updated display attributes and each object in the processed first image based on the depth-of-field information of each object in the processed first image and the depth-of-field information of the objects in the object image with updated display attributes in the processed first image; The image fusion model performs image fusion on the processed first image and the object image with updated display attributes according to the occlusion relationship between the objects in the object image with updated display attributes and each object in the processed first image to obtain the second image; Among all the objects located at the same image position in the processed first image, the object with a smaller depth of field occludes the object with a larger depth of field.
11. The method according to claim 7, characterized in that The first image information includes background object features; The image fusion model performs image fusion on the object image with updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes to obtain the second image, including: The image fusion model generates at least one background object image corresponding to the background object features based on the background object features and adds the at least one background object image to the object image with updated display attributes.
12. The method according to claim 7, wherein The second image information includes object features of the objects in the object image with updated display attributes; The image fusion model performs image fusion on the object image with updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes to obtain the second image, including: When the object in the object image with updated display attributes is incomplete, the image fusion model generates an image of the missing part of the object in the object image with updated display attributes based on the object features of the object in the object image with updated display attributes; The image fusion model performs image synthesis on the image of the missing part and the object image with updated display attributes to generate a complete image of the object; The image fusion model performs image fusion on the complete image of the object and the processed first image to obtain the second image.
13. The method according to claim 7, wherein The first image information includes background image features of the background area of the processed first image; The image fusion model performs image fusion on the object image with updated display attributes and the processed first image based on at least one of the first image information of the processed first image and the second image information of the object image with updated display attributes to obtain the second image, including: The image fusion model generates a background area image of the object area in the processed first image based on the background image features; The image fusion model performs image synthesis on the background area image and the processed first image to obtain a third image; The image fusion model fuses the object image with the updated display attributes and the third image to obtain a second image.
14. The method according to claim 1, characterized in that, The method further includes: During the process of fusing the object image with the updated display attributes and the processed first image, a second dynamic effect is played on the object image. Wherein, the second dynamic effect includes at least one of the following: highlight dynamic effect, flowing light dynamic effect, color dynamic effect, breathing dynamic effect, rotation dynamic effect.
15. The method according to claim 1, wherein The displaying of the second image includes: Playing a third dynamic effect on the object image with the updated display attributes and the processed first image. During the process of playing the third dynamic effect, when controlling the object image with the updated display attributes and the processed first image to disappear synchronously with the playing of the third dynamic effect, controlling the second image to be displayed synchronously with the playing of the third dynamic effect.
16. The method according to claim 15, characterized in that, The third dynamic effect includes at least one of the following: dynamic blur dynamic effect, image shrinkage dynamic effect, color light dynamic rotation dynamic effect, color light overflow dynamic effect, connection ripple dynamic effect, connection halo dynamic effect.
17. The method according to claim 16, wherein The playing of the third dynamic effect on the object image with the updated display attributes and the processed first image includes: On the object image with the updated display attributes and the processed first image, playing the dynamic blur dynamic effect, the image shrinkage dynamic effect, the color light dynamic rotation dynamic effect, the color light overflow dynamic effect, the connection ripple dynamic effect, and the connection halo dynamic effect in sequence.
18. The method according to claim 15, characterized in that, The playing of the third dynamic effect on the object image with the updated display attributes and the processed first image includes: Playing the dynamic blur dynamic effect on the object image with the updated display attributes and the processed first image. Centering on the object area of the first image, shrinking the object image with the updated display attributes and the processed first image, and playing the color light overflow dynamic effect on the object image with the updated display attributes and the processed first image. When the color light overflow dynamic effect completely covers the object image with the updated display attributes and the processed first image, stop playing the dynamic blur dynamic effect, and play the connection ripple dynamic effect and the connection halo dynamic effect on the object image with the updated display attributes and the processed first image, and the connection halo is of the first color. During the process of playing the connection ripple dynamic effect and the connection halo dynamic effect, controlling the connection ripple and the connection halo to spread, and controlling the connection halo to change from the first color to the second color. During the process of controlling the spread of the connection ripple, when the object image with the updated display attributes and the processed first image disappear synchronously with the spread of the connection ripple, controlling the second image to be displayed synchronously with the spread of the connection ripple.
19. An image fusion device, characterized in that, The device includes: a receiving module and a display module; The receiving module is used to receive a selection input for an object area in a first image of an album interface. The display module is used to display an object image in response to the selection input received by the receiving module, and the object image is obtained by cropping the object area in the first image. The receiving module is further configured to receive an adjustment input; The display module is further configured to, in response to the adjustment input received by the receiving module, update the display attributes of the object image and display a second image; the second image is obtained by performing image fusion on the object image with updated display attributes and the processed first image; the processing is to remove the image of the object area in the first image; Wherein, the display attributes include at least one of the following: display position, display size, display direction, brightness, transparency.
20. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the image fusion method according to any one of claims 1 to 18 are implemented.