Image generation method and device, electronic equipment and readable storage medium

CN117115287BActive Publication Date: 2026-11-03VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311079293.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-11-03
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

Electronic devices are less efficient at generating images that meet user needs because the AIGC large model takes a long time to process the captured user images.

Method used

By decomposing the image from an electronic device into a foreground image and a background image, a feature map is generated and transmitted to a second electronic device with greater computing power for processing. The second electronic device generates a new background image and returns the feature map. The electronic devices then synthesize the final image.

Benefits of technology

It reduces the time required to generate background images, improves image generation efficiency, and avoids image leaks, ensuring user privacy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115287B_ABST
    Figure CN117115287B_ABST
Patent Text Reader

Abstract

The application discloses an image generation method and device, electronic equipment and a readable storage medium, and belongs to the technical field of image processing. The image generation method provided by the application comprises the following steps: a first feature map corresponding to a first image is sent to a second electronic device; the first image comprises a foreground image and a first background image; the first feature map is used for the second electronic device to generate a second feature map; the second feature map is received from the second electronic device, and a second background image is generated according to the second feature map; the image content of the second background image is different from that of the first background image; and a second image is generated based on the foreground image and the second background image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to an image generation method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Currently, to prevent the leakage of user privacy, an Artificial Intelligence Generated Content (AIGC) model can be configured in electronic devices. This way, when a user requests a richer user image based on a captured user image, the user does not need to send the captured user image to other devices. Instead, the user can directly trigger the electronic device to input the captured user image into the AIGC model, so that the AIGC model can process the captured user image to generate a richer user image based on the user's requested content, thus allowing the user to obtain the desired user image.

[0003] However, after the electronic device inputs the captured user image into the AIGC large model, the AIGC large model may need a long time to complete the processing of the captured user image in order to generate a user image with richer content as required by the user. Therefore, the process of generating the user image required by the user takes a long time, resulting in low efficiency of the electronic device in generating the user image required by the user. Summary of the Invention

[0004] The purpose of this application is to provide an image generation method, apparatus, electronic device, and readable storage medium that can solve the problem of low efficiency in generating images required by users by electronic devices.

[0005] In a first aspect, embodiments of this application provide an image generation method applied to a first electronic device. The method includes: sending a first feature map corresponding to a first image to a second electronic device; the first image includes a foreground image and a first background image; the first feature map is used by the second electronic device to generate a second feature map; receiving the second feature map from the second electronic device and generating a second background image based on the second feature map; the image content of the second background image and the first background image are different; and generating a second image based on the foreground image and the second background image.

[0006] Secondly, embodiments of this application provide an image generation method applied to a second electronic device, the method comprising:

[0007] The first electronic device receives a first feature map corresponding to a first image; the first image includes a foreground image and a first background image; the first feature map is input into a first model to obtain a second feature map output by the first model; the second feature map is generated by the first model processing the first feature map; the second feature map is sent to the first electronic device; the second feature map is used by the first electronic device to generate a second background image, and a second image is generated based on the foreground image and the second background image; the image content of the second background image is different from that of the first background image.

[0008] Thirdly, embodiments of this application provide an image generation apparatus, which is a first image generation apparatus, comprising: a sending module, a receiving module, and a processing module. The sending module is used to send a first feature map corresponding to a first image to a second image generation apparatus; the first image includes a foreground image and a first background image; the first feature map is used by the second image generation apparatus to generate a second feature map. The receiving module is used to receive the second feature map from the second image generation apparatus. The processing module is used to generate a second background image based on the second feature map received by the receiving module; the second background image has different image content from the first background image; and the second image is generated based on the foreground image and the second background image.

[0009] Fourthly, embodiments of this application provide an image generation apparatus, which is a second image generation apparatus, comprising: a receiving module, a processing module, and a sending module. The receiving module is used to receive a first feature map corresponding to a first image from a first image generation apparatus; the first image includes a foreground image and a first background image. The processing module is used to input the first feature map received by the receiving module into a first model to obtain a second feature map output by the first model; the second feature map is generated by the first model processing the first feature map. The sending module is used to send the second feature map generated by the processing module to the first image generation apparatus; the second feature map is used by the first image generation apparatus to generate a second background image, and based on the foreground image and the second background image, a second image is generated, the content of which is different from that of the first background image.

[0010] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the method described in the first aspect, or to implement the steps of the method described in the second aspect.

[0011] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.

[0012] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method described in the first aspect, or to implement the steps of the method described in the second aspect.

[0013] Eighthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the method described in the first aspect, or to implement the steps of the method described in the second aspect.

[0014] In this embodiment, a first electronic device can send a first feature map corresponding to a first image to a second electronic device. The first image includes a foreground image and a first background image. The first feature map is used by the second electronic device to generate a second feature map, so that the second electronic device can receive the first feature map and input the first feature map into a first model to obtain a second feature map generated by the first model after processing the first feature map. In this way, the second electronic device can send the second feature map to the first electronic device, so that the first electronic device can generate a second background image based on the second feature map. The image content of the second background image is different from that of the first background image, and the second image is generated based on the foreground image and the second background image. Since the first electronic device can send the first feature map to the second electronic device with greater computing power, after the second electronic device inputs the first feature map into the first model, the first model only needs a short time to process the first feature map to generate the second feature map. This allows the first electronic device to quickly generate a second background image with content different from the first background image based on the second feature map, without the first electronic device needing to perform calculations to generate the second background image. Therefore, the time spent generating the second background image can be reduced, allowing the first electronic device to quickly generate the second image required by the user based on the foreground image and the second background image. Furthermore, since the first and second electronic devices transmit the first and second feature maps, rather than the first image and the second background image, during the generation of the second image required by the user, the leakage of the first image or the second background image during the generation of the second image required by the user can be avoided. Thus, the efficiency of the first electronic device in generating the image required by the user can be improved while avoiding the leakage of user privacy. Attached Figure Description

