Image processing method and apparatus and computer device

WO2025005875A1PCT designated stage expired Publication Date: 2025-01-02ALIBABA INNOVATION PRIVATE LIMITED
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/SG2024/050359
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-30
Filing Date
2024-05-29
Publication Date
2025-01-02

Smart Images

  • Figure SG2024050359_02012025_PF_FP_ABST
    Figure SG2024050359_02012025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present disclosure are an image processing method and apparatus and a computer device. The method comprises: acquiring a first image, wherein a first object in the first image wears clothing; performing clothing segmentation on the first image to obtain a clothing mask of the clothing; acquiring an object generation parameter, wherein the object generation parameter is used for representing a parameter required to generate the first object as a second object; in a generative diffusion model, by using the clothing mask to occlude the clothing in the first image, and by generating a second object on the basis of the object generation parameter, replacing with the second object the first object in the first image in which the clothing is occluded, thereby obtaining a second image in which the second object wears the clothing. The present invention solves the technical problem in related art of low fitness of clothing and an object in a display image when the display image is generated.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Image Processing Method, Apparatus, and Computer Device Cross-Reference This disclosure claims priority to Chinese patent application number 202310802827.3, filed with the China Patent Office on June 30, 2023, entitled "Image Processing Method, Apparatus, and Computer Device," the entire contents of which are incorporated herein by reference. Technical Field This disclosure relates to the field of image processing, and more specifically, to an image processing method, apparatus, and computer device. Background: In related art, when generating a display image of a subject wearing clothing, the clothing image is typically directly superimposed onto the subject image. This results in a poor fit between the clothing and the subject in the generated display image. Currently, no effective solution has been proposed to address this issue. SUMMARY OF THE INVENTION Embodiments of the present disclosure provide an image processing method, apparatus, and computer device to at least address the related art issue of poor fit between clothing and the subject in display images. According to one aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: acquiring a first image, wherein a first subject in the first image is wearing clothing; performing clothing segmentation on the first image to obtain a clothing mask for the clothing; acquiring object generation parameters, wherein the object generation parameters are used to represent parameters required to generate a second object from the first object; and, in a diffusion generation model, using the clothing mask to occlude the clothing in the first image, and generating a second object based on the object generation parameters, replacing the first object in the first image after occluding the clothing with the second object, thereby obtaining a second image of the second subject wearing the clothing. According to one aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: in response to an image input instruction applied on an operation interface, displaying a first image on the operation interface, wherein a first object in the first image is wearing clothing; in response to a clothing segmentation instruction applied on the operation interface, displaying a clothing mask of the clothing on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; in response to a parameter input instruction applied on the operation interface, displaying input object generation parameters on the operation interface, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and in response to an image generation instruction applied on the operation interface, displaying a second image on the operation interface, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object.According to one aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: displaying a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receiving an image processing instruction, performing clothing segmentation on the first image, and obtaining a clothing mask for the clothing; selecting object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and driving the VR device or AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. According to one aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: acquiring a first image by calling a first interface, wherein a first object in the first image is wearing clothing; outputting a clothing mask of the clothing by calling a second interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; acquiring object generation parameters by calling a third interface, and generating a second image, wherein the object generation parameters represent parameters required for generating a second object from the first object, and the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. According to one aspect of an embodiment of the present disclosure, an image processing apparatus is provided, comprising: a first acquisition module configured to acquire a first image, wherein a first object in the first image is wearing clothing; a segmentation module configured to perform clothing segmentation on the first image to obtain a clothing mask of the clothing; a second acquisition module configured to acquire object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and a processing module configured to, in a diffusion generation model, use the clothing mask to occlude the clothing in the first image, and generate the second object based on the object generation parameters, thereby replacing the first object in the first image after occluding the clothing with the second object, to obtain a second image of the second object wearing the clothing.According to one aspect of an embodiment of the present disclosure, an image processing apparatus is provided, comprising: a first display module configured to, in response to an image input instruction applied on an operation interface, display a first image on the operation interface, wherein a first object in the first image is wearing clothing; a second display module configured to, in response to a clothing segmentation instruction applied on the operation interface, display a clothing mask of the clothing on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; a third display module configured to, in response to a parameter input instruction applied on the operation interface, display input object generation parameters on the operation interface, wherein the object generation parameters are used to represent parameters required when generating a second object from a first object; and a fourth display module configured to, in response to the image generation instruction applied on the operation interface, display a second image on the operation interface, wherein the second image is obtained by, in a diffusion generation model, using a clothing mask to occlude the clothing in the first image and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. According to one aspect of an embodiment of the present disclosure, an image processing apparatus is provided, comprising: a display module configured to display a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; a receiving module configured to receive an image processing instruction, perform clothing segmentation on the first image, and obtain a clothing mask for the clothing; a selection module configured to select object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and a driving module configured to drive the VR device or the AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object.According to one aspect of an embodiment of the present disclosure, an image processing apparatus is provided, comprising: a first calling module configured to obtain a first image by calling a first interface, wherein a first object in the first image is wearing clothing; a second calling module configured to output a clothing mask of the clothing by calling a second interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; and a third calling module configured to obtain object generation parameters by calling a third interface and generate a second image, wherein the object generation parameters represent parameters required to generate a second object from a first object, and the second image is obtained by replacing the first object in the first image with the second object after occluding the clothing by using the clothing mask in a diffusion generation model and generating the second object based on the object generation parameters. According to one aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory configured to store an executable program; and a processor configured to execute the program, wherein the program, when executed, executes any one of the aforementioned image processing methods. According to one aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program. When executed by a processor, the computer program implements any of the aforementioned image processing methods. According to one aspect of an embodiment of the present disclosure, a computer program product is provided, including a non-volatile computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements any of the aforementioned image processing methods. According to one aspect of an embodiment of the present disclosure, a computer program is provided. When executed by a processor, the computer program implements any of the aforementioned image processing methods. According to one aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, including a stored executable program. When the executable program is executed, the device containing the computer-readable storage medium is controlled to perform any of the aforementioned image processing methods. In this embodiment of the present disclosure, a first image is obtained, including a first subject wearing clothing. Clothing segmentation is performed on the first image to obtain a clothing mask for the clothing. Object generation parameters are then obtained. In the diffusion generative model, a clothing mask is used to occlude the clothing in the first image. A second object is generated based on object generation parameters. The first object in the first image, after the clothing is occluded, is replaced with the second object, ultimately yielding a second image. This occlusion of the clothing by the clothing mask ensures that the clothing remains unchanged during the generation of the second image using the diffusion generative model, i.e., the clothing is not deformed. This ensures that the generated second object retains the natural appearance of the subject wearing the original clothing.Therefore, not only does the image generated based on the diffusion model have the accuracy required, but it also effectively ensures that the garment does not deform, maintaining a high degree of fit between the garment and the object. This achieves the goal of achieving a high degree of fit between the garment and the object, thereby resolving the technical problem of low fit between the garment and the object in display images generated in related technologies. It should be noted that the general description above and the detailed description that follow are merely examples and explanations of the present disclosure and do not constitute limitations of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS The drawings described herein are provided to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are provided to explain the present disclosure and do not constitute undue limitations of the present disclosure. In the accompanying drawings: Figure 1 is a schematic diagram of the hardware environment of a virtual reality device according to an image processing method of an embodiment of the present disclosure; Figure 2 is a structural block diagram of a computing environment of an image processing method according to an embodiment of the present disclosure; Figure 3 is a flowchart of an image processing method one according to an embodiment of the present disclosure; Figure 4 is a flowchart of an image processing method two according to an embodiment of the present disclosure; Figure 5 is a flowchart of an image processing method three according to an embodiment of the present disclosure; Figure 6 is a flowchart of an image processing method four according to an embodiment of the present disclosure; Figure 7 is a schematic diagram of an image processing method provided according to an optional implementation manner of the present disclosure; Figure 8 is a structural block diagram of an image processing device one according to an embodiment of the present disclosure; Figure 9 is a structural block diagram of an image processing device two according to an embodiment of the present disclosure; Figure 10 is a structural block diagram of an image processing device three according to an embodiment of the present disclosure; Figure 11 is a structural block diagram of an image processing device four according to an embodiment of the present disclosure; Figure 12 is a structural block diagram of a computer terminal according to an embodiment of the present disclosure; Figure 13 is a structural block diagram of a processor according to an embodiment of the present disclosure. DETAILED DESCRIPTION To help those skilled in the art better understand the disclosed solutions, the following will provide a clear and complete description of the technical solutions in the disclosed embodiments, in conjunction with the accompanying drawings. It should be noted that the described embodiments represent only a portion of the disclosed embodiments, and are not exhaustive. All other embodiments devised by persons of ordinary skill in the art based on the disclosed embodiments without inventive effort should fall within the scope of protection of the disclosed embodiments. It should be noted that the terms "first," "second," and so on, in the specification and claims of the disclosed embodiments, and in the accompanying drawings, are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that such terms are interchangeable where appropriate, so that the disclosed embodiments described herein can be implemented in an order other than that illustrated or described herein.Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to the steps or units explicitly listed and may include other steps or units not explicitly listed or inherent to the process, method, product, or apparatus. First, some terms or terms appearing in the description of the embodiments of this disclosure are subject to the following interpretations: Artificial Intelligence Generated Content (AIGC): Also known as Generative AI, this solution specifically refers to the generation of clothing fitting images based on a diffusion model. The Stable Diffusion (SD) algorithm is an image stabilization diffusion method that can smooth images and preserve edge information, and includes a generative large-scale network model structure. It reduces noise by adding diffusion terms to the image while preserving image detail and edge information. The SD method uses a diffusion coefficient to control the degree of image smoothing. A smaller diffusion coefficient preserves more detail and edge information in the image, but may also increase noise. A larger diffusion coefficient more effectively smooths the image and reduces noise. Stable diffusion methods are typically implemented by iteratively applying the diffusion operation. With each iteration, each pixel in the image is updated based on the intensities of its neighboring pixels. This way, each pixel is influenced by the intensities of its surrounding pixels, achieving a smoothing effect. Stable diffusion methods can be applied to image processing tasks such as image denoising and edge detection. They effectively smooth images while preserving details and edge information, improving image quality. ControlNet: A model for finely controlling the generation of SD. Diffusion: An algorithm or technique used in image processing for smoothing images. It reduces noise and detail by propagating differences between pixels across the image. Diffusion algorithms use gradient information between pixels to average pixel values ​​around them, reducing local variations in the image. This smoothing process can make the image appear blurrier, but it can remove noise and detail, thereby improving image quality. Warping: The process of deforming or deforming an image. Through warping, image transformations such as translation, rotation, scaling, and distortion can be achieved, thereby changing the shape or perspective relationship of the image.According to an embodiment of the present disclosure, an image processing method is provided. It should be noted that the steps illustrated in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions. Furthermore, although the flowcharts illustrate a logical order, in some cases, the steps illustrated or described may be executed in a different order. Figure 1 is a schematic diagram of the hardware environment of a virtual reality device according to an image processing method according to an embodiment of the present disclosure. As shown in Figure 1, a virtual reality device 104 is connected to a terminal 106, which is connected to a server 102 via a network. The virtual reality device 104 is not limited to a virtual reality helmet, virtual reality glasses, or an all-in-one virtual reality device. The terminal 104 is not limited to a PC, mobile phone, or tablet computer. The server 102 may be a server corresponding to a media file operator. The network includes, but is not limited to, a wide area network, a metropolitan area network, or a local area network. Optionally, the virtual reality device 104 of this embodiment includes a memory, a processor, and a transmission device. The memory is configured to store an application program, the application program being configured to: acquire a first image, wherein a first subject in the first image is wearing clothing; perform clothing segmentation on the first image to obtain a clothing mask for the clothing; obtain object generation parameters; and, using a diffusion generation model, occlude the clothing in the first image using the clothing mask, and generate a second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object to obtain a second image. Specifically, occluding the clothing using the clothing mask ensures that the clothing remains unchanged (i.e., the clothing is not deformed) during the generation of the second image using the diffusion generation model. As a result, the generated second object retains the natural state of the subject wearing the original clothing, and the clothing still exhibits realistic physical effects such as wrinkles and drape. Therefore, not only does the accuracy of image generation based on the diffusion model remain, but the clothing is also effectively guaranteed not to be deformed, and the clothing and the object still maintain a high degree of fit, achieving the goal of high fit between clothing and the object, thereby solving the technical problem of low fit between clothing and objects in the display image generated in the related art.The terminal of this embodiment can be configured to display a first image on a display screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receive an image processing instruction, perform clothing segmentation on the first image to obtain a clothing mask for the clothing; select object generation parameters; and drive the VR or AR device to display a second image, wherein the second image is obtained by inputting the first image into a diffusion generation model, occluding the clothing using the clothing mask, and generating a second object based on the object generation parameters. Optionally, the virtual reality device 104 of this embodiment includes an eye-tracking head-mounted display (HMD) and an eye-tracking module having the same functions as in the above embodiment. That is, the screen of the HMD is configured to display a real-time image, and the eye-tracking module of the HMD is configured to obtain the real-time movement trajectory of the user's eyeballs. The terminal of this embodiment obtains the user's position and motion information in the real three-dimensional space through the tracking system, and calculates the three-dimensional coordinates of the user's head in the virtual three-dimensional space, as well as the direction of the user's field of view in the virtual three-dimensional space. The hardware structure block diagram shown in Figure 1 can serve not only as an exemplary block diagram of the above-mentioned AR / VR device (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, Figure 2 shows a block diagram using the AR / VR device (or mobile device) shown in Figure 1 as a computing node in the computing environment 201. "D", "E" and "H". The end user 202 can provide and access services through a web browser or other software application on the client. In some embodiments, the supply and / or request of the end user 202 can be provided to the entry gateway 230. The entry gateway 230 may include a corresponding agent to handle the supply and / or request for the service (one or more services provided in the computing environment 201). The service is provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, the service can be provided based on virtual machine (VM)-based virtualization, container-based virtualization and / or similar methods. Virtual machine-based virtualization can be to simulate a real computer by initializing a virtual machine and execute programs and applications without directly contacting any actual hardware resources. While the virtual machine virtualizes the machine, according to container-based virtualization, a container can be started to virtualize the entire operating system (OS) so that multiple workloads can run on a single operating system instance. In an embodiment based on container virtualization, several containers of a service can be assembled into a Pod (for example, Load balancing, etc. Other services can also be pods, similar to pods. During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201. Executing one or more functions of one service requires invoking one or more functions of another service. As shown in Figure 2, service "A" 220-1 receives a user request from end user 202 from ingress gateway 230. Service "A" 220-1 can call service "D" 220-2, and service "D" 220-2 can request service "E" 220-3 to execute one or more functions. The computing environment described above can be a cloud computing environment, where resource allocation is managed by the cloud service provider, allowing for feature development without having to worry about implementing, adjusting, or scaling servers. This computing environment allows developers to execute code in response to events without building or maintaining complex infrastructure. Services can be partitioned to complete a set of functions that can scale automatically and independently, rather than scaling a single hardware device to handle potential load. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in this disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or deny. In the above operating environment, this disclosure provides an image processing method as shown in Figure 3. Figure 3 is a flowchart of the first image processing method according to an embodiment of the present disclosure. As shown in Figure 3, the method includes the following steps: Step S302: Acquire a first image, wherein a first subject in the first image is wearing clothing. In step S302 provided in this disclosure, the first image can be any image of the first subject wearing clothing, such as an image of any subject, an image of any clothing item, or an image of any posture. The first object can include various types, such as people, animals, and any other objects capable of wearing clothing, without limitation. The scope of first objects is broad. For example, people include anthropomorphic characters, cartoon characters, real people, and so on. Various types of first objects can be set. Clothing refers to clothing that can be worn by the first object, such as clothing that can be worn on the body, utensils that can be held in the hands, accessories that can be worn on the head, and so on. The scope of first objects is broad. For example, people include anthropomorphic characters, cartoon characters, real people, and so on. Clothing is clothing that can be worn by the first object, such as clothing that can be worn on the body, utensils that can be held in the hands, accessories that can be worn on the head, and so on. The scope of first objects is broad.As an optional embodiment, the method of this embodiment may be executed by a terminal or server for image processing. For example, when applied to a terminal for image processing, it can easily implement image processing for simple image scenarios. Alternatively, when applied to a server, it can leverage the server's abundant computing resources or a relatively larger and more accurate image processing model, thereby more accurately processing the image. It should be noted that the terminal can be of various types, such as a mobile terminal with certain computing capabilities or a fixed computer device with recognition capabilities. The server can also be of various types, such as a local server or a virtual cloud server. The computing power of the server can be that of a single computer device or a computer cluster integrating multiple computer devices. Step S304: Clothing segmentation is performed on the first image to obtain a clothing mask for the clothing item. In step S304 provided in the present disclosure, clothing segmentation is performed on the first image, the clothing portion in the first image is segmented, and this portion is processed to obtain a clothing mask for the clothing item. The clothing mask is a binary image of the same size as the clothing image. A pixel value of 1 indicates that the pixel should be retained during processing, while a pixel value of 0 indicates that the pixel should be ignored or blocked. This means that in subsequent operations, the mask can be used to mask specific areas within the image. Areas with a pixel value of 1 within the mask are retained, while other areas are set to 0 or replaced with other values. This means that the other areas are transformed, leaving the areas with a pixel value of 1 (i.e., the clothing portion) unchanged. Step S306: Obtain object generation parameters. In step S306 provided in the present disclosure, the object generation parameters can be used to represent the parameters required to generate the second object from the first object. These parameters can be generated in a variety of ways, such as based on keywords, user-selected controls, or any other generation method. These parameters can encompass multiple aspects of generation parameters. For example, if the second object may have a different hairstyle than the first object, the object generation parameters can be hairstyle-related parameters, such as those related to long or short hair, to modify the hair of the first object to generate the second object. For example, the second object may have different skin color or facial features compared to the first object. In this case, the object generation parameters can be parameters related to skin color and facial features, such as wheat-colored skin and parameters related to delicate facial features. The second object is obtained by changing the skin color and facial features of the first object.For example, the background of the second image may have changed compared to the first image. In this case, the object generation parameters may also be the environmental background of the second object. For example, if the background of the second image is a forest, the object generation parameters may be parameters related to the forest background. The background of the first image is changed to generate the second image. The specific object generation parameters are not limited here and can be customized according to the actual application and scenario. In step S308, the diffusion generation model uses a clothing mask to block the clothing in the first image and generates a second object based on the object generation parameters. The first object in the first image, after blocking the clothing, is replaced with the second object to obtain a second image of the second object wearing the clothing. In step S308 provided in the present disclosure, the first image is input into the diffusion generation model to generate the second image based on the first image. During this process, the clothing mask is used to block the clothing in the first image, leaving the clothing unchanged. This preserves the realistic physical effects of the clothing, such as wrinkles and drape, when worn on the subject. A second object is generated based on the object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second object wearing the clothing. The diffusion generation model can be a division model, an SD model, or other models, and can be adaptively selected based on the actual application and scenario. Through the above steps, a first image including the first subject wearing clothing is obtained, clothing segmentation is performed on the first image, a clothing mask is obtained, and object generation parameters are then obtained. Within the diffusion generation model, the clothing in the first image is occluded using the clothing mask, and the second object is generated based on the object generation parameters. The first object in the first image after the clothing is occluded is replaced with the second object, ultimately obtaining the second image. Specifically, occluding the clothing using the clothing mask ensures that the clothing remains unchanged (i.e., the clothing is not deformed) during the generation of the second image using the diffusion generation model. This ensures that the generated second object retains the natural state of the subject wearing the original clothing, with the clothing still exhibiting realistic physical effects such as wrinkles and drape. Therefore, not only does the image generated based on the diffusion model have the same accuracy as before, but it also effectively ensures that the garment does not deform, maintaining a high degree of fit between the garment and the object. This achieves the goal of achieving a high degree of fit between the garment and the object, thereby resolving the technical problem of low fit between the garment and the object in display images generated in related technologies. As an optional embodiment, obtaining a first image includes: obtaining an original image of a first object wearing clothing; segmenting the first object and clothing from the original image, and superimposing the segmented first object and clothing onto a target background image to obtain the first image.In this embodiment, an original image of a first subject wearing clothing is obtained. This original image can be an original image of any background. The first subject and clothing are segmented from the original image to separate them from the background in the original image. The segmented first subject and clothing are then overlaid onto a target background image to obtain a first image of the first subject and clothing within the target background. This allows the first subject and clothing to be within the specified target background, ultimately resulting in a second image of the specified background. Furthermore, since the first subject and clothing are segmented from the original image and overlaid onto the target background image to obtain the first image, the background is more closely aligned, improving the success rate and harmony of background changes. The target background can be a solid color background to better utilize the diffusion generation model and ensure that the resulting second image meets the requirements. As an optional embodiment, obtaining object generation parameters includes at least one of the following: obtaining object attribute parameters of the second subject to be generated; or obtaining object environment parameters of the second subject to be generated. This embodiment involves object attribute parameters and object environment parameters of the second object. Object attribute parameters can be parameters related to the object wearing the clothing, while object environment parameters can be parameters related to the background portion of the first image excluding the first object and the clothing, or parameters related to the lighting and shadow aspects of the first image. Object attribute parameters, such as skin color, facial features, and hairstyle, can be used to modify the first object to produce the second object. Object environment parameters can be background parameters or lighting parameters, such as backgrounds like the ocean and forest, or optical fiber light for dim or white light, to modify the background in the first image to produce the background in the second image. Therefore, using these two parameters, the portion of the first image excluding the clothing can be modified to produce a modified second image. This achieves the goal of creating a clothing display with realistic physical effects such as folds and drapes. Furthermore, the generated second image can be obtained by transforming any of the above parameters from the first image. Therefore, the second image can meet user needs and produce an image that better suits user preferences. As an optional embodiment, the method further includes: performing edge detection on a clothing mask to obtain a clothing outline; using the clothing mask to occlude the clothing in the first image in a diffusion generation model, and generating a second object based on object generation parameters to replace the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second object wearing the clothing, including: using the clothing outline as an edge constraint of the clothing in the diffusion generation model, using the clothing mask to occlude the clothing, and generating the second object based on the object generation parameters to replace the first object in the first image after the clothing is occluded with the second object, thereby obtaining the second image.In this embodiment, edge detection is performed on the clothing mask to determine the clothing outline. This is used to constrain the clothing, preventing the clothing from exceeding the clothing outline in the generated second image. Specifically, by setting the clothing outline, the algorithm is restricted from operating in areas outside the clothing outline, ensuring that the clothing remains unchanged in the second image. Setting the clothing outline can improve image processing performance. By using the clothing outline as a constraint, the algorithm is restricted from operating outside the clothing area, thereby improving algorithm accuracy and image processing performance, ensuring that the clothing portion remains unchanged in the generated second image. As an optional embodiment, the method further includes: obtaining an object contour of the first object based on the first image; and, in a diffusion generation model, using a clothing mask to occlude the clothing, and generating a second object based on object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second object wearing the clothing. This includes: using the object contour as an edge constraint for the second object in the diffusion generation model, occluding the clothing with the clothing mask, and generating the second object based on object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object, thereby obtaining the second image. In this embodiment, the first object is processed, perhaps using an algorithm such as edge detection, to obtain the object contour of the first object. This constraint is used to prevent the second object in the generated second image from exceeding the object contour. Specifically, by setting the object contour, the algorithm is restricted to operating within the object contour when generating the second object, enabling the generation of a second object with a height and body shape similar to the first object. Setting an object outline can improve image processing performance. By using the object outline as a constraint, the algorithm can be constrained to operate within the object area when generating the second object, thereby improving the algorithm's accuracy and effectiveness. A second object with similar height and build to the first object can also achieve the effect of displaying clothing with realistic physical effects such as folds and drapes. Furthermore, using the object outline as a constraint can make the generated second object's limbs and torso more realistic, avoiding the generation of abnormal objects. As an optional embodiment, obtaining the object outline of the first object based on a first image includes: if the first image is in color, converting the first image to a solid-color background image; and performing edge detection on the first object within the solid-color background image to obtain the object outline of the first object. This embodiment describes the steps involved in determining the object outline. Converting the first image to a solid-color background image facilitates edge detection, reduces interference, and makes the detected object outline more accurate.Furthermore, by converting the first image to a solid-color background image, the simplified background eliminates interference from objects in the background, preventing the extraction of background contours. Furthermore, the simplified background greatly simplifies image representation and processing, reducing storage and computational complexity. Furthermore, by converting the first image to a solid color, specific features in the image, such as edges, can be extracted. This processing facilitates the extraction of object contours. In an optional embodiment, the first and second objects have different images and / or backgrounds, with the object being a fitting model. In this embodiment, the fitting model can achieve the purpose of displaying clothing. Generating different second images from the first image can achieve the purpose of generating different clothing display images. These different clothing display images can be, as described above, different in terms of the object's image or background. These images can be customized based on actual applications and scenarios, catering to different user preferences. Furthermore, when the second object in the resulting second image wears clothing, the clothing can exhibit realistic physical effects such as folds and drapes. Therefore, the generated second image not only meets the user's preferences but also realistically depicts the state of the clothing being worn on the subject. Furthermore, clothing display images comparable to professional photography can be generated for the clothing. A large number of clothing display images can be quickly generated, and these display images can include different models and backgrounds. This is very convenient and the image quality is very high, significantly improving display quality while ensuring low costs. Figure 4 is a flowchart of a second image processing method according to an embodiment of the present disclosure. As shown in Figure 4, the method includes the following steps: Step S402: In response to an image input command on the operation interface, a first image is displayed on the operation interface, wherein the first subject in the first image is wearing clothing. Step S404: In response to a clothing segmentation command on the operation interface, a clothing mask of the clothing is displayed on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image. Step S406: In response to a parameter input command on the operation interface, the input object generation parameters are displayed on the operation interface, wherein the object generation parameters represent the parameters required to generate the first object into the second object. Step S408: In response to the image generation instruction applied to the operation interface, a second image is displayed on the operation interface. The second image is obtained by using a clothing mask to block the clothing in the first image and generating a second object based on the object generation parameters in the diffusion generation model, thereby replacing the first object in the first image after blocking the clothing with the second object.In this step, in response to an image input command on the operation interface, a first image including a first subject wearing clothing is displayed on the operation interface. Furthermore, in response to a clothing segmentation command on the operation interface, a clothing mask of the clothing obtained by performing clothing segmentation on the first image is displayed on the operation interface. Furthermore, in response to a parameter input command on the operation interface, the input object generation parameters are displayed on the operation interface. Finally, in response to an image generation command on the operation interface, a second image is displayed on the operation interface, which is obtained by occluding the clothing using the clothing mask in a diffusion generation model and generating a second object based on the object generation parameters, thereby replacing the first object in the first image after occluding the clothing with the second object. Specifically, by occluding the clothing using the clothing mask, the clothing remains unchanged (i.e., the clothing is not deformed) during the generation of the second image using the diffusion generation model. This ensures that the generated second object still represents the natural state of the subject wearing the original clothing, with the clothing still exhibiting realistic physical effects such as drape and wrinkles. Therefore, not only does the accuracy of image generation based on the diffusion model remain the same, but the garment is also effectively guaranteed not to deform, maintaining a high degree of fit between the garment and the object. This achieves the goal of achieving a high degree of fit between the garment and the object, thereby resolving the technical problem of low fit between the garment and the object in display images generated in related technologies. According to embodiments of the present disclosure, an image processing method is also provided that can be applied to virtual reality scenarios, such as virtual reality (VR) devices and augmented reality (AR) devices. It should be noted that the steps illustrated in the flowcharts of the accompanying figures can be executed in a computer system, such as a set of computer-executable instructions. Furthermore, while the flowcharts illustrate a logical order, in some cases, the steps illustrated or described may be executed in a different order. Figure 5 is a flowchart of a third image processing method according to an embodiment of the present disclosure. As shown in Figure 5, the method includes the following steps: Step S502: Displaying a first image on a display screen of a virtual reality (VR) device or augmented reality (AR) device, wherein a first object in the first image is wearing clothing. Step S504: Receive an image processing instruction, perform clothing segmentation on the first image, and obtain a clothing mask for the clothing. Step S506: Select object generation parameters, where the object generation parameters represent the parameters required to generate a second object from the first object. Step S508: Drive the VR device or AR device to display a second image, where the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object.In this step, a first image including a first subject wearing clothing is displayed on a display screen of a virtual reality (VR) device or an augmented reality (AR) device. An image processing instruction is received, clothing is segmented in the first image, and a clothing mask is obtained. Object generation parameters are then selected to drive the VR or AR device to display a second image generated by replacing the first object in the first image with the second object after the clothing is occluded, using the clothing mask in a diffusion generation model. This is done by generating a second object based on the object generation parameters. Specifically, by occluding the clothing with the clothing mask, the clothing remains unchanged (i.e., the clothing is not deformed) during the generation of the second image using the diffusion generation model. As a result, the generated second object retains the natural state of the subject wearing the original clothing, and the clothing still exhibits realistic physical effects such as wrinkles and drape. Therefore, not only does the image generated based on the diffusion model have the same accuracy as before, but it also effectively ensures that the garment does not deform, maintaining a high degree of fit between the garment and the object. This achieves the goal of achieving a high degree of fit between the garment and the object, thereby resolving the technical problem of low fit between the garment and the object in display images generated in related technologies. Optionally, in this embodiment, the above-described image processing method can be applied to a hardware environment consisting of a server and a virtual reality device. The second image is displayed on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device. The server can be a server corresponding to the media file provider. The above-described network includes, but is not limited to, a wide area network, a metropolitan area network, or a local area network. The above-described virtual reality device is not limited to a virtual reality helmet, virtual reality glasses, or an all-in-one virtual reality device. Optionally, the virtual reality device includes a memory, a processor, and a transmission device. The memory is configured to store an application program that can be used to: display a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receive an image processing instruction, perform clothing segmentation on the first image, and obtain a clothing mask for the clothing; select object generation parameters, wherein the object generation parameters represent parameters required to generate a second object from the first object; and drive the VR device or AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. It should be noted that the image processing method applied to the VR device or AR device in this embodiment may include the method of the embodiment shown in FIG. 5 to achieve the purpose of driving the VR device or AR device to display the second image.Optionally, the processor of this embodiment may invoke the application stored in the memory via a transmission device to perform the above steps. The transmission device may receive media files sent by a server via a network and may also be used for data transmission between the processor and the memory. Optionally, in a virtual reality device, a head-mounted display with eye tracking is provided. The screen of the HMD is configured to display a displayed video image. The eye tracking module in the HMD is configured to obtain the real-time movement trajectory of the user's eyes. The tracking system is configured to track the user's position and movement information in real three-dimensional space. The computing processing unit is configured to obtain the user's real-time position and movement information from the tracking system and calculate the three-dimensional coordinates of the user's head in the virtual three-dimensional space, as well as the user's field of view direction in the virtual three-dimensional space. In an embodiment of the present disclosure, a virtual reality device can be connected to a terminal, and the terminal and server are connected via a network. The virtual reality device is not limited to a virtual reality helmet, virtual reality glasses, or an all-in-one virtual reality device. The terminal is not limited to a PC, mobile phone, or tablet computer. The server can be a server of a media file provider. The network includes, but is not limited to, a wide area network, a metropolitan area network, or a local area network. Figure 6 is a flowchart of a fourth image processing method according to an embodiment of the present disclosure. As shown in Figure 6, the method includes the following steps: Step S602: Acquire a first image by calling a first interface, wherein a first subject in the first image is wearing clothing. Step S604: Output a clothing mask of the clothing by calling a second interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image. In step S606, object generation parameters are obtained by calling a third interface, and a second image is generated. The object generation parameters represent the parameters required to convert the first object into the second object. The second image is obtained by occluding the clothing in the first image using a clothing mask in the diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. Through the above steps, a first image including clothing worn by the first object is obtained by calling the first interface, a clothing mask for the clothing obtained by performing clothing segmentation on the first image is output by calling the second interface, and then the object generation parameters are obtained by calling the third interface. The second image is generated by occluding the clothing in the diffusion generation model using the clothing mask, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object.Specifically, the clothing mask is used to obscure the clothing, ensuring that the clothing remains unchanged during the generation of the second image using the diffusion generation model. Specifically, the clothing is not deformed. As a result, the generated second object maintains the natural state of the subject wearing the original clothing, with realistic physical effects such as wrinkles and drape. Therefore, not only does this maintain the accuracy of image generation based on the diffusion model, but it also effectively ensures that the clothing remains unchanged, maintaining a high degree of fit between the clothing and the subject, achieving a high degree of fit between the clothing and the subject. This addresses the technical issue of low fit between the clothing and the subject in display images generated in related art. Based on the above-mentioned embodiment and alternative embodiments, an alternative implementation is provided, which is described in detail below. In related art, the following methods are commonly used to generate fitting images: 1) Directly inputting the image into the diffusion generation model. However, this method can cause clothing details to change. The generated background will be affected by the background of the original image. 2) Using warping or other methods to attach clothing images to models, however, this approach can result in an unnatural fit. Since the fit must be based on key points, it is limited to specific clothing types. 3) Using 3D models, however, this approach also results in an unnatural fit and is prohibitively expensive. The above examples illustrate that, in related art, when generating display images, there is at least one technical issue of poor fit between clothing and the subject. To address this issue, an optional embodiment of the present disclosure provides an image processing method. Specifically, an image processing method is provided, using a human subject as an example. Figure 7 is a schematic diagram of the image processing method provided by an optional embodiment of the present disclosure. As shown in Figure 7, this optional embodiment of the present disclosure is described in detail below.

