Image restoration and generation method based on conditional generative adversarial network

By using a conditional generative adversarial network (GAN) approach, the problem of body contour coordination with clothing in body proportion adjustment was solved, achieving intelligent optimization and generating natural and aesthetically pleasing visual effects.

CN120876317APending Publication Date: 2025-10-31GUANGZHOU GOMO SHIJI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510995068.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In the process of adjusting body proportions, existing technology has difficulty in achieving dynamic linkage between body contours and clothing, resulting in an unnatural effect after adjustment. In particular, when the waistline and shoulder width change, the coordination between clothing and body is ignored, affecting the realism and harmony of the aesthetic effect.

Method used

By using a conditional generative adversarial network (GAN) approach, the contour key point data of the user's body proportions are obtained, 3D reconstruction is performed, the body contour and clothing area are separated, the changes in wrinkle curvature and local deformation amplitude are analyzed, and a GAN is used for overall matching and local feature fusion, global correction is performed, and a visual output result is generated.

Benefits of technology

It achieves intelligent optimization of body proportion adjustment and clothing fit, ensuring that the adjusted image is natural and meets aesthetic requirements, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876317A_ABST
    Figure CN120876317A_ABST
Patent Text Reader

Abstract

The invention provides an image restoration and generation method based on a conditional generative adversarial network, and the method comprises the steps: a camera APP obtains contour key point data of a user figure proportion through carrying out the high-resolution feature extraction of an input image, carries out the three-dimensional reconstruction of a waist line and a shoulder breadth size, and obtains a contour key point data of a user figure proportion; generating an initial feature mapping graph containing wrinkle density distribution and local deformation amplitude; according to the initial feature mapping graph, adopting a region segmentation technology to separate a body contour from a clothing region, extracting a texture stretching degree and contact point stress distribution, determining a distribution condition of clothing and body contact points, and generating a segmentation result for dynamic adjustment; and for the to-be-optimized detail area list, performing enhancement processing on the texture stretching degree of the contact points of the clothes and the body and the stress distribution of the contact points, obtaining wrinkle layer depth data of a local area, and generating an optimized image layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to an image inpainting and generation method based on conditional generative adversarial networks. Background Technology

[0002] In the field of modern image processing and intelligent beautification, technological innovation in camera apps is crucial for enhancing user experience. This field not only concerns the optimization of personal image but also plays an indispensable role in social media and virtual interaction. By adjusting body proportions through intelligent algorithms, users can achieve visual effects that better meet their aesthetic needs, directly impacting the app's popularity and user satisfaction. However, balancing realism and naturalness during the beautification process remains a core objective of technological development. While many current solutions can achieve basic adjustments to body proportions, they often overlook the dynamic relationships between different elements during the beautification process. Especially when body shape changes, the coordination between clothing and body contours is often neglected, resulting in an unnatural adjusted effect. When the waistline is tightened, the distribution of clothing folds is directly affected; if these details cannot be dynamically adjusted, the image will appear distorted. These subtle changes further involve the coordination of other parts; for example, if the collar position does not shift accordingly after adjusting shoulder width, it will disrupt the overall harmony. These two factors are closely related: changes in body lines naturally affect the appearance of clothing, while the treatment of clothing details, in turn, determines the realism of the aesthetic effect. Therefore, how to achieve dynamic and coordinated adjustment between the body contour and the fit of clothing when adjusting body proportions has become a key issue that urgently needs to be addressed. Summary of the Invention

[0003] This invention provides an image inpainting and generation method based on conditional generative adversarial networks, mainly including:

[0004] The process involves acquiring an input image, extracting key contour points of the user's body proportions, performing 3D reconstruction on the waistline and shoulder width, and generating an initial feature map. Based on this initial feature map, the body contour and clothing area are separated, and the degree of texture stretching and contact point stress distribution are extracted to generate a segmentation result for dynamic adjustment. Based on the changes in the body contour within the segmentation result, the changes in fold curvature and local deformation amplitude of the waistline after optimization are analyzed. The fold direction offset of the clothing area is adjusted to generate adjusted clothing texture features. Finally, the feature extraction accuracy of the adjusted clothing texture features is analyzed to obtain the fold depth and... Texture generation consistency data is used to calibrate the fold direction offset at the collar position, generating an updated feature map containing offset correction. Based on the updated feature map, a generative adversarial network is used to perform overall matching between the body contour and the clothing area, extracting contour matching error and texture generation consistency parameters to generate a list of detail areas to be optimized. For the list of detail areas to be optimized, the texture stretching degree and stress distribution at the contact points between the clothing and the body are enhanced to generate an optimized image layer. The optimized image layer is then globally corrected, analyzing the coordination between fold density distribution and fabric elasticity parameters, fine-tuning the fold direction offset in areas that do not meet the standards, and generating a visual output result.

[0005] Furthermore, the process of acquiring the input image, extracting key contour data of the user's body proportions, performing 3D reconstruction of the waistline and shoulder width, and generating an initial feature map includes:

[0006] A full-body image of the user is acquired, and the input image is preprocessed to extract human contour information and determine the coordinate sets of key points in the shoulders and waist. Based on the coordinate sets of key points, shoulder width and waist circumference are calculated, local image patches of the corresponding regions are extracted, and the number of pixels with gradient amplitudes exceeding a threshold per unit area is counted to generate wrinkle density distribution data. Based on the wrinkle density distribution data, a mapping relationship between wrinkle density and depth is established, the relative depth value of each key point is calculated, and combined with the shoulder width and waist circumference values, three-dimensional point cloud data of the waist and shoulders is reconstructed using triangulation. Surface fitting is performed on the three-dimensional point cloud data, the angle between the normal vectors of adjacent points is calculated, the curvature of the local region is determined, and an initial feature mapping map containing the wrinkle density distribution data and curvature data is generated.

[0007] Furthermore, the step of separating the body contour and clothing area based on the initial feature map, extracting the texture stretching degree and contact point stress distribution, and generating a segmentation result for dynamic adjustment includes:

[0008] Based on the wrinkle density and deformation amplitude data in the initial feature map, the boundary between the clothing area and the body contour is identified; for the areas on both sides of the boundary, texture lines perpendicular to the boundary direction are extracted, the ratio of the texture line spacing to the standard spacing is calculated, and a texture stretching distribution map is generated; based on the texture stretching distribution map, the set of pixels with stretching exceeding a threshold is identified, the average difference between the deformation amplitude values ​​of each pixel and its neighboring pixels is calculated, and the contact center point and stress value are determined; based on the position coordinates of the contact center point and the stress value, a clustering algorithm is used to divide the contact points into strong contact groups and weak contact groups, generating a segmentation result containing the clothing area, the body contour area, and areas with different contact intensities. Further, based on the changes in the body contour in the segmentation result, the changes in wrinkle curvature and local deformation amplitude of the waistline after optimization are analyzed, the fold direction offset of the clothing area is adjusted, and the adjusted clothing texture features are generated, including:

[0009] Based on the body contour regions marked in the segmentation results, the contour point sequence of the waist region is extracted, and the reciprocal of the included angle between three adjacent contour points is calculated to generate the waist fold curvature distribution. Based on the waist fold curvature distribution, the Euclidean distance between the pixels of the initial contour and the current contour is calculated to generate a local deformation amplitude distribution map. Based on the local deformation amplitude distribution map and the waist fold curvature distribution, a comprehensive deformation index is calculated, the fold contour lines of the regions exceeding the threshold are extracted, and the tangent direction and normal vector direction are calculated. Using an interpolation algorithm, the offset distance of the fold points is adjusted along the normal vector direction to reconstruct the texture coordinates inside the clothing region and generate the adjusted clothing texture features.

[0010] Furthermore, the step of performing feature extraction accuracy analysis on the adjusted garment texture features, obtaining data on the depth of fold layers and consistency of texture generation resulting from the shoulder width adjustment, calibrating the fold direction offset at the collar position, and generating an updated feature map including offset correction includes:

[0011] The adjusted garment texture features are divided into meshes, and the difference in feature point coordinates at the boundaries of adjacent meshes is calculated to determine the feature extraction accuracy. Based on the shoulder width adjustment, the vertical distance of the folds in the shoulder area is measured to generate fold depth data. Based on the fold depth data, the angle between the texture directions of adjacent depth layers is calculated to determine the texture generation consistency data. For the collar area, the coordinates of the fold outline points are extracted, the offset vector with the standard shape is calculated, the fold position in the collar area is calibrated using affine transformation, and the boundary features are fused to generate an updated feature map including offset correction.

[0012] Furthermore, based on the updated feature map, a generative adversarial network is used to perform overall matching of the body contour and clothing area, extract contour matching error and texture generation consistency parameters, and generate a list of detailed regions to be optimized, including:

[0013] Based on the updated feature map, a generative adversarial network (GAN) is input to generate an adjusted clothing fit image. The average Euclidean distance between the body contour line and the clothing edge line is calculated to generate a contour matching error. The standard deviation of the texture direction angle within the clothing area is calculated to generate a texture generation consistency parameter. Based on the contour matching error and texture generation consistency parameter, contour mismatch areas and texture inconsistency areas are marked, and their center coordinates and error categories are recorded. Based on the spatial distribution of the inconsistent areas, adjacent areas are merged, a comprehensive priority score is calculated, and a list of detail regions to be optimized, including boundary coordinate ranges and error categories, is generated. Further, for the list of detail regions to be optimized, the texture stretching degree and stress distribution at the contact points between the clothing and the body are enhanced to generate an optimized image layer, including:

[0014] Based on the list of detailed regions to be optimized, the texture feature values ​​and contact point stress values ​​of the regions are extracted, and a filtering algorithm is used to smooth the internal regions of the texture. The spacing of the texture lines is adjusted according to the stress values ​​to generate a dense texture distribution. Based on the texture distribution, the difference between the gray value of a pixel and the average value of its neighborhood is calculated to generate contour lines and determine the shape and depth of the wrinkle contour. Based on the depth values, the enhanced texture is mapped to the corresponding depth layer, and image editing methods are used to smooth the boundaries to generate an optimized image layer containing enhanced texture details.

[0015] Furthermore, the optimized image layer undergoes global correction, analyzing the coordination between wrinkle density distribution and fabric elasticity parameters, fine-tuning the fold direction offset in substandard areas, and generating visual output results, including:

[0016] The optimized image layer is divided into grids, the number of wrinkle lines is counted, and wrinkle density values ​​are generated. Based on the wrinkle density values ​​and material elastic parameters, deformation compatibility index is calculated, and areas that do not meet the standard are marked. For the areas that do not meet the standard, the tangent direction of the wrinkle contour line is extracted, the position of the contour point is adjusted along the vertical direction, and iterative adjustment is performed until the compatibility index meets the standard, generating a fine-tuned image. Based on the fine-tuned image, the change in wrinkle curvature and contour matching error are calculated, and a deformation constraint weight feedback information matrix is ​​generated.

[0017] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0018] This invention discloses an image inpainting and generation method based on conditional generative adversarial networks (GANs). It extracts high-resolution features from the input image to obtain key contour data of the user's body proportions, and performs 3D reconstruction of the waistline and shoulder width to generate an initial feature map. Region segmentation technology is used to separate the body contour from the clothing area, extracting texture stretching and contact point stress distribution. For changes in the body contour, the method analyzes the changes in wrinkle curvature and local deformation amplitude after waistline optimization, and adjusts the clothing area using a geometric deformation algorithm. A dynamic adjustment mechanism using a GAN is employed to perform overall matching of the body contour and clothing area, and local feature fusion and enhancement processing is performed on detailed areas. Finally, through global correction and iterative optimization, the visual output result is obtained, achieving intelligent optimization of body proportion adjustment and clothing fit. Attached Figure Description

[0019] Figure 1 This is a flowchart of an image inpainting and generation method based on conditional generative adversarial networks according to the present invention. Detailed Implementation

[0020] To further understand the content of this invention, a detailed description of the invention is provided in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0021] like Figure 1 This embodiment of an image inpainting and generation method based on conditional generative adversarial networks may specifically include:

[0022] In step S101, the camera app extracts high-resolution features from the input image to obtain the contour key point data of the user's body proportions, performs three-dimensional reconstruction on the waistline and shoulder width, and generates an initial feature map containing the distribution of wrinkle density and the amplitude of local deformation.