[0015] Figure 1 This is one of the flowcharts illustrating the image generation method provided in the embodiments of this application;

[0016] Figure 2 This is a second schematic flowchart of the image generation method provided in the embodiments of this application;

[0017] Figure 3 This is the third schematic flowchart of the image generation method provided in the embodiments of this application;

[0018] Figure 4 This is the fourth flowchart illustrating the image generation method provided in the embodiments of this application;

[0019] Figure 5 This is a schematic diagram of the structure of the first image generation apparatus provided in the embodiments of this application;

[0020] Figure 6 This is a schematic diagram of the structure of the second image generation apparatus provided in the embodiments of this application;

[0021] Figure 7 This is one of the hardware structure diagrams of the electronic device provided in the embodiments of this application;

[0022] Figure 8 This is a second schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0023] Figure 9 This is a schematic diagram of the hardware structure of the server provided in the embodiments of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first image can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "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" refers to two or more items, and its meaning is similar to that of "at least one."

[0027] The image generation method, apparatus, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0028] The image generation method provided in this application can be executed by a first image generation device and a second image generation device, or a first electronic device and a second electronic device, or a functional module or entity within the first electronic device and the second electronic device. This application uses the execution of the image generation method by a first electronic device and a second electronic device as an example to illustrate the image generation method provided in this application.

[0029] Figure 1 A flowchart of an image generation method provided in an embodiment of this application is shown. Figure 1 As shown, the image generation method provided in this application embodiment may include the following steps 101 to 106.

[0030] Step 101: The first electronic device sends the first feature map corresponding to the first image to the second electronic device.

[0031] In some embodiments of this application, the first electronic device can be a user-used electronic device, such as a mobile phone, computer, or tablet computer. The second electronic device can be any of the following: other user-used electronic devices, servers, etc.

[0032] In some embodiments of this application, the computing power of the second electronic device is greater than that of the first electronic device.

[0033] In some embodiments of this application, the first image may be an image captured by a camera of a first electronic device, or an image received from another device. For example, the first image may be a 4K image captured by a camera of the first electronic device.

[0034] In this embodiment of the application, the first image includes a foreground image and a first background image; the first feature map is used by the second electronic device to generate a second feature map.

[0035] It can be understood that the first image is composed of a foreground image and a first background image.

[0036] In some embodiments of this application, the foreground image may include at least one of the following: a person image and a foreground object image. It should be noted that the "person image" can be understood as the image area where a person is located in the foreground image. The "foreground object image" can be understood as the image area where an object is located in the foreground image, and the object may include at least one of the following: an animal, scenery, etc.

[0037] In some embodiments of this application, the first feature map described above can be a feature map obtained by the first electronic device extracting features from the first image using a second model. The second model can be a convolutional network model.

[0038] The following example illustrates a specific scheme for obtaining the first feature map using a first electronic device.

[0039] In some embodiments of this application, combined with Figure 1 ,like Figure 2 As shown, prior to step 101 above, the image generation method provided in this application embodiment may further include step 201 below.

[0040] Step 201: The first electronic device inputs the first image into the encoder to obtain the first feature map output by the encoder.

[0041] In this embodiment of the application, the first feature map is obtained by the encoder encoding the first image.

[0042] In some embodiments of this application, the encoder described above may specifically be a variational autoencoder (VAE) in a convolutional network model.

[0043] Optionally, the aforementioned VAE can be obtained by training a preset convolutional network model on a first electronic device. It is understood that the VAE in the first electronic device differs from the VAE in other devices; that is, other devices cannot decode the visual image using the VAE.

[0044] In some embodiments of this application, the size of the first feature map is smaller than that of the first image. It is understood that the amount of data required to transmit the first feature map is less than the amount of data required to transmit the first image.

[0045] In this embodiment of the application, the first electronic device can encode the latent space features of the first image, namely the first feature map, through VAE. The first feature map cannot be decoded into a visible image on other devices, thus avoiding the leakage of user privacy.

[0046] Thus, since the first electronic device can encode the first image into a first feature map of a certain size through an encoder, after sending the first feature map to the second electronic device, the first feature map cannot be decoded into a visible image on either the second electronic device or any other device. Therefore, user privacy can be avoided while saving transmission resources, thereby improving the security of the first electronic device while increasing transmission efficiency.

[0047] In some embodiments of this application, the aforementioned second feature map may specifically be a feature map corresponding to another background image. This other background image may be a second background image as described in the following embodiments. The image content of this other background image differs from that of the first background image. The image content may include at least one of the following: image color bars, image style, image scenery, etc. The image style may include at least one of the following: image color, image hue, content layout, etc.

[0048] It is understandable that the other background images have similar image structures to the first background image, and the other background images have richer content.

[0049] In some embodiments of this application, when a user needs to generate a second multimedia file with richer content based on a first multimedia file, the user can trigger a first electronic device to select the first multimedia file, so that the first electronic device can obtain the first feature map corresponding to the first image, and send the first feature map to a second electronic device through a first application.