[0002] 51. Obtain the original image of the first subject wearing clothing. The original image is shown in (1) of FIG7. The first subject is a female wearing casual short-sleeved shirts and casual trousers. In the original image, there is a female wearing casual short-sleeved shirts and casual trousers standing in a cherry blossom forest.

[0003] 52. A first object and clothing are segmented from the original image, and the segmented first object and clothing are superimposed on the target background image to obtain a first image, as shown in (2) in FIG7 ; the target background image is a beach background, a woman wearing a casual short-sleeved shirt and casual trousers is segmented from the original image, and the image of the woman wearing a casual short-sleeved shirt and casual trousers is superimposed on the beach background to obtain a first image, in which a woman wearing a casual short-sleeved shirt and casual trousers stands on the beach.

[0004] 53. When the background of the first image is in color, the background of the first image is replaced with a solid color background. The first image after the background is replaced is shown in (3) in FIG7. When the background of the beach is in color, the background of the beach is replaced with a solid color background. The first image after the background is replaced is a woman wearing a casual short-sleeved shirt and casual trousers on a solid color background.

[0005] 54. Perform clothing segmentation on the first image to obtain a clothing mask for the clothing. The obtained clothing mask is shown in (4) in Figure 7. Perform clothing segmentation on the image of a woman wearing a casual short-sleeved shirt and casual trousers against a solid background to obtain a clothing mask, that is, a mask for the casual short-sleeved shirt and casual trousers. It should be noted that the female character in the image is a virtual character, not a specific person in reality. Therefore, the disclosure of the character's privacy is not involved.

