Migration methods and apparatus

By selecting target model clothing images from a model clothing image library and transferring the patterns part by part, the problems of insufficient realism and fixed angles in existing technologies are solved, thereby improving the accuracy and realism of clothing patterns.

CN115641254BActive Publication Date: 2026-11-17BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211251561.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-13
Publication Date
2026-11-17
Estimated Expiration
2042-10-13

AI Technical Summary

Technical Problem

In existing fitting technologies, clothing generated using GANs is not realistic enough. Designers need to use a fixed angle for fitting the front view of the clothing, which makes it difficult to meet the needs of multiple angles.

Method used

By selecting target model clothing images from a pre-set model clothing image library, extracting patterns based on the style and category of the clothing, and transferring the patterns to the second garment part by part, the accuracy and authenticity of the patterns are ensured.

Benefits of technology

It improves the accuracy and realism of clothing pattern transfer, avoids extracting naturally stacked folds of clothing as patterns, and achieves multi-angle clothing fitting effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115641254B_ABST
    Figure CN115641254B_ABST
Patent Text Reader

Abstract

This application discloses a pattern transfer method and apparatus, relating to the field of image processing technology. One specific embodiment of the method includes: in response to acquiring an image to be transferred containing a first garment, selecting target model garment images from a preset model garment image library based on the style and category of the first garment; extracting patterns from sub-images of various parts of the first garment to obtain patterns for each part; and transferring the patterns to a second garment to obtain the transferred target model garment image. This embodiment effectively improves the accuracy and realism of pattern transfer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to the field of image processing technology, and more particularly to a migration method and apparatus. Background Technology

[0002] Current fitting techniques mainly fall into two categories: Option 1, using GANs to directly generate clothing for the model; Option 2, creating a front view of the clothing and directly pasting it onto the model. However, the clothing generated using GANs in Option 1 is not realistic enough; the front view of the clothing in Option 2 requires a designer to create, which is difficult to achieve, and the model can only try on the clothing from a fixed angle. Summary of the Invention

[0003] This application provides a migration method, apparatus, device, and storage medium.

[0004] According to a first aspect, embodiments of this application provide a migration method, the method comprising: in response to obtaining an image to be migrated containing a first garment, selecting a target model garment image from a preset model garment image library based on the style and category of the first garment; extracting patterns from sub-images of various parts of the first garment to obtain patterns for each part; and migrating the patterns to a second garment to obtain a migrated target model garment image.

[0005] According to a second aspect, embodiments of this application provide a migration apparatus, the apparatus comprising: a filtering module configured to, in response to acquiring an image to be migrated containing a first garment, filter out a target model garment image from a preset model garment image library based on the style and category of the first garment; an extraction module configured to extract patterns based on sub-images of various parts of the first garment to obtain patterns for each part; and a migration module configured to migrate the patterns to the second garment to obtain a migrated target model garment image.

[0006] According to a third aspect, embodiments of this application provide an electronic device including one or more processors; a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the migration method as described in any implementation of the first aspect.

[0007] According to a fourth aspect, embodiments of this application provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the migration method as described in any implementation of the first aspect.

[0008] This application, in response to obtaining an image of a first garment to be transferred, selects target model garment images from a pre-set model garment image library based on the style and category of the first garment; extracts patterns from sub-images of various parts of the first garment to obtain patterns for each part; and transfers the patterns to a second garment to obtain the transferred target model garment image. This avoids extracting naturally stacked folds of the garment as patterns, thus improving the accuracy and realism of pattern transfer.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0011] Figure 2 This is a flowchart of one embodiment of the migration method according to this application;

[0012] Figure 3 This is a flowchart of yet another embodiment of the migration method according to this application;

[0013] Figure 4 This is a schematic diagram of an application scenario of the migration method according to this application;

[0014] Figure 5 This is a flowchart of another embodiment of the migration method according to this application;

[0015] Figure 6 This is a flowchart of yet another embodiment of the migration method according to this application;

[0016] Figure 7 This is a schematic diagram of one embodiment of the migration apparatus according to this application;

[0017] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing the server embodiments of this application. Detailed Implementation

[0018] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] Figure 1 An exemplary system architecture 100 is shown, in which the migration method of this application can be applied.

