A method and device for detecting fabric defects on a circular machine

By acquiring reference images and calculating the motion vector sequence features of the difference images, the system can distinguish between real and false defects, solving the problems of low efficiency and misjudgment in traditional detection methods, and achieving efficient and accurate fabric defect detection.

CN122109109AInactive Publication Date: 2026-05-29QUANZHOU HENGYI MACHINE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QUANZHOU HENGYI MACHINE
Filing Date
2026-04-24
Publication Date
2026-05-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional manual methods for detecting defects in textiles are inefficient and prone to missing minor flaws, while image recognition systems are prone to misjudging defects after the fabric is contaminated with fiber particles.

Method used

A reference image is acquired using a thoroughly cleaned image acquisition module. By comparing the current frame with the reference image, the difference image is calculated, motion vector sequence features are extracted, real defects and false defects are distinguished, and the reference image is updated when a false defect is identified.

Benefits of technology

It improves the accuracy of fabric defect detection, avoids misjudgments caused by fiber particle contamination, and enhances the reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122109109A_ABST
    Figure CN122109109A_ABST
Patent Text Reader

Abstract

The application provides a loom cloth defect detection method and device, and relates to the field of textiles, which comprises the following steps: acquiring the image of a cloth without defects by using a completely cleaned image acquisition module to obtain a reference image; during loom production, continuously acquiring the image of a cloth to be detected, comparing the current frame of the cloth image to be detected with the reference image to determine the difference area; from the current frame of the difference image to the previous N-1 frames of the difference image, calculating the displacement vector according to the center coordinates of the matched difference area in two continuous frames of the difference image, forming a motion vector sequence, extracting the average displacement feature, the direction consistency feature, the motion stability feature and the trajectory feature of the motion vector sequence, judging whether it is a real defect or a false defect according to the extracted features; if the current frame of the cloth image to be detected has a difference area that is judged to be a false defect, updating the reference image by using the current frame of the cloth image to be detected. The application can avoid misjudgment and improve the accuracy of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the textile field, and in particular to a method and apparatus for detecting defects in circular knitting fabrics. Background Technology

[0002] In textile machinery production, when circular knitting machines are used to weave fabrics, various defects such as holes, stains, and misaligned weave patterns can easily appear on the fabric surface. Traditional inspection methods mainly rely on manual sampling, but this method is not only inefficient but also prone to missing some subtle defects. To solve this problem, image recognition is used to identify fabric defects.

[0003] However, in actual production, special fabrics containing short fibers or with a loose surface structure continuously release tiny fiber particles. These particles gradually adhere to and accumulate on the camera lens of the image recognition system and the light-transmitting windows of the LED lighting unit. As production continues, the accumulated particles can obscure parts of the lens area and the light-transmitting windows, creating optical contamination. This results in dark spots or shadows in the acquired images that are easily confused with actual defects, causing the image recognition system to misjudge the situation. Summary of the Invention

[0004] The main objective of this invention is to provide a method and apparatus for detecting defects in circular knitting fabrics, which can avoid misjudgment and improve the accuracy of defect detection.

[0005] This invention is achieved through the following technical solution:

[0006] A method for detecting defects in circular knitting fabrics includes the following steps:

[0007] Step S1: Use the thoroughly cleaned image acquisition module to acquire an image of the flawless fabric to obtain a reference image;

[0008] Step S2: During circular knitting production, the image acquisition module continuously acquires images of the fabric to be inspected, compares the current frame of the fabric to be inspected with the reference image to obtain a difference image, and determines the difference area in the difference image.

[0009] Step S3: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images, and form a motion vector sequence corresponding to the N frame difference images from each displacement vector.

[0010] Step S4: Extract the average displacement features, direction consistency features, motion stability features, and trajectory features of the motion vector sequence. Based on the extracted features, determine whether it is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm.

[0011] Step S5: If there are discrepancy areas in the current frame of the fabric image to be detected that are judged to be false defects, then update the reference image using the current frame of the fabric image to be detected.

[0012] Furthermore, in step S1, the circular knitting machine outputs a flawless piece of fabric at normal speed, and the thoroughly cleaned image acquisition module continuously acquires N1 frames of images of the fabric. For each pixel, the average pixel value in the N1 frames of images at that pixel is calculated, and the average pixel value corresponding to all pixels forms the reference image.