[0006] 55, edge detection is performed on the clothing mask to obtain the clothing outline, edge detection is performed on the first object to obtain the object outline, and the outline diagram is shown in (5) in Figure 7; edge detection is performed on the masks of casual short-sleeved shirts and casual trousers to obtain the outlines of casual short-sleeved shirts and casual long-sleeved shirts, and edge detection is performed on the female part to obtain the outline of the female torso.

[0007] 56. Obtain object generation parameters, wherein obtaining the object generation parameters includes at least one of the following: obtaining object attribute parameters of the second object to be generated, such as darker skin color; obtaining object environment parameters of the second object to be generated, such as beach background, bright light.

[0008] 57. In the diffusion generation model, the clothing outline is used as the edge constraint of the clothing, the object outline is used as the edge constraint of the second object, the clothing is occluded by using a clothing mask, and the second object is generated based on the object generation parameter. The first object in the first image after the clothing is occluded is replaced by the second object to obtain a second image. The second image is shown in (6) in Figure 7. That is, an image of a woman with a darker skin color standing on a sunny beach can be obtained. In this image, the woman's clothing has not changed and can still remain in its original state, which can make the woman and the clothing fit better. Among them, the diffusion generation model can be a diffiision model or an SD model, etc., and an adaptive selection can be made according to the actual application and scenario. Through the above optional implementation, the following beneficial effects can be achieved:

[0009] (1) Compared with the method 1) in the related art, a mask is used to retain the original clothing details, and the background is protected from the influence of the original image by regenerating the background, thereby enhancing the operability of the scheme and making the first object, clothing, and background fit more closely.

[0010] (2) Since the original image can be an image of any object wearing any clothing, compared with method 2) in the related art, the solution provided by the optional embodiment of the present disclosure is not limited by clothing categories.

[0011] (3) Since the object generation parameters are obtained, the generated second image can be free from constraints and the generated image is more natural. Compared with the method 3) in the related art, the method provided by the optional embodiment of the present disclosure has a better light and shadow fusion. Moreover, no 3D technical means are used, thus greatly reducing production costs and saving time and manpower.

[0012] (4) The background change and regeneration mechanism improves the success rate and harmony of background change.

[0013] (5) By setting the clothing outline, the algorithm can be restricted to operate in the area outside the clothing outline, which can ensure that the clothing in the second image remains unchanged. By setting the object outline, the algorithm can be restricted to operate in the area within the object outline when generating the second object, which can generate a second object with a height and body shape similar to the first object. When the second object with a height and body shape similar to the first object wears clothing, it can also achieve the effect of displaying clothing with real physical effects such as folds and drapes. Moreover, due to the use of object outlines for constraints, the limbs and torso of the generated second object can be made more reasonable, avoiding the phenomenon of generating abnormal objects.