[0021] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0022] Terminal devices 101, 102, and 103 interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications, such as shopping applications and communication applications, can be installed on terminal devices 101, 102, and 103.

[0023] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with displays, including but not limited to mobile phones and laptops. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software programs or software modules (e.g., to provide migration services) or as a single software program or software module. No specific limitations are made here.

[0024] Server 105 can be a server that provides various services. For example, in response to obtaining an image to be migrated containing a first garment, it filters out target model garment images from a preset model garment image library based on the style and category of the first garment; it extracts patterns from sub-images of various parts of the first garment to obtain patterns for each part; and it migrates the patterns to a second garment to obtain the migrated target model garment image.

[0025] It should be noted that server 105 can be either hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide migration services), or as a single software program or software module. No specific limitations are made here.

[0026] It should be noted that the migration method provided in the embodiments of this disclosure can be executed by server 105, terminal devices 101, 102, and 103, or by server 105 and terminal devices 101, 102, and 103 in cooperation with each other. Accordingly, all parts (e.g., units, sub-units, modules, and sub-modules) of the migration device can be entirely located in server 105, entirely located in terminal devices 101, 102, and 103, or separately located in server 105 and terminal devices 101, 102, and 103.

[0027] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0028] Figure 2 A flowchart 200 is shown that can be applied to the migration method of this application. In this embodiment, the migration method includes the following steps:

[0029] Step 201: In response to obtaining the image to be transferred containing the first garment, the target model garment image is selected from the preset model garment image library based on the style and category of the first garment.

[0030] In this embodiment, the execution subject (such as...) Figure 1 The server 105 or terminal devices 101, 102, 103 shown can actively obtain images containing the first garment to be moved from a local or remote server, or passively receive images containing the first garment to be moved specified by the user. This application does not limit this.

[0031] In response to obtaining the image to be migrated containing the first garment, the executing entity may simultaneously select the target model garment image from a preset model garment image library based on the category and style of the first garment, or it may first select a preset number of model garment images from the preset model garment image library based on the category of the first garment, and then select the target model garment image from the preset number of model garment images based on the style of the first garment. This application does not limit this.

[0032] The model clothing image includes the model and the clothing she is wearing, and the target model clothing image includes a second garment that matches the category and style of the first garment.

[0033] Here, the target model clothing image may include other clothing worn by the model in addition to the second garment worn by the model.

[0034] Specifically, the first garment in the image to be migrated is a black T-shirt, the second garment worn by the model in the target model's clothing image is a white T-shirt, and the target model's clothing image also includes black pants worn by the model.

[0035] In some optional methods, target model clothing images are selected from a preset model clothing image library based on the style and category of the first garment, including: selecting a preset number of model clothing images from the preset model clothing image library based on the category of the first garment; and determining the target model clothing image based on the similarity between the style features of the first garment and the style features of the garments contained in the preset number of model clothing images.

[0036] In this implementation, after obtaining the image to be migrated containing the first garment, the executing entity can filter out a preset number of model garment images from a preset model garment image library according to the category of the first garment.

[0037] Here, each of the preset number of model clothing images contains clothing that matches the category of the first clothing.

[0038] The preset quantity can be set according to actual needs, such as 50 or 100, but this application does not limit it.

[0039] Furthermore, the style features of the first garment and the style features of garments of the same category as the first garment in a preset number of model garment images are extracted, and the similarity between the style features of the first garment and the style features of each garment of the same category is calculated. The model garment image corresponding to the garment of the same category with the highest similarity is determined as the target model garment image.

[0040] Here, the style features can be determined based on the mask image of the garment, or by analyzing the key points of the garment; this application does not limit this.

[0041] This implementation method filters out a preset number of model clothing images from a pre-set model clothing image library based on the category of the first clothing; and determines the target model clothing image based on the similarity between the style features of the first clothing and the style features of the clothing contained in the preset number of model clothing images. This helps to improve the accuracy of the determined target model clothing image, thereby improving the realism of transferring the image of the first clothing to the second clothing.

[0042] In some alternative approaches, style features are determined by: extracting the boundary key points of the garment; analyzing the boundary key points to obtain the garment's size information; and determining the style features based on the garment's size information.

