A method for identifying rough knot defects in textiles

By calculating the analysis of the grayscale run matrix and Hough space in the grayscale image of the textile surface, combined with the grayscale similarity, accurately identifying the rough knot defect type of the textile, the inability to distinguish between cotton neighs and flying flowers in the prior art is solved. Defect identification problems have improved the accuracy of textile quality inspection.

CN118762015BActive Publication Date: 2024-11-15NANTONG JIEYUAN TEXTILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411245409.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-15
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The prior art cannot accurately identify the type of coarse knot defects on the surface of textiles, resulting in the inability to target different types of defects.

Method used

By obtaining the grayscale image of the textile surface, it is divided into multiple window areas, calculate the grayscale run matrix, converting it to Hough space, analyzing the degree of dispersion and brightness values ​​of the high bright spots, combining the grayscale similarity to judge the defect line, and distinguishing cotton Flaws of knot and flying flowers.

Benefits of technology

It realizes accurate identification of textile rough knot defects, can distinguish between cotton neigh and fly flower defects, provides targeted treatment solutions, and improves the accuracy of textile quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762015B_ABST
    Figure CN118762015B_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing and recognition, and in particular to a method for identifying rough knot defects of textiles, comprising dividing a grayscale image of a surface image of a to-be-detected textile into a plurality of window areas, determining a defect area according to a grayscale run matrix and a run length threshold of pixels in each window area, converting each defect area into a Hough space, obtaining a highlight point in the Hough space, and judging a defective straight line in each defect area according to the brightness value and the discrete degree of the highlight point; arranging windows on both sides of the defective straight line to slide along the defective straight line, and the windows do not include the defective straight line, weighting the grayscale values ​​of pixels on both sides of the defective straight line according to the distance from the pixels in the windows to the defective straight line, calculating the entropy and mean of the grayscale values ​​of the pixels in the windows on both sides of the defective straight line according to the weighted grayscale values, obtaining the grayscale similarity on both sides of the defective straight line according to the entropy and the mean, and classifying and identifying the defects by using the grayscale similarity. The method is intelligent and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing and recognition, and in particular to a method for identifying rough knot defects in textiles. Background Art

[0002] Textiles are soft items made of textile fibers and yarns, which are widely present in our lives. In the production process of textiles, there are often coarse knot defects in textiles due to production reasons. The main causes of coarse knots are cotton knots and flying flowers. The cause of cotton knots generally occurs before the cleaning process. There are dead cotton fiber clusters in the raw cotton fibers, which are not cleaned up in the cleaning process. The cloth surface presents fiber clusters of similar size to the joints, which are spun into the yarn to form coarse knots; flying flowers appear on the cloth surface, which are similar to cotton knots, but are in the form of flocs. The main cause is that the suction force of the cotton suction device is insufficient, resulting in the yarn breaking and the whiskers flying and attaching to the yarn. In addition, the unreasonable workshop air supply system will also cause the workshop air flow to be turbulent, resulting in a lot of flying flowers, which is easy to generate coarse knots; textiles with coarse knots will not only affect their appearance, but also the quality of the textiles. Therefore, it is necessary to detect the coarse knot defects of textiles so that different treatment methods can be adopted for different types of coarse knot defects in the future. The main treatment method for cotton knots is to improve the cleaning process; and for flying flowers, the main measures are to increase the suction force of the cotton suction device;

[0003] The existing technology analyzes the image texture according to the grayscale run-length matrix of the pixel points on the textile surface and identifies the coarse knot defects on the textile surface. However, since both cotton knots and flying flowers are tiny defects, it is impossible to accurately identify the type of coarse knot defects on the textile surface using only the grayscale run-length matrix, resulting in the inability to carry out targeted treatment of different defect types. Summary of the invention

[0004] Aiming at the problem that the type of rough knot defect on the surface of a textile cannot be accurately identified by using a grayscale run-length matrix, resulting in the inability to perform targeted treatment on different defect types, the present invention provides a method for identifying rough knot defects on a textile, comprising:

[0005] Obtaining a grayscale image of the surface image of the textile to be detected;

[0006] The grayscale image of the surface image of the textile to be inspected is divided into a plurality of window areas, and a grayscale run-length matrix of the pixel points in each window area is obtained; if there is a run length in the grayscale run-length matrix that is greater than a run length threshold, the window area is a defective area;

[0007] Transform each defect region into Hough space;