[0014] (6) It can generate clothing display pictures comparable to professional photography for clothing, and can quickly generate a large number of clothing display pictures. A large number of clothing display pictures can be of different models and different backgrounds. It is very convenient and the image quality is very good. It can greatly improve the display quality while ensuring low cost.

[0015] (7) It can also provide users with a more convenient try-on experience. By generating a hairstyle and skin color similar to their own and then replacing the user's facial features, the user can achieve the effect of trying on clothes. It should be noted that for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited by the described action sequence, because according to the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure. Through the above description of the implementation method, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware. Based on this understanding, the technical solution of the present disclosure, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present disclosure. According to an embodiment of the present disclosure, an image processing device 1 for implementing the above-mentioned image processing method 1 is further provided. FIG8 is a structural block diagram of the image processing device 1 according to an embodiment of the present disclosure. As shown in FIG8 , the device includes: a first acquisition module 802, configured to acquire a first image, wherein a first subject in the first image is wearing clothing; a segmentation module 804, connected to the first acquisition module 802, configured to perform clothing segmentation on the first image to obtain a clothing mask for the clothing; a second acquisition module 806, connected to the segmentation module 804, configured to acquire object generation parameters, wherein the object generation parameters represent parameters required for generating a second object from the first object; and a processing module 808, connected to the second acquisition module 806, configured to, in a diffusion generation model, use the clothing mask to occlude the clothing in the first image, and generate a second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second subject wearing the clothing.It should be noted that the first acquisition module 802, segmentation module 804, second acquisition module 806, and processing module 808 correspond to steps S302 to S308 in the embodiment. The examples and application scenarios implemented by the multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory and processed by one or more processors. The above modules can also be part of a device and can be run in the AR / VR device provided in this application. According to an embodiment of the present disclosure, a second image processing device for implementing the second image processing method is further provided. FIG9 is a structural block diagram of the second image processing device according to an embodiment of the present disclosure. As shown in FIG9 , the device includes: a first display module 902, configured to display a first image on the operation interface in response to an image input instruction on an operation interface, wherein a first object in the first image is wearing clothing; a second display module 904, connected to the first display module 902, configured to display a clothing mask of the clothing on the operation interface in response to a clothing segmentation instruction on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; a third display module 906, connected to the second display module 904, configured to display input object generation parameters on the operation interface in response to a parameter input instruction on the operation interface, wherein the object generation parameters are used to represent parameters required when generating the first object into the second object; and a fourth display module 908, connected to the third display module 906, configured to display an input object generation parameter on the operation interface in response to a parameter input instruction on the operation interface. A second image is displayed on the user interface. The second image is obtained by replacing the first object in the first image after the clothing is occluded with the second object using a clothing mask in a diffusion generation model and generating a second object based on object generation parameters. It should be noted that the first display module 902, second display module 904, third display module 906, and fourth display module 908 correspond to steps S402 to S408 in the embodiment. The examples and application scenarios implemented by these modules and corresponding steps are the same, but are not limited to those disclosed in the above embodiment. It should be noted that the above modules or units may be hardware or software components stored in memory and processed by one or more processors. These modules may also be part of an apparatus and run in the AR / VR device provided herein.According to an embodiment of the present disclosure, a third image processing apparatus for implementing the third image processing method is also provided. FIG10 is a structural block diagram of the third image processing apparatus according to an embodiment of the present disclosure. As shown in FIG10 , the apparatus includes: a display module 1002 configured to display a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; a receiving module 1004 connected to the display module 1002 and configured to receive an image processing instruction, perform clothing segmentation on the first image, and obtain a clothing mask for the clothing; a selection module 1006 connected to the receiving module 1004 and configured to select object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and a driving module 1008 connected to the selection module 1006 and configured to drive the VR device or AR device to display a second image, wherein the second image is a method of occluding clothing in the first image using the clothing mask in a diffusion generation model and generating the second object based on the object generation parameters. The first object in the first image after the clothing is obscured is replaced with the second object. It should be noted that the display module 1002, receiving module 1004, selection module 1006, and driving module 1008 described above correspond to steps S502 to S508 in the embodiment. The examples and application scenarios implemented by these modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in memory and processed by one or more processors. These modules can also be part of a device and run in the AR / VR device provided in this application.According to an embodiment of the present disclosure, an image processing apparatus 4 for implementing the above-mentioned image processing method 4 is further provided. FIG11 is a structural block diagram of the image processing apparatus 4 according to an embodiment of the present disclosure. As shown in FIG11 , the apparatus includes: a first calling module 1102, configured to obtain a first image by calling a first interface, wherein a first object in the first image is wearing clothing; a second calling module 1104, connected to the first calling module 1102, configured to output a clothing mask of the clothing by calling a second interface, wherein the clothing mask of the clothing is obtained by performing clothing segmentation on the first image; and a third calling module 1106, connected to the second calling module 1104, configured to obtain object generation parameters by calling the third interface and generate a second image, wherein the object generation parameters represent parameters required for generating a second object from a first object, and the second image is obtained by replacing the first object in the first image after the clothing is occluded with the second object by using the clothing mask to occlude the clothing in the first image in a diffusion generation model and generating the second object based on the object generation parameters. It should be noted that the first calling module 1102, the second calling module 1104, and the third calling module 1106 correspond to steps S602 to S606 in the embodiment. The examples and application scenarios implemented by these modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory and processed by one or more processors. The above modules can also be part of an apparatus and can be run in the AR / VR device provided in this application. The embodiments of the present disclosure can provide an image processing system. The computer terminal can include an AR / VR device, a server, and a client. The AR / VR device can be any AR / VR device in a group of AR / VR devices.Optionally, the image processing device includes: a processor; a memory, configured to be connected to the processor and configured to provide the processor with instructions for performing the following processing steps: displaying a first image on a display screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receiving an image processing instruction, performing clothing segmentation on the first image to obtain a clothing mask for the clothing; selecting object generation parameters, wherein the object generation parameters represent parameters required to generate a second object from the first object; and driving the VR device or AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. Embodiments of the present disclosure may provide an AR / VR device, which may be any AR / VR device in a group of AR / VR devices. Optionally, in this embodiment, the AR / VR device may be replaced by a terminal device such as a mobile terminal. Optionally, in this embodiment, the AR / VR device may be located in at least one of a plurality of network devices in a computer network. In this embodiment, the AR / VR device may execute program code for the following steps in the image processing method: displaying a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receiving an image processing instruction, performing clothing segmentation on the first image to obtain a clothing mask for the clothing; selecting object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and driving the VR device or AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object. Optionally, FIG12 is a structural block diagram of a computer terminal according to an embodiment of the present disclosure. As shown in Figure 12 , the computer terminal may include one or more (only one shown) processors 1202, a memory 1204, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display. Embodiments of the present disclosure also provide a processor. Figure 13 shows a block diagram of a processor used to implement embodiments of the present disclosure. As shown in Figure 13 , the processor 1300 is configured to run a program. When executed by the processor, the program executes the method in the above-described embodiment.The memory can be configured to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and apparatus in the embodiments of the present disclosure. The processor executes the software programs and modules stored in the memory to perform various functional applications and data processing, thereby implementing the aforementioned image processing method. The memory can include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory can further include memory located remotely from the processor, and such remote memory can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The processor can access information and applications stored in the memory through a transmission device to execute the following steps: acquiring a first image, wherein a first subject in the first image is wearing clothing; performing clothing segmentation on the first image to obtain a clothing mask for the clothing; acquiring object generation parameters, wherein the object generation parameters represent parameters required to transform the first object into a second object; and, in a diffusion generation model, using the clothing mask to occlude the clothing in the first image and generating the second object based on the object generation parameters, replacing the first object in the first image after occluding the clothing with the second object to obtain a second image of the second subject wearing the clothing. Optionally, the processor can further execute program code for the following steps: acquiring the first image, including: acquiring an original image of the first subject wearing clothing; segmenting the first subject and clothing from the original image, and superimposing the segmented first subject and clothing onto a target background image to obtain the first image. Optionally, the processor can further execute program code for the following steps: acquiring the object generation parameters, including at least one of the following: acquiring object attribute parameters of the second object to be generated; and acquiring object environment parameters of the second object to be generated.Optionally, the processor may further execute program code for the following steps: performing edge detection on a clothing mask to obtain a clothing outline; using the clothing mask to occlude clothing in the first image in a diffusion generation model, and generating a second object based on object generation parameters to replace the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second object wearing the clothing, including: using the clothing outline as an edge constraint for the clothing in the diffusion generation model, occluding the clothing in the first image using the clothing mask, and generating the second object based on the object generation parameters to replace the first object in the first image after the clothing is occluded with the second object, thereby obtaining a second image of the second object wearing the clothing, including: using the object outline as an edge constraint for the second object in the diffusion generation model, The clothing is occluded using a clothing mask, and a second object is generated based on object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object to obtain a second image. Optionally, the processor may further execute program code for the following steps: obtaining an object contour of the first object based on the first image, including: if the first image is in color, converting the first image to a solid color background image; and performing edge detection on the first object in the solid color background image to obtain an object contour of the first object. Optionally, the processor may further execute program code for the following steps: the first object and the second object are objects with different images and / or background environments, and the object is a fitting model.The processor may call information and application programs stored in the memory through the transmission device to perform the following steps: in response to an image input instruction applied on the operation interface, display a first image on the operation interface, wherein a first object in the first image is wearing clothing; in response to a clothing segmentation instruction applied on the operation interface, display a clothing mask of the clothing on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; in response to a parameter input instruction applied on the operation interface, display input object generation parameters on the operation interface, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; in response to an image generation instruction applied on the operation interface, display a second image on the operation interface, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after occluding the clothing with the second object. The processor may call information and application programs stored in the memory through the transmission device to perform the following steps: displaying the first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the first object in the first image is wearing clothing; Receive an image processing instruction, perform clothing segmentation on the first image, and obtain a clothing mask of the clothing; select object generation parameters, wherein the object generation parameters are used to represent parameters required when generating the first object into the second object; drive a VR device or an AR device to display a second image, wherein the second image is obtained by using the clothing mask to occlude the clothing in the first image in a diffusion generation model, and replacing the first object in the first image after the clothing is occluded with the second object based on the object generation parameters. The processor can call information and applications stored in the memory through a transmission device to perform the following steps: obtain a first image by calling a first interface, wherein the first object in the first image is wearing clothing; output a clothing mask of the clothing by calling a second interface, wherein the clothing mask of the clothing is obtained by performing clothing segmentation on the first image; obtain object generation parameters by calling a third interface, and generate a second image, wherein the object generation parameters are used to represent parameters required when generating the first object into the second object, and the second image is obtained by using the clothing mask to occlude the clothing in the first image in the diffusion generation model. The second object is generated based on the object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object. An image processing solution is provided using the disclosed embodiments. A first image including a first object wearing clothing is obtained, clothing segmentation is performed on the first image to obtain a clothing mask for the clothing, and object generation parameters are then obtained.In the diffusion generation model, clothing is occluded using a clothing mask and a second object is generated based on object generation parameters. The first object in the first image, after the clothing is occluded, is replaced with the second object, ultimately achieving the second image. Specifically, by occluding the clothing using the clothing mask, the clothing remains unchanged during the generation of the second image using the diffusion generation model, meaning that the clothing is not deformed. This ensures that the generated second object retains the natural state of the original clothing worn by the subject, with realistic physical effects such as wrinkles and drape. Therefore, not only does this achieve the same accuracy as image generation based on the diffusion model, but it also effectively ensures that the clothing does not deform, maintaining a high degree of fit between the clothing and the subject. This achieves a high degree of fit between the clothing and the subject, thereby resolving the technical issue of low fit between the clothing and the subject in display images generated in related technologies. Those skilled in the art will appreciate that the structure shown in FIG12 is merely illustrative, and the computer terminal may also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, or a mobile internet device (MID), PAD, or other terminal device. FIG12 does not limit the structure of the aforementioned electronic devices. For example, the computer terminal may include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG12 , or may have a configuration different from that shown in FIG12 . Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the hardware associated with the terminal device. The program may be stored in a computer-readable storage medium, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Embodiments of the present disclosure also provide a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium may be used to store the program code executed by the image processing method provided herein. Computer-readable storage media may also be referred to as computer storage media. They may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable storage media may transmit, propagate, or transfer programs for use by or in conjunction with an instruction execution system, apparatus, or device.The program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical, radio frequency, or any suitable combination thereof. Optionally, in this embodiment, the computer-readable storage medium can be located in any computer terminal in a group of AR / VR device terminals in an AR / VR device network, or in any mobile terminal in a group of mobile terminals. Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: acquiring a first image, wherein a first object in the first image is wearing clothing; performing clothing segmentation on the first image to obtain a clothing mask for the clothing; obtaining object generation parameters, wherein the object generation parameters represent parameters required to generate a second object from the first object; and, in a diffusion generation model, replacing the first object in the first image after the clothing is occluded with the second object by using the clothing mask to occlude the clothing in the first image and generating the second object based on the object generation parameters, thereby obtaining the second image. Optionally, acquiring a first image includes: acquiring an original image of a first subject wearing clothing; segmenting the first subject and clothing from the original image, and overlaying the segmented first subject and clothing onto a target background image to obtain the first image. Optionally, acquiring object generation parameters includes at least one of the following: acquiring object attribute parameters of a second object to be generated; or acquiring object environment parameters of the second object to be generated. Optionally, performing edge detection on a clothing mask to obtain a clothing outline; and, in a diffusion generation model, occluding the clothing in the first image using the clothing mask, and generating the second object based on the object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object to obtain a second image of the second subject wearing clothing. This includes: in a diffusion generation model, using the clothing outline as an edge constraint for the clothing, occluding the clothing using the clothing mask, and generating the second object based on the object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object to obtain the second image. Optionally, obtaining an object contour of a first object based on the first image; and, in a diffusion generation model, using a clothing mask to occlude clothing in the first image, and generating the second object based on object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object to obtain the second image, including: using the object contour as an edge constraint of the second object in the diffusion generation model, using a clothing mask to occlude the clothing, and generating the second object based on object generation parameters, replacing the first object in the first image after the clothing is occluded with the second object to obtain the second image.Optionally, obtaining the object contour of the first object based on the first image includes: if the first image is in color, converting the first image to a solid color background image; and performing edge detection on the first object in the solid color background image to obtain the object contour of the first object. Optionally, the first object and the second object have different images and / or background environments, and the object is a fitting model. Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: in response to an image input instruction on the operation interface, displaying a first image on the operation interface, wherein a first object in the first image is wearing clothing; in response to a clothing segmentation instruction on the operation interface, displaying a clothing mask of the clothing on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; in response to a parameter input instruction on the operation interface, displaying input object generation parameters on the operation interface, wherein the object generation parameters are used to represent parameters required when generating the first object into the second object; in response to an image generation instruction on the operation interface, displaying a second image on the operation interface, wherein the second image is obtained by using the clothing mask to block the clothing in the first image in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after blocking the clothing with the second object. Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: displaying a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receiving an image processing instruction, performing clothing segmentation on the first image, and obtaining a clothing mask of the clothing; selecting object generation parameters, wherein the object generation parameters are used to represent parameters required when generating the first object into a second object; and driving the VR device or AR device to display a second image, wherein the second image is obtained by using a clothing mask to occlude the clothing in the first image in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after the clothing is occluded with the second object.Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: acquiring a first image by calling a first interface, wherein a first object in the first image is wearing clothing; outputting a clothing mask of the clothing by calling a second interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; acquiring object generation parameters by calling a third interface, and generating a second image, wherein the object generation parameters represent parameters required to transform the first object into a second object, and the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, thereby replacing the first object in the first image after occluding the clothing with the second object. Embodiments of the present disclosure also provide a computer program. Optionally, in this embodiment, when executed by a processor, the computer program implements the program code executed by the image processing method provided herein. Optionally, the computer program, when executed by a processor, implements program code for the following steps: acquiring a first image, wherein a first object in the first image is wearing clothing; performing clothing segmentation on the first image to obtain a clothing mask for the clothing; acquiring object generation parameters, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; and, in a diffusion generation model, using the clothing mask to occlude the clothing in the first image, and generating the second object based on the object generation parameters, replacing the first object in the first image after occluding the clothing with the second object, to obtain a second image. Optionally, the computer program implements program code for the following steps when executed by a processor: in response to an image input instruction on an operation interface, displaying a first image on the operation interface, wherein a first object in the first image is wearing clothing; in response to a clothing segmentation instruction on the operation interface, displaying a clothing mask of the clothing on the operation interface, wherein the clothing mask is obtained by performing clothing segmentation on the first image; in response to a parameter input instruction on the operation interface, displaying input object generation parameters on the operation interface, wherein the object generation parameters are used to represent parameters required when generating a second object from the first object; in response to an image generation instruction on the operation interface, displaying a second image on the operation interface, wherein the second image is obtained by replacing the first object in the first image after the clothing is blocked with the second object by using the clothing mask to block the clothing in the first image in a diffusion generation model and generating the second object based on the object generation parameters.Optionally, when the computer program is executed by a processor, program code is implemented to implement the following steps: displaying a first image on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein a first object in the first image is wearing clothing; receiving an image processing instruction, performing clothing segmentation on the first image, and obtaining a clothing mask of the clothing; selecting object generation parameters, wherein the object generation parameters are used to represent parameters required when generating the first object into a second object; driving the VR device or AR device to display a second image, wherein the second image is obtained by occluding the clothing in the first image using the clothing mask in a diffusion generation model, and generating the second object based on the object generation parameters, and replacing the first object in the first image after the clothing is occluded with the second object. Optionally, when the computer program is executed by a processor, program code is implemented to implement the following steps: acquiring the first image by calling a first interface, wherein the first object in the first image is wearing clothing; outputting the clothing mask of the clothing by calling a second interface, wherein the clothing mask of the clothing is obtained by performing clothing segmentation on the first image; acquiring the object generation parameters by calling a third interface, and generating a second image, wherein The object generation parameters represent the parameters required to transform a first object into a second object. The second image is obtained by replacing the first object in the first image with the second object after the clothing is occluded using a clothing mask in a diffusion generation model. The second object is generated based on the object generation parameters. The serial numbers of the embodiments of the present disclosure are for descriptive purposes only and do not represent the superiority or inferiority of each embodiment. In the above embodiments of the present disclosure, each embodiment has its own focus. For details not provided in a particular embodiment, please refer to the relevant descriptions of other embodiments. It should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other divisions may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through interfaces, units, or modules. It may be in electrical, physical, or other forms. Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of this embodiment.Furthermore, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. These integrated units may be implemented in either hardware or software functional units. If these integrated units are implemented as software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the portion that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (such as a personal computer, server, or network device) to execute all or part of the steps of the methods of the various embodiments of the present disclosure. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), removable hard drives, magnetic disks, or optical disks. The above are merely preferred embodiments of the present disclosure. It should be noted that those skilled in the art could make several improvements and modifications without departing from the principles of the present disclosure, and such improvements and modifications should be considered within the scope of protection of the present disclosure. Industrial Applicability: The solutions provided by the embodiments of the present disclosure can be applied to image processing, including obtaining a first image in which a first subject is wearing clothing; performing clothing segmentation on the first image to obtain a clothing mask for the clothing; obtaining object generation parameters, where the object generation parameters represent the parameters required to transform the first object into a second object; and, in a diffusion generation model, using the clothing mask to occlude the clothing in the first image and generating the second object based on the object generation parameters. The second object is then replaced with the second object in the first image after the clothing is occluded, thereby resolving the technical issue of poor fit between clothing and the subject in the display image generated in the related art.