[0043] In this implementation, the executing entity can first extract multiple boundary key points of the first garment, analyze the boundary key points of the first garment to obtain the size information of the first garment, determine the style features of the first garment based on the size information of the first garment, and analyze the boundary key points of garments of the same category as the first garment in a preset number of model garment images to obtain the size information of garments of the same category as the first garment. Based on the size information of garments of the same category as the first garment, determine the style features of garments of the same category included in the preset number of model garment images, calculate the similarity between the style features of the first garment and the style features of each garment of the same category, and determine the model garment image corresponding to the garment of the same category with the highest similarity as the target model garment image.

[0044] Specifically, such as Figure 3 As shown, the style features can be represented as F = {f1, f2, ... f} k Taking a short-sleeved T-shirt as an example, the coordinates of 25 boundary key points p1, p2...p... can be used to... 24 p 25 The size information is obtained, and the style features are determined based on this information. The style features can include 13 characteristics: shoulder width, chest height, chest width, upper sleeve length, lower sleeve length, upper sleeve width, lower sleeve width, collar width, collar height, garment length, hem width, upper waist width, and lower waist width. Among these, shoulder width f1 and chest height f2 can be expressed by the following formulas:

[0045]

[0046]

[0047] The keypoint coordinates of each model's clothing image containing clothing of the same category are P′={p′1,p′2,…p′ n}, calculate the feature F′={f1′,f2′,…f in the same way for each category of clothing style. k ′}.

[0048] Furthermore, the similarity between the style feature F′ of each garment of the same category and the style feature F of the first garment is calculated, that is, the distance between the style feature F′ of each garment of the same category and the style feature F of the first garment is calculated, and the model garment image corresponding to the garment of the same category with the smallest distance is determined as the target model image.

[0049] The style characteristics of clothing of the same category with the smallest distance can be represented by the following formula:

[0050]

[0051] It should be noted that the definition and calculation method of features may differ for different clothing styles (short-sleeved T-shirts, long-sleeved jackets, pants, etc.), and can be set according to actual needs.

[0052] This approach extracts the boundary key points of the garment; analyzes these boundary key points to obtain the garment's size information; and determines the style features based on the garment's size information, which helps improve the accuracy of the determined style features.

[0053] Step 202: Extract patterns from the sub-images of each part of the first garment to obtain patterns for each part.

[0054] In this embodiment, after obtaining the image to be migrated containing the first garment, the executing entity can first segment the outer surface mask image of the first garment according to the parts to obtain multiple sub-mask images corresponding to different parts, and then extract the patterns of the sub-images of the first garment corresponding to the sub-mask images to obtain the patterns of each part.

[0055] The executing entity can use existing or future-developed pattern extraction algorithms to extract patterns, such as big law, edge detection, hole filling, etc.

[0056] In some alternative methods, the sub-images of each part of the first garment are determined by: obtaining the outer surface mask image of the first garment; segmenting the outer surface mask image according to the parts based on the key points associated with the parts in the boundary key points of the first garment to obtain sub-mask images corresponding to each part; and determining the sub-images of the first garment corresponding to each sub-mask image as the sub-images of each part of the first garment.

[0057] In this implementation, after obtaining the image to be migrated containing the first garment, the executing entity can generate an outer surface mask image of the first garment based on the image to be migrated containing the first garment; then, based on the key points associated with the parts in the boundary key points of the first garment, the outer surface mask image is segmented according to the parts to obtain sub-mask images corresponding to each part; and the sub-images of the first garment corresponding to each sub-mask image are determined as sub-images of each part of the first garment.

[0058] Specifically, the first garment is a short-sleeved T-shirt. The executing entity can first divide the outer surface mask image of the short-sleeved T-shirt into three sub-mask images according to the parts, namely the left sleeve sub-mask M. a Torso submask M b Right sleeve mask M c The segmentation can be based on key points p7, p... 12 p 20 p 25The sub-images of the first garment corresponding to each sub-mask image are determined as sub-images of each part of the first garment.