[0050] Optionally, the first multimedia file can be any of the following: a first image, a first video, and if the first multimedia file is a first video, the first image can be any one frame from the multiple frames of the first video. The first multimedia file can be a multimedia file captured by the camera of the first electronic device, or a multimedia file received from other devices.

[0051] Optionally, the second multimedia file can be any of the following: other images, second video. The other images can be the second images in the following embodiments. In the case that the second multimedia file is a second video, the other images can be a frame image in the multi-frame images of the second video that has the same playback timestamp as the first image.

[0052] Optionally, the first application can be any of the following: a chat application, an image processing application, a camera application, etc.

[0053] In some embodiments of this application, the first electronic device may further send first information to the second electronic device, the first information being used to generate a second feature map with the first feature map. The first information may include at least one of the following: a depth map corresponding to the first image and first text data; exemplarily, the first information includes a depth map corresponding to the first image and first text data. It is understood that the second electronic device can generate the second feature map based on the first information and the first feature map.

[0054] Optionally, the first information is used by the second electronic device to determine the image content of the other background images.

[0055] Optionally, if the first image is an image captured by the first electronic device through a camera, the first electronic device may also acquire the aforementioned depth map using its Time-of-Flight (TOF) sensor when capturing the first image. If the first image is an image received by the first electronic device from another device, the first electronic device may also receive the aforementioned depth map from that other device.

[0056] Optionally, the aforementioned first text data may specifically be text data entered by the user in the first electronic device.

[0057] Step 102: The second electronic device receives the first feature map corresponding to the first image from the first electronic device.

[0058] In some embodiments of this application, the computing power of the second electronic device is greater than that of the first electronic device.

[0059] In this embodiment of the application, the first image includes a foreground image and a first background image.

[0060] Step 103: The second electronic device inputs the first feature map into the first model to obtain the second feature map output by the first model.

[0061] In this embodiment of the application, the second feature map is generated by the first model processing the first feature map.

[0062] It is understandable that since the computing power of the second electronic device is greater than that of the first electronic device, after the second electronic device inputs the first feature map into the first model, the first model can quickly process the first feature map to quickly generate and output the second feature map.

[0063] In some embodiments of this application, the first model described above may specifically be: an Artificial Intelligence Generated Content (AIGC) big model.

[0064] It should be noted that for the explanation of how the AIGC large model processes the first feature map to generate the second feature map, please refer to the specific description in the relevant technology, and the embodiments of this application will not be repeated here.

[0065] In one example, the second electronic device can directly input the first feature map into the first model to obtain the second feature map output by the first model.

[0066] In another example, the second electronic device can first obtain the feature region corresponding to the foreground image in the first feature map in the first image, and obtain the feature region corresponding to the first background image in the first feature map based on the feature region corresponding to the foreground image in the first feature map, and then input the feature region corresponding to the first background image in the first feature map into the first model to obtain the second feature map output by the first model.

[0067] Optionally, the second electronic device may employ a salient object detection (SOD) algorithm to detect the first feature map to determine the feature region corresponding to the foreground image in the first feature map. Alternatively, the second electronic device may receive information from the first electronic device indicating the position of the person image in the first image, and thus the second electronic device may determine the feature region corresponding to the foreground image in the first feature map based on this information.

[0068] It should be noted that for the explanation of the above SOD algorithm, please refer to the specific description in the relevant technology, and the embodiments of this application will not be repeated here.

[0069] In some embodiments of this application, the second electronic device may also receive first information from the first electronic device, thereby allowing the second electronic device to input the first feature map and the first information into the first model to obtain a second feature map output by the first model. The first information may include at least one of the following: a depth map corresponding to the first image and first text data, which is used by the first model to determine the image content of the other background images; exemplarily, the first information includes a depth map corresponding to the first image and first text data.

[0070] Optionally, if the first information does not include the depth map corresponding to the first image, the second electronic device may first use a monocular depth estimation module to detect the first feature map to obtain the depth map corresponding to the first image, and then input the first feature map, the depth map corresponding to the first image, and the first text data into the first model to obtain the second feature map.

[0071] It should be noted that the descriptions of the depth map and the first text data mentioned above can be found in the specific descriptions in the above embodiments, and will not be repeated here.

[0072] Step 104: The second electronic device sends the second feature map to the first electronic device.

[0073] In this embodiment of the application, the second feature map is used by the first electronic device to generate a second background image, and a second image is generated based on the foreground image and the second background image. The image content of the second background image is different from that of the first background image.

[0074] Step 105: The first electronic device receives the second feature map from the second electronic device and generates a second background image based on the second feature map.

[0075] In this embodiment of the application, the image content of the second background image and the first background image are different.

[0076] In some embodiments of this application, the second background image described above may be an image generated by the first electronic device through processing the second feature map using the second model described above.

[0077] The following example illustrates the specific scheme for the first electronic device to generate the second background image.

[0078] In some embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, step 105 above can be implemented through step 105a below.

[0079] Step 105a: The first electronic device receives the second feature map from the second electronic device and inputs the second feature map into the decoder of the first electronic device to obtain the second background image output by the decoder.

[0080] In this embodiment of the application, the second background image is obtained by the decoder decoding the second feature map.

[0081] In some embodiments of this application, the decoder described above may be the VAE described above.