Claims

Claims 1. An image processing method, characterized in that: include: A first image is obtained, wherein a first object in the first image is wearing clothing; clothing segmentation is performed on the first image to obtain a clothing mask of the clothing; object generation parameters are obtained, wherein the object generation parameters are used to represent parameters required when the first object is generated as a second object; in a diffusion generation model, the clothing in the first image is occluded by using the clothing mask, and the second object is generated based on the object generation parameters, and the first object in the first image after the clothing is occluded is replaced with the second object, so as to obtain a second image in which the second object wears the clothing.

2. The method according to claim 1, characterized in that: The acquiring the first image includes: acquiring an original image of the first object wearing the clothing; segmenting the first object and the clothing from the original image, and superimposing the segmented first object and the clothing on a target background image to acquire the first image.

3. The method according to claim 1, characterized in that: The acquiring of the object generation parameters includes at least one of the following: acquiring object attribute parameters of the second object to be generated; acquiring object environment parameters of the second object to be generated.

4. The method according to claim 1, characterized in that: The method also includes: performing edge detection on the clothing mask to obtain a clothing contour; in the diffusion generation model, using the clothing mask to occlude the clothing in the first image, and generating the second object based on the object generation parameters, replacing the first object in the first image after occluding the clothing with the second object, so as to obtain a second image in which the second object wears the clothing, including: in the diffusion generation model, using the clothing contour as the edge constraint of the clothing, using the clothing mask to occlude the clothing, and generating the second object based on the object generation parameters, replacing the first object in the first image after occluding the clothing with the second object, so as to obtain the second image.