[0059] This implementation method obtains the outer surface mask image of the first garment; based on the key points associated with the parts in the boundary key points of the first garment, the outer surface mask image is segmented according to the parts to obtain sub-mask images corresponding to each part; the sub-images of the first garment corresponding to each sub-mask image are determined as sub-images of each part of the first garment, which helps to improve the accuracy of the determined sub-images of each part.

[0060] In some alternative approaches, pattern extraction is performed based on sub-images of various parts of the first garment to obtain patterns for each part, including: for each sub-image of the first garment, Canny edge detection and hole filling are used to obtain patterns for each part.

[0061] In this implementation, for each sub-image of the first garment, the execution subject can first use Canny edge detection to obtain the edge of the pattern, and then fill the holes based on the edge of the pattern to obtain the pattern of each part.

[0062] This implementation method uses Canny edge detection and hole filling on sub-images of each part of the first garment to obtain patterns for each part, effectively improving the accuracy of the determined patterns. Step 203: Transfer the patterns to the second garment in the target model's garment image.

[0063] In this embodiment, after obtaining the patterns of the sub-images of each part, the executing entity can directly transfer the patterns to the second garment in the target model's clothing image to obtain the transferred target model's clothing image. Alternatively, it can first determine whether the background color of the first garment and the second garment in the target model's clothing image are the same. If they are the same, the patterns of each part obtained above can be transferred to the second garment. This application does not limit this.

[0064] In some alternative approaches, the method further includes: in response to determining that the background color of the first garment is different from the background color of the second garment, transferring the background color of the first garment to the second garment based on the background color of the first garment.

[0065] In this implementation, before or after pattern migration, the executing entity can use existing or future-developed background color extraction algorithms, such as iterative methods or big-law methods, to extract the background color of the first garment and the background color of the second garment of the target model's garment, and determine whether the two are the same. If they are not the same, the background color of the second garment can be directly replaced with the background color of the first garment based on the background color of the first garment.

[0066] Specifically, the executing entity can perform large-scale binarization on the portion of the grayscale image G of the image to be transferred where M>0 (the first garment), removing abrupt color changes on the garment to obtain the mask M. 1 .

[0067] From M 1 Extract the base color of clothing from clothing values ​​greater than 0.

[0068] θ=OTSU(G(M>0))

[0069] S1 = count(G>θ∩M>0)

[0070] S2 = count(G≤θ∩M>0)

[0071]

[0072] Where OTSU represents the threshold calculation by the big law, and count represents the number of pixels that meet the conditions.

[0073] Furthermore, we obtain M 1 From now on, it can be assumed that M 1 The foreground pixels of the clothing represent the background color of the first clothing. We denote the grayscale image of the image to be transferred, I, as G, and the foreground (M) of G... 1 If the set of pixels >0 is g, then the background color C is:

[0074]

[0075] Here, Mode represents the mode of the set, and mean represents the mean. Therefore, the background color C is the mean color of all pixels whose grayscale value equals Mode(g).

[0076] This implementation method, in response to the determination that the background color of the first garment is different from the background color of the second garment of the target model, transfers the background color of the first garment to the second garment of the target model based on the background color of the first garment, achieving simultaneous transfer of background color and image, and further improving the transfer effect.

[0077] In some alternative methods, the background color of the first garment is transferred to the second garment based on the background color of the first garment, including: transferring the background color of the first garment to the second garment based on the pixel value change information between the pixels corresponding to the background colors of the first garment and the second garment.

[0078] In this implementation, the executing entity can determine whether the background color of the first garment and the background color of the second garment in the target model's garment image are the same. If they are different, background color migration can be performed based on the grayscale value change information between the pixels corresponding to the background color of the first garment and the background color of the second garment in the target model's garment.

[0079] Specifically, the background color of the first garment is C, and the background color of the second garment in the target model's garment image is C′. To transfer the background color of the first garment to the second garment in the target model's garment image while preserving the motion texture and lighting rendering effects of the second garment—that is, retaining the grayscale value variations between pixels in the second garment—then the transferred target model's garment image I... 2 for

[0080]

[0081] Where C is the average color value of all pixels in the first garment, C′ is the average color value of all pixels in the second garment, and I * For the target model's clothing image, (I * -C′) represents the grayscale value variation information between pixels in the second garment, I * +CC′,(M * >0) is to overlay the grayscale value variation information between pixels in the second garment onto the base color of the first garment, M * >0 indicates the second garment in the target model's clothing image.