[0082] In some embodiments of this application, the size of the second feature map is smaller than that of the second background image. It is understood that the amount of data required to transmit the second feature map is less than the amount of data required to transmit the second background image.

[0083] Thus, since only the first electronic device can decode the second feature map into a second background image through the decoder, while the second electronic device and other devices cannot decode the second feature map into a visible image, user privacy can be prevented, thereby improving the security of the first electronic device.

[0084] Step 106: The first electronic device generates a second image based on the foreground image and the second background image.

[0085] In some embodiments of this application, the first electronic device may fuse a foreground image and a second background image to generate a second image.

[0086] Optionally, the first electronic device may overlay a foreground image onto the second background image to fuse the foreground image and the second background image.

[0087] In this embodiment of the application, since the people and objects in the foreground image of the first image are often the people and objects that the user needs, that is, the user may not need the people and objects in the foreground image to change, the first electronic device can generate a second image based on the foreground image and the second background image, and the people and objects in the second image are exactly the same as the people and objects in the foreground image of the first image.

[0088] This application provides an image generation method in which a first electronic device can send a first feature map corresponding to a first image to a second electronic device. The first image includes a foreground image and a first background image. The first feature map is used by the second electronic device to generate a second feature map, so that the second electronic device can receive the first feature map and input the first feature map into a first model to obtain a second feature map generated by the first model after processing the first feature map. In this way, the second electronic device can send the second feature map to the first electronic device, so that the first electronic device can generate a second background image based on the second feature map. The image content of the second background image is different from that of the first background image, and the second image is generated based on the foreground image and the second background image. Since the first electronic device can send the first feature map to the second electronic device with greater computing power, after the second electronic device inputs the first feature map into the first model, the first model only needs a short time to process the first feature map to generate the second feature map. This allows the first electronic device to quickly generate a second background image with content different from the first background image based on the second feature map, without the first electronic device needing to perform calculations to generate the second background image. Therefore, the time spent generating the second background image can be reduced, allowing the first electronic device to quickly generate the second image required by the user based on the foreground image and the second background image. Furthermore, since the first and second electronic devices transmit the first and second feature maps, rather than the first image and the second background image, during the generation of the second image required by the user, the leakage of the first image or the second background image during the generation of the second image required by the user can be avoided. Thus, the efficiency of the first electronic device in generating the image required by the user can be improved while avoiding the leakage of user privacy.

[0089] The following example illustrates a specific scheme for generating a second feature map using a second electronic device.

[0090] In some embodiments of this application, the foreground image includes a person image. Optionally, combined with... Figure 1 ,like Figure 4 As shown, before step 103 above, the image generation method provided in this application embodiment may further include steps 301 to 304 below, and step 103 above can be specifically implemented by steps 103a and 103b below.

[0091] Step 301: The first electronic device determines the first mask image based on the first image.

[0092] It should be noted that the execution order of steps 101 and 301 is not limited in this embodiment. In one example, step 101 can be executed first, followed by step 301; in another example, step 301 can be executed first, followed by step 101; in yet another example, step 301 can be executed simultaneously with step 101. Figure 4 The example in the text illustrates the process of executing step 101 first, followed by step 301.

[0093] In this embodiment of the application, the first mask image indicates the position of the person image in the first image.

[0094] In some embodiments of this application, each pixel in the first mask image corresponds to a pixel in the first image, and in the first mask image, the pixel value of the pixel corresponding to the pixel in the person image can be "1", while the pixel value of the pixel corresponding to the pixel in other images can be "0".

[0095] In some embodiments of this application, the first electronic device may use a portrait segmentation algorithm module to calculate the first image using a portrait segmentation algorithm to determine the first mask image.

[0096] It should be noted that for the explanation of the above-mentioned human image segmentation algorithm, please refer to the specific description in the relevant technology, and the embodiments of this application will not be repeated here.

[0097] Step 302: The first electronic device sends the first mask image to the second electronic device.

[0098] In this embodiment of the application, the first mask image is used by the second electronic device to determine the first feature region corresponding to the foreground image in the first feature map.

[0099] In this embodiment of the application, the second feature map is generated by the second electronic device based on the second feature region corresponding to the first background image in the first feature map, and the second feature region is determined by the second electronic device based on the first feature region.

[0100] In this embodiment of the application, since the computing power of the first electronic device is limited, it may take a long time for the first electronic device to determine the position of the foreground image in the first image. Therefore, the first electronic device can first quickly determine the first mask image and send the first mask image to the second electronic device so that the second electronic device with greater computing power can determine the first feature region corresponding to the foreground image in the first feature map.

[0101] Step 303: The second electronic device receives the first mask image from the first electronic device.

[0102] In this embodiment of the application, the first mask image indicates the position of the person image in the first image.

[0103] Step 304: The second electronic device determines the first feature region corresponding to the foreground image in the first feature map based on the first mask image.

[0104] In some embodiments of this application, the foreground image may include a person image and a foreground object image. Thus, the second electronic device can first determine the feature region corresponding to the person image in the first feature map based on the first mask image, and then detect the first feature map to determine the feature region corresponding to the foreground object image in the first feature map. Thus, the second electronic device can determine the first feature region corresponding to the foreground image in the first feature map based on the feature regions corresponding to the person image and the foreground object image in the first feature map.

[0105] In some embodiments of this application, the foreground image further includes a foreground object image. Optionally, step 304 can be implemented using steps 304a and 304b described below.