5. The method according to claim 1, characterized in that: The method further includes: obtaining an object contour of the first object based on the first image; using the clothing mask to cover the clothing in the first image in the diffusion generation model, and generating the second object based on the object generation parameter, replacing the first object in the first image after covering the clothing with the second object, and obtaining a second image in which the second object wears the clothing, including: using the object contour as an edge constraint of the second object in the diffusion generation model, covering the clothing with the clothing mask, and generating the second object based on the object generation parameter. 27 clothing; outputting a clothing mask of the clothing by calling a second interface, wherein the clothing mask of the clothing is obtained by performing clothing segmentation on the first image; acquiring object generation parameters by calling a third interface, and generating a second image, wherein the object generation parameters are used to represent parameters required when generating the first object as a second object, and the second image is obtained by using the clothing mask to occlude the clothing in the first image in a diffusion generation model, and generating the second object based on the object generation parameters, and replacing the first object in the first image after occluding the clothing with the second object.

11. The method according to claim 10, characterized in that The acquiring the first image includes: acquiring an original image of the first object wearing the clothing; segmenting the first object and the clothing from the original image, and superimposing the segmented first object and the clothing on a target background image to acquire the first image.

12. The method according to claim 10, characterized in that: The acquiring of the object generation parameters includes at least one of the following: acquiring object attribute parameters of the second object to be generated; acquiring object environment parameters of the second object to be generated.

