Contour feature-preserving grid deformation system and method for virtual fitting
Through the contour-keeping feature grid deformation system for virtual fittings, combined with fitting model data creation, clothing detection and image processing modules, the problem of difficult to maintain the outline shape of the clothing in virtual fittings is solved, and an efficient, real and natural fitting experience is achieved.
Patent Information
- Application Number
- CN202510307556.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-17
AI Technical Summary
Existing virtual fitting technology is difficult to maintain the outline shape of the clothing, resulting in the user experience being unreal and natural.
A contour-protecting feature grid deformation system for virtual fittings is adopted. The system includes an image deformation fitting device. Through fitting model data creation, clothing detection and image processing modules, the global and local deformation registration fusion of clothing and mannequins is realized to maintain the original contour shape of the clothing.
It achieves fast and efficient fitting results, maintains the original outline shape of the clothing, and provides users with an economical, convenient, real and natural fitting experience.
Smart Images

Figure CN119810374A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a deformation system and method thereof, and more specifically, to a contour-preserving feature grid deformation system and method thereof for virtual fitting, and belongs to the technical field of image processing. Background Art
[0002] As living standards improve, consumers have an urgent need for economical and convenient clothing try-on. Virtual fitting digitally displays the effect of clothing on the body, allowing users to quickly switch clothing combinations without paying for purchase and transportation costs, improving and meeting users' try-on experience and personalized requirements.
[0003] Image mesh deformation technology for virtual fitting combines computer graphics, image processing and machine learning to quickly align and fuse clothing models and human body models. During this image processing process, how to maintain the contour of the clothing and provide users with a realistic upper body matching effect is the focus and difficulty of virtual fitting technology research. Summary of the invention
[0004] In order to solve the above-mentioned problems of the prior art, the present invention provides a contour-preserving feature grid deformation system and method for virtual fitting, which has the technical characteristics of being able to quickly and efficiently obtain fitting results while maintaining the original contour shape of the clothing, providing users with an economical, convenient, real and natural fitting experience.
[0005] In order to achieve the above object, the present invention is implemented by the following technical solutions: The present invention discloses a contour-preserving feature mesh deformation system for virtual fitting, which is characterized by comprising an electronic device 100, wherein the electronic device 100 comprises an image deformation fitting device 110, a memory 111, a processor 112 and a communication unit 113; the memory 111, the processor 112 and the communication unit 113 are connected to realize data transmission or interaction; The memory 111 is used to store programs. The processor 112 executes the programs after receiving the execution instruction. The communication unit 113 is used to establish a communication connection between the electronic device 100 and other devices through the network, and to receive and send data through the network; The image deformation fitting device 110 includes a fitting model data creation module 1101, a clothing detection module 1102, and an image processing module 1103; The model data creation module 1101 is used to mark and save the positions and attributes of the key points and contour lines of the human model, so as to facilitate the subsequent model fitting judgment and deformation target position calculation of the fitting garment; The clothing detection module 1102 is used to classify the fitting clothing and detect key points, as well as segment the clothing area and the back area of the clothing to determine the clothing deformation strategy and key control points, and provide semantic information and geometric information for clothing mesh deformation; The image processing module 1103 is used for image triangulation, global and local deformation registration and fusion of clothing and human models, iterative penetration testing and correction by constructing a linear sparse system for solving contour-preserving features to obtain fitting results.
[0006] The present invention provides a contour feature-preserving mesh deformation method for virtual fitting, characterized in that the method comprises the following steps: Step 20: Before fitting, create fitting mannequin data and save it to the fitting database for reuse in various categories of clothing; use the self-annotated data to train clothing category classification and key point detection models, as well as clothing segmentation models, to obtain clothing semantic information and geometric information; Step 21: Obtain the clothing image to be tried on and designate the fitting model; Step 22: Classify clothing image categories and detect key points, as well as perform clothing area and clothing back mask segmentation; Step 23: Based on the corresponding key points, contour shapes and other constraints of the clothing and the model, the clothing image is differentially deformed and fused to the model to generate a virtual fitting result.
[0007] Preferably, the specific steps of creating fitting mannequin data in step 20 and saving it to the fitting database include: Step 24: Mark the key points and attributes of the mannequin’s torso; Step 25: Extract the contour of the human model and divide it into different parts according to the body parts where the contour is located; Step 26: Save the key point and contour line annotation results to the fitting database for easy reuse in fitting of different categories of clothing.
[0008] Preferably, the key points in step 24 include shoulders, elbows, wrists, armpits, hips, crotch, knees and ankles of the human model, and the coordinate positions of the human body images and the names of the parts thereof are recorded; In step 25, the human body contour line is specifically divided into 10 regions, namely, the left and right arms and the inner and outer sides of the left and right arms, the left and right legs and the inner and outer sides of the left and right legs, and the left and right torsos, and the positions of the contour points and the partitions where the contour points are located are recorded; In step 26, the data related to the labeled human model is saved as a binary file, and the relevant data is subsequently read from the file according to the fitting model specified by the user.
[0009] Preferably, the training of the clothing category classification and key point detection model and the clothing segmentation model in step 20 specifically includes the following steps: Step S27: labeling own clothing image data using Labelme software; Step S28: Use the HRNet convolutional neural network to train the own data set to obtain clothing classification and key point detection models; Step S29: Use the MaskR-CNN convolutional neural network to train the own data set to obtain the mask segmentation model of the clothing area and the back area.
[0010] Preferably, the annotated own clothing image data in step S27 include labels of five clothing categories, namely, tops, dresses, coats, skirts, and trousers, and key points of shoulders, cuffs, hems, trouser legs, crotches, and hems of each clothing category, as well as clothing areas of each category and back areas of necklines, cuffs, and hems.
[0011] Preferably, the step S23 includes sub-step S231, sub-step S232, sub-step S233, sub-step S234, sub-step S235 and sub-step S236; Step S231: triangular mesh subdividing the clothing image; extracting the clothing area contour line according to the clothing segmentation mask, taking the points on the contour line together with the clothing key points as the grid point set to be subdivided, and the clothing contour line as the grid edge set, and using the Triangle algorithm library to subdivide the clothing image into a set of triangular units to improve image processing efficiency; Step S232: the clothing image and the human model are roughly aligned by similarity transformation and local Laplacian differential deformation; Step S233: Integrate the contour shape constraint, target position constraint and length constraint, construct and solve a linear least squares sparse system, and obtain a new contour line position that maintains the original contour shape features; Step S234: Perform a penetration test on the closed contour points of the clothing, and update the safe position of the penetration point as the position constraint of the sparse linear system. The closed contour points of the clothing should be outside the corresponding human model contour boundary, otherwise the human image will pass through the clothing contour, causing a penetration phenomenon, which is visually unreasonable. The steps of the penetration test and updating the penetration point position are as follows: Select the closed contour points of the garment ; Use kd-tree to find The closest point in the segment corresponding to the mannequin's outline ; according to Adjacent points and The line segment vector of the human body is calculated Normal vector ; connect and For vector , calculate the vector outer product ; If the vector The z component , then record the current point as the penetration point and update to ,in The clearance margin from the updated contour point to the model contour, for The position normal vector is given by Adjacent points and The line segment vector is calculated and the design clearance margin is ;like , then the closed contour point passes the mold penetration test; Step S235: after confirming that all closed contour points of the clothing have passed the mold penetration test, the clothing mesh is differentially deformed with the latest clothing contour line position as the target constraint to complete the clothing image processing; Step S236: The processed clothing image is layered and fused with the human model image to complete the virtual fitting.
[0012] Preferably, the step S232 includes sub-step S2321 and sub-step S2322; Step 2321: by matching the corresponding points of the clothing and the model, similar transformation of the clothing is performed to achieve global rough alignment. For tops, coats and dresses, their shoulder points are selected and matched with the model's shoulder points to calculate the similarity transformation matrix; for skirts and trousers, their waists are selected and matched with the model's waist contour points to calculate the similarity transformation matrix. The clothing image is similarly transformed through the matrix to achieve global rough alignment with the model; Step 2322: through the matching relationship between the corresponding points of the clothing and the model, the clothing mesh Laplacian differential deformation is performed to achieve local alignment; for tops, coats and dresses, the armpit points, elbow points and cuff midpoints are selected as control points, and the armpit points, elbow points and wrist points of the corresponding models are the target positions; for skirts and trousers, the waist points, trouser leg midpoints and crotch points are selected as control points, and the waist points, ankle points and crotch points of the corresponding models are the target positions; execute the clothing mesh Laplacian differential deformation to achieve approximate alignment of local positions; The grid Laplacian differential deformation is to solve the least squares linear system, which is expressed as follows: ; in, and Represent the mesh vertices before and after deformation, is the vertex The Laplacian coordinates of are defined as: ; in Represents a vertex The set of adjacent vertices of Represents a vertex The position vectors of adjacent vertices, is the vertex The number of adjacent vertices.
[0013] Preferably, the step S233 may include sub-step S2331, sub-step S2332, sub-step S2333 and sub-step S2234; Step S2331: constructing clothing outline shape constraints; the clothing outline shape constraints are expressed as follows: ; in, and Represent the contour points before and after deformation, respectively. It is a contour point The Laplacian coordinates of are defined as: ; in Represents contour points The set of contour points in the n-Ring neighborhood of Indicate point The position vector of the neighborhood contour points, is the vertex The number of contour points in the n-Ring neighborhood, design ; Step S2332: constructing the position constraints of the key contour points of the clothing; the position constraints of the key contour points of the clothing are expressed as follows: ; in Indicates the fixed contour points required for the current category of clothing. For tops, coats, and dresses, the fixed contour points are the shoulder point, armpit point, elbow point, and hem point. For skirts and trousers, the fixed contour points are the waist point, hem point, leg point, and crotch point. Step S2333: constructing the length constraint of the key parts of the clothing; the length constraint of the key parts of the clothing is expressed as follows: ; in Indicates the connection line of key points; for tops, coats and dresses, the key point is the sleeve width; for trousers, the key point is the trouser leg width; there is no key point for skirts; and Respectively represent the line vectors of the contour points of the key parts before and after deformation, that is, ; Step S2334: construct and solve a linear least squares sparse system; the linear least squares sparse system is expressed as follows: ; in , and They represent the weights of clothing contour shape constraints, clothing key contour point constraints, and clothing key part length constraints, respectively. , , .
[0014] Beneficial effects: Compared with the existing fitting technology, this application creates a fitting model database, classifies clothing image categories and detects key points, as well as performs clothing area and clothing back mask segmentation. Based on the detected clothing information, the clothing is aligned and fused to the human model through grid differential deformation to complete the fitting process. The grid deformation method provided in this application can quickly and efficiently obtain fitting results while maintaining the original contour shape of the clothing, providing users with an economical, convenient, real and natural fitting experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic block diagram of the structure of an electronic device provided in an embodiment of the present application.
[0016] Figure 2 A schematic block diagram of the steps of a contour-preserving feature mesh deformation method for virtual fitting provided in an embodiment of the present application.
[0017] Figure 3 This is a schematic block diagram of other steps of the contour-preserving feature mesh deformation method for virtual fitting provided in an embodiment of the present application.
[0018] Figure 4 This is a schematic block diagram of other steps of the contour-preserving feature mesh deformation method for virtual fitting provided in an embodiment of the present application.
[0019] Figure 5 for Figure 2 Schematic diagram of the sub-step process of step S23.
[0020] Figure 6 for Figure 5 Schematic diagram of the sub-step process of step S232.
[0021] Figure 7 for Figure 5 Schematic diagram of the sub-step process of step S233.
[0022] Figure 8 This is a schematic block diagram of an image deformation fitting device provided in an embodiment of the present application.
[0023] Fig. 9 A virtual fitting flow chart provided for an embodiment of the present application. DETAILED DESCRIPTION
[0024] The present invention is further described below in conjunction with the accompanying drawings of the specification, but the present invention is not limited to the following embodiments. The described embodiments are part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0026] The specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings.
[0027] Please refer to Figure 1 , Figure 1 1 is a schematic block diagram of the structure of an electronic device 100. The electronic device 100 includes an image deformation fitting device 110, a memory 111, a processor 112 and a communication unit 113.
[0028] The memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0029] The memory 111 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 112 executes the programs after receiving the execution instruction. The communication unit 113 is used to establish a communication connection between the electronic device 100 and other devices (such as user terminals) through a network, and to receive and send data through the network. For example, in this embodiment, the electronic device 100 communicates data with external devices through the communication unit 113.
[0030] Please refer to Figure 2 , Figure 2 A schematic block diagram of the steps of a contour-preserving feature mesh deformation method for virtual fitting provided in an embodiment of the present application. The present application provides a contour-preserving feature mesh deformation method for virtual fitting, which is applied to an electronic device 100, and the method includes: Step 21, obtaining pictures of clothing to be tried on and specifying a fitting model.
[0031] Step 22, classify the clothing image categories and detect key points, as well as perform clothing area and clothing back mask segmentation.
[0032] Step 23, based on the corresponding key points and contour shapes of the clothing and the model, the clothing image is differentially deformed and fused to the model to generate a virtual fitting result.
[0033] Please refer to Figure 3 , Figure 3 A schematic block diagram of other steps of the contour-preserving feature mesh deformation method for virtual fitting provided in an embodiment of the present application. In this embodiment, human model data needs to be created before fitting and saved in a fitting database. The method includes: Step 24, marking the key points and attributes of the mannequin's torso. The key points are specifically the mannequin's shoulders, elbows, wrists, armpits, hips, crotch, knees and ankles, and recording the coordinates of the mannequin's image and the names of its parts; Step 25, extract the human model contour line and divide it into zones according to the body part where the contour line is located. Specifically, divide the human body contour line into 10 zones, including the left (right) arm (inner) and outer side, the left (right) leg (inner) and outer side, and the left (right) torso, and record the position of the contour point and the zone where the contour point is located; Step 26, save the key point and contour line annotation results to the fitting database, so as to facilitate reuse in fitting of different categories of clothing. Specifically, save the annotated human model related data as a binary file, and then read the related data from the file according to the fitting model specified by the user.
[0034] Please refer to Figure 4 , Figure 4 Schematic diagram of other steps of the contour-preserving feature mesh deformation method for virtual fitting provided in the embodiment of the present application. In this embodiment, before fitting, it is necessary to train clothing category classification and key point detection models, as well as mask segmentation models for clothing areas and back areas. The method includes: Step S27, use Labelme software to label the own clothing image data, specifically the labels of five clothing categories, namely, tops, dresses, coats, skirts, and pants, and key points such as shoulders, cuffs, hems, trouser legs, crotches, and hems of each clothing category, as well as clothing areas of each category and back areas such as necklines, cuffs, and hems.
[0035] Step S28, using the HRNet convolutional neural network to train the own data set to obtain clothing classification and key point detection models; Step S29, using the MaskR-CNN convolutional neural network to train the own data set to obtain the mask segmentation model of the clothing area and the back area; Please refer to Figure 5 , Figure 5 for Figure 2 In the present embodiment, step S23 may include sub-steps S231, S232, S233, S234, S235 and S236.
[0036] Step S231, triangular mesh subdividing the clothing image. The clothing area contour line is extracted according to the clothing segmentation mask, and the points on the contour line together with the clothing key points are used as the grid point set to be subdivided, and the clothing contour line is used as the grid edge set. The clothing image is subdivided into a set of triangular units using the Triangle algorithm library to improve the image processing efficiency.
[0037] Step S232, the clothing image and the human model are roughly aligned by similarity transformation and local Laplacian differential deformation.
[0038] Step S233, integrating the contour shape constraint, the target position constraint and the length constraint, constructing and solving a linear least squares sparse system, and obtaining a new contour line position that maintains the original contour shape features.
[0039] Step S234, perform a penetration test on the closed contour points of the clothing, and update the safe position of the penetration point as the position constraint of the sparse linear system. The closed contour points of the clothing should be outside the corresponding human model contour boundary, otherwise the human image will pass through the clothing contour, causing a penetration phenomenon, which is visually unreasonable. The steps of the penetration test and updating the penetration point position are as follows: Select the closed contour points of the garment ; Use kd-tree to find The closest point in the segment corresponding to the mannequin's outline ; according to Adjacent points and The line segment vector of the human body is calculated Normal vector ; connect and For vector , calculate the vector outer product ; If the vector The z component , then record the current point as the penetration point and update to ,in The clearance margin from the updated contour point to the model contour, for The position normal vector is given by Adjacent points and The line segment vector is calculated and the design clearance margin is ;like , then the closed contour point passes the mold penetration test.
[0040] Step S235, after confirming that all closed contour points of the clothing have passed the mold penetration test, the clothing mesh is differentially deformed with the latest clothing contour line position as the target constraint to complete the clothing image processing.
[0041] Step S236, the processed clothing image is layered and fused with the human model image to complete the virtual fitting.
[0042] Please refer to Figure 6 , Figure 6 for Figure 5Schematic diagram of the sub-step flow of step S232 in FIG. 1. In this embodiment, step S232 may include sub-step S2321 and sub-step S2322.
[0043] Step 2321, through the matching relationship between the corresponding points of the clothing and the model, the clothing is similarly transformed to achieve global rough alignment. For tops, coats and dresses, their shoulder points are selected and matched with the model's shoulder points to calculate the similarity transformation matrix; for skirts and trousers, their waists are selected and matched with the model's waist contour points to calculate the similarity transformation matrix. The clothing image is similarly transformed through this matrix to achieve global rough alignment with the model.
[0044] Step 2322, through the matching relationship between the corresponding points of the clothing and the model, the clothing mesh Laplacian differential deformation is performed to achieve local alignment. For tops, coats and dresses, the armpit points, elbow points and cuff midpoints are selected as control points, and the model's armpit points, elbow points and wrist points are selected as target positions; for skirts and trousers, the waist points, trouser leg midpoints and crotch points are selected as control points, and the model's waist points, ankle points and crotch points are selected as target positions. Perform the clothing mesh Laplacian differential deformation to achieve approximate alignment of local positions.
[0045] The essence of grid Laplacian differential deformation is to solve the least squares linear system, which is expressed as follows: ; in, and Represent the mesh vertices before and after deformation, is the vertex The Laplacian coordinates of are defined as: ; in Represents a vertex The set of adjacent vertices of Represents a vertex The position vectors of adjacent vertices, is the vertex The number of adjacent vertices.
[0046] Please refer to Figure 7 , Figure 7 for Figure 5 In the present embodiment, step S233 may include sub-step S2331, sub-step S2332, sub-step S2333 and sub-step S2234.
[0047] Step S2331, constructing clothing outline shape constraints. The clothing outline shape constraints are expressed as follows: ; in, and Represent the contour points before and after deformation, respectively. It is a contour point The Laplacian coordinates of are defined as: ; in Represents contour points The set of contour points in the n-Ring neighborhood of Indicate point The position vector of the neighborhood contour points, is the vertex The number of contour points in the n-Ring neighborhood, design .
[0048] Step S2332, constructing the position constraints of the key contour points of the clothing. The position constraints of the key contour points of the clothing are expressed as follows: ; in Indicates the fixed contour points required for the current category of clothing. For tops, coats and dresses, the fixed contour points are shoulder points, armpit points, elbow points and hem points. For skirts and trousers, the fixed contour points are waist points, hem points, trouser leg points and crotch points.
[0049] Step S2333: construct the length constraint of the key parts of the clothing. The length constraint of the key parts of the clothing is expressed as follows: ; in Indicates the connection line of key points; for tops, coats and dresses, the key point is the sleeve width; for trousers, the key point is the trouser leg width; there is no key point for skirts; and Respectively represent the line vectors of the contour points of the key parts before and after deformation, that is, .
[0050] Step S2334, construct and solve a linear least squares sparse system. The linear least squares sparse system is expressed as follows: ; in , and They respectively represent the weights of the clothing contour shape constraint, the clothing key contour point constraint and the clothing key part length constraint. In the embodiment of the present application, , , .
[0051] The QR decomposition method is used to solve the linear least squares sparse system. QR decomposition can simplify the complex least squares problem into an upper triangular equation system that is easy to solve by decomposing the matrix into an orthogonal matrix and an upper triangular matrix. It has numerical stability and high efficiency.
[0052] Please refer to Fig. 9 , Fig. 9 A virtual fitting flow chart provided for an embodiment of the present application. In this embodiment, the category is a picture of a dress, and the fitting is performed on a female model. In other embodiments, the clothing category may also be tops, coats, skirts, and trousers, and the fitting object may be a model in any fitting database.
[0053] In summary, the present application provides a contour feature preserving mesh deformation method for virtual fitting, the method comprising: creating a human model database; training a clothing category classification and key point detection model, and a clothing segmentation model to obtain semantic information and geometric information of a clothing image to be processed; extracting the clothing contour line and then subdividing the clothing area with a triangular mesh, respectively, through similarity transformation and clothing mesh differential deformation, to achieve global and local apparel and human model approximate alignment; integrating clothing contour line shape constraints, key point position constraints, and clothing key part length constraints, constructing a linear least squares sparse system about the clothing contour line, and solving a new contour line; performing a penetration test on closed contour points on the new contour line, and updating the contour point position constraints; iteratively executing the contour feature preserving sparse system solution and the penetration test until all closed clothing contour points pass the penetration test, and then performing clothing mesh deformation with the contour line as the position constraint; decomposing the clothing image into foreground and background according to the clothing segmentation result, and merging them with the human model in layers to complete virtual fitting. This solution solves the problem of contour distortion caused by severe deformation of clothing images in virtual fitting applications based on image processing, reduces user usage costs, and provides users with an economical, convenient, and real and natural fitting experience.
[0054] Finally, it should be noted that the present invention is not limited to the above embodiments, and many variations are possible. All variations that can be directly derived or associated with the content disclosed by a person skilled in the art should be considered as within the protection scope of the present invention.
Claims
1. A contour-preserving feature mesh deformation system for virtual fitting, characterized by: The electronic device includes an image deformation fitting device, a memory, a processor and a communication unit; the memory, the processor and the communication unit are connected to realize data transmission or interaction; The memory is used to store programs. After receiving the execution instruction, the processor executes the program. The communication unit is used to establish a communication connection between the electronic device and other devices through the network, and to receive and send data through the network.
2. The contour-preserving feature mesh deformation system for virtual fitting according to claim 1, characterized in that: The image deformation fitting device includes a fitting model data creation module, a clothing detection module, and an image processing module; The model data creation module is used to mark and save the positions and attributes of the key points and contour lines of the human model, so as to facilitate the subsequent model fitting judgment and deformation target position calculation of the fitting clothing. The clothing detection module is used to classify the categories and detect key points of the fitting clothing, as well as segment the clothing area and the back area of the clothing to determine the clothing deformation strategy and key control points, and provide semantic information and geometric information for clothing mesh deformation; The image processing module is used for image triangulation, as well as global and local deformation registration and fusion of clothing and human models, iterative penetration testing and correction by constructing a linear sparse system to solve contour-preserving features to obtain fitting results.
3. A contour feature-preserving mesh deformation method for virtual fitting, characterized in that The method comprises the following steps: Step 20: Before fitting, create fitting mannequin data and save it to the fitting database for reuse in various categories of clothing; use the self-annotated data to train clothing category classification and key point detection models, as well as clothing segmentation models, to obtain clothing semantic information and geometric information; Step 21: Obtain the clothing image to be tried on and designate the fitting model; Step 22: Classify clothing image categories and detect key points, as well as perform clothing area and clothing back mask segmentation; Step 23: Based on the corresponding key points, contour shapes and other constraints of the clothing and the model, the clothing image is differentially deformed and fused to the model to generate a virtual fitting result.
4. The contour feature-preserving mesh deformation method for virtual fitting according to claim 3, characterized in that: The specific steps of creating the fitting mannequin data in step 20 and saving it to the fitting database include: Step 24: Mark the key points and attributes of the mannequin’s torso; Step 25: Extract the contour of the human model and divide it into different parts according to the body parts where the contour is located; Step 26: Save the key point and contour line annotation results to the fitting database for easy reuse in fitting of different categories of clothing.
5. The contour feature-preserving mesh deformation method for virtual fitting according to claim 4, characterized in that: In step 24, the key points include shoulders, elbows, wrists, armpits, hips, crotch, knees and ankles of the human model, and the coordinate positions and part names of the human body images are recorded; In step 25, the human body contour line is specifically divided into 10 regions, namely, the left and right arms and the inner and outer sides of the left and right arms, the left and right legs and the inner and outer sides of the left and right legs, and the left and right torsos, and the positions of the contour points and the partitions where the contour points are located are recorded; In step 26, the data related to the labeled human model is saved as a binary file, and the relevant data is subsequently read from the file according to the fitting model specified by the user.
6. A contour feature preserving mesh deformation method for virtual fitting according to claim 3 or 4, characterized in that: Training the clothing category classification and key point detection model and clothing segmentation model in step 20 specifically includes the following steps: Step S27: labeling own clothing image data using Labelme software; Step S28: Use the HRNet convolutional neural network to train the own data set to obtain clothing classification and key point detection models; Step S29: Use the MaskR-CNN convolutional neural network to train the own data set to obtain the mask segmentation model of the clothing area and the back area.
7. The contour feature preserving mesh deformation method for virtual fitting according to claim 6, characterized in that: The labeled own clothing image data in step S27 include labels of five clothing categories, namely, tops, dresses, jackets, skirts, and pants, and key points of shoulders, cuffs, hems, trouser legs, crotches, and hems of each clothing category, as well as clothing areas of each category and back areas of necklines, cuffs, and hems.
8. The contour feature-preserving mesh deformation method for virtual fitting according to claim 3, characterized in that: The step S23 includes sub-step S231, sub-step S232, sub-step S233, sub-step S234, sub-step S235 and sub-step S236; Step S231: triangular mesh subdividing the clothing image; extracting the clothing area contour line according to the clothing segmentation mask, taking the points on the contour line together with the clothing key points as the grid point set to be subdivided, and the clothing contour line as the grid edge set, and using the Triangle algorithm library to subdivide the clothing image into a set of triangular units to improve image processing efficiency; Step S232: the clothing image and the human model are roughly aligned by similarity transformation and local Laplacian differential deformation; Step S233: Integrate the contour shape constraint, target position constraint and length constraint, construct and solve a linear least squares sparse system, and obtain a new contour line position that maintains the original contour shape features; Step S234: Perform a penetration test on the closed contour points of the clothing, and update the safe position of the penetration point as the position constraint of the sparse linear system. The closed contour points of the clothing should be outside the corresponding human model contour boundary, otherwise the human image will pass through the clothing contour, causing a penetration phenomenon, which is visually unreasonable. The steps of the penetration test and updating the penetration point position are as follows: Select the closed contour points of the garment ; Use kd-tree to find The closest point in the segment corresponding to the mannequin's outline ; according to Adjacent points and The line segment vector of the human body is calculated Normal vector ; connect and For vector , calculate the vector outer product ; If the vector The z component , then record the current point as the penetration point and update to ,in The clearance margin from the updated contour point to the model contour, for The position normal vector is given by Adjacent points and The line segment vector is calculated and the design clearance margin is ;like , then the closed contour point passes the mold penetration test; Step S235: after confirming that all closed contour points of the clothing have passed the mold penetration test, the clothing mesh is differentially deformed with the latest clothing contour line position as the target constraint to complete the clothing image processing; Step S236: The processed clothing image is layered and fused with the human model image to complete the virtual fitting.
9. The contour feature-preserving mesh deformation method for virtual fitting according to claim 8, characterized in that: The step S232 includes sub-step S2321 and sub-step S2322; Step 2321: by matching the corresponding points of the clothing and the model, similar transformation of the clothing is performed to achieve global rough alignment. For tops, coats and dresses, their shoulder points are selected and matched with the model's shoulder points to calculate the similarity transformation matrix; for skirts and trousers, their waists are selected and matched with the model's waist contour points to calculate the similarity transformation matrix. The clothing image is similarly transformed through the matrix to achieve global rough alignment with the model; Step 2322: through the matching relationship between the corresponding points of the clothing and the model, the clothing mesh Laplacian differential deformation is performed to achieve local alignment; for tops, coats and dresses, the armpit points, elbow points and cuff midpoints are selected as control points, and the armpit points, elbow points and wrist points of the corresponding models are the target positions; for skirts and trousers, the waist points, trouser leg midpoints and crotch points are selected as control points, and the waist points, ankle points and crotch points of the corresponding models are the target positions; execute the clothing mesh Laplacian differential deformation to achieve approximate alignment of local positions; The grid Laplacian differential deformation is to solve the least squares linear system, which is expressed as follows: ; in, and Represent the mesh vertices before and after deformation, is the vertex The Laplacian coordinates of are defined as: ; in Represents a vertex The set of adjacent vertices of Represents a vertex The position vectors of adjacent vertices, is the vertex The number of adjacent vertices.
10. The contour feature-preserving mesh deformation method for virtual fitting according to claim 8, characterized in that: The step S233 may include sub-step S2331, sub-step S2332, sub-step S2333 and sub-step S2234; Step S2331: constructing clothing outline shape constraints; the clothing outline shape constraints are expressed as follows: ; in, and Represent the contour points before and after deformation, respectively. It is a contour point The Laplacian coordinates of are defined as: ; in Represents contour points The set of contour points in the n-Ring neighborhood of Indicate point The position vector of the neighborhood contour points, is the vertex The number of contour points in the n-Ring neighborhood, design ; Step S2332: constructing the position constraints of the key contour points of the clothing; the position constraints of the key contour points of the clothing are expressed as follows: ; in Indicates the fixed contour points required for the current category of clothing. For tops, coats, and dresses, the fixed contour points are the shoulder point, armpit point, elbow point, and hem point. For skirts and trousers, the fixed contour points are the waist point, hem point, leg point, and crotch point. Step S2333: constructing the length constraint of the key parts of the clothing; the length constraint of the key parts of the clothing is expressed as follows: ; in Indicates the connection line of key points; for tops, coats and dresses, the key point is the sleeve width; for trousers, the key point is the trouser leg width; there is no key point for skirts; and Respectively represent the line vectors of the contour points of the key parts before and after deformation, that is, ; Step S2334: construct and solve a linear least squares sparse system; the linear least squares sparse system is expressed as follows: ; in , and They represent the weights of clothing contour shape constraints, clothing key contour point constraints, and clothing key part length constraints, respectively. , , .
Citation Information
Patent Citations
Garment deformation method based on human body Laplace deformation
CN110176063A
Multi-type variable-scale virtual fitting method capable of keeping texture features of clothes
CN113012303A
Fitting model training method, virtual fitting method and related device
CN115439179A
Plane garment visual three-dimensional method and system based on image processing
CN116894914A
System and method for virtual fitting
US11321916B1