[0008] Obtain all highlight points in the Hough space, and obtain the discreteness of each highlight point according to the difference between the brightness value of each highlight point and the brightness values ​​of other highlight points; use the discreteness of each highlight point and the average brightness value of all highlight points to determine the defect straight line in each defect area;

[0009] Windows are set on both sides of the defect line and slide along the defect line. The window does not include the pixel points of the defect line. The distance between the pixel points in the window and the defect line is used to weight the gray values ​​on both sides of the defect line.

[0010] The grayscale similarity on both sides of the defect line is obtained according to the weighted grayscale value;

[0011] The grayscale similarity on both sides of the defect line is used to determine whether the defect line is a nep defect or a flying flower defect.

[0012] The method for obtaining the grayscale similarity on both sides of the defect line according to the weighted grayscale value is:

[0013] Obtain the entropy value and mean grayscale value of the pixel grayscale values ​​on each side of the defect line;

[0014] The grayscale similarity on both sides of the defect line is obtained according to the difference in entropy values ​​of the grayscale values ​​of the pixels on both sides of the defect line and the difference in the mean grayscale values.

[0015] The calculation method of the grayscale similarity on both sides of the defect line is:

[0016]

[0017] In the formula, is the grayscale similarity on both sides of the defect line, is an exponential function with e as the base, where e is a natural constant. , are the mean gray values ​​of the pixels on both sides of the defect line, , are the entropy values ​​of the grayscale values ​​of the pixels on both sides of the defect line.

[0018] The method for obtaining the entropy value and the mean grayscale value of the pixel grayscale values ​​on each side of the defect line is:

[0019] A window is set on each side of the defect line and slides along the defect line. The entropy value and the mean grayscale value of the pixel grayscale value in the window are used as the entropy value and the mean grayscale value of the pixel grayscale value on each side of the defect line.

[0020] The method of weighting the grayscale values ​​on both sides of the defect line by using the distance from the pixel point in the window to the defect line is:

[0021] The distance difference is obtained by subtracting the distance from the pixel to the defect line from the window length. The ratio of the distance difference to the window length is used as the weight, and the product of the weight and the grayscale value of the pixel is used as the weighted grayscale value of the pixel.

[0022] The method for obtaining the discreteness of each highlight point according to the difference between the brightness value of each highlight point and the brightness values ​​of other highlight points is:

[0023] Get the square of the difference between the brightness value of each highlight point and the brightness value of each other highlight point;

[0024] The mean of the square of the difference between the brightness value of each highlight point and the brightness values ​​of all other highlight points is taken as the discreteness of the highlight point.

[0025] The method for judging the defect straight line in each defect area by using the discrete degree of each highlight point and the average brightness value of all highlight points is:

[0026] A highlight point with the largest discreteness and a brightness value greater than the average brightness value is obtained, and a straight line corresponding to the highlight point in the image space is used as a defect straight line in the defect area.

[0027] The method of using the grayscale similarity on both sides of the defect line to judge whether the defect line is a nep defect or a flying flower defect is as follows:

[0028] If the grayscale similarity on both sides of the defect line is greater than the similarity threshold, there is a nep defect on the defect line; otherwise, there is a flying flower defect on the defect line.

[0029] The beneficial effects of the present invention are:

[0030] The invention divides the grayscale image of the surface of the textile to be detected into a plurality of window areas, and determines the defective area by using the run length characteristics of the grayscale value in the grayscale run length matrix of each window area; the method divides the surface image of the textile to be detected into regions, preliminarily screens out the defective area, performs subsequent analysis, and eliminates the interference of irrelevant areas; then, the invention converts the image into the Hough space, analyzes the brightness value of the highlight points therein, obtains the discrete degree of each highlight point according to the brightness value difference, and selects the defective straight line according to the discrete degree and the brightness value mean value, and the method fully considers the characteristics of the highlight points in the Hough space, that is, the highlight points in the Hough space are the intersection points of multiple intersecting straight lines in the Hough space, corresponding to multiple collinear points in the image space, the more the number of intersecting straight lines in the Hough space, the greater the brightness value in the Hough space, the more the number of collinear points in the corresponding image space, and the more likely there is a defect, and the discrete degree of each highlight point is calculated here, the purpose is to screen out the highlight points with large brightness value; the invention sets windows on both sides of the defective straight line, slides along the defective straight line, and selects the defective straight line according to the distance from the pixel point in the window to the defective straight line. The distance between the lines is used to weight the grayscale values ​​of the pixels in the window, and the entropy value of the grayscale values ​​of the pixels in the window on each side of the defect line is obtained according to the weighted grayscale values. The grayscale similarity on both sides of the defect line is calculated, and the grayscale similarity is used to determine whether the defect line is a nep defect or a fly defect; this method analyzes the grayscale distribution characteristics on both sides of the defect line. The smaller the difference in the mean grayscale values ​​on both sides of the defect line, the greater the similarity, and the smaller the difference in the entropy value of the grayscale values ​​of the pixels on both sides of the defect line, the greater the similarity; this method starts from the image characteristics of nep and fly defect, considering that nep is a group of fibers gathered together, which is relatively concentrated and has little effect on the surrounding pixels. Therefore, the greater the similarity of the grayscale values ​​on both sides of the defect line, the more likely it is a nep defect; while fly is relatively scattered, in the collected image, the pixels on both sides of the defect line will be blocked by some fly, resulting in a large change in the grayscale values ​​of the pixels around the defect. Therefore, when the similarity of the grayscale values ​​on both sides of the defect line is small, it means that the grayscale value changes greatly, and the possibility that the defect is a fly is greater. Therefore, the grayscale similarity on both sides of the defect line is used to accurately identify the type of coarse knot defect. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0032] Figure 1 It is a schematic flow chart of a method for identifying rough knot defects in textiles according to the present invention;

[0033] Figure 2 It is a schematic diagram of a cotton knot defect in a method for identifying a rough knot defect of a textile according to the present invention;

[0034] Figure 3 It is a schematic diagram of flying defects in a method for identifying rough knot defects of textiles according to the present invention. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] An embodiment of a method for identifying a rough knot defect in a textile according to the present invention is as follows: Figure 1 As shown, including:

[0037] Step 1: Obtain a grayscale image of the surface image of the textile to be inspected; divide the grayscale image of the surface image of the textile to be inspected into multiple window areas, and obtain a grayscale run-length matrix of pixels in each window area; if there is a run length in the grayscale run-length matrix that is greater than a run length threshold, the window area is a defect area;

[0038] The purpose of this step is to collect the surface image of the textile, grayscale it, obtain a grayscale image, and use the set window to obtain the grayscale run-length matrix of each window area of ​​the grayscale image, use the grayscale run-length matrix to analyze each window area, and screen out defective window areas.

[0039] The method for obtaining the defect area is as follows:

[0040] Firstly, the surface image of the textile to be tested is collected. The image is an RGB image. In order to avoid the interference of redundant colors and reduce the amount of calculation, the image is grayed to obtain a grayscale image of the surface image of the textile to be tested.

[0041] Then, the grayscale image is divided into multiple window areas, and the defect area is determined according to the run matrix and run length threshold of each window area, as follows:

[0042] (1) Get the grayscale run-length matrix of the pixels in each window area:

[0043] A window is set to divide the grayscale image into multiple window areas of equal size. The length and width of the window can be set according to the image size. In the present invention, the length of the window is set to one tenth of the length of the grayscale image, and the width of the window is also set to one tenth of the width of the grayscale image. Then, for each window area, the grayscale run matrix of the pixel points in the window area is used to analyze the pixel points in the window. It should be noted that each row in the grayscale run matrix represents a grayscale level, that is, a grayscale value, and each column represents the length of continuous pixel points of this grayscale along a certain direction, that is, the run length, that is, the length of the connected domain along a certain direction. The present invention sets the horizontal rightward direction as the run direction.

[0044] (2) Use the grayscale run-length matrix to find the defective area: Because only the defective area needs to be found, the window area is divided, and the grayscale run-length matrix is ​​used to analyze each window area to determine the defective window area until all pixels in the grayscale image are analyzed. Specifically:

[0045] Since the surface of the textile has certain texture characteristics, there are many pixels in the same grayscale, but very few pixels belong to the same connected domain; therefore, the present invention uses the same window to obtain the grayscale run matrix for the defect-free textile, and counts the maximum run value of the grayscale value in the grayscale run matrix, which is used as the run length threshold;

[0046] If the run length in the grayscale run matrix of a certain window area of ​​the grayscale image of the surface of the textile to be detected is greater than the run length threshold, it is determined that there is a defect in this window area and this window area is used as a defective area. According to this determination method, all defective areas in the grayscale image of the surface of the textile to be detected are obtained, and only the defective areas need to be analyzed subsequently, eliminating the interference of pixels in other areas of the textile and reducing the calculation amount of subsequent Hough transform.