[0106] Step 304a: The second electronic device determines the third feature region corresponding to the person image in the first feature map from the first feature map based on the first mask image.

[0107] In some embodiments of this application, the second electronic device may first determine the position of the corresponding pixel in the first feature map based on the position of the pixel with a pixel value of "1" in the first mask image, and then determine the area where the corresponding pixel in the first feature map is located as the third feature region.

[0108] Step 304b: The second electronic device determines the third feature region and the fourth feature region corresponding to the foreground object image in the first feature map as the first feature region.

[0109] In some embodiments of this application, the second electronic device may first use the SOD algorithm to detect the first feature map through the foreground segmentation module to determine the fourth feature region, and then determine the region formed by the third feature region and the fourth feature region as the first feature region.

[0110] Thus, since the second electronic device can accurately determine the third feature region corresponding to the person image in the foreground image in the first feature map based on the first mask image, the electronic device can accurately determine the first feature region corresponding to the foreground image in the first feature map based on the third feature region and the fourth feature region corresponding to the foreground image in the first feature map.

[0111] Step 103a: The second electronic device obtains the second feature region other than the first feature region from the first feature map.

[0112] In this embodiment of the application, the second feature region is the feature region corresponding to the first background image in the first feature map.

[0113] In some embodiments of this application, the second electronic device may first set the feature values ​​of each feature point in the first feature region to "0", and then randomly set the feature values ​​of each feature point in the first feature region to obtain the second feature region.

[0114] Step 103b: The second electronic device inputs the second feature region into the first model to obtain the second feature map output by the first model.

[0115] In this embodiment of the application, in order to avoid the presence of people and objects in the foreground image of the first image in the second background image, and thus to avoid ghosting in the second image, the first electronic device can indicate the position of the person image in the foreground image in the first image to the second electronic device through the first mask image, so that the second electronic device can determine the first feature region corresponding to the foreground image in the first feature map based on the position, and delete the first feature region from the first feature map. As a result, the feature region corresponding to the foreground image does not exist in the second feature map generated by the second electronic device through the first model, and thus the person and object in the foreground image does not exist in the second background image.

[0116] Thus, since the first electronic device can send the first mask image to the second electronic device, enabling the second electronic device to determine the first feature region corresponding to the foreground image in the first feature map and obtain the second feature region excluding the first feature region from the first feature map, after the second electronic device inputs the second feature region into the first model, it can obtain a second feature map that does not include the feature region corresponding to the foreground image. That is, the second background image generated by the first electronic device does not contain the people and objects in the foreground image, thus avoiding ghosting in the generated second image. Furthermore, since the first feature region corresponding to the foreground image in the first feature map can be determined by both the first and second electronic devices, instead of only by the first electronic device, the time spent determining the first feature region can be reduced, thereby reducing the time spent generating the second feature map. In this way, the quality of the second image generated by the first electronic device according to the user's requirements can be further improved while reducing the time spent generating the second image.

[0117] In this embodiment of the application, after the second electronic device receives the first mask image, the second electronic device can also update the first mask image according to the feature region corresponding to the foreground object image in the first feature image. The updated first mask image indicates the position of the foreground image in the first image, so that the first electronic device can accurately fuse the foreground image and the second background image based on the updated first mask image to obtain the second image required by the user. An example will be given below.

[0118] In some embodiments of this application, the foreground image further includes a foreground object image. Optionally, after step 303, the image generation method provided in this application embodiment may further include steps 401 to 404 as described below, and step 106 may be specifically implemented through step 106a as described below.

[0119] Step 401: The second electronic device determines the third mask image based on the fourth feature region corresponding to the foreground object image in the first feature image.

[0120] In this embodiment, the third mask image indicates the position of the foreground object image in the first image.

[0121] It should be noted that the explanation of determining the fourth feature region for the second electronic device can be found in the specific description in the above embodiments, and will not be repeated here in the embodiments of this application.

[0122] In some embodiments of this application, each pixel in the third mask image corresponds to a pixel in the first image, and in the third mask image, the pixel value of the pixel corresponding to the pixel in the foreground image can be "1", while the pixel value of the pixel corresponding to the pixel in other images can be "0".

[0123] In some embodiments of this application, the second electronic device can determine the position of the corresponding pixel in the first image based on the position of each feature point in the fourth feature region, and then determine the position of the foreground object image in the first image based on the position of the region where the corresponding pixel is located, and generate a third mask image based on the position.

[0124] Step 402: The second electronic device generates a second mask image based on the first mask image and the third mask image.

[0125] In this embodiment, the second mask image indicates the position of the foreground image in the first image.

[0126] In some embodiments of this application, the second electronic device may superimpose the first mask image and the second mask image to generate a second mask image.

[0127] Step 403: The second electronic device sends the second mask image to the first electronic device.

[0128] In this embodiment of the application, the second mask image is used by the first electronic device to fuse the foreground image and the second background image to obtain a second image.

[0129] Step 404: The first electronic device receives the second mask image from the second electronic device.

[0130] In this embodiment of the application, the second mask image indicates the position of the foreground image in the first image, and the second mask image is determined by the second electronic device based on the first mask image.

[0131] Step 106a: The first electronic device fuses the foreground image and the second background image based on the second mask image to obtain the second image.

[0132] In some embodiments of this application, the first electronic device may first multiply the second mask image and the first image to obtain a third image, which includes only the foreground image and has the same size as the first image. Thus, the first electronic device may directly overlay the third image on the second background image to generate the second image.

