Suspension type clothing defect detection method
By combining multi-view image reconstruction and deformation compensation techniques with convolutional neural networks, high-precision defect detection of hanging garments was achieved, solving the problems of complex deformation and texture interference in garment detection under hanging conditions, and improving the accuracy and efficiency of detection.
Patent Information
- Application Number
- CN202511078107.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies struggle to accurately detect defects in clothing while it is suspended, especially for highly elastic fabrics where the detection rate of minute defects is insufficient and the ability to distinguish between real defects and texture noise is lacking. Traditional planar detection algorithms cannot be registered, and curvature filtering methods have poor adaptability.
Multiple industrial cameras arranged in a ring simultaneously acquire multi-view images, reconstruct a 3D point cloud model, perform deformation compensation through thin plate spline transformation (TPS), identify defects by combining curvature filtering and convolutional neural network models, and perform accurate detection by using coded marker points and multi-physical feature fusion.
It achieves millimeter-level 3D reconstruction of suspended garments, significantly reduces visual reconstruction errors, improves the success rate of geometric distortion compensation and the accuracy of defect detection, and solves the deformation interference problem in the inspection of flexible textiles.
Smart Images

Figure CN120976140A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of garment defect detection technology, and more particularly to a hanging garment defect detection method. Background Technology
[0002] Currently, the garment manufacturing industry generally uses automated visual inspection systems for defect detection. However, for garments in a hanging state, the garments undergo complex deformations (stretching and twisting) due to gravity. Traditional planar detection algorithms cannot accurately register the garments, resulting in defect location errors. Wrinkles formed by the natural draping of the fabric are easily misjudged as defects in the image. Furthermore, existing curvature filtering methods have poor adaptability to highly elastic fabrics (such as silk and knitwear). Traditional monocular camera systems have a detection rate of less than 50% for tiny defects such as broken yarns and pinholes ≤1mm, and cannot distinguish between real defects and texture noise. Summary of the Invention
[0003] This invention provides the following technical solution: A method for detecting defects in suspended garments includes the following steps: Step 1: Simultaneously acquire multi-view images of the garment in a suspended state using multiple sets of industrial cameras arranged in a ring. Step 2: Reconstruct the 3D point cloud model of the garment based on the multi-view images, and calculate the fabric stretch deformation rate. Step 3, Perform deformation compensation: Use Thin Plate Spline Transform (TPS) to register images from each viewpoint to a standard planar template to eliminate geometric distortion; Step 4, perform wrinkle suppression: apply curvature filtering to the registered image to generate a wrinkle mask and segment the non-wrinkle region; Step 5: Run a convolutional neural network model in the non-wrinkled area to identify the type and location of defects; Step 6: Trigger the sorting instruction based on the recognition result.
[0004] Preferably, in step 21, 3D reconstruction preprocessing: the multi-view images obtained in step 1 are calibrated by camera, the camera intrinsic parameter matrix and distortion coefficients are calculated by Zhang Zhengyou calibration method, and the extrinsic parameter matrix is optimized by bundle adjustment. Step 22, Feature matching: The SIFT algorithm is used to extract image feature points, and feature descriptor matching is performed based on KD-Tree. The RANSAC algorithm is used to remove mismatched point pairs. Step 23, Point Cloud Generation: Sparse reconstruction: Generate an initial sparse point cloud by triangulating matching point pairs, and solve for minimizing the reprojection error; Dense Reconstruction: The PatchMatch multi-view stereo matching algorithm is used to generate a dense point cloud model based on sparse point cloud. Step 24, Deformation rate calculation.
[0005] Preferably, the solution minimizes the reprojection error: Among them, P i Let X be the camera projection matrix. j Let x be the coordinates of a 3D point. ij The coordinates of the observed pixels.
[0006] Preferably, the deformation rate calculation involves placing reflective markers at predetermined positions on the garment. These markers are 2mm in diameter and exhibit a specific coded pattern. The three-dimensional coordinates of the markers are identified based on point cloud data, and the measured length L between adjacent markers is calculated. k ; Call the pre-stored design dimension L 0k Calculate the deformation rate by zone: Output a heat map showing the deformation rate distribution of the entire garment.
[0007] Preferably, in step 31, control point pair generation: N reference control points are defined on a standard planar template and evenly distributed along the key structural lines of the garment; the corresponding actual control points are extracted through the 3D point cloud model, and the structural feature points are located using a curvature extreme value detection algorithm; Step 32, TPS parameter solution: Construct the thin plate spline transformation function and solve the weights by minimizing the bending energy; Step 33, Dynamic Deformation Compensation: Adjust the density of control points according to the fabric tensile deformation rate in Step 2, and generate coordinates for newly added control points using B-spline interpolation; Step 34, Image resampling: Calculate the mapped coordinates for each pixel and use bicubic convolution interpolation to calculate the pixel value; Step 35, Compensation effect verification: Calculate the registration error and optimize the control point position.
[0008] Preferably, dynamic deformation compensation: the control point density is adjusted according to the fabric tensile deformation rate η from step 2.
[0009] Preferably, image resampling: for each pixel (x,y), calculate the mapped coordinates (u,v) = T -1 (x, y); Pixel values are calculated using bicubic convolution interpolation: Where R is a cubic basis function and s is a scaling factor.
[0010] Preferably, in step 41, multi-scale curvature field construction: multi-scale preprocessing is performed using a difference of Gaussian (DoG) filter to calculate the principal curvature field; Step 42, wrinkle feature enhancement: Define the wrinkle index and apply anisotropic diffusion in the texture direction; Step 43, Probability Mask Generation: Train a random forest classifier and output a pixel-level wrinkle probability map; Step 44, Multimodal segmentation: Initial binarization, GrabCut segmentation is used for the "undetermined" region; Step 45, Non-wrinkle area optimization: Post-processing is performed based on the fabric physical model to output the final non-wrinkle area mask.
[0011] Preferably, step 51, multi-channel input construction: converting the RGB image into a four-channel input; Step 52, Attention-guided feature extraction: An improved ConvNeXt-T network is used as the backbone, and dual-path attention modules are inserted in Stage 3 and Stage 4; Step 53, Multi-scale defect detection head: Construct a feature pyramid to output {P2,P3,P4,P5} corresponding to different receptive fields, and adopt a cascaded detection architecture, with each detection head outputting a three-dimensional tensor; Step 54, Cross-modal verification: Establish a defect property rule base; Step 55, Positioning Optimization: Use Gaussian heatmap to regress the center point, refine the bounding box, and locate sub-pixel edges; Step 56, Dynamic Confidence Calibration: Calculate the environmental confidence factor and adjust the classification confidence. Step 57, Defect Report Generation: Non-maximum suppression, output structured report.
[0012] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the invention.
[0013] In this invention, the method achieves millimeter-level 3D reconstruction of suspended garments through multi-view stereo vision and a coded marker point system, significantly reducing visual reconstruction errors. Combined with dynamic TPS registration technology (adaptive deformation rate of control point density), the success rate of geometric distortion compensation is significantly improved. The synchronously calculated fabric tensile deformation rate η provides precise physical parameter support for subsequent processing, addressing the core pain point of deformation interference in the inspection of flexible textiles. Attached Figure Description
[0014] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a hanging garment defect detection method provided in an embodiment of the present invention; Figure 2 This is a flowchart of step 2 of a hanging garment defect detection method provided in an embodiment of the present invention; Figure 3This is a flowchart of step 3 of a hanging garment defect detection method provided in an embodiment of the present invention; Figure 4 This is a flowchart of step 4 of a hanging garment defect detection method provided in an embodiment of the present invention; Figure 5 The flowchart of step 5 of a hanging garment defect detection method provided in an embodiment of the present invention is shown. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0016] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0017] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0018] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0019] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0020] To better understand the purpose, function, and specific design of this invention, the fully automatic open-line pressing machine of this invention will be described in further detail below with reference to the accompanying drawings.
[0021] Reference Figures 1-5 A method for detecting defects in suspended garments includes the following steps: Step 1: Simultaneously acquire multi-view images of the garment in a suspended state using multiple sets of industrial cameras arranged in a ring. Step 2: Reconstruct the 3D point cloud model of the garment based on the multi-view images, and calculate the fabric stretch deformation rate. Step 3, Perform deformation compensation: Use Thin Plate Spline Transform (TPS) to register images from each viewpoint to a standard planar template to eliminate geometric distortion; Step 4, perform wrinkle suppression: apply curvature filtering to the registered image to generate a wrinkle mask and segment the non-wrinkle region; Step 5: Run a convolutional neural network model in the non-wrinkled area to identify the type and location of defects; Step 6: Trigger the sorting instruction based on the recognition result.
[0022] Step 2 specifically includes: Step 21, 3D reconstruction preprocessing: Camera calibration is performed on the multi-view images obtained in Step 1. The Zhang Zhengyou calibration method is used to calculate the camera intrinsic parameter matrix K and distortion coefficients, and the extrinsic parameter matrix R|t is optimized by bundle adjustment; the camera calibration residual is controlled to be <0.1 pixels. Step 22, Feature matching: Image feature points are extracted using the SIFT algorithm, feature descriptor matching is performed based on KD-Tree, and mismatched point pairs are removed using the RANSAC algorithm. Step 23, Point cloud generation: Sparse reconstruction: An initial sparse point cloud is generated by triangulating the matched point pairs, and the reprojection error is minimized. Where P i Let X be the camera projection matrix. j Let x be the coordinates of a 3D point. ij For the observed pixel coordinates; Dense Reconstruction: The PatchMatch multi-view stereo matching algorithm is used to generate a dense point cloud model based on sparse point cloud; the dense reconstruction resolution reaches 0.2mm / point. Step 24, Deformation Rate Calculation: Reflective markers with a diameter of 2mm and a specific coded pattern are placed at predetermined positions on the garment. Based on point cloud recognition of the three-dimensional coordinates of the markers, the measured length L between adjacent markers is calculated. k Call the pre-stored design dimension L 0k Calculate the deformation rate by zone. Encoded marker points (such as ArUco codes) are used to resolve ambiguity issues in flexible body feature matching. Output a heat map of the deformation rate distribution of the entire garment. The markers are made of near-infrared sensitive material with a wavelength of 850nm, separated from the visible light imaging channel (to resolve interference from complex textures). When marker occlusion is detected, the fabric physical simulation model is activated to predict the deformation rate. The prediction formula is: Where E is the Young's modulus of the fabric, ∈ is the strain, and F t For tension, G fabric The fabric weight coefficient is used to reduce deformation rate measurement error through coding markers and a zone calculation strategy.
[0023] Step 3 includes: Step 31: Control point pair generation: Define N ≥ 50 reference control points Q on the standard plane template. i =(x i y i The points are evenly distributed along the key structural lines of the garment (shoulder line / side seam line / armhole line), and the corresponding actual control points P are extracted from the 3D point cloud model. i =(u i ,v i The curvature extremum detection algorithm is used to locate structural feature points; Step 32: TPS parameter solution: Constructing the thin-plate spline transformation function:
[0024] The weights are solved by minimizing the bending energy:
[0025] Among them, K ij =φ(||P i -P j ||),Q=[1,u i ,v i ],W=(w1,...,w n ) T A = (a0, a1, α2) T ; Step 33: Dynamic Deformation Compensation Adjust the control point density according to the fabric tensile deformation rate η from step 2: The coordinates of the newly added control points are generated using B-spline interpolation; Step 34 Image resampling: Calculate the mapped coordinates (u,v) = T for each pixel (x,y). -1 (x,y); Pixel values are calculated using bicubic convolution interpolation:
[0026] Where R is a cubic basis function and S is a scaling factor; Step 35: Verification of compensation effect: Calculate the registration error: When E rms When the value is greater than 2px, the control point position is iteratively optimized based on the gradient descent method. The control points include a primary control point (located at the intersection of the sutures) and an auxiliary control point (located at the center of the provincial highway), with a weight ratio of 3:1. A transfer learning-based pre-trained TPS model is used: 1 million sets of virtual deformation samples are generated on a synthetic dataset for pre-training, and the loss function is: Regularization is applied to knitted fabrics: the angle between the movement vectors of adjacent control points is constrained to ≤15°.
[0027] Step 4 includes: Step 41: Construction of multi-scale curvature fields: Multi-scale preprocessing is performed using a Difference of Gaussian (DoG) filter to calculate the principal curvature field: Among them, I xx I yy I xy Elements of a Hessian matrix; Step 42: Enhancement of wrinkle features: Define the wrinkle index: Apply anisotropic diffusion along the texture direction: Where K is the derivative of the fabric texture direction; Step 43: Probability Mask Generation: Train a random forest classifier. Input features include: curvature ratio. Local Binary Pattern (LBP) variance, illumination-invariant texture features, deformation rate η in step 2, output pixel-level wrinkle probability map: P fold (x,y)∈[0,1]; Step 44: Multimodal segmentation: Initial binarization: Where τ1 = 0.7, τ2 = 0.3, the "undetermined" region is segmented using GrabCut: min M λ·R(M)+B(M), where R is the region term and B is the boundary term.
[0028] Step 45: Optimization of non-wrinkled areas: Post-processing based on the fabric physical model: Remove areas <10mm 2 Isolated folds are connected to broken folds, and a 3mm safety boundary is forcibly maintained at the seam to output the final mask for the non-folded area: Special treatment for knitted fabrics: When a loop structure is detected, the principal curvature calculation window is expanded to three times the loop diameter, and the path for pleat connections is optimized using Dijkstra's algorithm. Where κ is the path curvature, and the weights are α = 0.7 and β = 0.3; a fabric-parameter mapping library is established: the parameters are dynamically adjusted according to the fabric type.
[0029] Through a triple innovation of multi-scale curvature field analysis, physically constrained GrabCut optimization, and fabric adaptive parameter mechanism, the limitations of traditional methods in handling complex fabric wrinkles have been overcome.
[0030] Step 5 includes: Step 51: Multi-channel input construction: Convert an RGB image to a four-channel input: I in =[R,G,B,M flat ]
[0031] Add physical feature map: F phys =[η map κ map M edge ]
[0032] Where η map The deformation rate distribution diagram, κ map For a curvature field, M edge Used as a mask for the edges of clothing.
[0033] Step 52 Attention-guided feature extraction: An improved ConvNeXt-T network is used as the backbone, and dual-path attention modules are inserted in Stage 3 and Stage 4: A spatial =sigmoid(f 3×3 ([F max ;F avg ])) A channel =softmax(W δ (δ(F))
[0034] Feature weighting:
[0035] Step 53: Multi-scale defect detection head: Constructing a feature pyramid, the outputs {P2, P3, P4, P5} correspond to different receptive fields. A cascaded detection architecture is adopted, with each detection head outputting a three-dimensional tensor. T i =[C cls ,Δx,Δy,w,h] i×j×a
[0036] Where a is the number of anchor frames, C cls For classification confidence; Step 54 Cross-modal verification: Establish a defect property rule base and filter detection results that violate the property rules; Step 55: Positioning Optimization Regression of the center point using Gaussian heatmap:
[0037] Bounding box refinement: Δb=MLP(F crop )
[0038] Subpixel edge positioning:
[0039] Step 56: Dynamic confidence calibration Calculate the environmental credibility factor:
[0040] Adjusting classification confidence:
[0041] Step 57: Defect Report Generation Non-maximum suppression (IoU threshold = 0.25) outputs a structured report.
[0042] Through the triple innovation of multi-physical feature fusion, attention-guided detection, and cascaded multi-scale architecture, the industry problem of easy missed detection of small targets and large interference from complex textures in textile defect detection has been solved.
[0043] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. In the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting defects in suspended garments, comprising the following steps: Step 1: Simultaneously acquire multi-view images of the garment in a suspended state using multiple sets of industrial cameras arranged in a ring. Step 2: Reconstruct the 3D point cloud model of the garment based on the multi-view images, and calculate the fabric stretch deformation rate. Step 3, Perform deformation compensation: Use Thin Plate Spline Transform (TPS) to register images from each viewpoint to a standard planar template to eliminate geometric distortion; Step 4, perform wrinkle suppression: apply curvature filtering to the registered image to generate a wrinkle mask and segment the non-wrinkle region; Step 5: Run a convolutional neural network model in the non-wrinkled area to identify the type and location of defects; Step 6: Trigger the sorting instruction based on the recognition result.
2. The method for detecting defects in suspended garments according to claim 1, characterized in that, Step 21, 3D reconstruction preprocessing: Camera calibration is performed on the multi-view images obtained in Step 1. The camera intrinsic parameter matrix and distortion coefficients are calculated using the Zhang Zhengyou calibration method, and the extrinsic parameter matrix is optimized by bundle adjustment. Step 22, Feature matching: The SIFT algorithm is used to extract image feature points, and feature descriptor matching is performed based on KD-Tree. The RANSAC algorithm is used to remove mismatched point pairs. Step 23, Point Cloud Generation: Sparse reconstruction: Generate an initial sparse point cloud by triangulating matching point pairs, and solve for minimizing the reprojection error; Dense Reconstruction: The PatchMatch multi-view stereo matching algorithm is used to generate a dense point cloud model based on sparse point cloud. Step 24, Deformation rate calculation.
3. The method for detecting defects in suspended garments according to claim 2, characterized in that, The solution minimizes the reprojection error: Among them, P i Let X be the camera projection matrix. j Let x be the coordinates of a 3D point. ij The coordinates of the observed pixels.
4. The method for detecting defects in suspended garments according to claim 2, characterized in that, The deformation rate calculation involves placing reflective markers at predetermined positions on the garment. These markers are 2mm in diameter and exhibit a specific coded pattern. Based on point cloud recognition of the markers' three-dimensional coordinates, the measured length L between adjacent markers is calculated. k ; Call the pre-stored design dimension L 0k Calculate the deformation rate by zone: Output a heat map showing the deformation rate distribution of the entire garment.
5. The method for detecting defects in suspended garments according to claim 1, characterized in that, Step 31, Control point pair generation: Define N reference control points on a standard planar template and distribute them evenly along the key structural lines of the garment; extract the corresponding actual control points through the 3D point cloud model and use the curvature extreme value detection algorithm to locate structural feature points; Step 32, TPS parameter solution: Construct the thin plate spline transformation function and solve the weights by minimizing the bending energy; Step 33, Dynamic Deformation Compensation: Adjust the density of control points according to the fabric tensile deformation rate in Step 2, and generate coordinates for newly added control points using B-spline interpolation; Step 34, Image resampling: Calculate the mapped coordinates for each pixel and use bicubic convolution interpolation to calculate the pixel value; Step 35, Compensation effect verification: Calculate the registration error and optimize the control point position.
6. The method for detecting defects in suspended garments according to claim 5, characterized in that, Dynamic deformation compensation: Adjust the control point density based on the fabric tensile deformation rate η from step 2. Image resampling: Calculate the mapped coordinates (u, v) = T for each pixel (x, y). -1 (x, y); Pixel values are calculated using bicubic convolution interpolation: in is a cubic basis function, and s is a scaling factor.
7. The method for detecting defects in suspended garments according to claim 1, characterized in that, Step 41, Multi-scale curvature field construction: Multi-scale preprocessing is performed using a Difference of Gaussians (DoG) filter to calculate the principal curvature field; Step 42, wrinkle feature enhancement: Define the wrinkle index and apply anisotropic diffusion in the texture direction; Step 43, Probability Mask Generation: Train a random forest classifier and output a pixel-level wrinkle probability map; Step 44, Multimodal segmentation: Initial binarization, GrabCut segmentation is used for the "undetermined" region; Step 45, Non-wrinkle area optimization: Post-processing is performed based on the fabric physical model to output the final non-wrinkle area mask.
8. The method for detecting defects in suspended garments according to claim 1, characterized in that, Step 51, Multi-channel input construction: Convert the RGB image into a four-channel input; Step 52, Attention-guided feature extraction: An improved ConvNeXt-T network is used as the backbone, and dual-path attention modules are inserted in Stage 3 and Stage 4; Step 53, Multi-scale defect detection head: Construct a feature pyramid to output {P2, P3, P4, P5} corresponding to different receptive fields, and use a hierarchical... A joint detection architecture, where each detection head outputs a three-dimensional tensor; Step 54, Cross-modal verification: Establish a defect property rule base; Step 55, Positioning Optimization: Use Gaussian heatmap to regress the center point, refine the bounding box, and locate sub-pixel edges; Step 56, Dynamic Confidence Calibration: Calculate the environmental confidence factor and adjust the classification confidence. Step 57, Defect Report Generation: Non-maximum suppression, output structured report.
Citation Information
Cited By
Garment wrinkle detection method based on image analysis
CN121190468A