[0047] Step 2: Convert each defect area into Hough space; obtain all highlight points in Hough space, and obtain the discrete degree of each highlight point according to the difference between the brightness value of each highlight point and the brightness value of other highlight points; use the discrete degree of each highlight point and the average brightness value of all highlight points to determine the defect line in each defect area;

[0048] The purpose of this step is to use Hough transform to transform the defective area in the surface image of the textile to be inspected in step 1 into Hough space, obtain the highlight points in Hough space, determine the defective straight line in each defective area according to the discrete degree and the mean brightness value of the highlight points, and find out the location of the defect.

[0049] Among them, the image of each defect area is transformed into Hough space:

[0050] The image of the abnormal area is found through the run matrix, and the image is converted into the Hough space through the Hough transform. After the Hough transform, the line in the image is a point in the Hough space, and the point in the image is a curve in the Hough space. The collinear point in the image is a point where multiple straight lines intersect in the Hough space.

[0051] Among them, the highlight point in the Hough space refers to the point where multiple straight lines intersect at the Hough space, and the intersection of the multiple straight lines is used as the highlight point.

[0052] The method for obtaining the discreteness of each highlight point according to the difference between the brightness value of each highlight point and the brightness values ​​of other highlight points is:

[0053] Get the square of the difference between the brightness value of each highlight point and the brightness value of each other highlight point;

[0054] The mean of the square of the difference between the brightness value of each highlight point and the brightness values ​​of all other highlight points is taken as the discrete degree of the highlight point. The calculation formula is:

[0055]

[0056] In the formula, is the discrete degree of the mth highlight point in Hough space, n is the total number of highlight points, i is the i-th highlight point, is the brightness value of the mth highlight point, is the brightness value of the i-th highlight point. The formula calculates the discrete degree of each highlight point according to the difference in brightness between each highlight point and other highlight points.

[0057] Among them, the method of judging the defect straight line in each defect area by using the discrete degree of each highlight point and the average brightness value of all highlight points is:

[0058] Calculate the mean brightness value of all highlight points in the Hough space. To ensure accuracy, exclude some points with low brightness but large discreteness. Finally, take the highlight points with the largest discreteness and brightness greater than the mean brightness value as the defect line in the image of each defect area, and obtain the position of the defect line.

[0059] It should be noted that this step is to obtain all the straight line intersections in the Hough space and obtain the brightness information of each intersection. Since the highlight point in the Hough space is formed by the intersection of different straight lines at one point, the more straight lines pass through this intersection, the higher the brightness. Then, according to the degree of discreteness and the brightness mean, the highlight points with brightness values ​​much larger than other brightness values ​​are screened out and regarded as abnormal highlight points. The straight line at the corresponding position of the highlight point in the original image is considered to be a defective straight line.

[0060] Step 3: Set windows on both sides of the defect line and slide along the defect line. The window does not include the pixel points of the defect line. The distance between the pixel points in the window and the defect line is used to weight the grayscale values ​​on both sides of the defect line. The grayscale similarity on both sides of the defect line is obtained according to the weighted grayscale values.

[0061] The purpose of this step is to use the window to slide to obtain the gray value change characteristics of the pixels on both sides of the defect line, calculate the gray value similarity of the pixels on both sides of the defect line, and provide a basis for the subsequent classification of defects using gray value similarity.

[0062] Among them, windows are set on both sides of the defect line, and the method of sliding along the defect line is:

[0063] On each side of the defect line, a window is set, and the window size can be set by itself. The length and width of the window are set to one tenth of the length of the defect line. The window is slid along the defect line, and the sliding step length is one pixel each time, until the length of the defect line is slid, and the pixel point information in the window can be obtained at each sliding.

[0064] Among them, the method of weighting the grayscale values ​​on both sides of the defect line by using the distance from the pixel point in the window to the defect line is:

[0065] The distance difference is obtained by subtracting the distance from the pixel to the defect line from the window length. The ratio of the distance difference to the window length is used as the weight, and the product of the weight and the gray value of the pixel is used as the weighted gray value of the pixel.

[0066] The details are as follows:

[0067] The grayscale value of the pixel in the statistical window is set according to the distance from the pixel to the straight line. The formula is:

[0068]