[0133] Thus, since the second electronic device can also determine a third mask image indicating the position of the foreground image in the first image, and generate an image indicating the position of the foreground image in the first image based on the third mask image and the first mask image, after the first electronic device fuses the foreground image and the second background image based on the second mask image, the position of the foreground image in the second image can match its position in the first image. Therefore, it can avoid the mismatch between the positions of the foreground image in the two images, which would cause changes in the composition of the second image. As a result, the user does not need to adjust the second image again, thus further improving the efficiency of the first electronic device in generating the image required by the user.

[0134] The image generation method provided in this application can be executed by an image generation device. This application uses an image generation device executing the image generation method as an example to illustrate the image generation device provided in this application.

[0135] Figure 5 A schematic diagram of a possible structure of an image generation apparatus according to an embodiment of this application is shown. This image generation apparatus is a first image generation apparatus. Figure 5 As shown, the first image generation device 50 provided in this application embodiment may include: a sending module 51, a receiving module 52, and a processing module 53.

[0136] The sending module 51 is used to send a first feature map corresponding to the first image to the second image generating device; the first image includes a foreground image and a first background image; the first feature map is used by the second image generating device to generate a second feature map. The receiving module 52 is used to receive the second feature map from the second image generating device. The processing module 53 is used to generate a second background image based on the second feature map received by the receiving module 52; the second background image has different image content from the first background image; and the second image is generated based on the foreground image and the second background image.

[0137] This application provides an image generation apparatus. Since the first image generation apparatus can send a first feature map to a second image generation apparatus with greater computing power, after the second image generation apparatus inputs the first feature map into a first model, the first model only needs a short computation time to process the first feature map and generate a second feature map. This allows the first image generation apparatus to quickly generate a second background image with content different from the first background image based on the second feature map, without requiring the first image generation apparatus to perform calculations to generate the second background image. Therefore, the time spent generating the second background image can be reduced, allowing the first image generation apparatus to quickly generate the second image required by the user based on the foreground image and the second background image. Furthermore, since the transmission between the first and second image generation apparatus during the generation of the second image required by the user is between the first and second feature maps, rather than the first image and the second background image, leakage of the first image or the second background image can be avoided during the generation of the second image required by the user. Thus, the efficiency of the first image generation apparatus in generating the image required by the user can be improved while avoiding leakage of user privacy.

[0138] In one possible implementation, the foreground image includes a person image. The processing module 53 is further configured to determine a first mask image based on the first image before the receiving module 52 receives the second feature map from the second image generating device; the first mask image indicates the position of the person image in the first image. The sending module 51 is further configured to send the first mask image determined by the processing module 53 to the second image generating device; the first mask image is used by the second image generating device to determine a first feature region corresponding to the foreground image in the first feature map. The second feature map is generated by the second image generating device based on a second feature region corresponding to the first background image in the first feature map, and this second feature region is determined by the second image generating device based on the first feature region.

[0139] In one possible implementation, the receiving module 52 is further configured to receive a second mask image from the second image generating device after the sending module 51 sends the first mask image to the second image generating device; the second mask image indicates the position of the foreground image in the first image, and the second mask image is determined by the second image generating device based on the first mask image. The processing module 53 is specifically configured to fuse the foreground image and the second background image based on the second mask image received by the receiving module to obtain a second image.

[0140] In one possible implementation, the processing module 53 is further configured to input the first image into the encoder of the first image generating device 50 before the sending module 51 sends the first feature map corresponding to the first image to the second image generating device, so as to obtain the first feature map output by the encoder; the first feature map is obtained by the encoder encoding the first image.

[0141] In one possible implementation, the processing module 53 is specifically used to input the second feature map into the decoder of the first image generation device 50 to obtain the second background image output by the decoder; the second background image is obtained by the decoder decoding the second feature map.

[0142] The image generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0143] The image generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0144] The image generation apparatus provided in this application embodiment can achieve... Figures 1 to 4 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0145] Figure 6 A schematic diagram of a possible structure of the image generation apparatus involved in an embodiment of this application is shown. This image generation apparatus is a second image generation apparatus. Figure 6As shown, the second image generation device 60 provided in this application embodiment may include: a receiving module 61, a processing module 62, and a sending module 63.

[0146] The receiving module 61 is used to receive a first feature map corresponding to a first image from a first image generating device; the first image includes a foreground image and a first background image. The processing module 62 is used to input the first feature map received by the receiving module 61 into a first model to obtain a second feature map output by the first model; the second feature map is generated by the first model processing the first feature map. The sending module 63 is used to send the second feature map generated by the processing module 62 to the first image generating device; the second feature map is used by the first image generating device to generate a second background image, and based on the foreground image and the second background image, a second image is generated, the content of which is different from that of the first background image.

[0147] This application provides an image generation apparatus. Since the first image generation apparatus can send a first feature map to a second image generation apparatus with greater computing power, after the second image generation apparatus inputs the first feature map into a first model, the first model only needs a short computation time to process the first feature map and generate a second feature map. This allows the first image generation apparatus to quickly generate a second background image with content different from the first background image based on the second feature map, without requiring the first image generation apparatus to perform calculations to generate the second background image. Therefore, the time spent generating the second background image can be reduced, allowing the first image generation apparatus to quickly generate the second image required by the user based on the foreground image and the second background image. Furthermore, since the transmission between the first and second image generation apparatus during the generation of the second image required by the user is between the first and second feature maps, rather than the first image and the second background image, leakage of the first image or the second background image can be avoided during the generation of the second image required by the user. Thus, the efficiency of the first image generation apparatus in generating the image required by the user can be improved while avoiding leakage of user privacy.

