Management platform filtering method for processing cloth defect report information

By integrating the fabric defect detection device and filtering algorithm on the textile management platform, the problem of error alarm in the online fabric defect detection system is solved, and effective management of fabric defect information and improvement of production efficiency is achieved.

CN119417789APending Publication Date: 2025-02-11ZHEJIANG SCI-TECH UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411487108.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The online cloth defect detection system occasionally produces error judgments and calls an alarm, which increases the on-site personnel's inspection workload and reduces production efficiency.

Method used

Design a management platform filtering method for processing information reporting of cloth defects. Through the cloth defect detection device installed on each textile machine, it uses machine vision and deep learning to detect defects on the cloth, and connects it to the management platform to perform data analysis and information Statistics and alarm triggers. The management platform uses defect filtering algorithms, including defect category judgment, identity judgment, authenticity judgment and filtering based on the principle of occurrence frequency to filter out erroneous defect information.

Benefits of technology

Minimize error alarms, improve actual production efficiency, and realize centralized management, data analysis, information statistics and alarm triggering of reported fabric defect information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417789A_ABST
    Figure CN119417789A_ABST
Patent Text Reader

Abstract

Relates to a cloud platform filtering method for processing cloth defect report information, which comprises cloth defect detection devices arranged on each textile machine and a management platform connected with the cloth defect detection devices in a wired or wireless mode, and the management platform is provided with a defect filtering algorithm. And filtering misjudgment flaw information reported by the cloth flaw detection device, comprising the following steps of: (1) judging flaw types: distinguishing a curved quill flaw, a broken warp flaw and a weft flaw, and respectively storing the flaws; (2) identity judgment: due to the fact that the image acquisition speed far exceeds the cloth weaving speed, a single flaw can be acquired and reported for multiple times, and therefore flaw information which is submitted repeatedly is removed; (3) authenticity judgment: for various flaws, adopting judgment methods corresponding to respective forms to filter out mistakenly reported flaw information; and (4) filtering based on an occurrence frequency principle: filtering out occasionally generated false alarm flaws.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a management platform filtering method for processing cloth defect reporting information, and belongs to the technical field of artificial intelligence and textile equipment. Background Art

[0002] In the digital and intelligent transformation of the textile industry, fabric quality control is a key issue faced by textile manufacturers, and defect detection is a necessary step in fabric quality control. Therefore, whether defects can be detected in a timely and accurate manner during fabric production is a key issue that needs to be solved urgently. In order to solve the above problems, an online cloth defect detection system based on machine vision and deep learning is used to quickly detect cloth defects, control defects to the minimum range, and prevent defects from spreading to the entire roll of cloth, thereby reducing the labor costs and fabric production costs of textile companies and improving fabric quality.

[0003] However, in the actual working process, the online cloth defect detection system occasionally makes wrong judgments and alarms, which not only increases the workload of on-site personnel. And because the number of textile machines in the factory ranges from dozens to two or three hundred, false alarms will reduce the actual production efficiency. For this reason, it is necessary to design a textile management platform at a higher technical level, connect it to the online cloth defect detection system through wired or wireless means, summarize the reported cloth defect information, and perform data analysis, information statistics, and alarm triggering. In this process, filter out erroneous defect information, minimize false alarms, and truly improve actual production efficiency. Summary of the invention

[0004] The purpose of the present invention is to meet the above technical requirements and propose a management platform filtering method for processing cloth defect reporting information. The technical solution adopted is:

[0005] A management platform filtering method for processing cloth defect reporting information, comprising a cloth defect detection device arranged on each textile machine, using machine vision and deep learning methods to detect defects on the cloth, and also comprising a management platform connected to the cloth defect detection device in a wired or wireless manner, the management platform being used to receive the cloth defect information reported by the cloth defect detection device, and perform data analysis, information statistics, and alarm triggering; the cloth defect information reported by the cloth defect detection device includes the location (X i , Y i ), size (L i , W i ), defect area image f i (x, y) and time t i , where i is the number of the reported defect, i = 0, 1, 2, 3...., (X i , Yi ), which are the pixel coordinates of the reported defect in the original image, (L i , W i ), which are the length and width data of the reported defect, and the time t i is the capture time of the reported defect. Due to the existence of a certain number of misjudgment information, the management platform sets a defect filtering algorithm, including the following steps:

[0006] (1). Determine the defect category: For defects with an area less than p*p pixels, i.e., L i < p and W i < p, it is determined as a curved defect, where p is the area parameter, denoted as z 1 k , z 1 k .X = X i , z 1 k .Y = Y i , z 1 k .L = L i , z 1 k .W = W i , z 1 k .f(x, y) = f i (x, y), z 1 k .t = t i , k is the serial number of the curved defect, k = 0, 1, 2, 3....; For defects with W i > L i * q, it is determined as a broken warp defect, where q is the length-width ratio coefficient, denoted as z 2 m , z 2 m .X = X i , z 2 m .Y = Y i , z 2 m .L = L i , z 2 m .W = W i , z 2 m .f(x,y) = f i (x,y), z 2 m .t = t i , m is the serial number of the broken warp defect, m = 0, 1, 2, 3....; For L i > W i*q defect is judged as weft defect, recorded as z 3 n , z 3 n .X=X i , z 3 n .Y=Y i , z 3 n .L=L i , z 3 n .W=W i , z 3 n .f(x,y)=f i (x,y),z 3 n .t=t i , n is the serial number of the weft defect, n = 0, 1, 2, 3....; (2) Identity judgment: For the curvature defect, if |z 1 k .Xz l k-1 .X|<δ, then z 1 k For the defects that are repeatedly detected, they are deleted, where δ is the maximum position detection error of the defect detection; for the broken warp defect, if |z 2 m .Xz 2 m-1 .X|<δ, then z 2 m For repeated defects, delete them; for weft defects, if |z 3 n .Xz 3 n-1 .X|<δ, and |z 3 n .Lz 3 n-1 .L|<ε, then z 3 n Defects that are detected repeatedly are deleted, where ε is the maximum length detection error of weft defect detection;