[0082] This implementation method transfers the background color of the first garment to the second garment of the target model's garment by using the grayscale value change information between the corresponding pixels of the background color of the first garment and the background color of the second garment in the target model's garment. This achieves the transfer of the background color of the first garment to the second garment of the target model's garment image, while preserving the motion texture and lighting rendering effect of the second garment, effectively improving the background color transfer effect.

[0083] In some alternative approaches, transferring the pattern to the second garment includes: transferring the pattern to the second garment based on the mapping relationship between the boundary key points of the sub-image of each part and the boundary key points of the corresponding part of the second garment.

[0084] In this implementation, after obtaining the patterns of each part, the executing entity can further transfer the pattern of each part to the corresponding part of the second garment in the target model's clothing image based on the mapping relationship between the boundary key points of the sub-images of each part and the boundary key points of the corresponding part of the second garment in the target model's clothing image.

[0085] The boundary key points of each part of the sub-image include the key points on which the sub-image of that part is divided.

[0086] Specifically, for the pattern in the sub-image of the torso, the boundary key points of the first garment torso are K = {p2,…,p7,p...} 12 ,…,p 20 ,p 25The boundary key point of the second garment torso is K. * ={p * 2,…,p * 7,p * 12 ,…,p * 20 ,p * 25}

[0087] Calculate from K to K using Singular Value Decomposition (SVD) * The mapping matrix T∈R 3×2 Then, the image of the torso sub-image I is mapped to the image of the torso of the second garment through the mapping matrix T. 2 In the image I, let the coordinates of a pixel on the pattern of the first garment I be p = (x, y). Then, after mapping, the pixel in image I... 2 The coordinates on are p * =(x * ,y * )

[0088]

[0089] Furthermore, the executing entity can transfer the patterns of each part of the extracted first garment to the corresponding parts of the second garment in the target model image, thereby obtaining the final transferred target model garment image.

[0090] This implementation improves the accuracy of pattern transfer by mapping the boundary key points of the sub-images of each part to the boundary key points of the corresponding parts of the second garment.

[0091] See also Figure 4 , Figure 4 This is a schematic diagram illustrating an application scenario of the migration method according to this embodiment. Figure 4 In the application scenario, in response to obtaining the image 402 to be transferred containing a first garment, such as a black patterned T-shirt, the execution entity 401 can filter out target model garment images 403 from a preset model garment image library based on the style and category of the first garment. The target model garment image 403 includes a second garment, such as a black plain T-shirt, and the second garment matches the category and style of the first garment. Further, based on sub-images 404 of various parts of the first garment, such as the left sleeve image, torso sub-image, and right sleeve image, pattern extraction is performed, and the extracted pattern, such as pattern M405, is transferred to the second garment to obtain the transferred target model garment image 406.

[0092] The migration method disclosed herein, in response to obtaining an image to be migrated containing a first garment, selects a target model garment image from a preset model garment image library based on the style and category of the first garment; extracts patterns from sub-images of various parts of the first garment to obtain patterns for each part; and migrates the patterns to a second garment to obtain a migrated target model garment image. This avoids extracting naturally stacked folds of the garment as patterns, thus improving the accuracy and realism of pattern migration.

[0093] Further reference Figure 5 This illustrates a flow 500 of another embodiment of the migration method. In this embodiment, the flow 500 of the migration method may include the following steps:

[0094] Step 501: In response to obtaining the image to be transferred containing the first garment, the target model garment image is selected from the preset model garment image library based on the style and category of the first garment.

[0095] In this embodiment, the implementation details and technical effects of step 501 can be found in the description of step 201, and will not be repeated here.

[0096] Step 502: For each part of the first garment, determine the connected regions of the sub-image.

[0097] In this embodiment, after obtaining the image to be migrated containing the first garment, the executing entity can first segment the outer surface mask image of the first garment according to the parts to obtain multiple sub-mask images corresponding to different parts, and then extract patterns from the sub-images of the corresponding parts of the first garment corresponding to the sub-mask images.