[0069] In the formula, is the original gray value, is the weighted grayscale value, b is the side length of the window, that is, the farthest distance from the pixel point in the window on each side of the defect line to the defect line, and p is the distance from the pixel point to the defect line; because if the defect is a flying flower woven into the fabric to form a coarse knot, the flying flower is generally in the form of flocculent, and has limited impact on the surrounding area. The closer it is, the easier it is to be affected. Therefore, the closer the pixel point is to the defect line, the smaller the impact on the defect, and the two sides of the cotton knot almost have no impact on the surrounding pixels. Therefore, for each pixel point in the window, the weight is set according to the distance from each pixel point to the defect line. The closer the distance is, the greater the weight, and the farther the distance is, the smaller the weight;

[0070] Among them, the method for obtaining the grayscale similarity on both sides of the defect line according to the weighted grayscale value is:

[0071] (1) Obtain the entropy value and mean grayscale value of the pixel points on each side of the defect line using the following method:

[0072] The window is slid along the defect line, and the entropy value and the mean grayscale value of the grayscale value of the pixel points in the window are used as the entropy value and the mean grayscale value of the grayscale value of the pixel points on each side of the defect line; it is only the entropy value of the grayscale value of all the pixels in the window included in the window when the window slides, and not the entropy value of the grayscale value of all the pixels on both sides of the defect line; it should be noted that in the present invention, a window is used to slide along each side of the defect line, which can be considered as dividing the pixel points on each side of the defect line into multiple window areas, and the effects of the two are the same, so the present invention refers to each sliding as each window, that is, there are as many windows as the number of sliding times;

[0073] The specific method is as follows:

[0074] First, calculate the grayscale mean of the pixels in the sliding window. The formula is:

[0075]

[0076] In the formula, is the grayscale mean of the pixels in the window, is the total number of grayscale values ​​of pixels in the window, It is a traversal of the number of grayscale values ​​of pixels in the window. is the pixel in the window Gray value;

[0077] Then, according to the grayscale mean of each window, the grayscale mean of all windows on each side of the straight line is calculated. The formula is:

[0078]

[0079] In the formula, is the grayscale mean of all windows on one side of the defect line, Indicates the first side of the straight line windows, Represents the total number of windows on one side of the defect line, Indicates the defect line on one side The mean gray value of the window;

[0080] Finally, the entropy value of the grayscale value of all pixels in the window on one side of the straight line is calculated. The formula is:

[0081]

[0082] In the formula, is the entropy value of the grayscale value of all pixels in the window on one side of the defect line, Represents the total number of windows on one side of the defect line, The defect line side The mean gray value of the window, is a logarithmic function;

[0083] (2) The calculation method of the grayscale similarity on both sides of the defect line is:

[0084]

[0085] In the formula, is the grayscale similarity on both sides of the defect line, is an exponential function with e as the base, where e is a natural constant. , are the mean gray values ​​of the pixels on both sides of the defect line, , are the entropy values ​​of the grayscale values ​​of the pixels on both sides of the defect line;

[0086] In this formula, The smaller the grayscale mean difference, the greater the similarity. The smaller the entropy value, the greater the similarity; the formula uses the exponential function to normalize the result. The smaller the grayscale mean difference and the entropy value difference, the greater the similarity. The square calculation here is to make the grayscale mean difference and the entropy value difference a positive number, so as to ensure that the result of the exponential function is in the range of 0 to 1. The square root of the sum of the two is to integrate the two parameters to obtain a similarity index;

[0087] This formula analyzes the image features of cotton neps and flying fibers. Considering that cotton neps are fiber clusters gathered together, they are relatively concentrated and have little impact on the surrounding areas. Therefore, the greater the similarity of the grayscale values ​​on both sides of the defect line, the more likely it is a cotton nep defect. However, flying fibers are relatively scattered, resulting in the pixels on both sides of the defect in the collected image being blocked by some flying fibers, resulting in a large change in the grayscale values ​​of the pixels around the defect. Therefore, when the similarity of the grayscale values ​​on both sides of the defect line is small, it means that the grayscale value changes greatly, and the possibility that the defect is flying fibers is greater. Therefore, the similarity is used to judge the type of coarse knot defects with high accuracy.

[0088] Step 4: Use the grayscale similarity on both sides of the defect line to determine whether the defect line is a nep defect or a flying flower defect.

[0089] The purpose of this step is to classify the defects on the defect line according to the similarity of the gray values ​​on both sides of the defect line.

[0090] Cotton neps are clusters of fibers that are relatively concentrated and have little impact on the surrounding areas. Figure 2 As shown in the figure, the flying flowers are relatively scattered, resulting in the pixels on both sides of the defect being blocked by some flying flowers in the captured image, such as Figure 3 As shown, the grayscale values ​​of the surrounding pixels change greatly, so the defects are classified using the grayscale similarity on both sides of the defect line;