[0023] The camera app captures full-body images of the user using the front or rear camera. The acquired raw images undergo preprocessing, including noise reduction and brightness equalization, to obtain a preprocessed image. The Canny edge detection algorithm is then used to extract human contour information from the preprocessed image. Contour tracking determines the pixel coordinates of key anatomical locations such as the shoulders, waist, and hips, resulting in a set of key points for the human contour. Based on this set of key points, the pixel distance between the two endpoints of the shoulder is calculated as the shoulder width, and the pixel distance at the narrowest point of the waist contour is calculated as the waist circumference. For the identified shoulder and waist regions, corresponding local image patches are extracted. The Sobel operator is used to calculate the gradient magnitude of each pixel, and the number of pixels with gradient magnitudes exceeding a preset threshold per unit area is counted to obtain wrinkle density distribution data. Based on this wrinkle density distribution data, a mapping relationship between wrinkle density and depth is established; areas with higher wrinkle density correspond to greater depth variations. The relative depth values ​​of each key point are calculated based on this mapping relationship. Combining shoulder width, waist circumference, and relative depth values, triangulation methods from two-view geometry are used to calculate spatial coordinates based on the disparity of the same feature point from different viewpoints, reconstructing 3D point cloud data for the waist and shoulders. Surface fitting is performed on the 3D point cloud data, and the curvature of each local region is determined by calculating the angle between the normal vectors of adjacent points. The degree of curvature change is the deformation amplitude. The wrinkle density distribution data and deformation amplitude data are combined according to the spatial location of body parts to construct a two-dimensional matrix. The rows and columns of the matrix correspond to the horizontal and vertical positions of the body, respectively. Each matrix element contains the wrinkle density value and deformation amplitude value at that location, generating an initial feature map containing the wrinkle density distribution and local deformation amplitude.

[0024] In one possible implementation, when the camera app captures a full-body image of the user, the impact of shooting angle and lighting conditions on subsequent processing needs to be considered. When the user stands in front of the camera, the system automatically detects the ambient light intensity. If the lighting is uneven, it will adjust the exposure parameters to compensate for dark areas, ensuring that the human body outline is clearly visible in the image. In the image preprocessing stage, Gaussian filtering is used to remove noise, while histogram equalization is employed to improve image contrast. This results in an image that more accurately reflects the texture details of the human body surface.

[0025] It's worth noting that the Canny edge detection algorithm has unique advantages in extracting human contours. The algorithm first calculates the gradient intensity and direction of the image, then removes false edges through non-maximum suppression, and finally uses double threshold detection and edge connection to form a complete contour. When processing human images, the algorithm can accurately identify the turning points of the shoulders, the concave curves of the waist, and the convex contours of the hips. Through contour tracking, the system traverses the detected edge pixels point by point, recording the coordinate information of key anatomical locations to form a set of key points describing the human body's shape.

[0026] Specifically, when calculating body measurements, shoulder width measurement requires accurate location of the left and right acromion points, which are typically the outermost prominent positions of the shoulder contour. Waist circumference is determined by finding the narrowest point of the waist contour; the system scans the waist region line by line to find the position where the distance between the left and right contour points is minimal. During the analysis of wrinkle density, the Sobel operator calculates gradients in both the horizontal and vertical directions, with larger gradient amplitudes occurring at clothing wrinkles. By counting the number of high-gradient pixels in a local area, the density of wrinkles can be quantified, directly reflecting the tightness of the clothing in that area.

[0027] In one embodiment, the mapping relationship between wrinkle density and depth is based on the principle that denser wrinkles in a garment typically indicate more complex 3D deformation and greater depth variation. The system establishes a correspondence between wrinkle density values ​​and relative depth values ​​by analyzing a large amount of sample data. The triangulation method in two-view geometry utilizes the parallax principle; when the positional offset of the same feature point under different viewpoints is known, the coordinates of that point in 3D space can be calculated by combining the camera's intrinsic parameters. This method can convert 2D image information into 3D point cloud data, providing a spatial information foundation for subsequent morphological analysis.

[0028] Preferably, the surface fitting process employs the least squares method to fit discrete 3D point cloud data into a continuous surface. Curvature is calculated using the angle between the normal vectors of adjacent points; a larger angle indicates a higher degree of curvature and a greater deformation amplitude. The generated feature map is stored as a two-dimensional matrix, where each element corresponds to a sampling point on the body surface, containing the wrinkle density and deformation amplitude values ​​for that point.

[0029] Step S102: Based on the initial feature map, the body contour and clothing area are separated using region segmentation technology, the texture stretching degree and contact point stress distribution are extracted, the distribution of contact points between clothing and body is determined, and a segmentation result for dynamic adjustment is generated.

[0030] Based on the wrinkle density and deformation amplitude data in the initial feature map, the watershed algorithm is used to segment the image into regions. A wrinkle density threshold is set to identify the boundary between the clothing area and the body contour. For the regions on both sides of the segmented boundary line, texture lines perpendicular to the boundary direction are extracted. The pixel distance between adjacent texture lines is measured, and the ratio of this distance to the texture spacing under standard unstretched conditions is calculated to obtain a texture stretching distribution map. Based on the texture stretching distribution map, the set of pixels with stretching exceeding a preset threshold is identified as potential contact areas. For each pixel within a potential contact area, the average difference between the deformation amplitude of that pixel and the deformation amplitude of its eight neighboring pixels is calculated. The pixel with the largest average difference is determined as the contact center point between the clothing and the body. This average difference is multiplied by a preset material elasticity coefficient to obtain the contact point stress value. Based on the position coordinates of all contact center points and their corresponding stress values, a contact point distribution matrix is ​​constructed. The K-means clustering algorithm is applied to the contact point distribution matrix to divide the contact points into strong contact groups and weak contact groups according to the stress value. Different label values ​​are used to represent regions with different contact intensities in the segmentation result map, generating a segmentation result with four types of labels: clothing area, body contour area, strong contact area and weak contact area, which is used to dynamically adjust the clothing fit.

[0031] In one possible implementation, the watershed algorithm offers unique advantages in processing clothing image segmentation. This algorithm treats the image as a terrain surface, with wrinkle density values ​​serving as height information. High-density areas form "ridges," and low-density areas form "valleys." The algorithm expands outward from local minima, forming a watershed line when expanded regions from different minima meet. This line precisely corresponds to the boundary between clothing and the body. When setting the wrinkle density threshold, the system analyzes the wrinkle density histogram of the entire image, selecting the valley value between the two peaks as the segmentation threshold to ensure accurate differentiation between clothing wrinkle areas and smooth body contour areas.

[0032] It's important to note that the calculation of texture stretching is based on the physical properties of the garment's texture. When clothing fits the body, the originally uniformly distributed texture deforms, increasing the distance between texture lines. Fourier transform analysis is used to analyze the periodicity of the texture, extracting the dominant texture frequencies perpendicular to the boundary direction. In the unstretched state, the texture spacing remains constant, while in stretched areas, the pixel distance between adjacent texture lines increases significantly. By calculating the ratio of the actual measured distance to the standard distance, the degree of stretching at each location can be quantified; a higher ratio indicates a more severe stretching of the garment at that point.