[0098] However, since the accuracy of the mask image is not very high, there are many false patterns in the extracted pattern, that is, non-pattern parts are extracted as patterns, such as a small amount of background is extracted as a pattern. To solve the above problem, for each part of the first garment's sub-image, the executing entity can first use the connected region marking method in the existing technology or future development technology, such as the Two-pass algorithm, edge detection and hole filling, to determine the connected regions in the sub-image mask image.

[0099] Here, a connected region generally refers to an image region composed of foreground pixels with the same pixel value and adjacent positions.

[0100] The connected region corresponding to the sub-image can be one or more, that is, the initial pattern (including real image and fake pattern) corresponding to the sub-image can be one or more, and this application does not limit this.

[0101] Specifically, a connected region can be represented as Con = {q1, q2, ..., q}.m} indicates that the current connected region consists of m points, q i =[x,y] represents the coordinates of the i-th point.

[0102] Step 503: For each connected region, calculate the distance between the connected region and the boundary of the corresponding sub-image.

[0103] In this embodiment, for each connected region, the execution entity can calculate the distance between the connected region and each point of the boundary of the corresponding sub-image, that is, the distance between the connected region and each point of the boundary of the mask image of the corresponding sub-image, and determine the minimum distance as the distance between the connected region and the boundary of the corresponding sub-image.

[0104] Specifically, the set of boundary points of the mask image of the sub-image corresponding to the connected region is Edge={v1,v2,…,v…} u}, that is, there are u boundary points, v i Let represent the coordinates of the i-th boundary point. The distance d between the connected region and the boundary of its corresponding sub-image can be represented by the following formula:

[0105]

[0106] Step 504: In response to the determination that the distance satisfies the first preset condition, the connected region is defined as a pattern.

[0107] In this embodiment, for each connected region, the executing entity can determine whether the minimum distance between the connected region and the boundary satisfies the first preset condition. If the first preset condition is satisfied, the connected region is determined as a pattern, that is, a true pattern is determined in the initial pattern.

[0108] The first preset condition can be set according to actual needs, such as the minimum distance between the connected region and the boundary being greater than or equal to a preset value, or the minimum distance between the connected region and the boundary conforming to a preset threshold range, etc. This application does not limit this.

[0109] In some alternative approaches, determining a pattern for the connected region in response to a determination that the distance satisfies a first preset condition includes: determining the connected region as a pattern in response to a determination that the distance satisfies the first preset condition and the number of pixels contained in the connected region satisfies a second preset condition.

[0110] In this implementation, after determining that the minimum distance between the connected region and the boundary satisfies the first preset condition, the executing entity can further determine that the number of pixels contained in the connected region satisfies the second preset condition. If the condition is met, the connected region is determined as a pattern.

[0111] The second preset condition can be set according to actual needs, such as the number of pixels in the connected region being greater than or equal to a preset value, or the number of pixels in the connected region meeting a preset threshold range, etc. This application does not limit this.

[0112] Specifically, such as Figure 6 As shown, Figure 6 The CCP includes 5 connected regions (located in) Figure 6 The two white connected regions above and located in Figure 6 The three white connected regions at the bottom can be used to characterize whether a connected region is a pattern, as shown in the following formula:

[0113]

[0114] Where α and β are the threshold for the size of the connected component and the distance threshold, respectively. After obtaining the attributes A of all connected components, only the connected components where A = True are retained; that is, the connected components where A = True are located in... Figure 6 The connected area in the middle is identified as the pattern for that part.

[0115] This implementation determines the connected region as a pattern in response to the determination that the minimum distance between the connected region and the boundary satisfies a first preset condition, and that the number of pixels contained in the connected region satisfies a second preset condition. This helps to improve the accuracy of the determined pattern and further enhances the migration effect.

[0116] Step 505: Transfer the pattern to the second garment in the target model's clothing image to obtain the transferred target model's clothing image.

[0117] In this embodiment, the implementation details and technical effects of step 505 can be found in the description of step 203, and will not be repeated here.