13. The method according to claim 10, characterized in that The method also includes: performing edge detection on the clothing mask to obtain a clothing contour; the second image is obtained by using the clothing mask to occlude the clothing in the first image in a diffusion generation model, and generating the second object based on the object generation parameters, and replacing the first object in the first image after occluding the clothing with the second object, including: the second image is obtained by using the clothing contour as an edge constraint of the clothing in the diffusion generation model, using the clothing mask to occlude the clothing, and generating the second object based on the object generation parameters, and replacing the first object in the first image after occluding the clothing with the second object.

14. The method according to claim 10, characterized in that: The method also includes: obtaining an object contour of the first object based on the first image; the second image is obtained by using the clothing mask to occlude the clothing in the first image in a diffusion generation model, and generating the second object based on the object generation parameters, and replacing the first object in the first image after occluding the clothing with the second object, including: the second image is obtained by using the clothing mask to occlude the clothing in the diffusion generation model using the object contour as an edge constraint of the second object, and generating the second object based on the object generation parameters, and replacing the first object in the first image after occluding the clothing with the second object.

15. An image processing device, characterized in that: include: A first acquisition module is configured to acquire a first image, wherein a first object in the first image is wearing clothing; a segmentation module is configured to perform clothing segmentation on the first image to obtain a clothing mask of the clothing; a second acquisition module is configured to acquire object generation parameters, wherein the object generation parameters are used to represent parameters required when the first object is generated as a second object; and a processing module is configured to, in a diffusion generation model, use the clothing mask to occlude the clothing in the first image, and generate the second object based on the object generation parameters, replace the first object in the first image after occluding the clothing with the second object, and obtain a second image in which the second object wears the clothing.

16. An electronic device, characterized in that: include: A memory configured to store an executable program; A processor is configured to run the program, wherein the program executes the image processing method according to any one of claims 1 to 14 when running.

17. A computer program product, wherein: The method comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.

18. A computer program product, wherein: The method comprises a non-volatile computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 14 when executed by a processor.

19. A computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the image processing method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Method and device for generating safe clothing patterns for rider of bike

    CN111508042A

  • Clothing deformation via multi-scale patch adversarial loss

    CN112784865A

  • Figure virtual clothes changing method, terminal equipment and storage medium

    CN113436058A