[0148] In one possible implementation, the foreground image includes a person image. The receiving module 61 is further configured to receive a first mask image from the first image generating device before the processing module 62 inputs the first feature map to the first model to obtain a second feature map output by the first model; the first mask image indicates the position of the person image in the first image. The processing module 62 is further configured to determine a first feature region corresponding to the foreground image in the first feature map based on the first mask image received by the receiving module 61. Specifically, the processing module 62 is configured to obtain a second feature region other than the first feature region from the first feature map, the second feature region being the feature region corresponding to the first background image in the first feature map, and input the second feature region to the first model to obtain a second feature map output by the first model.

[0149] In one possible implementation, the foreground image further includes a foreground object image. Specifically, the processing module 62 is used to determine, based on the first mask image, the third feature region corresponding to the person image in the first feature map; and to determine the third feature region and the fourth feature region corresponding to the foreground object image in the first feature map as the first feature region.

[0150] In one possible implementation, the foreground image further includes a foreground object image. The processing module 62 is further configured to, after the receiving module 61 receives the first mask image from the first image generating device, determine a third mask image based on the fourth feature region corresponding to the foreground object image in the first feature image; the third mask image indicates the position of the foreground object image in the first image; and generate a second mask image based on the first mask image and the third mask image; the second mask image indicates the position of the foreground image in the first image. The sending module 63 is further configured to send the second mask image generated by the processing module 62 to the first image generating device; the second mask image is used by the first image generating device to fuse the foreground image and the second background image to obtain a second image.

[0151] The image generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0152] The image generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0153] The image generation apparatus provided in this application embodiment can achieve... Figures 1 to 4 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0154] In some implementations of this application, such as Figure 7 As shown, this application embodiment also provides an electronic device 70, including a processor 71 and a memory 72. The memory 72 stores a program or instructions that can run on the processor 71. When the program or instructions are executed by the processor 71, they implement the various process steps of the above-described image generation method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0155] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.

[0156] Figure 8 The schematic diagram of the hardware structure of an electronic device according to an embodiment of this application is shown. The electronic device is a first electronic device.

[0157] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0158] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on 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.

[0159] The radio frequency unit 101 is used to send a first feature map corresponding to the first image to the second electronic device; the first image includes a foreground image and a first background image; the first feature map is used by the second electronic device to generate a second feature map; and the second electronic device receives the second feature map and generates a second background image based on the second feature map; the image content of the second background image is different from that of the first background image.

[0160] Processor 110 is used to generate a second image based on a foreground image and a second background image.

[0161] This application provides an electronic device. Since a first electronic device can send a first feature map to a second electronic device with greater computing power, after the second electronic device inputs the first feature map into a first model, the first model only needs a short computation time to process the first feature map and generate a second feature map. This allows the first electronic device to quickly generate a second background image with content different from the first background image based on the second feature map, without requiring the first electronic device to perform calculations to generate the second background image. Therefore, the time spent generating the second background image can be reduced, allowing the first electronic device to quickly generate the second image required by the user based on the foreground image and the second background image. Furthermore, since the transmission between the first and second electronic devices during the generation of the second image required by the user is between the first and second feature maps, rather than the first image and the second background image, leakage of the first image or the second background image during the generation of the second image required by the user can be avoided. Thus, the efficiency of the first electronic device in generating the image required by the user can be improved while avoiding leakage of user privacy.

[0162] In some embodiments of this application, the foreground image includes a person image.

[0163] The processor 110 is further configured to determine a first mask image based on the first image; the first mask image indicating the position of the person image in the first image.

[0164] The radio frequency unit 101 is also used to send a first mask image to a second electronic device; the first mask image is used by the second electronic device to determine a first feature region corresponding to the foreground image in the first feature map.

[0165] The second feature map is generated by the second electronic device based on the second feature region corresponding to the first background image in the first feature map, and the second feature region is determined by the second electronic device based on the first feature region.

[0166] In some embodiments of this application, the radio frequency unit 101 is further configured to receive a second mask image from a second electronic device; the second mask image indicates the position of a foreground image in a first image, and the second mask image is determined by the second electronic device based on a first mask image.

[0167] The processor 110 is specifically used to fuse the foreground image and the second background image based on the second mask image to obtain a second image.

[0168] In some embodiments of this application, the processor 110 is further configured to input the first image into the encoder of the first electronic device to obtain a first feature map output by the encoder; the first feature map is obtained by the encoder encoding the first image.

[0169] In some embodiments of this application, the processor 110 is specifically used to input the second feature map into the decoder of the first electronic device to obtain a second background image output by the decoder; the second background image is obtained by the decoder decoding the second feature map.

[0170] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0171] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0172] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0173] Figure 9 A schematic diagram of the hardware structure of a server to implement an embodiment of this application.

[0174] This server can achieve Figures 1 to 4 The details of the image generation method corresponding to the second electronic device in the illustrated embodiment are shown, achieving the same effect. For example... Figure 9As shown, server 80 includes a processor 81, a memory 82, and a computer program stored in the memory 82 and executable on the processor. The various components of server 80 are coupled together via a bus system 83. It is understood that the bus system 83 is used to implement communication between these components. When the computer program is executed by the processor, it implements the various process steps of the image generation method as described in the above embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0175] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0176] 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 disk, or optical disk.