[0118] The above embodiments of this application, and Figure 2 Compared with the corresponding embodiments, the migration method in this embodiment has a process 500 that involves determining the connected regions of each part of the first garment's sub-image; calculating the distance between the connected region and the boundary of the corresponding sub-image for each connected region; and determining the connected region as a pattern in response to the determination that the distance satisfies a first preset condition, thereby achieving refined pattern recognition, effectively improving the accuracy of the extracted pattern to be migrated, and further improving the accuracy and effectiveness of pattern migration.

[0119] Further reference Figure 7 As an implementation of the methods shown in the above figures, this application provides an embodiment of a migration device, which is similar to... Figure 2Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0120] like Figure 7 As shown, the migration device 700 of this embodiment includes: an image filtering module 701, a pattern extraction module 702, and a pattern migration module 703.

[0121] The image filtering module 701 can be configured to, in response to acquiring an image to be transferred containing the first garment, filter out target model garment images from a preset model garment image library based on the style and category of the first garment.

[0122] The pattern extraction module 702 can be configured to extract patterns based on sub-images of various parts of the first garment to obtain patterns for each part.

[0123] The pattern transfer module 703 can be configured to transfer a pattern to the second garment to obtain a transferred image of the target model's garment.

[0124] In some optional embodiments of this example, the extraction module is further configured to: for each part of the first garment, determine the connected region of the sub-image; for each connected region, calculate the distance between the connected region and the boundary of the corresponding sub-image; and in response to determining that the distance satisfies a first preset condition, determine the connected region as a pattern.

[0125] In some optional embodiments of this example, determining a pattern for the connected region in response to the determination that the distance satisfies a first preset condition includes: determining the connected region as a pattern in response to the determination that the distance satisfies the first preset condition and the number of pixels contained in the connected region satisfies a second preset condition.

[0126] In some optional embodiments of this example, the sub-images of each part of the first garment are determined by: obtaining an outer surface mask image of the first garment; segmenting the outer surface mask image according to the parts based on the key points associated with the parts in the boundary key points of the first garment to obtain sub-mask images corresponding to each part; and determining the sub-images of the first garment corresponding to each sub-mask image as sub-images of each part of the first garment.

[0127] In some optional embodiments of this example, the pattern extraction module is further configured to: for each part of the first garment, use Canny edge detection and hole filling to obtain the pattern of each part.

[0128] In some optional embodiments of this example, the filtering module is further configured to: filter out a preset number of model clothing images from a preset model clothing image library based on the category of the first clothing; and determine the target model clothing image based on the similarity between the style features of the first clothing and the style features of the clothing contained in the preset number of model clothing images.

[0129] In some optional embodiments of this example, style features are determined by: extracting the boundary key points of the garment; analyzing the boundary key points to obtain the size information of the garment; and determining the style features based on the size information of the garment.

[0130] In some alternative embodiments of this embodiment, the device further includes a background color transfer module configured to transfer the background color of the first garment to the second garment based on the background color of the first garment in response to determining that the background color of the first garment is different from the background color of the second garment.

[0131] In some optional embodiments of this example, the background color migration module is further configured to migrate the background color of the first garment to the second garment based on the background color of the first garment and the background color of the second garment.

[0132] In some optional embodiments of this embodiment, the pattern transfer module is further configured to transfer the pattern to the second garment based on the mapping relationship between the boundary points of the sub-image of each part and the boundary points of the corresponding part of the second garment.

[0133] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.

[0134] like Figure 8 The diagram shown is a block diagram of an electronic device according to an embodiment of the migration method of this application.

[0135] 800 is a block diagram of an electronic device for a migration method according to embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.

[0136] like Figure 8As shown, the electronic device includes one or more processors 801, a memory 802, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take the 801 processor as an example.

[0137] The memory 802 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the migration method provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to perform the migration method provided in this application.

[0138] Memory 802, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the migration method in the embodiments of this application (e.g., appendix). Figure 7 The image filtering module 701, pattern extraction module 702, and pattern migration module 703 are shown. The processor 801 executes various server functions and migrations by running non-transient software programs, instructions, and modules stored in the memory 802, thereby implementing the migration method in the above method embodiments.