[0013] Furthermore, in step S2, according to the formula Calculate the difference image, for the difference image After binarization, the pixel value is compared with a set difference threshold. Pixels with a difference threshold are identified as difference points. Connectivity analysis is then performed using these difference points as a reference to obtain the difference regions. As the current reference image, The image of the fabric to be detected is the current frame, where t represents the current frame and (x,y) are the pixel coordinates.

[0014] Furthermore, in step S3, when the center distance between two different regions is less than a distance threshold and the area difference is less than an area threshold, the two different regions are matched.

[0015] Furthermore, in step S3, the motion vector sequence is represented as follows: , ,in, These are the center coordinates of the difference region in the current frame's difference image.

[0016] Furthermore, in step S4, according to the formula Extract the average displacement feature according to the formula Extract directional consistency features according to the formula Extract motion stability features according to the formula Extract trajectory features, where, Let be the expected displacement vector of the fabric. To find the standard deviation, This is the average distance from the center point of the difference region in each frame to the straight line fitted by the center point of the difference region in each frame.

[0017] Furthermore, in step S4, when the following conditions are met... Pixels , and When the abnormal area is determined to be a pseudo-defect, and the following conditions are met: In the expected displacement vector Within the range , and When the abnormal area is determined to be a real defect, an alarm is triggered.

[0018] Furthermore, in step S5, using Obtain the updated reference image ,in, As the current reference image, The current frame contains the image of the fabric to be detected. This is the learning rate.

[0019] Furthermore, in step S5, using Update coordinates in the current reference image The pixel value, if the coordinates If the region of difference belongs to a rapidly changing region, then the learning rate should be set to [value]. If coordinates If the region of difference belongs to a region of slow change, then the learning rate should be set to [value]. Wherein, if the difference region corresponding to the false defect has an average pixel change rate over the past M frames If the change exceeds the set threshold, the region of difference is determined to be a rapidly changing region; otherwise, it is determined to be a slowly changing region. This represents the average pixel value of the i-th frame in the past.

[0020] This invention is also achieved through the following technical solutions:

[0021] A detection apparatus for implementing the circular knitting fabric defect detection method as described above includes:

[0022] Reference image acquisition module: Used to acquire images of flawless fabric using a thoroughly cleaned image acquisition module to obtain reference images;

[0023] Difference Area Determination Module: Used during circular knitting machine production, this module acquires images of the fabric to be inspected using an image acquisition module, compares the current frame of the fabric to be inspected with a reference image to obtain a difference image, and determines the difference areas within the difference image.

[0024] Defect determination module: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images. The displacement vectors form a motion vector sequence corresponding to the N frame difference images. Extract the average displacement feature, direction consistency feature, motion stability feature and trajectory feature of the motion vector sequence. Based on the extracted features, determine whether it is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm.

[0025] Reference image update module: If there are discrepancies in the fabric image to be detected in the current frame that are judged to be false defects, then the reference image is updated using the fabric image to be detected in the current frame.

[0026] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:

[0027] 1. This invention first uses a thoroughly cleaned image acquisition module to acquire images of flawless fabric to obtain a reference image. During actual production on the circular knitting machine, the image acquisition module acquires images of the fabric to be inspected. The current frame of the fabric to be inspected is compared with the reference image to obtain a difference image, and the difference regions in the difference image are determined. Then, from the current frame of the difference image to the previous N-1 frames of the difference image, displacement vectors are calculated based on the center coordinates of the difference regions matched in the two consecutive frames of the difference image. Each displacement vector forms a motion vector sequence corresponding to the N frames of the difference image, and the average displacement feature, direction consistency feature, motion stability feature, and trajectory feature of the motion vector sequence are extracted. Based on the extracted features, it is determined whether it is a real defect or a false defect. When a defective area is determined to be a false defect, the reference image is updated using the corresponding image of the fabric to be inspected. This can avoid misjudging fiber particles accumulated on the image acquisition module during the production process as defects, thereby effectively improving the detection accuracy.

[0028] 2. When updating the reference image, determine whether it is a fast-changing region or a slow-changing region based on the average pixel change rate of the false defect. A fast-changing region means that fiber particles are accumulating rapidly, so a larger learning rate is set so that the reference image can quickly integrate into the false defect region, further avoiding misjudgment. Attached Figure Description

[0029] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0031] The present invention will be further described below through specific embodiments.