[0177] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image generation method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0178] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0179] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the image generation method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0180] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0181] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0182] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An image generation method, applied to a first electronic device, characterized in that, The method includes: A first feature map corresponding to a first image is sent to a second electronic device; the first image includes a foreground image and a first background image; the first feature map is used by the second electronic device to generate a second feature map. The second feature map is received from the second electronic device, and a second background image is generated based on the second feature map; the image content of the second background image is different from that of the first background image. A second image is generated based on the foreground image and the second background image.

2. The method according to claim 1, characterized in that, The foreground image includes images of people; Before receiving the second feature map from the second electronic device, the method further includes: Based on the first image, a first mask image is determined; the first mask image indicates the position of the person image in the first image; The first mask image is sent to the second electronic device; the first mask image is used by the second electronic device to determine the first feature region corresponding to the foreground image in the first feature map; The second feature map is generated by the second electronic device based on the second feature region corresponding to the first background image in the first feature map, and the second feature region is the feature region in the first feature map other than the first feature region.

3. The method according to claim 2, characterized in that, After sending the first mask image to the second electronic device, the method further includes: The second electronic device receives a second mask image; the second mask image indicates the position of the foreground image in the first image, and the second mask image is determined by the second electronic device based on the first mask image; The step of generating a second image based on the foreground image and the second background image includes: Based on the second mask image, the foreground image and the second background image are fused to obtain the second image.

4. The method according to claim 1, characterized in that, Before sending the first feature map corresponding to the first image to the second electronic device, the method further includes: The first image is input into the encoder to obtain the first feature map output by the encoder; the first feature map is obtained by the encoder encoding the first image.

5. The method according to claim 1, characterized in that, The step of generating a second background image based on the second feature map includes: The second feature map is input into the decoder of the first electronic device to obtain the second background image output by the decoder; the second background image is obtained by the decoder decoding the second feature map.

6. An image generation method, applied to a second electronic device, characterized in that, The method includes: A first feature map corresponding to a first image is received from a first electronic device; the first image includes a foreground image and a first background image; The first feature map is input into the first model to obtain the second feature map output by the first model; the second feature map is generated by the first model processing the first feature map. The second feature map is sent to the first electronic device; the second feature map is used by the first electronic device to generate a second background image, and a second image is generated based on the foreground image and the second background image; the image content of the second background image and the first background image are different.

7. The method according to claim 6, characterized in that, The foreground image includes images of people; Before inputting the first feature map into the first model to obtain the second feature map output by the first model, the method further includes: Receive a first mask image from the first electronic device; the first mask image indicates the position of the person image in the first image; Based on the first mask image, determine the first feature region corresponding to the foreground image in the first feature map; The step of inputting the first feature map into the first model to obtain the second feature map output by the first model includes: A second feature region other than the first feature region is obtained from the first feature map, and the second feature region is the feature region of the first background image corresponding to the first feature map. The second feature region is input into the first model to obtain the second feature map output by the first model.

8. The method according to claim 7, characterized in that, The foreground image also includes foreground object images; The step of determining the first feature region corresponding to the foreground image in the first feature map based on the first mask image includes: Based on the first mask image, determine the third feature region corresponding to the person image in the first feature map from the first feature map; The third feature region and the fourth feature region corresponding to the foreground object image in the first feature map are determined as the first feature region.

9. The method according to claim 7, characterized in that, The foreground image also includes foreground object images; After receiving the first mask image from the first electronic device, the method further includes: A third mask image is determined based on the fourth feature region corresponding to the foreground object image in the first feature image; the third mask image indicates the position of the foreground object image in the first image; A second mask image is generated based on the first mask image and the third mask image; the second mask image indicates the position of the foreground image in the first image; The second mask image is sent to the first electronic device; the second mask image is used by the first electronic device to fuse the foreground image and the second background image to obtain the second image.

10. An image generating apparatus, wherein the image generating apparatus is a first image generating apparatus, characterized in that, The first image generation device includes: a sending module, a receiving module, and a processing module; The sending module is used to send a first feature map corresponding to the first image to the second image generating device; the first image includes: a foreground image and a first background image; the first feature map is used by the second image generating device to generate a second feature map; The receiving module is used to receive the second feature map from the second image generating device; The processing module is configured to generate a second background image based on the second feature map received by the receiving module; the image content of the second background image is different from that of the first background image; and generate a second image based on the foreground image and the second background image.

11. An image generating apparatus, wherein the image generating apparatus is a second image generating apparatus, characterized in that, The second image generation device includes: a receiving module, a processing module, and a sending module; The receiving module is configured to receive a first feature map corresponding to a first image from a first image generating device; the first image includes a foreground image and a first background image; The processing module is used to input the first feature map received by the receiving module into the first model to obtain a second feature map output by the first model; the second feature map is generated by the first model processing the first feature map; The sending module is used to send the second feature map generated by the processing module to the first image generating device; the second feature map is used by the first image generating device to generate a second background image, and a second image is generated based on the foreground image and the second background image; the image content of the second background image and the first background image are different.

12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the image generation method as described in any one of claims 1 to 9.

13. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image generation method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Image synthesis method and device

    CN105338242A

  • Image generation method and device, equipment and storage medium

    CN115131464A