[0139] Memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the migrated electronic device. Furthermore, memory 802 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 802 may optionally include memory remotely located relative to processor 801, and these remote memories can be connected to the migrated electronic device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0140] The electronic device for the migration method may further include an input device 803 and an output device 804. The processor 801, memory 802, input device 803, and output device 804 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0141] Input device 803 can receive input numerical or character information, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 804 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touchscreen.

[0142] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0143] These computational programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.

[0144] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor for transferring input to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0145] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0146] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0147] The technical solution according to the embodiments of this application effectively improves the accuracy and authenticity of pattern migration.

[0148] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0149] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A migration method, the method comprising: In response to acquiring a transferable image containing a first garment, a target model garment image is selected from a preset model garment image library based on the style and category of the first garment. The target model garment image includes a second garment, which matches the category and style features of the first garment. The style features are determined by: extracting boundary key points of the garment; analyzing the boundary key points to obtain the garment's size information; and determining the style features based on the garment's size information. The boundary key points include the dividing key points of the garment's internal structure. Patterns are extracted from sub-images of various parts of the first garment to obtain patterns for each part. The pattern is transferred to the second garment to obtain the transferred target model garment image.

2. The method of claim 1, wherein, The process of extracting patterns from sub-images of various parts of the first garment to obtain patterns for each part includes: For each part of the first garment, determine the connected regions of that sub-image; For each connected region, calculate the distance between the connected region and the boundary of the corresponding sub-image; In response to determining that the distance satisfies a first preset condition, the connected region is defined as a pattern.

3. The method of claim 2, wherein, The step of determining the connected region as a pattern in response to determining that the distance satisfies a first preset condition includes: In response to determining that the distance satisfies a first preset condition and that the number of pixels contained in the connected region satisfies a second preset condition, the connected region is determined as a pattern.

4. The method of claim 1, wherein, The sub-images of each part of the first garment are determined in the following way: Obtain the mask image of the outer surface of the first garment; Based on the key points associated with the parts in the boundary key points of the first garment, the outer surface mask image is segmented according to the parts to obtain sub-mask images corresponding to each part; The sub-images of the first garment corresponding to each sub-mask image are determined as sub-images of each part of the first garment.

5. The method of claim 1, wherein, The process of extracting patterns from sub-images of various parts of the first garment to obtain patterns for each part includes: For each sub-image of the first garment, Canny edge detection and hole filling are used to obtain the pattern of each part.

6. The method of claim 1, wherein, The step of filtering target model clothing images based on the style and category of the first garment includes: In a pre-defined library of model clothing images, a pre-defined number of model clothing images are selected based on the category of the first garment. The target model clothing image is determined based on the similarity between the style features of the first garment and the style features of the garments contained in a preset number of model clothing images.

7. The method according to claim 1, further comprising: In response to determining that the base color of the first garment is different from the base color of the second garment, the base color of the first garment is transferred to the second garment based on the base color of the first garment.

8. The method of claim 7, wherein, The step of transferring the base color of the first garment to the second garment based on the base color of the first garment includes: Based on the grayscale value change information between the pixels corresponding to the background color of the first garment and the background color of the second garment, the background color of the first garment is transferred to the second garment.

9. The method of claim 4, wherein, The process of transferring the pattern to the second garment includes: Based on the mapping relationship between the boundary key points of the sub-image of each part and the boundary key points of the corresponding part of the second garment, the pattern is transferred to the second garment, wherein the boundary key points of the sub-image of each part include: the key points on which the sub-image of that part is divided.

10. A migration device, the device comprising: An image filtering module is configured to, in response to acquiring a transfer image containing a first garment, filter target model garment images from a preset model garment image library based on the style and category of the first garment. The target model garment images include a second garment, which matches the category and style features of the first garment. The style features are determined by: extracting boundary key points of the garment; analyzing the boundary key points to obtain the garment's size information; and determining the style features based on the garment's size information. The boundary key points include the dividing key points of the garment's internal structure. The pattern extraction module is configured to extract patterns based on sub-images of various parts of the first garment to obtain patterns for each part. The pattern transfer module is configured to transfer the pattern to the second garment to obtain a transferred image of the target model's garment.

11. An electronic device, comprising: include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores information that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-9.

12. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The calculation instructions are used to cause the computer to perform the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Garment style migration system and method

    CN113160033A