[0032] like Figure 1 As shown, the method for detecting fabric defects on a circular knitting machine includes the following steps:

[0033] Step S1: Use the thoroughly cleaned image acquisition module to acquire an image of the flawless fabric to obtain a reference image;

[0034] The circular knitting machine outputs a flawless piece of fabric at normal speed. A thoroughly cleaned image acquisition module continuously captures N1 frames of images of this fabric. For each pixel, the average pixel value across the N1 frames is calculated. The average pixel value across all pixels forms the reference image. In this embodiment, the image acquisition module uses a high-resolution industrial camera to capture N1 = 500 frames.

[0035] Step S2: During circular knitting production, the image acquisition module continuously acquires images of the fabric to be inspected, compares the current frame of the fabric to be inspected with the reference image to obtain a difference image, and determines the difference area in the difference image.

[0036] The acquired images of the fabric to be inspected undergo preprocessing to remove random image noise. Specifically, this can be done using a... The median filter replaces each pixel value in the fabric image to be detected with the median of its neighboring pixels to smooth the image. This can remove random noise such as salt and pepper noise while better preserving the edge details of the image.

[0037] According to the formula Calculate the difference image Differential images For grayscale images, the larger the pixel value, the better. This indicates the current frame of the fabric image to be detected. As the current reference image, This indicates the absolute value, where t represents the current frame and (x, y) are the pixel coordinates.

[0038] To highlight the areas of difference, the difference image After binarization, the pixel value is compared with the set difference threshold. Pixels with a difference value greater than the difference threshold are considered difference points. Connectivity analysis is performed based on the difference points to obtain the difference region. The difference threshold can be set as a fixed value based on experience, or it can be adaptively adjusted based on the mean and standard deviation of the brightness of the fabric image to be detected in the current frame. The specific process of connected component analysis is existing technology.

[0039] Step S3: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images, and form a motion vector sequence corresponding to the N frame difference images from each displacement vector.

[0040] If the distance between the center points of two difference regions is less than a distance threshold and the area difference is less than an area threshold, then the two difference regions are considered to match, meaning that the difference region exists in both corresponding difference images. The area is the sum of the pixel values ​​of the difference regions. The distance threshold is set to 10 pixels, and the area threshold is set to ±20% of the area of ​​the difference region in the current frame. If a difference region does not find a match in its preceding consecutive frames, the movement of the difference region is considered interrupted, and the construction of the difference image restarts from the current moment.

[0041] To determine whether the discrepancy area is a real defect or a pseudo-defect, it is necessary to track the positional changes of these discrepancy areas in consecutive frames of difference images. In addition, the combined effect of the minute mechanical vibrations generated by the long-term operation of the circular knitting machine and the uneven airflow in the workshop may cause the fiber particle clusters attached to the image acquisition module to no longer remain absolutely still, but instead exhibit extremely small, non-periodic shaking or drifting, which increases the difficulty of judging the defect type.

[0042] Therefore, a short-term historical list is maintained for each difference region, recording the center coordinates of that difference region in the past N=10 frames. The process of obtaining the center coordinates is based on existing technology. For each pair of matching difference regions in consecutive frames, a displacement vector is calculated based on its center coordinates, and all displacement vectors form a motion vector sequence. , Let be the displacement vector of the region of difference between the current frame and the previous frame, where These are the center coordinates of the difference region in the current frame's difference image. The coordinates are the center coordinates of the difference region in the previous frame of the difference image.

[0043] Step S4: Extract the average displacement feature, direction consistency feature, motion stability feature and trajectory feature of the motion vector sequence. Based on the extracted features, determine whether the difference area is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm.

[0044] Average displacement characteristics, directional consistency characteristics, motion stability characteristics, and trajectory characteristics are features that can describe the behavioral patterns of different regions. They reflect the stability of motion, directional consistency, and the degree of deviation of the expected motion of the fabric.

[0045] According to the formula Extracting the average displacement feature is the average value of the magnitudes of all displacement vectors in the motion vector sequence;

[0046] According to the formula Extract directional consistency features to measure the degree of concentration of displacement vector directions in a motion vector sequence. The expected displacement vector of the fabric is calculated using the speed of the circular knitting machine and the frame rate of the industrial camera; the calculation process is based on existing technology.

