Method for stitch quality detection for face mask automation sewing
The stitch detection method, which uses multi-angle light source shadow superposition and segmented analysis, solves the problems of insufficient three-dimensional shape perception and color sensitivity in traditional detection methods, improves the accuracy and efficiency of stitch detection, and adapts to the characteristics of complex fabrics.
Patent Information
- Application Number
- CN202510633327.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Traditional stitch detection methods cannot effectively perceive the three-dimensional embedding depth of the stitch, are highly sensitive to color, and are easily affected by fabric texture, resulting in a high rate of missed detections and making it difficult to meet the quality control requirements of complex textured fabrics and high-precision three-dimensional stitches.
By employing multi-angle tilted light sources for time-division illumination, a comprehensive shadow image is generated. Through shadow overlay and segmented analysis, the symmetry axis of the line trace is identified, and the shadow areas on both sides of the symmetry axis are compared. Combined with dynamic calibration and normalized illumination compensation, three-dimensional morphological perception and high-precision detection are achieved.
It significantly improves the detection rate of three-dimensional defects such as uneven tension and tilted thread loops, adapts to complex stitch patterns and diverse fabric characteristics, and achieves reliable detection of light-colored stitches on light-colored fabrics, balancing detection accuracy and efficiency.
Smart Images

Figure CN120510132B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality inspection technology, and in particular to a method for inspecting stitch quality in automated mask sewing. Background Technology
[0002] Face covers are made of fabric sewn together by a sewing machine. As an important textile product in furniture, automotive interiors, and other fields, the uniformity, symmetry, and three-dimensional shape of the stitches not only affect aesthetics but also directly determine durability. High-quality stitches require standardized three-dimensional shapes. Traditional contour detection involves capturing stitch images with an industrial camera, extracting the binarized contour of the seam through grayscale conversion and edge enhancement, calculating the contour's geometric parameters, and finally judging the quality by comparing it with a preset threshold. This method is highly dependent on the color difference between the seam and the fabric and requires precise image segmentation technology.
[0003] High-quality stitches must meet three-dimensional morphological specifications. Traditional inspection methods are mostly based on machine vision technology, which is a mature technology but suffers from two-dimensional perspective limitations. It cannot perceive the three-dimensional embedding depth of the stitches and is overly sensitive to color, resulting in problems such as light-colored stitches appearing blurry on white fabrics. Fabric textures also often interfere with and lead to misjudgments; for example, fabric patterns may be misidentified as broken stitches, resulting in a high rate of missed detections for critical three-dimensional defects such as uneven tension and tilted thread loops. Therefore, these limitations restrict the quality control of complex textured fabrics and high-precision three-dimensional stitches, urgently requiring technological breakthroughs. Summary of the Invention
[0004] This invention provides a method for detecting stitch quality in automated mask sewing, which can effectively solve the problems in the background art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] Methods for inspecting stitch quality in automated mask sewing include:
[0007] A multi-angle tilted light source is set above the mask to be tested. Each light source selects the same wavelength according to the color of the fabric and turns on at different times.
[0008] Vertical projection images of the cover illuminated by each of the aforementioned light sources are collected at fixed points;
[0009] The vertical projection images corresponding to each angle are subjected to shadow overlay processing to generate a comprehensive shadow image;
[0010] In the composite shadow image, segmentation points are set at predetermined distance intervals along the line direction to obtain segmented line traces;
[0011] For each segmented line trace, identify the axis of symmetry, and expand an analysis window with the same area on both sides of the axis of symmetry.
[0012] Compare and analyze the shadow areas on both sides of the axis of symmetry within the comparison and analysis window, and judge the quality of the line stitch based on the comparison and analysis results.
[0013] Furthermore, before the shadow overlay process, the following steps are included:
[0014] Normalized illumination compensation is performed on each of the vertical projection images.
[0015] Furthermore, the shadow overlay process includes:
[0016] Extract the shadow regions from each image and convert them into binary masks to obtain the corresponding mask images;
[0017] A composite shadow image is generated by performing operations on multiple mask images.
[0018] Furthermore, the composite shadow image is generated by performing operations on multiple mask images as follows:
[0019] Binary operations are performed on pixels at the same coordinate position in multiple mask images, and the results are used to identify whether each pixel is a shadow area.
[0020] Furthermore, the process of setting segmentation points at predetermined intervals to obtain segmented line traces includes:
[0021] Calculate the rate of change of the tangent angle at consecutive points along the direction of the line;
[0022] When the rate of change of the angle exceeds a set threshold, it is marked as a bending point;
[0023] Two dividing points are obtained by extending 1 to 2 predetermined distances before and after the bending point, and the area between the two dividing points is used as the rejection area.
[0024] Furthermore, the shadow area within the analysis window accounts for more than 70% of the total shadow area.
[0025] Furthermore, the shadow areas on both sides of the axis of symmetry within the analysis window are compared, and the stitch quality is judged based on the comparison analysis results, including:
[0026] The number of shadow pixels on both sides of the axis of symmetry within the statistical analysis window;
[0027] Calculate the natural logarithm of the ratio of the number of shadow pixels on both sides;
[0028] When the natural logarithm exceeds a set range, it is determined to be a line defect.
[0029] Furthermore, it also includes a dynamic calibration step, including:
[0030] Online trajectory setting location setting standard reference block;
[0031] The set distance between the two dividing points is determined based on the shadow features of the standard reference block and the cloth texture direction.
[0032] Furthermore, image acquisition is performed 50-100 milliseconds after the light source is turned on.
[0033] Further, identifying the axis of symmetry for each of the segmented line traces includes:
[0034] Identify the edges at both ends of the segmented line, and take the line connecting the midpoints of the two edges as the axis of symmetry.
[0035] The technical solution of this invention can achieve the following technical effects:
[0036] This invention effectively solves the problems of lack of three-dimensional shape perception, strong color sensitivity, and severe texture interference in stitch quality inspection. It significantly improves the detection rate of three-dimensional defects such as uneven tension and tilted stitch loops, and enables reliable detection of light-colored stitches on light-colored fabrics. At the same time, it takes into account both detection accuracy and efficiency, and adapts to complex stitch shapes and diverse fabric characteristics.
[0037] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating a method for inspecting stitch quality in automated mask sewing.
[0040] Figure 2 A flowchart illustrating the process of setting up exclusion regions;
[0041] Figure 3 A flowchart illustrating the process of comparing and analyzing the shadow areas on both sides of the axis of symmetry within the window, and then judging the quality of the line stitch based on the comparative analysis results. Detailed Implementation
[0042] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0044] Example 1:
[0045] like Figure 1 As shown, a stitch quality inspection method for automated mask sewing includes:
[0046] S1: Set up multi-angle tilted light sources above the fabric to be tested. Each light source selects the same wavelength according to the fabric color and turns on at different times.
[0047] S2: Collect vertical projection images of the cover illuminated by each light source at fixed points;
[0048] S3: Perform shadow overlay processing on the vertical projection images corresponding to each angle to generate a comprehensive shadow image;
[0049] Specifically, to ensure accurate alignment of images acquired under various light sources, this embodiment acquires vertical projection images of each light source at fixed points, resulting in natural image alignment and simplifying the image processing workflow. Under a single-angle light source, the direction of the line may be parallel to the light direction, leading to shadows that are too short or missing. Therefore, this embodiment uses light sources at different angles for illumination to acquire more comprehensive shadow information. In subsequent image processing, by fusing the shadow information from multiple angle light sources, the detection blind spots of a single viewpoint can be eliminated, the three-dimensional features of the line can be enhanced, and interference noise such as fabric texture can be suppressed.
[0050] S4: Set segmentation points at set distance intervals along the line direction in the composite shadow image to obtain segmented line traces;
[0051] Since there may be local quality problems in the stitches, segmented processing can pinpoint the location of defects more precisely, and prevent local anomalies from being smoothed out by the overall data during global analysis. Therefore, segmented analysis can accurately locate defects such as uneven tension and tilted loops, and prevent local anomalies in long stitches from being ignored, thus reducing the interference of global deformation.
[0052] S5: Identify the axis of symmetry for each segmented line trace, and expand the same area region on both sides of the axis of symmetry to form an analysis window;
[0053] S6: Compare and analyze the shadow areas on both sides of the axis of symmetry within the window, and judge the quality of the line stitch based on the comparison and analysis results.
[0054] By projecting light from multiple angles at the same wavelength into a three-dimensional image, three-dimensional shadow features are constructed, directly reflecting the three-dimensional shape of the stitch. This allows for the identification of three-dimensional defects such as loose threads and twisted threads, solving the problem that traditional two-dimensional image methods cannot accurately detect the three-dimensional shape of stitches. During implementation, the selection of fixed spectral bands combined with shadow analysis effectively avoids the problem of insufficient contrast between light-colored stitches and light-colored fabrics. Even white stitches on white fabrics can still be clearly imaged through shadows. The detection logic of comparing the same wavelength illumination and shadow area creates uniform background noise in the superimposed image, while the stitch shadows produce specific features due to their three-dimensional protrusion, fundamentally avoiding texture misjudgment. For example, if the fabric pattern is identified as a broken thread, the system automatically adapts to complex stitches through segmented symmetry analysis, accurately capturing local unevenness and tilted thread loops that are easily missed by traditional methods.
[0055] This invention effectively solves the problems of lack of three-dimensional shape perception, strong color sensitivity, and severe texture interference in stitch quality inspection. It significantly improves the detection rate of three-dimensional defects such as uneven tension and tilted stitch loops, and enables reliable detection of light-colored stitches on light-colored fabrics. At the same time, it takes into account both detection accuracy and efficiency, and adapts to complex stitch shapes and diverse fabric characteristics.
[0056] Furthermore, before shadow overlay processing, the process includes:
[0057] Normalized illumination compensation is performed on each vertical projection image.
[0058] As a preferred embodiment, the actual light intensity projected onto the mask surface may vary due to differences in installation position, illumination distance, or attenuation of light sources at different angles. Shadow overlay relies on the consistency of illumination across multiple angle images; otherwise, the overlay result cannot reflect the true three-dimensional features. Therefore, in this embodiment, before shadow overlay processing, normalized illumination compensation is performed on each vertical projection image. Methods such as whiteboard calibration and histogram matching are used to adjust the vertical projection images taken at different light source angles, making their illumination intensity distribution more consistent. This eliminates the problem of uneven brightness caused by differences in light source position, angle, or intensity, providing a unified benchmark for multi-angle shadow overlay.
[0059] Based on the above embodiments, the shadow overlay processing includes:
[0060] S31: Extract the shadow regions from each image and convert them into binary masks to obtain the corresponding mask images;
[0061] The binarization masking in this step is a method that converts an image into one containing only two pixel values. By setting a grayscale threshold, a binary image containing only line shadow information is formed, simplifying the complex grayscale image into logical values, facilitating subsequent rapid calculations and logical operations. The core criterion for judging line quality is the presence of shadows, and the binarization masking method is computationally efficient, noise-resistant, and suitable for real-time detection. This step can choose to use a binarization mask to handle the shadow overlay problem, directly calculating the shadow area, which is simple and robust. Simultaneously, the binarization masking works synergistically with normalized illumination compensation. Illumination compensation ensures consistent grayscale distribution of shadows under different light sources, while the binarization masking further converts grayscale differences into logical values, simplifying multi-angle consistency verification.
[0062] S32: Perform operations on multiple mask images to generate a composite shadow image.
[0063] This ensures that shadow areas captured from any angle are preserved in the composite image. After normalization preprocessing, the operation retains only geometric shadow features, eliminating the influence of uneven brightness from a single light source. After multi-angle synthesis, only the stable shadows of three-dimensional lines are enhanced. Light-colored seams may appear blurry at some angles, but the signal-to-noise ratio is significantly improved through the union and superposition of shadows from multiple angles.
[0064] Based on the above embodiments, a composite shadow image is generated by performing calculations on multiple mask images as follows:
[0065] Perform binary operations on pixels at the same coordinate position in multiple mask images, and identify whether the pixel is a shadow area based on the operation results.
[0066] Specifically, when the binary result of pixels at the same coordinate position is all 0, it is identified as a non-shadow area; if all are 1, it is identified as a multi-angle overlapping shadow area; if some are 0 and some are 1, it is identified as a shadow area in part of the image. After combining, a comprehensive shadow image can be obtained.
[0067] As a preferred embodiment of this example, Figure 2 As shown, the process of setting dividing points at predetermined intervals to obtain segmented line traces includes:
[0068] A1: Calculate the rate of change of the tangent angle at consecutive points along the trace direction;
[0069] A2: When the rate of change of angle exceeds the set threshold, it is marked as a bending point;
[0070] A3: Extend 1-2 predetermined distances before and after the bend point to obtain two dividing points, and use the area between the two dividing points as the rejection area.
[0071] To better adapt to complex and varied stitch patterns, a pattern divide-and-conquer strategy can be adopted, separating complex curved segments from simple straight segments and using optimal detection methods for each. For example, in this embodiment, a rejection area is set. Straight segments can rely on efficient symmetry analysis, while curved segments require higher precision detection. Therefore, extending a set distance before and after the bending point ensures that high-defect areas are completely preserved within a single segment, facilitating subsequent detection using other methods. The area after rejecting the rejection area can achieve better detection results through this invention. In this embodiment, the tangent angle change rate can be comprehensively determined based on different faceplates, different stitches, and different stitching methods.
[0072] Furthermore, the analysis showed that the shadow area within the window accounted for more than 70% of the total shadow area.
[0073] Specifically, the threshold setting of the shadow area within the analysis window being more than 70% of the total shadow area in this step can be based on a comprehensive consideration of multi-dimensional experimental verification and process characteristics, providing a clear benchmark for practical applications. At the same time, it allows for flexible adjustment for special scenarios. However, the shadow area ratio cannot be too low. If the shadow area ratio within the window is too low, the shadow distribution data on both sides of the axis of symmetry may not be sufficient to reflect the actual sewing defects, increasing the risk of error.
[0074] Based on the above embodiments, such as Figure 3 As shown, the shadow areas on both sides of the axis of symmetry within the comparison and analysis window are analyzed. Based on the comparison and analysis results, the stitch quality is judged, including:
[0075] S61: Statistical analysis of the number of shadow pixels on both sides of the axis of symmetry within the window;
[0076] S62: Calculate the natural logarithm of the ratio of the number of shadow pixels on both sides;
[0077] S63: When the natural logarithm exceeds the set range, it is judged as a line defect.
[0078] In this embodiment, the essence of stitch quality is the disruption of symmetry, namely, uneven distribution of shadows on the left and right sides. Directly comparing absolute values is affected by global factors such as light intensity and fabric color, while the ratio can eliminate the influence of absolute brightness differences, retaining only relative proportion information. Furthermore, comparing the ratio using the natural logarithm of the shadow pixel count ratio transforms the proportional difference into a logarithmic space. The natural logarithm amplifies the ratio difference on a non-linear scale. Compared to directly using the ratio, logarithmic transformation is more sensitive to small proportional differences, which is beneficial for early defect detection.
[0079] Furthermore, it also includes a dynamic calibration step, including:
[0080] B1: Online trace setting position setting standard reference block;
[0081] B2: Determine the set distance between two split points based on the shadow features of the standard reference block and the cloth texture direction.
[0082] Dynamic calibration achieves adaptive optimization of detection parameters through geometric and shadow calibration of a standard reference block, combined with fabric texture direction recognition. The standard reference block can be a representative location on the sewing path of the cover, reflecting a relatively standard stitch condition. Under multi-angle light illumination, the deviation between the actual light source angle and the theoretical value can be calculated by analyzing the length, density, and direction of the reference block's shadow. This allows for adjustment of the light source parameters. Furthermore, by analyzing the texture direction of the fabric surrounding the reference block, the angle between the reference block and the stitch can be determined, adjusting the spacing between segmentation points to avoid texture interference. Based on the calibrated light source parameters and texture direction, the interval of the segmented stitches can be calculated.
[0083] To achieve the optimal trade-off in production efficiency, image acquisition is performed 50-100 milliseconds after the light source is turned on.
[0084] To avoid initial fluctuations, the light source needs 50 milliseconds to reach stable brightness after startup. At the same time, the camera needs to take pictures immediately after the light source stabilizes to reduce motion blur. The upper limit of 100 milliseconds prevents production line cycle delays and reduces energy consumption, ensuring an optimal balance between image clarity, equipment lifespan, and production efficiency.
[0085] Furthermore, the axis of symmetry is identified for each segment of the line trace, including:
[0086] Identify the edges at both ends of the segmented line and take the line connecting the midpoints of the two edges as the axis of symmetry.
[0087] Specifically, a qualified stitch should have a symmetrical sewing structure, with parallel and uniformly spaced left and right (or top and bottom) edges. The line connecting the midpoints of the two edge lines is naturally located at the geometric center of the stitch, directly reflecting the symmetry characteristic. Therefore, the line connecting the midpoints of the two edge lines can be taken as the axis of symmetry. Choosing the line connecting the midpoints of the two edge lines as the axis of symmetry can balance computational efficiency and geometric intuition, but its reliability is highly dependent on the edge detection accuracy and endpoint positioning accuracy. In practical applications, it is necessary to combine noise suppression, dynamic calibration, and segmentation strategy optimization to adapt to complex stitch shapes and diverse industrial scenarios.
[0088] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and accompanying drawings are merely exemplary illustrations of the application as defined herein, and are to be considered as covering any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Thus, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. A method for inspecting stitch quality in automated mask sewing, characterized in that, include: A multi-angle tilted light source is set above the mask to be tested. Each light source selects the same wavelength according to the color of the fabric and turns on at different times. Vertical projection images of the cover illuminated by each of the aforementioned light sources are collected at fixed points; The vertical projection images corresponding to each angle are subjected to shadow overlay processing to generate a comprehensive shadow image; In the composite shadow image, segmentation points are set at predetermined distance intervals along the line direction to obtain segmented line traces; For each segmented line trace, identify the axis of symmetry, and expand an analysis window with the same area on both sides of the axis of symmetry. Compare and analyze the shadow areas on both sides of the axis of symmetry within the comparison and analysis window, and judge the quality of the stitches based on the comparison and analysis results; The process of setting division points at predetermined intervals to obtain segmented line traces includes: Calculate the rate of change of the tangent angle at consecutive points along the direction of the line; When the rate of change of the angle exceeds a set threshold, it is marked as a bending point; Two dividing points are obtained by extending 1 to 2 predetermined distances before and after the bending point, and the area between the two dividing points is used as the rejection area.
2. The stitch quality inspection method for automated mask sewing according to claim 1, characterized in that, Before the shadow overlay process, it includes: Normalized illumination compensation is performed on each of the vertical projection images.
3. The stitch quality inspection method for automated mask sewing according to claim 2, characterized in that, The shadow overlay process includes: Extract the shadow regions from each image and convert them into binary masks to obtain the corresponding mask images; A composite shadow image is generated by performing operations on multiple mask images.
4. The stitch quality inspection method for automated mask sewing according to claim 3, characterized in that, The composite shadow image is generated by performing operations on multiple mask images as follows: Binary operations are performed on pixels at the same coordinate position in multiple mask images, and the results are used to identify whether each pixel is a shadow area.
5. The stitch quality inspection method for automated mask sewing according to claim 1, characterized in that, The shadow area within the analysis window accounts for more than 70% of the total shadow area.
6. The stitch quality inspection method for automated mask sewing according to claim 1, characterized in that, It also includes a dynamic calibration step, including: Online trajectory setting location setting standard reference block; The set distance between the two dividing points is determined based on the shadow features of the standard reference block and the cloth texture direction.
7. The stitch quality inspection method for automated mask sewing according to claim 1, characterized in that, Image acquisition begins 50-100 milliseconds after the light source is turned on.
8. The stitch quality inspection method for automated mask sewing according to claim 1, characterized in that, Identifying the axis of symmetry for each of the segmented line traces includes: Identify the edges at both ends of the segmented line, and take the line connecting the midpoints of the two edges as the axis of symmetry.
9. A method for inspecting stitch quality in automated mask sewing, characterized in that, include: A multi-angle tilted light source is set above the mask to be tested. Each light source selects the same wavelength according to the color of the fabric and turns on at different times. Vertical projection images of the cover illuminated by each of the aforementioned light sources are collected at fixed points; The vertical projection images corresponding to each angle are subjected to shadow overlay processing to generate a comprehensive shadow image; In the composite shadow image, segmentation points are set at predetermined distance intervals along the line direction to obtain segmented line traces; For each segmented line trace, identify the axis of symmetry, and expand an analysis window with the same area on both sides of the axis of symmetry. The comparison analysis window compares the shadow areas on both sides of the axis of symmetry, and the stitch quality is judged based on the comparison analysis results, including: The number of shadow pixels on both sides of the axis of symmetry within the statistical analysis window; Calculate the natural logarithm of the ratio of the number of shadow pixels on both sides; When the natural logarithm exceeds a set range, it is determined to be a line defect.
10. The stitch quality inspection method for automated mask sewing according to claim 9, characterized in that, Before the shadow overlay process, it includes: Normalized illumination compensation is performed on each of the vertical projection images.
11. The stitch quality inspection method for automated mask sewing according to claim 10, characterized in that, The shadow overlay process includes: Extract the shadow regions from each image and convert them into binary masks to obtain the corresponding mask images; A composite shadow image is generated by performing operations on multiple mask images.
12. The stitch quality inspection method for automated mask sewing according to claim 11, characterized in that, The composite shadow image is generated by performing operations on multiple mask images as follows: Binary operations are performed on pixels at the same coordinate position in multiple mask images, and the results are used to identify whether each pixel is a shadow area.
13. The stitch quality inspection method for automated mask sewing according to claim 9, characterized in that, The shadow area within the analysis window accounts for more than 70% of the total shadow area.
14. The stitch quality inspection method for automated mask sewing according to claim 9, characterized in that, It also includes a dynamic calibration step, including: Online trajectory setting location setting standard reference block; The set distance between the two dividing points is determined based on the shadow features of the standard reference block and the cloth texture direction.
15. The stitch quality inspection method for automated mask sewing according to claim 9, characterized in that, Image acquisition begins 50-100 milliseconds after the light source is turned on.
16. The stitch quality inspection method for automated mask sewing according to claim 9, characterized in that, Identifying the axis of symmetry for each of the segmented line traces includes: Identify the edges at both ends of the segmented line, and take the line connecting the midpoints of the two edges as the axis of symmetry.
Citation Information
Patent Citations
Strip steel scabbing defect detection method based on image processing
CN115115642A
Data line appearance defect rapid detection method based on intelligent image recognition
CN119963551A