[0033] Specifically, the contact point identification process utilizes the local variation characteristics of deformation amplitude. At the location where clothing contacts the body, the deformation amplitude is significantly higher than the surrounding area due to compression. The system employs an eight-neighborhood analysis method to calculate the difference in deformation amplitude between the central pixel and its eight surrounding pixels. These differences reflect the degree of abrupt change in deformation. The point with the largest average difference is the location where the contact pressure is most concentrated. The introduction of the material's elastic coefficient makes stress value calculation more accurate. Different clothing materials have different elastic coefficients; cotton clothing has a lower elastic coefficient, while elastic fiber materials have a higher coefficient, which directly affects the final stress value.

[0034] In one embodiment, the K-means clustering algorithm automatically determines cluster centers based on the stress value distribution characteristics when processing the contact point distribution matrix. The algorithm first randomly selects two initial cluster centers, representing strong and weak contact categories, respectively. Then, it calculates the distance from each contact point to the two cluster centers; this distance refers to the difference in stress values, and assigns each point to the nearest category. This process is repeated iteratively to adjust the cluster center positions until the clustering results stabilize. Strong contact groups typically correspond to major support areas such as the shoulders, chest, and waist, where stress values ​​are significantly higher than in other areas. Weak contact groups include the edge areas where clothing makes slight contact with the body.

[0035] Preferably, the final segmentation result uses four different label values ​​to distinguish different regions. Clothing areas are labeled 1, body contour areas are labeled 2, strong contact areas are labeled 3, and weak contact areas are labeled 4. This labeling method facilitates subsequent dynamic adjustment processing; the system can adopt corresponding adjustment strategies based on the characteristics of different regions. Strong contact areas require a focus on comfort, while weak contact areas can be adjusted to achieve better drape.

[0036] Step S103: For the changes in body contour in the segmentation results, analyze the changes in the curvature of the folds and the local deformation amplitude after the waistline optimization. If the deformation amplitude exceeds the preset threshold, the fold direction offset of the clothing area is recalculated to obtain the adjusted clothing texture features.

[0037] For the marked body contour regions in the segmentation results, the contour point sequence of the waist region is extracted. The angle formed by three adjacent contour points is calculated, and the reciprocal of the angle is the curvature value of that point, thus obtaining the waist fold curvature distribution. The initial waist contour in the segmentation results is compared with the current waist contour, and the Euclidean distance between corresponding pixels is calculated to obtain a local deformation amplitude distribution map. Based on the local deformation amplitude distribution map and the waist fold curvature distribution, the deformation amplitude value is multiplied by the curvature value at the corresponding position to obtain a comprehensive deformation index. If the comprehensive deformation index exceeds a preset threshold, the garment fold contour line corresponding to that region is extracted, and the tangent direction of each point on the fold contour line is calculated. The tangent direction is rotated 90 degrees to obtain the normal vector direction of that point. Based on the normal vector direction, a thin plate spline interpolation algorithm is used to calculate the fold adjustment parameters. The comprehensive deformation index is used as the weight of the control point, and the offset distance of each fold point is calculated along the opposite direction of the normal vector. The offset distance is equal to the comprehensive deformation index multiplied by a preset adjustment coefficient. Based on the offset position of the fold point, the texture coordinates inside the garment area are reconstructed by bilinear interpolation to obtain the adjusted garment texture features.

[0038] In one possible implementation, the curvature of the waist contour is calculated based on the geometric properties of discrete points. After extracting the sequence of contour points in the waist region, every three adjacent points define a local arc. The angle formed by these three points can be calculated using their coordinates; a smaller angle indicates a greater degree of curvature. The curvature value, as the reciprocal of the angle, quantitatively describes the degree of curvature of the contour. The curvature value peaks in the concave areas of the waist, while it approaches zero in relatively flat regions. This curvature distribution directly reflects the morphological characteristics of the waist.

[0039] It should be noted that the calculation of local deformation amplitude involves contour comparison analysis. The initial waist contour comes from the unadjusted original state in the segmentation result, while the current waist contour is the actual state after the garment is fitted. By calculating the Euclidean distance between corresponding points on the two contours point by point, the degree of deformation at each location can be obtained. Areas with larger deformation amplitudes usually appear at the narrowest part of the waist, because this is where the garment fits the body most tightly.

[0040] Specifically, the design of the comprehensive deformation index takes into account the coupling effect of curvature and deformation. In areas of high curvature, even small deformations can produce noticeable wrinkles, while in areas of low curvature, the same deformation may not have a significant impact. By multiplying the deformation amplitude value by the curvature value, the resulting comprehensive index can more accurately reflect the degree of adjustment required. When the comprehensive deformation index exceeds a preset threshold, it indicates that the wrinkles in that area have affected the overall aesthetics of the garment.

[0041] In one embodiment, the normal vector of the pleat contour line is calculated using differential geometry. For each point on the pleat, the direction of the line connecting the two adjacent points is first calculated; this direction is the tangent direction. The tangent direction vector is then rotated 90 degrees counterclockwise to obtain the normal vector pointing outwards from the contour. This normal vector direction determines the direction of movement for pleat adjustment, ensuring that the adjusted pleat naturally adapts to the body contour.

[0042] Preferably, the thin-plate spline interpolation algorithm plays a crucial role in hem adjustment. This algorithm treats the hem as an elastic thin plate, with a comprehensive deformation index acting as the external force applied to it. The algorithm calculates the optimal offset for each point by minimizing bending energy, ensuring that the adjusted hem alleviates excessive local deformation while maintaining overall smoothness. The offset distance is obtained by multiplying the comprehensive deformation index by an adjustment coefficient, which is pre-set based on the softness of the garment material. Bilinear interpolation ensures texture continuity during texture reconstruction. When the hem point position shifts, the texture coordinates within the garment need to be adjusted accordingly. By performing linear interpolation in both the horizontal and vertical directions, the new texture coordinates for each internal point can be calculated based on the new hem position. This method ensures that the texture does not tear or overlap during adjustment, resulting in garment texture features that conform to the body contour while maintaining a natural fold distribution.

[0043] Step S104: By performing feature extraction accuracy analysis on the adjusted clothing texture features, obtain the fold depth and texture generation consistency data brought about by the shoulder width size adjustment, calibrate the fold direction offset at the collar position, and generate an updated feature map containing offset correction.