[0047] According to the formula Extract motion stability features to measure the standard deviation of the displacement vector magnitude in a motion vector sequence. and the standard deviation of the rate of change of direction (such as the angle between adjacent vectors) , To determine the standard deviation, a higher stability eigenvalue indicates smoother motion.

[0048] According to the formula Trajectory features are extracted to measure the degree of fit between the motion trajectory of the difference region and the expected motion trajectory of the fabric. The expected motion trajectory of the fabric is obtained by fitting the center points of the difference regions in each frame using the least squares method. The fitting process is a current technique. This is the average distance from the center point of the difference region in each frame to the straight line fitted by the center point of the difference region in each frame.

[0049] When satisfied Pixels (Indicates frequent changes in direction) (Indicating unstable motion) and When (indicating non-linear trajectory), the abnormal region is determined to be a pseudo-defect, and when the following conditions are met... In the expected displacement vector Within the range (Indicating that the directions are roughly the same) (Indicating relatively stable motion) and When the trajectory is close to linear, the abnormal area is determined to be a real defect, and an alarm is triggered.

[0050] The alarms specifically include audible and visual alarms, such as activating the buzzer and red indicator light through the digital output interface of the circular knitting machine, sending a stop command to the circular knitting machine control system through the Modbus TCP protocol, and displaying the location of the defect and an image screenshot on the operation interface.

[0051] Step S5: If there are discrepancy areas in the current frame of the fabric image to be detected that are judged to be false defects, then update the reference image using the current frame of the fabric image to be detected.

[0052] use Obtain the updated reference image The updated reference image is used as the current reference image, where, As the current reference image, The current frame contains the image of the fabric to be detected. The learning rate can be 0.001.

[0053] In actual production, the accumulation of fiber particles can be slow or rapid depending on the fabric (such as microfiber blended fabrics with special electrostatic properties). False defects with different accumulation rates should have different learning rates when updating the reference image. This is crucial to maintaining the detection sensitivity for real defects and better avoiding false positives and missed detections.

[0054] Therefore, the learning rate is automatically adjusted by the average pixel change rate: for the pixel values ​​in the current reference image According to its coordinates Adjust the learning rate according to whether the region of difference belongs to a rapidly changing region. And according to the formula Update coordinates The pixel value.

[0055] Calculate the average pixel change rate of the difference region corresponding to the fake defect over the past M=10 frames. If the average pixel change rate If the change exceeds the set threshold (5 pixels), the region of difference is determined to be a rapidly changing region, and the learning rate is adjusted accordingly. Values Otherwise, the region of difference is determined to be a region of slow change, and the learning rate parameter is adjusted accordingly. Values , This represents the average pixel value of the i-th frame in the past.

[0056] The detection apparatus for implementing the above detection method includes:

[0057] Reference image acquisition module: Used to acquire images of flawless fabric using a thoroughly cleaned image acquisition module to obtain reference images;

[0058] Difference Area Determination Module: Used during circular knitting machine production, this module acquires images of the fabric to be inspected using an image acquisition module, compares the current frame of the fabric to be inspected with a reference image to obtain a difference image, and determines the difference areas within the difference image.

[0059] Defect determination module: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images. The displacement vectors form a motion vector sequence corresponding to the N frame difference images. Extract the average displacement feature, direction consistency feature, motion stability feature and trajectory feature of the motion vector sequence. Based on the extracted features, determine whether it is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm.

[0060] Reference image update module: If there are discrepancies in the fabric image to be detected in the current frame that are judged to be false defects, then the reference image is updated using the fabric image to be detected in the current frame.

[0061] In this invention, the terms "first," "second," and "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. The use of terms such as "upper," "lower," "left," "right," "front," and "rear" to indicate orientation or positional relationships is based on the orientation or positional relationships shown in the accompanying drawings and is only for the convenience of describing the invention, not to indicate or imply that the device referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation on the scope of protection of this invention. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0062] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0063] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.

Claims

1. A method for detecting defects in circular knitting fabrics, characterized in that: Includes the following steps: Step S1: Use the thoroughly cleaned image acquisition module to acquire an image of the flawless fabric to obtain a reference image; Step S2: During circular knitting production, the image acquisition module continuously acquires images of the fabric to be inspected, compares the current frame of the fabric to be inspected with the reference image to obtain a difference image, and determines the difference area in the difference image. Step S3: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images, and form a motion vector sequence corresponding to the N frame difference images from each displacement vector. Step S4: Extract the average displacement features, direction consistency features, motion stability features, and trajectory features of the motion vector sequence. Based on the extracted features, determine whether it is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm. Step S5: If there are discrepancy areas in the current frame of the fabric image to be detected that are judged to be false defects, then update the reference image using the current frame of the fabric image to be detected.