[0007] (3) Authenticity judgment: For curved defects, calculate the grayscale mean T of the defect image 1 ={∑ y ∑ x z 1 k .f(x,y)]} / (z 1 k .L*z 1k .W), if T 1 <G 1 , then the defect is judged to be a real curvature defect, otherwise the defect is deleted, where G 1 is the grayscale threshold; for broken warp defects, set the horizontal gradient kernel of the Sobel filter For each pixel z 2 m .f(x,y), apply the horizontal convolution kernel to obtain the gradient value in the horizontal direction: Gx(x,y)=Gx·z 2 m .f(x,y), and accumulate and average in the longitude direction to obtain Gx(x)=∑ y Gx(x,y)] / z 2 m .W, then find the absolute maximum value T 2 = max[|Gx(x)|], for T 2 >G 2 The defect is judged as a broken warp, otherwise the defect is deleted. 2 is the gradient threshold; for latitude defects, the horizontal gradient kernel Gx and vertical gradient kernel of the Sobel filter are used Calculate the gradient value G of each pixel 3 (x,y)={[Gx*z 3 n .f(x,y)] 2 +[Gy*z 3 n .f((x,y)] 2} 1 / 2 , for z 3 n .f(x, y) and G 3 (x, y) is transformed: F(x, y) = INT{z 3 n .f(x,y)·N f / MAX[z 3 n .f(x,y)]}, where INT represents the integer operation, MAX represents the maximum value operation, and N f is the maximum gray value after transformation; P(x,y)=INT{G 3 (x,y)·N p / MAX[G 3 (x,y)]}, where N p is the maximum gradient level after transformation; set the grayscale gradient co-occurrence matrix H(w,v), w=0…N f -1, v = 0...N p-1, H(w,v) is equal to the statistical value of the number of pixels in the matrix F(x,y) and the matrix P(x,y) where w = F(x,y) and v = P(x,y); then the grayscale gradient co-occurrence matrix H(w,v) is normalized so that the sum of its elements is 1. The specific process is as follows: H`(w,v) = H(w,v) / ∑ w ∑ v H(w,v); Based on the gradient information, two feature information, large gradient advantage and average gradient, are calculated, where the large gradient advantage is T 3 =[∑ w ∑ v H(w,v)·v 2 ] / ∑ w ∑ v H(w,v), the average gradient is T 4 =∑ v [∑ w H′(w,v)]·v. If T 3 <G 3 And T 4 <G 4 , then the defect is judged to be a real weft defect, otherwise the defect is deleted, where G 3 is the large gradient advantage threshold, G 4 is the average gradient threshold;

[0008] (4) Filtering based on the principle of occurrence frequency: For tortuous defects, z 1 k .tz 1 k-4 .t<T G , it is judged that there is a cloth defect and an alarm is issued; for a warp break defect, if z 2 m .tz 2 m-4 .t<T G , it is judged that there is a fabric defect and an alarm is issued; for weft defects, if z 3 n .tz 3 n-4 .t<T G , it is judged that there is a defect in the cloth and an alarm is issued, where T G is the time threshold.

[0009] The positive effects of implementing the present invention are: 1. It can filter out the erroneous defect information reported by the lower-level online cloth defect detection system, minimize false alarms, and truly improve the actual production efficiency; 2. It can realize centralized management, data analysis, and information statistics of the reported cloth defect information, and realize alarm triggering. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a schematic diagram of the system structure of the management platform;

[0011] Figure 2 It is a schematic diagram of the geometric dimensions of the cloth defects;

[0012] Figure 3 It is the algorithm flow chart of the management platform filtering method;

[0013] Figure 4 This is a normal cloth sampling picture;

[0014] Figure 5 It is a sampling diagram of tortuosity defects;

[0015] Figure 6 This is a sampling diagram of warp breakage defects;

[0016] Figure 7 It is a schematic curve for judging the authenticity of warp breakage defects;

[0017] Figure 8 It is a sampling diagram of weft defects;

[0018] Fig. 9 It is a large gradient advantage comparison curve;

[0019] Fig.10 is the gradient mean contrast curve. DETAILED DESCRIPTION

[0020] The present invention will be further described with reference to the accompanying drawings:

[0021] Reference Figure 1-10 A management platform filtering method for processing cloth defect reporting information includes a cloth defect detection device 2 arranged on each textile machine, which uses machine vision and deep learning methods to detect defects on the cloth; and also includes a management platform 1 connected to the cloth defect detection device 2 through a wired or wireless router 3.

[0022] Defects on the fabric surface are usually caused by machine failure, nozzle position deviation, yarn misalignment, excessive stretching and other reasons, mainly including bends, broken warps and weft banding. The cause of broken warps is generally the breakage of white warp yarns, which causes the black weft yarns in the middle layer of the cloth to be exposed to the field of vision. This defect is a narrow and long strip that occupies the entire fabric, causing large-scale damage. During the weaving process, if the nozzle is damaged, the angle is not correct, the cross-sectional area of ​​the water pump is deviated, etc., the weft yarn will shake or fail to fully straighten to form defects. According to the length of the defect, this type of defect can be divided into bends and weft banding. Bends are caused by the slight bending of the weft yarn at a certain point, and the appearance is a raised black spot on the surface of the fabric; weft banding is caused by the bending or dislocation of the weft yarn at a certain section due to uneven force, which is manifested as a clear, narrow and long section of bulge or dislocation area in the weft direction of the fabric, and the color is obviously different from the surrounding normal fabric.

[0023] The management platform 1 is used to receive the cloth defect information reported by the cloth defect detection device 2, and perform data analysis, information statistics, and alarm triggering.

[0024] The cloth defect detection device 2 collects cloth images in real time, applies deep learning methods to detect defects on the cloth, and reports the cloth defect information to the management platform 1. The cloth defect information includes the location of the defect (X i , Y 1 ), size (L i , W i ), defect area image f i (x, y) and time t i , where i is the number of the reported defect, i = 0, 1, 2, 3..., (X 1 , Y i ) is the reported defect in image f i The pixel coordinates in (x,y), (L i ,W i ) is the length and width data of the reported defect, time t i The capture time of the reported defect.

[0025] Since there is a certain amount of misjudgment information in the cloth defect information reported by the cloth defect detection device 2, the management platform 1 sets a defect filtering algorithm to further screen the reported cloth defect information.

[0026] The defect filtering algorithm comprises the following steps:

[0027] (1) Determine the defect type

[0028] Cloth defects mainly include three categories: bends, broken warps and weft bands. Their causes and external manifestations are different, so they need to be classified in order to implement different filtering methods.

[0029] The specific steps are:

[0030] First, the defects with smaller areas are screened out and classified as tortuosity defects: For defects with an area smaller than p*p pixels, that is, L i <p and W i <p, it is judged as a tortuosity defect, where p is the area parameter, denoted by z 1 k , z 1 k .X=X i , z 1 k .Y=Y i , z 1 k .L=L i , z 1 k .W=W i , z 1 k .f(x,y)=f i (x,y),z 1 k .t=t i , k is the serial number of the tortuosity defect, k=0, 1, 2, 3...., thereby realizing the classification of tortuosity defects and the storage of information.

[0031] Then filter out the thin strip defects in the warp direction and classify them as broken warp defects: i >L i *q defect is judged as warp break defect, where q is the aspect ratio coefficient, recorded as z 2 m , z 2 m .X=X i , z 2 m .Y=Y i , z 2 m .L=L i , z 2 m .W=W i , z 2 m .f(x,y)=f i (x,y),z 2 m .t=t i , m is the serial number of the warp break defect, m=0, 1, 2, 3..., thereby realizing the classification of the warp break defect and the storage of information.

[0032] The defects finally screened out are classified as weft defects: for Li >W i *q defect is judged as weft defect, recorded as z 3 n , z 3 n .X=X i , z 3 n .Y=Y i , z 3 n .L=L i , z 3 n .W=W i , z 3 n .f(x,y)=f i (x,y),z 3 n .t=t i , n is the serial number of the weft defect, n=0, 1, 2, 3..., thereby realizing the classification of the weft defects and the storage of information.

[0033] (2) Identity Judgment

[0034] Since the image acquisition speed is much faster than the weaving speed of the cloth, a single defect will be captured multiple times and judged as a defect, so it is necessary to eliminate the defect information submitted repeatedly.

[0035] For bend defects and warp break defects, the position in the x direction is used for judgment, specifically:

[0036] For curvature defects, if |z 1 k .Xz l k-1 .X|<δ, then z 1 k and z 1 k-1 It is the reporting information of the same curve defect at different times, so it is 1 k Perform deletion processing, where δ is the maximum position detection error of defect detection;

[0037] Similarly, for warp breakage, if |z 2 m .Xz 2 m-1 .X|<δ, then z 2 m Deletion of defects detected repeatedly;

[0038] For weft defects, the position and width in the x direction are used for judgment. Specifically: if |z3 n .Xz 3 n-1 .X|<δ, and |z 3 n .Lz 3 n-1 .L|<ε, then z 3 n and z 3 n-1 It is the reporting information of the same weft defect at different times, so 3 n The deletion process is performed, where ε is the maximum length detection error of the weft defect detection.

[0039] (3) Authenticity judgment:

[0040] For each type of defect, use the judgment method corresponding to each form to filter out the erroneously reported defect information. The specific method is:

[0041] For Figure 5 The curved defect shown is a small protrusion of the black weft on the warp, which appears as a small black area in morphology. Therefore, the grayscale threshold judgment method is used. First, calculate the sum of the grayscale values ​​of the defect image: ∑ y ∑ x z 1 k .f(x,y), and then take the average to get the grayscale mean T of the defect area image 1 ={∑ y ∑ x z 1 k .f(x,y)]} / (z 1 k .L*z 1 k .W), if T 1 <G 1 , then the defect is judged to be a real curvature defect, otherwise the defect is deleted, where G 1 is the grayscale threshold;

[0042] For Figure 6 The broken warp defect shown in the figure is a black yarn in the warp direction of the fabric, and its color is obviously different from other surrounding yarns. Considering that the grayscale information in the horizontal direction of the image will suddenly change at the defect, the Sobel operator is used for edge detection in the horizontal direction to calculate the horizontal gradient of the image. Set the horizontal gradient kernel of the Sobel filter For each pixel z 2 m.f(x,y), apply the horizontal convolution kernel Gx to obtain the gradient value in the horizontal direction: Gx(x,y)=Gx·z 2 m .f(x, y), that is, Gx(x, y) = z 2 m .f(x+1,y-1)+2z 2 m .f(x+1,y)+z 2 mf(x+1,y+1)-z 2 m .f(x-1, y-1)-2z 2 m .f(x-1,y)-z 2 m .f(x-1, y+1) describes the grayscale change intensity of each pixel position on the defect image, and accumulates and averages in the meridian direction to obtain Gx(x)=∑ y Gx(x,y)] / z 2 m .W, get the mean gradient of each column. Finally, find the maximum absolute value T 2 = max|Gx(x)|. Since the warp break defect is the black yarn along the warp direction, such as Figure 6 As shown in , a gradient peak will appear at the defect location and greatly exceed the normal value of other parts, which is conducive to judgment by threshold. 2 >G 2 If there is a defect, it will be judged as a broken warp, otherwise the defect will be deleted. 2 is the gradient threshold;

[0043] For Figure 6 The weft defect shown in the figure is a defect in the horizontal direction, so the horizontal gradient kernel Gx and vertical gradient kernel Gx of the Sobel filter are used. Calculate the gradient value G of each pixel 3 (x,y)={[Gx·z 3 n .f(x,y)] 2 +[Gy·z 3 n .f(x,y)] 2} 1 / 2 For the specific dot product calculation method, see the calculation method of the horizontal gradient value of the broken warp defect. 3 n .f(x,y) and G 3 (x, y) is transformed: F(x, y) = INT{z 3 n .f(x, y)·Nf / MAX[z 3 n .f(x, y)]}, where INT represents the integer operation, MAX represents the maximum value operation, and N f is the maximum grayscale value of the transformation, which can be optionally set to 32; P(x,y)=INT{G 3 (x,y)·N p / MAX[G 3 (x,y)]}, where N p is the maximum gradient level after, which can be optionally set to 32. Set the grayscale gradient co-occurrence matrix H = (w, v), w = 0...N f -1, v = 0...N p -1, that is, N f ·N p The size of the matrix, where H = (w, v) is equal to the statistical value of the number of pixels with gray value w and gradient value v at the same position (x, y) in the matrix F (x, y) and the matrix P (x, y), that is, w = F (x, y), v = P (x, y). Then the gray gradient co-occurrence matrix H (w, v) is normalized so that the sum of its elements is 1. The specific process is as follows: H` (w, v) = H (w, v) / ∑ w ∑ v H(w,v). Based on the gradient information, two feature information, large gradient advantage and average gradient, are calculated, where the large gradient advantage is T 3 =[∑ w ∑ v H(w,v)·v 2 ] / ∑ w ∑ v H(w,v), through v 2 The pixels with large gradients are weighted and the average gradient is T 4 =∑ v [∑ w H′(w,v)]·v. Since the defective part has a single color, while the normal part presents a pattern of alternating light and dark, the large gradient advantage is T 3 and the average gradient for T4 showed a significant decrease, such as Fig. 9 and 10 As shown. If T 3 <G 3 And T 4 <G 4 , then the defect is judged to be a real weft defect, otherwise the defect is deleted, where G 3 is the large gradient advantage threshold, G 4 is the average gradient threshold.

[0044] (4) Filtering based on the frequency of occurrence

[0045] The frequency of occurrence principle is used for further filtering and screening. If a defect occurs due to a machine failure, such as nozzle angle, water pressure, etc., then such defects will occur repeatedly, but the defect recognition error will only occur occasionally. Therefore, for the bend defect, z 1 k .tz 1 k-4 .t <T G , where T G is the time threshold, indicating that at time T G If there are 5 consecutive warp defects within 20 seconds, it is judged that there is a cloth defect and an alarm is issued; similarly, for warp breakage defects, if z 2 m .tz 2 m-4 .t <T G , it is judged that there is a fabric defect and an alarm is issued; for weft defects, if z 3 n .tz 3 n-4 .t <T G , it is judged that there is a cloth defect and an alarm is issued.

[0046] The technical features of the above embodiment can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiment are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of this patent, which all belong to the protection scope of this patent. Therefore, the protection scope of this patent shall be based on the attached claims.

Claims

1. A management platform filtering method for processing cloth defect reporting information, comprising a cloth defect detection device arranged on each textile machine, using machine vision and deep learning methods to detect defects on the cloth, and also comprising a management platform connected to the cloth defect detection device in a wired or wireless manner, the management platform is used to receive the cloth defect information reported by the cloth defect detection device, and perform data analysis, information statistics, and alarm triggering, characterized in that: The cloth defect information reported by the cloth defect detection device includes the location of the defect (X i ,Y i ), size (L i ,W i ), defect area image f i (x,y) and time t i , where i is the number of the reported defect, i = 0, 1, 2, 3...., (X i ,Y i ) is the pixel coordinate of the reported defect in the original image, (L i ,W i ) is the length and width data of the reported defect, time t i To report the capture time of the defect, since there is a certain amount of misjudgment information, the management platform sets a defect filtering algorithm, including the following steps: (1) Determine the defect category: For defects with an area smaller than p*p pixels, that is, L i <p and W i <p, it is judged as a tortuosity defect, where p is the area parameter, denoted by z 1 k, z 1 kX=X i , z 1 k .Y=Y i , z 1 k .L=L i , z 1 kW=W i , z 1 k .f(x, y) = f i (x,y),z 1 kt=t i , k is the number of the tortuosity defect, k = 0, 1, 2, 3....; for W i >L i *q defect is judged as warp break defect, where q is the aspect ratio coefficient, recorded as z 2 m , z 2 m .X=X i , z 2 m .Y=Y i , z 2 m .L=L i , z 2 m .W=W i , z 2 m .f(x,y)=f i (x,y),z 2 m .t=t i , m is the serial number of the broken warp defect, m = 0, 1, 2, 3...; for L i >W i * q The defect is judged as a weft defect and is recorded as z 3 n , z 3 n .X=X i , z 3 n .Y=Y i , z 3 n .L=L i , z 3 n .W=W i , z 3 n .f(x,y)=f i (x,y),z 3 n .t=t i , n is the serial number of the weft defect, n = 0, 1, 2, 3...; (2) Identity judgment: For tortuosity defects, if |z 1 k .Xz 1 k-1 .X|<δ, then z 1 k For the defects that are repeatedly detected, they are deleted, where δ is the maximum position detection error of the defect detection; for the broken warp defect, if |z 2 m .Xz 2 m-1 .X|<δ, then z 2 m For repeated defects, delete them; for weft defects, if |z 3 n .Xz 3 n-1 .X|<δ, and |z 3 n .Lz 3 n-1 .L|<ε, then z 3 n Deletion processing is performed for the defects that are detected repeatedly, where ε is the maximum length detection error of the weft defect detection; (3) Authenticity judgment: For curved defects, calculate the grayscale mean value T1 of the defect image = {∑ y ∑ x z 1 k .f(x,y)]} / (z 1 k .L*z 1 k .W), if T1<G1, the defect is judged to be a real curvature defect, otherwise the defect is deleted, where G1 is the grayscale threshold; for the broken warp defect, the horizontal gradient kernel of the Sobel filter is set For each pixel z 2 m .f(x,y), apply the horizontal convolution kernel to obtain the gradient value in the horizontal direction: Gx(x,y)=Gx·z 2 m .f(x,y), and accumulate and average in the longitude direction to obtain Gx(x)=∑ y Gx(x,y)] / z 2 m .W, and then find the maximum absolute value T2 = max|Gx(x)|. For defects that satisfy T2>G2, it is judged as a broken warp, otherwise the defect is deleted, where G2 is the gradient threshold; for weft defects, the horizontal gradient kernel Gx and vertical gradient kernel of the Sobel filter are used. Calculate the gradient value G of each pixel 3 (x,y)={[Gx*z 3 n .f(x,y)] 2 +[Gy*z 3 n .f(x,y)] 2 } 1 / 2 , for z 3 n .f(x, y) and G 3 (x, y) is transformed: F(x, y) = INT{z 3 n .f(x,y)·N f / MAX[z 3 n .f(x,y)]}, where INT represents the integer operation, MAX represents the maximum value operation, and N f is the maximum gray value after transformation; P(x,y)=INT{G 3 (x, y)·N p / MAX[G 3 (x, y)]}, where N p is the maximum gradient level after transformation; set the grayscale gradient co-occurrence matrix H(w,v), w=0...N f -1, v = 0...N p -1, H(w,v) is equal to the statistical value of the number of pixels in the matrix F(x,y) and the matrix P(x,y) where w = F(x,y) and v = P(x,y); then the grayscale gradient co-occurrence matrix H(w,v) is normalized so that the sum of its elements is 1. The specific process is as follows: H`(w,v) = H(w,v) / ∑ w ∑ v H(w,v); According to the gradient information, two feature information, large gradient advantage and average gradient, are calculated, where the large gradient advantage is T3=[∑ w ∑ v H(w,v)·V 2 ] / ∑ w ∑ v H(w,v), the average gradient is T4=∑ v [∑ w H′(w,v)]·v. If T3<G3 and T4<G4, the defect is judged to be a real weft defect, otherwise the defect is deleted, where G3 is the large gradient advantage threshold and G4 is the average gradient threshold; (4) Filtering based on the principle of occurrence frequency: For tortuous defects, z 1 k .tz 1 k-4 .t<T G , it is judged that there is a cloth defect and an alarm is issued; for a warp break defect, if z 2 m .tz 2 m-4 .t<T G , it is judged that there is a fabric defect and an alarm is issued; for weft defects, if z 3 n .tz 3 n-4 .t<T G , it is judged that there is a defect in the cloth and an alarm is issued, where T G is the time threshold.