[0044] The camera app divides the adjusted clothing texture features into a grid. Within each grid, the pixel coordinates of texture feature points are extracted. The difference between the coordinates of feature points at the boundaries of adjacent grids is calculated. The proportion of feature points with a difference less than a preset threshold is the feature extraction accuracy. The pixel distance between the left and right endpoints of the shoulder is measured and compared with the initial shoulder width value to obtain the shoulder width adjustment. Based on the shoulder width adjustment, the distribution of folds in the shoulder area from the outer layer to the inner layer is analyzed. The vertical distance between each layer of folds is measured using the clothing surface as a reference plane to obtain fold depth data. Based on the fold depth data, the direction of texture lines in each depth layer is identified, and the angle between the texture directions of adjacent depth layers is calculated. The proportion of texture lines with an angle less than a preset angle threshold is the texture generation consistency data. For the collar area, according to preset standard collar shape parameters, the coordinates of each point on the collar fold outline are extracted. The difference vector between the actual coordinates and the corresponding coordinates of the standard shape is calculated to obtain the offset vector that needs calibration. Based on the offset vector and the texture generation consistency data, affine transformation is used to calibrate the fold position of collar areas with consistency data below a threshold. The transformation matrix is ​​determined by the offset vector. The calibrated collar area features are fused with other clothing area features at the boundary. A preset width range is taken on both sides of the boundary, and the feature values ​​within the range are weighted according to their distance from the boundary and then averaged to generate an updated feature map including offset correction.

[0045] In one possible implementation, the fineness of the grid division directly affects the evaluation of feature extraction accuracy. The clothing image is divided into a uniform rectangular grid, with the size of each grid dynamically adjusted according to the image resolution, typically 32×32 pixels or 64×64 pixels. Within each grid, the pixel coordinates of key feature points such as corner points and edge points are extracted using a feature detection algorithm. Checking the feature continuity at the boundary of adjacent grids is particularly crucial; when two grids share a boundary, the feature points on both sides of the boundary should remain spatially coherent. This degree of continuity can be quantified by calculating the Euclidean distance between corresponding feature points on both sides of the boundary.

[0046] It's important to note that the shoulder width adjustment calculation involves a comparative analysis of the initial and current states. The initial shoulder width value comes from the measurement taken during the user's first photoshoot, while the current shoulder width is the actual measurement after garment adjustments. This adjustment reflects the degree of contraction or expansion of the garment in the shoulder area, directly affecting the fold formation pattern. The concept of fold layers is based on the physical properties of the garment material. When garments form folds at the shoulders, a multi-layered overlapping effect is created, with outer folds covering inner folds, forming a distinct layered structure.

[0047] Specifically, the measurement of fold depth employs the principle of stereoscopic vision. The outermost surface of the garment is used as the reference plane, i.e., a plane with zero depth. By analyzing the changes in brightness and texture density in the folded areas, the relative depth of different layers can be inferred. Deeper folds, being obscured, will exhibit darker tones and higher density in their texture characteristics. Through layer-by-layer analysis, each fold is identified from the outside in, and its vertical distance relative to the reference plane is measured, forming complete depth distribution data.

[0048] In one embodiment, texture orientation consistency is evaluated based on the angular relationship between adjacent layers. Each fold layer has its dominant texture orientation, which is obtained by calculating the average orientation of all texture lines within that layer. The angle between the texture orientations of two adjacent layers reflects the regularity of the folds; the smaller the angle, the more regular the folds and the higher the consistency of texture generation. An angle threshold, typically 15 degrees, is set; when the angle is less than this threshold, the texture orientations of the two layers are considered consistent.

[0049] Preferably, the standard collar shape parameters are set considering the characteristics of different collar types. Different styles such as round necks, V-necks, and square necks have their specific geometric parameters, including the curvature of the neckline, the opening angle, and the width of the collar edge. The system pre-stores these standard parameters, and during collar calibration, selects the corresponding parameter set based on the identified collar type. The offset vector is calculated by comparing the actual collar outline with the standard shape point by point; each outline point has a vector pointing to the standard position. Affine transformation plays a crucial role in collar area calibration, and this transformation includes translation, rotation, and scaling operations. The parameters of the transformation matrix are obtained from the offset vector set using the least squares method, ensuring that the calibrated collar shape approximates the standard shape as closely as possible. Boundary blending employs a gradual weighting strategy; the closer a point is to the boundary, the smoother its weight change, ensuring a natural feature transition. The generated updated feature map fully preserves the texture details of the garment while correcting deformations caused by shooting angles or wearing conditions.

[0050] Step S105: Based on the updated feature map, the dynamic frequency adjustment mechanism of generative adversarial network is used to perform overall matching of body contour and clothing area, extract contour matching error and texture generation consistency parameters, determine whether there are incompatible areas, and generate a list of detailed areas to be optimized.

[0051] Based on the updated feature map, it is input into a generative adversarial network (GAN). The generator uses the updated feature map as input to generate an adjusted clothing fit image. The discriminator compares the generated image with the real clothing fit sample, and optimizes the generation effect through multiple iterations. The iteration frequency is dynamically adjusted according to the error convergence speed. The Euclidean distance between each corresponding point between the body contour line and the clothing edge line in the generated image is calculated, and the average value is taken as the contour matching error. At the same time, the standard deviation of the texture direction angle of all pixels in the clothing area is calculated as the texture generation consistency parameter. Based on the contour matching error and the texture generation consistency parameter, when the contour matching error exceeds a preset distance threshold, it is marked as a contour mismatch region; when the texture generation consistency parameter exceeds a preset angle threshold, it is marked as a texture inconsistency region. For each marked inconsistent region, its center coordinates, region range, error value, and error category are recorded. The error categories include contour deviation type and texture disorder type. According to the spatial distribution of inconsistent regions, adjacent regions with a distance less than a preset pixel threshold are merged into a block to be optimized. Calculate the overall priority of each block by multiplying contour deviation errors by a contour weight coefficient and texture disorder errors by a texture weight coefficient, and add the two together to obtain the priority score for that block. Sort the blocks by priority scores from high to low to generate a list of detailed regions to be optimized. The list records the boundary coordinate range and main error category of each block.

[0052] In one possible implementation, the application of generative adversarial networks (GANs) in clothing fit optimization demonstrates the powerful capabilities of deep learning. The generator network receives updated feature maps as input, which contain offset-corrected clothing texture information. Through multiple layers of convolution and deconvolution operations, the generator learns how to transform these features into a more realistic clothing fit. The discriminator network acts as a quality inspector, simultaneously receiving generated fit images and real clothing fit samples, and judging the realism of the generated images through comparative analysis. This adversarial training mechanism allows the generator to continuously improve its generation strategy, producing increasingly realistic fit effects.