2. The method for detecting defects in circular knitting fabrics according to claim 1, characterized in that: In step S1, the circular knitting machine outputs a flawless piece of fabric at normal speed. The thoroughly cleaned image acquisition module continuously acquires N1 frames of images of the fabric. For each pixel, the average pixel value in the N1 frames of images is calculated. The average pixel value of all pixels forms the reference image.

3. The method for detecting defects in circular knitting fabrics according to claim 2, characterized in that: In step S2, according to the formula Calculate the difference image, for the difference image After binarization, the pixel value is compared with a set difference threshold. Pixels with a difference threshold are identified as difference points. Connectivity analysis is then performed using these difference points as a reference to obtain the difference regions. As the current reference image, The image of the fabric to be detected is the current frame, where t represents the current frame and (x,y) are the pixel coordinates.

4. A method for detecting defects in circular knitting fabrics according to claim 1, 2, or 3, characterized in that: In step S3, if the center distance between two different regions is less than a distance threshold and the area difference is less than an area threshold, then the two different regions are matched.

5. The method for detecting defects in circular knitting fabrics according to claim 4, characterized in that: In step S3, the motion vector sequence is represented as follows: , ,in, These are the center coordinates of the difference region in the current frame's difference image.

6. The method for detecting defects in circular knitting fabrics according to claim 5, characterized in that: In step S4, according to the formula Extract the average displacement feature according to the formula Extract directional consistency features according to the formula Extract motion stability features according to the formula Extract trajectory features, where, Let be the expected displacement vector of the fabric. To find the standard deviation, This is the average distance from the center point of the difference region in each frame to the straight line fitted by the center point of the difference region in each frame.

7. The method for detecting defects in circular knitting fabrics according to claim 6, characterized in that: In step S4, when the following conditions are met... Pixels , and When the abnormal area is determined to be a pseudo-defect, and the following conditions are met: In the expected displacement vector Within the range , and When the abnormal area is determined to be a real defect, an alarm is triggered.

8. A method for detecting defects in circular knitting fabrics according to claim 1, 2, or 3, characterized in that: In step S5, using Obtain the updated reference image ,in, As the current reference image, The current frame contains the image of the fabric to be detected. This is the learning rate.

9. A method for detecting defects in circular knitting fabrics according to claim 1, 2, or 3, characterized in that: In step S5, using Update coordinates in the current reference image The pixel value, if the coordinates If the region of difference belongs to a rapidly changing region, then the learning rate should be set to [value]. If coordinates If the region of difference belongs to a region of slow change, then the learning rate should be set to [value]. Wherein, if the difference region corresponding to the false defect has an average pixel change rate over the past M frames If the change exceeds the set threshold, the region of difference is determined to be a rapidly changing region; otherwise, it is determined to be a slowly changing region. This represents the average pixel value of the i-th frame in the past.

10. A detection apparatus for implementing the circular knitting fabric defect detection method as described in any one of claims 1 to 9, characterized in that: include: Reference image acquisition module: Used to acquire images of flawless fabric using a thoroughly cleaned image acquisition module to obtain reference images; Difference Area Determination Module: Used during circular knitting machine production, this module acquires images of the fabric to be inspected using an image acquisition module, compares the current frame of the fabric to be inspected with a reference image to obtain a difference image, and determines the difference areas within the difference image. Defect determination module: Starting from the current frame difference image to the previous N-1 frame difference images, calculate the displacement vector based on the center coordinates of the matched difference regions in the two consecutive frame difference images. The displacement vectors form a motion vector sequence corresponding to the N frame difference images. Extract the average displacement feature, direction consistency feature, motion stability feature and trajectory feature of the motion vector sequence. Based on the extracted features, determine whether it is a real defect or a false defect. When it is determined to be a real defect, trigger an alarm. Reference image update module: If there are discrepancies in the fabric image to be detected in the current frame that are judged to be false defects, then the reference image is updated using the fabric image to be detected in the current frame.