[0091] Among them, the method of using the grayscale similarity on both sides of the defect line to judge whether the defect line is a nep defect or a flying flower defect is as follows:

[0092] According to the grayscale similarity T on both sides of the defect line, the defects are classified:

[0093] Set a threshold based on experience , can be set by yourself. In this embodiment is 0.8, the smaller the gray value change on both sides of the defect, the greater the possibility that the defect is a cotton knot. In this embodiment, when the gray value similarity on both sides of the defect straight line is When the gray value on both sides of the defect changes greatly, the similarity is small, and the possibility that the defect is flying flower is greater. In this embodiment, when the gray value similarity on both sides of the defect straight line is When the defect is flying flowers.

[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying rough knot defects in textiles, It is characterized in that The method includes: Obtaining a grayscale image of the surface image of the textile to be detected; The grayscale image of the surface image of the textile to be inspected is divided into a plurality of window areas, and a grayscale run-length matrix of the pixel points in each window area is obtained; if there is a run length in the grayscale run-length matrix that is greater than a run length threshold, the window area is a defective area; Transform each defect region into Hough space; Obtain all highlight points in the Hough space, and obtain the discreteness of each highlight point according to the difference between the brightness value of each highlight point and the brightness values ​​of other highlight points; use the discreteness of each highlight point and the average brightness value of all highlight points to determine the defect straight line in each defect area; Windows are set on both sides of the defect line and slide along the defect line. The window does not include the pixel points of the defect line. The distance between the pixel points in the window and the defect line is used to weight the gray values ​​on both sides of the defect line. The grayscale similarity on both sides of the defect line is obtained according to the weighted grayscale value; Use the grayscale similarity on both sides of the defect line to determine whether the defect line is a nep defect or a flying defect; The method for obtaining the grayscale similarity on both sides of the defect line according to the weighted grayscale value is: Obtain the entropy value and mean grayscale value of the pixel grayscale values ​​on each side of the defect line; The grayscale similarity on both sides of the defect line is obtained according to the difference in entropy value of the grayscale values ​​of the pixels on both sides of the defect line and the difference in the mean grayscale value; The calculation method of the grayscale similarity on both sides of the defect line is: In the formula, is the grayscale similarity on both sides of the defect line, is an exponential function with e as the base, where e is a natural constant. , are the mean gray values ​​of the pixels on both sides of the defect line, , are the entropy values ​​of the grayscale values ​​of the pixels on both sides of the defect line; The method for obtaining the entropy value and the mean grayscale value of the pixel grayscale values ​​on each side of the defect line is: A window is set on each side of the defect line, and the window is slid along the defect line. The entropy value and the mean gray value of the pixel gray value in the window are used as the entropy value and the mean gray value of the pixel gray value on each side of the defect line. The method of using the grayscale similarity on both sides of the defect line to judge whether the defect line is a nep defect or a flying flower defect is as follows: If the grayscale similarity on both sides of the defect line is greater than the similarity threshold, there is a nep defect on the defect line; otherwise, there is a flying flower defect on the defect line.

2. A method for identifying rough knot defects in textiles according to claim 1, It is characterized in that The method of weighting the grayscale values ​​on both sides of the defect line by using the distance from the pixel point in the window to the defect line is: The distance difference is obtained by subtracting the distance from the pixel to the defect line from the window length. The ratio of the distance difference to the window length is used as the weight, and the product of the weight and the grayscale value of the pixel is used as the weighted grayscale value of the pixel.

3. A method for identifying rough knot defects in textiles according to claim 1, It is characterized in that The method for obtaining the discreteness of each highlight point according to the difference between the brightness value of each highlight point and the brightness values ​​of other highlight points is: Get the square of the difference between the brightness value of each highlight point and the brightness value of each other highlight point; The mean of the square of the difference between the brightness value of each highlight point and the brightness values ​​of all other highlight points is taken as the discreteness of the highlight point.

4. A method for identifying rough knot defects in textiles according to claim 1, It is characterized in that The method for judging the defect straight line in each defect area by using the discrete degree of each highlight point and the average brightness value of all highlight points is: A highlight point with the largest discreteness and a brightness value greater than the average brightness value is obtained, and a straight line corresponding to the highlight point in the image space is used as a defect straight line in the defect area.