[0053] It's important to note that the dynamic frequency adjustment mechanism balances computational efficiency and convergence speed. In the early stages of training, when errors are large, the system uses a higher iteration frequency, updating parameters only every few training epochs. As the error gradually decreases, the iteration frequency decreases accordingly to avoid oscillations when approaching the optimal solution. This adaptive frequency adjustment ensures the network converges quickly to the ideal state while avoiding the waste of computational resources caused by overtraining.

[0054] Specifically, calculating the contour matching error involves precise geometric analysis. First, a series of control points are uniformly sampled along the body contour line. Then, the nearest neighbor of each control point is found along the garment's edge. The Euclidean distance between two points reflects the fit deviation at that location. The overall contour matching error is obtained by calculating the average distance between all control point pairs. Larger error values ​​typically appear in areas with dramatic shape changes, such as shoulder angles and waist curves, where garments are prone to either hanging loosely or being too tight.

[0055] In one embodiment, the standard deviation calculation of texture direction angles reveals the regularity of the texture. The system divides the garment area into small analysis windows, and within each window, it uses a gradient direction histogram to statistically analyze the main texture directions. Under normal circumstances, garment textures should exhibit relatively consistent directionality with a small standard deviation. When wrinkles accumulate or stretching occurs, the texture directions become disordered, leading to an increase in the standard deviation. By setting a reasonable threshold, areas with disordered textures can be effectively identified.

[0056] Preferably, the error category classification is based on the differences in processing strategies for different types of problems. Contour deviation errors mainly involve adjusting the spatial relationship between clothing and the body, requiring changes to the overall shape of the clothing to resolve. Texture disorder errors, on the other hand, focus more on local texture reconstruction and can be improved through texture synthesis or smoothing. When calculating the overall priority, the system sets different weight coefficients based on user preferences. For example, users seeking a close fit will assign higher weights to contour, while those prioritizing aesthetics will increase texture weights. The region merging process employs the concept of spatial clustering. Adjacent small error regions often originate from the same structural problem; merging them avoids redundant optimization. The merged blocks retain detailed information about the original errors, including the specific location and error characteristics of each sub-region. The generated optimization list is sorted by priority, ensuring that the most severe problems are addressed first, improving overall optimization efficiency.

[0057] Step S106: For the list of detailed areas to be optimized, enhance the texture stretching degree and stress distribution at the contact points between the clothing and the body, obtain the wrinkle depth data of the local area, and generate the optimized image layer.

[0058] For each region's coordinate range in the list of detail regions to be optimized, texture feature values ​​and contact point stress values ​​are extracted from the previously generated fitting image. A bilateral filtering algorithm is used to process the texture feature values, weighting them simultaneously in the spatial and value domains to maintain sharp edges while smoothing the internal texture regions. The spacing of texture lines at each pixel is adjusted proportionally based on its stress value; higher stress values ​​result in smaller spacing, creating a denser texture distribution. Based on the adjusted texture distribution, the difference between the grayscale value of each pixel and the average grayscale value of its neighbors is calculated; the sign of the difference indicates whether the pixel is a convexity or concavity relative to its surroundings. Contour lines are formed by connecting points at the same height to determine the contour shape of the wrinkles. The distance from each contour line to the reference plane is measured vertically, and the wrinkles are divided into different layers according to the distance. The depth value of each layer is recorded to obtain the wrinkle layer depth data for the local region. Based on the wrinkle layer depth data, the enhanced texture of each optimized region is mapped onto the corresponding depth layer. A Poisson image editing method is employed to calculate the pixel value difference at the boundary between the optimized region and the surrounding unoptimized region. A Laplacian operator is constructed and solved to ensure a smooth transition at the boundary. The processing results of all locally optimized regions are combined to generate an optimized image layer containing enhanced texture details and multi-layered wrinkle information.

[0059] In one possible implementation, the bilateral filtering algorithm exhibits unique advantages in texture processing. This algorithm simultaneously considers the weighting of two dimensions: spatial distance and pixel value difference. Spatial domain weights are calculated based on the Euclidean distance between pixels, with closer pixels receiving greater weight. Value domain weights are determined based on the difference in pixel grayscale values, with pixels having similar grayscale values ​​receiving higher weights. This dual-weighting mechanism allows the algorithm to accurately preserve the sharpness of texture edges when smoothing the internal regions of a texture. When processing clothing folds, the high contrast characteristics of the fold edges are preserved, while noise and subtle perturbations within the folds are effectively eliminated.

[0060] It's important to note that texture density adjustment is based on the physical principles of stress distribution. In areas where clothing is in close contact with the body, the material experiences significant stress due to compression, causing the texture lines to be compressed. The system dynamically adjusts the texture spacing at each location by analyzing the stress value of each pixel. In practice, the original texture pattern is treated as an elastic mesh, with the stress value acting as a compression coefficient; the greater the stress, the denser the mesh is compressed. This adjustment method conforms to the deformation patterns of real clothing under stress, resulting in a more natural texture distribution.

[0061] Specifically, the process of identifying fold layers utilizes the light and dark variations in an image. The system first calculates the local gradient for each pixel, the magnitude of which reflects the degree of light and dark variation at that point. At the ridges of a fold, the light is brighter due to the angle of illumination, while the valleys are relatively darker. By tracing these alternating patterns of light and dark, the overall outline of the fold can be delineated. The concept of contour lines borrows from topographic maps, connecting points with the same grayscale value to form closed or open curves. These curves visually represent the undulating shape of the folds.

[0062] In one embodiment, the core of Poisson image editing lies in maintaining the continuity of the gradient field. When an optimized local region is embedded into the original image, there is often a significant discontinuity at the boundary between the two. The Poisson equation addresses this issue by minimizing the gradient difference. The system first calculates the gradient field within the optimized region, and then, while keeping this gradient field unchanged, adjusts the pixel values ​​within the region to ensure a smooth transition with the pixel values ​​outside the boundary. The Laplacian operator plays a crucial role in this process; it measures the second derivative of each point, reflecting the degree of difference between that point and its surrounding points.

[0063] Preferably, the multi-layered wrinkle information is organized using a hierarchical storage structure. The outermost wrinkles have the highest visibility, and their texture details need to be preserved. As the layers deepen, the visibility of the wrinkles decreases, but they still affect the overall three-dimensionality. The system assigns different rendering priorities to each layer; high-resolution texture maps are used for outer wrinkles, while the resolution is appropriately reduced for inner layers to save computational resources. This layered processing strategy ensures both the realism of the visual effect and improves rendering efficiency. The generated optimized image layers fully preserve the enhanced texture details, the layering of the wrinkles is more distinct, and the fit between the clothing and the body is significantly improved.

[0064] Step S107: By performing global correction on the optimized image layer, the overall coordination between the fold density distribution and the fabric elasticity parameters is analyzed. If there are areas that do not meet the standards, the fold direction offset of the area is finely adjusted by iteratively optimizing the step size to obtain the visual output result. The fold curvature change and contour matching error before and after adjustment are extracted to verify the consistency of texture generation between body proportion adjustment and clothing fit. Deformation constraint weight feedback information for subsequent optimization is generated.

[0065] The camera app divides the optimized image layer into a grid, counts the number of fold lines within each grid, and calculates the fold density value. It obtains the density difference between adjacent grids and queries the elastic modulus and Poisson's ratio of the current clothing material from a pre-established material property database. Dividing the density difference by the elastic modulus yields a deformation compatibility index. If this index exceeds the material's deformation threshold, the corresponding grid is marked as a non-compliant area. For each non-compliant area, the fold contour line is extracted, and the tangent direction at each point on the contour line is calculated. The direction perpendicular to the tangent is the adjustment direction. An initial step size is set as the product of the feature size of the area and a preset coefficient, and the fold contour points are moved along the adjustment direction. After each movement, a new deformation compatibility index is calculated. If the index value decreases, the adjustment continues in the current direction; if the index value increases, the adjustment is reversed and the step size is halved. This iteration continues until the index value reaches the threshold range, resulting in a fine-tuned image. Fold features are extracted from the fine-tuned image, and the change in curvature of folds at the same position before and after adjustment is calculated. The average distance between the body contour line and the clothing edge line is measured as the matching error. The curvature change is mapped to the interval between zero and one, and the matching error is also mapped to this interval. The product of the two is used as the consistency metric for that location. The deformation constraint weight is calculated based on the consistency metric; the smaller the metric, the greater the weight. The weight values ​​and coordinates of all locations are combined to form a feedback information matrix for subsequent optimization.

[0066] In one possible implementation, the material property database is built based on extensive experimental test data of clothing materials. The elastic modulus reflects the degree of deformation of a material under stress; a higher value indicates that the material is less prone to deformation. Cotton clothing typically has a lower elastic modulus, making it prone to wrinkling under stress, while synthetic fiber materials have a higher elastic modulus, resulting in a higher threshold for wrinkle formation. Poisson's ratio describes the degree of contraction in the perpendicular direction when a material is stretched in one direction. These two parameters together determine the deformation characteristics of clothing when it fits the body.

[0067] It should be noted that the calculation of the deformation compatibility index involves principles of materials mechanics. When the difference in wrinkle density between adjacent areas is too large, it means that the material is experiencing uneven stress distribution at that location. The index obtained by dividing the density difference by the elastic modulus actually reflects the deformation gradient under unit elasticity. If this gradient exceeds the material's deformation threshold, it indicates that stress concentration may occur in that area, leading to excessive stretching or wrinkle buildup in localized areas of the garment. This uncoordinated deformation will affect the overall aesthetics and comfort of the garment.

[0068] Specifically, the fine-tuning process of the fold contour employs an adaptive step-size control strategy. The initial step size is set considering the characteristic size of the region; larger regions require larger initial step sizes to improve convergence speed. The adjustment direction is perpendicular to the tangent of the fold contour, ensuring that the basic shape of the folds is maintained during the adjustment process. After each iteration, the system judges the adjustment effect by comparing changes in the deformation compatibility index. A decrease in the index indicates more uniform deformation, and the current direction should be continued; an increase in the index indicates an incorrect adjustment direction, requiring a reversal and a reduction in the step size. This strategy can quickly find the optimal fold position.

[0069] In one embodiment, a nonlinear transformation method is used to map the curvature change. Small changes in fold curvature can produce noticeable visual differences; therefore, a logarithmic transformation is used to map the curvature change to the interval between zero and one. This mapping method allows even small curvature changes to be reasonably represented. The matching error is mapped using linear normalization, mapping the maximum error to one and the minimum error to zero. The product of the two normalized values ​​comprehensively considers both morphological changes and positional deviations.

[0070] Preferably, the calculation of deformation constraint weights follows an inverse proportional relationship. A smaller consistency metric value indicates a better adjustment effect in that area, and it should maintain its current state in subsequent optimizations, thus receiving a larger constraint weight. Conversely, areas with larger consistency metric values ​​still require further adjustment, and their constraint weights are correspondingly smaller. The feedback information matrix is ​​structured as a two-dimensional array, with each element containing three components: an x-coordinate, a y-coordinate, and the corresponding weight value. This data organization facilitates the subsequent optimization algorithm's rapid location of areas requiring focused processing, while preserving spatial location information to ensure the continuity and accuracy of the optimization process. Through this weight feedback mechanism, the fit of the clothing can be gradually improved through multiple iterations, achieving a balance between visual appeal and wearing comfort.

[0071] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. An image inpainting and generation method based on conditional generative adversarial networks, characterized in that, The method includes: The process involves acquiring an input image, extracting key contour points of the user's body proportions, performing 3D reconstruction on the waistline and shoulder width, and generating an initial feature map. Based on this initial feature map, the body contour and clothing area are separated, and the degree of texture stretching and contact point stress distribution are extracted to generate a segmentation result for dynamic adjustment. Based on the changes in the body contour within the segmentation result, the changes in fold curvature and local deformation amplitude of the waistline after optimization are analyzed. The fold direction offset of the clothing area is adjusted to generate adjusted clothing texture features. Finally, the feature extraction accuracy of the adjusted clothing texture features is analyzed to obtain the fold depth and... Texture generation consistency data is used to calibrate the fold direction offset at the collar position, generating an updated feature map containing offset correction. Based on the updated feature map, a generative adversarial network is used to perform overall matching between the body contour and the clothing area, extracting contour matching error and texture generation consistency parameters to generate a list of detail areas to be optimized. For the list of detail areas to be optimized, the texture stretching degree and stress distribution at the contact points between the clothing and the body are enhanced to generate an optimized image layer. The optimized image layer is then globally corrected, analyzing the coordination between fold density distribution and fabric elasticity parameters, fine-tuning the fold direction offset in areas that do not meet the standards, and generating a visual output result.

2. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The process of acquiring the input image, extracting key contour points of the user's body proportions, performing 3D reconstruction of the waistline and shoulder width, and generating an initial feature map includes: A full-body image of the user is acquired, and the input image is preprocessed to extract human contour information and determine the coordinate sets of key points in the shoulders and waist. Based on the coordinate sets of key points, shoulder width and waist circumference are calculated, local image patches of the corresponding regions are extracted, and the number of pixels with gradient amplitudes exceeding a threshold per unit area is counted to generate wrinkle density distribution data. Based on the wrinkle density distribution data, a mapping relationship between wrinkle density and depth is established, the relative depth value of each key point is calculated, and combined with the shoulder width and waist circumference values, three-dimensional point cloud data of the waist and shoulders is reconstructed using triangulation. Surface fitting is performed on the three-dimensional point cloud data, the angle between the normal vectors of adjacent points is calculated, the curvature of the local region is determined, and an initial feature mapping map containing the wrinkle density distribution data and curvature data is generated.

3. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The step of separating the body contour and clothing area based on the initial feature map, extracting the texture stretching degree and contact point stress distribution, and generating a segmentation result for dynamic adjustment includes: Based on the wrinkle density and deformation amplitude data in the initial feature map, the boundary between the clothing area and the body contour is identified; for the areas on both sides of the boundary, texture lines perpendicular to the boundary direction are extracted, the ratio of the texture line spacing to the standard spacing is calculated, and a texture stretching degree distribution map is generated; based on the texture stretching degree distribution map, the set of pixels with stretching degree exceeding the threshold is identified, the average difference between the deformation amplitude values ​​of each pixel and its neighboring pixels is calculated, and the contact center point and stress value are determined; based on the position coordinates of the contact center point and the stress value, a clustering algorithm is used to divide the contact points into strong contact groups and weak contact groups, generating a segmentation result that includes the clothing area, the body contour area, and areas with different contact intensities.

4. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The process involves analyzing the changes in body contour based on the segmentation results, examining the changes in fold curvature and local deformation amplitude of the waistline after optimization, adjusting the fold direction offset of the clothing area, and generating adjusted clothing texture features, including: Based on the body contour regions marked in the segmentation results, the contour point sequence of the waist region is extracted, and the reciprocal of the included angle between three adjacent contour points is calculated to generate the waist fold curvature distribution. Based on the waist fold curvature distribution, the Euclidean distance between the pixels of the initial contour and the current contour is calculated to generate a local deformation amplitude distribution map. Based on the local deformation amplitude distribution map and the waist fold curvature distribution, a comprehensive deformation index is calculated, the fold contour lines of the regions exceeding the threshold are extracted, and the tangent direction and normal vector direction are calculated. Using an interpolation algorithm, the offset distance of the fold points is adjusted along the normal vector direction to reconstruct the texture coordinates inside the clothing region and generate the adjusted clothing texture features.

5. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The process involves performing feature extraction accuracy analysis on the adjusted garment texture features, obtaining data on the depth of folds and consistency of texture generation resulting from the shoulder width adjustment, calibrating the fold direction offset at the collar position, and generating an updated feature map including offset correction. The adjusted garment texture features are divided into meshes, and the difference in feature point coordinates at the boundaries of adjacent meshes is calculated to determine the feature extraction accuracy. Based on the shoulder width adjustment, the vertical distance of the folds in the shoulder area is measured to generate fold depth data. Based on the fold depth data, the angle between the texture directions of adjacent depth layers is calculated to determine the texture generation consistency data. For the collar area, the coordinates of the fold outline points are extracted, the offset vector with the standard shape is calculated, the fold position in the collar area is calibrated using affine transformation, and the boundary features are fused to generate an updated feature map including offset correction.

6. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, Based on the updated feature map, a generative adversarial network is used to perform overall matching of the body contour and clothing area, extract contour matching error and texture generation consistency parameters, and generate a list of detail areas to be optimized, including: Based on the updated feature map, a generative adversarial network is input to generate an adjusted clothing fit image. The average Euclidean distance between the body contour line and the clothing edge line is calculated to generate a contour matching error. The standard deviation of the texture direction angle within the clothing area is calculated to generate a texture generation consistency parameter. Based on the contour matching error and the texture generation consistency parameter, contour mismatch areas and texture inconsistency areas are marked, and the center coordinates and error categories are recorded. Based on the spatial distribution of the inconsistent areas, adjacent areas are merged, a comprehensive priority score is calculated, and a list of detailed regions to be optimized, including boundary coordinate ranges and error categories, is generated.

7. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The process of optimizing the list of detailed regions enhances the texture stretching and stress distribution at the points of contact between the clothing and the body, generating an optimized image layer, including: Based on the list of detailed regions to be optimized, the texture feature values ​​and contact point stress values ​​of the regions are extracted, and a filtering algorithm is used to smooth the internal regions of the texture. The spacing of the texture lines is adjusted according to the stress values ​​to generate a dense texture distribution. Based on the texture distribution, the difference between the gray value of a pixel and the average value of its neighborhood is calculated to generate contour lines and determine the shape and depth of the wrinkle contour. Based on the depth values, the enhanced texture is mapped to the corresponding depth layer, and image editing methods are used to smooth the boundaries to generate an optimized image layer containing enhanced texture details.

8. The image inpainting and generation method based on conditional generative adversarial networks according to claim 1, characterized in that, The optimized image layer undergoes global correction, analyzing the coordination between wrinkle density distribution and fabric elasticity parameters, fine-tuning the fold direction offset in substandard areas, and generating visual output results, including: The optimized image layer is divided into grids, the number of wrinkle lines is counted, and wrinkle density values ​​are generated. Based on the wrinkle density values ​​and material elastic parameters, deformation compatibility index is calculated, and areas that do not meet the standard are marked. For the areas that do not meet the standard, the tangent direction of the wrinkle contour line is extracted, the position of the contour point is adjusted along the vertical direction, and iterative adjustment is performed until the compatibility index meets the standard, generating a fine-tuned image. Based on the fine-tuned image, the change in wrinkle curvature and contour matching error are calculated, and a deformation constraint weight feedback information matrix is ​​generated.

Citation Information

Cited By

  • Garment image segmentation method and device based on human skeleton joint points and storage medium

    CN121437897A

  • Garment wrinkle detection and posture fine adjustment method and system for humanoid robot

    CN122241442A

  • A humanoid robot garment wrinkle detection and posture fine-tuning method and system

    CN122241442B