A method and system for identifying clothing fabric defects

Through the method of combining edge detection and SIFT algorithm, the clothing fabric defect identification method is optimized, the problems of lighting and cloth posture sensitivity in the prior art are solved, the recognition accuracy and efficiency are improved, and the accurate identification of different defects is achieved.

CN118918101BActive Publication Date: 2024-12-13HAIMEN QIWEI SWEATER WEAVING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411375847.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-13
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The existing clothing fabric defect identification methods are sensitive to lighting and fabric placement postures, have low efficiency and low detection accuracy, and cannot use targeted identification methods based on different defects, resulting in efficiency and accuracy problems in automated production.

Method used

The edge detection algorithm is used to obtain the scale-invariant feature points and main directions in the grayscale image of clothing fabrics, and the image matching is performed by combining the SIFT algorithm. The defects are identified through the feature descriptor, and the feature descriptor of the scale-invariant feature point is optimized to improve the recognition accuracy. and speed.

Benefits of technology

It realizes accurate identification of the quality of clothing fabrics, improves identification accuracy and efficiency, and can use targeted identification methods according to different defects, improving the efficiency and accuracy of automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918101B_ABST
    Figure CN118918101B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of defect recognition, and in particular to a method and system for identifying defects in clothing fabrics, the method comprising: collecting a grayscale image of clothing fabrics; obtaining scale-invariant feature points in the grayscale image of clothing fabrics; obtaining the main direction of each single structure image in the edge binary image of the clothing fabrics grayscale image; determining the feature descriptors of the scale-invariant feature points in each dimension according to each edge point in the pixel window of the scale-invariant feature point and the main direction of the single structure image; using the SIFT algorithm to complete image matching based on the feature descriptors of the scale-invariant feature points, performing defect recognition according to the matching results, and judging the quality of clothing fabrics. The present invention aims to mine the pattern features of clothing fabrics and improve the accuracy of defect recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of defect recognition, and in particular to a method and system for identifying defects in clothing fabrics. Background Art

[0002] The textile and garment industry is a pillar industry in my country, and the main manufacturing methods include spinning, weaving, printing and dyeing, and finishing. However, many garment manufacturing companies in my country have simple product processing and poor quality, and most of them export low- and medium-end garment textiles. In the actual production process of garment factories, garment fabrics may have various types of defects, such as flaws, stains, breaks, distortions, color differences, etc. Timely and accurate identification of these defects is crucial to ensure product quality.

[0003] Conventional clothing fabric defect recognition methods include visual inspection methods, machine learning detection methods, sensor detection methods, and multimodal fusion methods. However, these conventional defect recognition test results are sensitive to lighting and fabric placement, and machine learning methods usually require a large amount of labeled data for training, which is time-consuming and labor-intensive. In the defect recognition process of automated production, problems such as low efficiency and low detection accuracy will occur, and it is impossible to use targeted recognition methods according to different defects. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a method and system for identifying clothing fabric defects. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for identifying defects in clothing fabrics, the method comprising the following steps:

[0006] Collect grayscale images of clothing fabrics;

[0007] Obtain scale-invariant feature points in the grayscale image of clothing fabrics; use an edge detection algorithm to obtain the fitting ellipse and its main direction vector of each single structure graph in the edge binary image of the clothing fabric grayscale image; for each single structure graph, determine the trend vector of the single structure graph based on the fitting ellipse in the single structure graph; determine the main direction of the single structure graph by combining the trend vector and the main direction vector of the single structure graph;

[0008] The single structure graph where the scale-invariant feature point is located is rotated along the main direction to the vertical direction, and the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window are determined according to the distribution of edge points in the pixel window of the scale-invariant feature point; the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window is determined based on the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window; the feature descriptors of the scale-invariant feature point in each dimension are determined according to the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window;

[0009] The SIFT algorithm is used to complete image matching based on the feature descriptors of scale-invariant feature points in various dimensions, and defects are identified based on the matching results to judge the quality of clothing fabrics.

[0010] Preferably, the step of acquiring scale-invariant feature points in the grayscale image of clothing fabric comprises:

[0011] The Gaussian pyramid is used to downsample the grayscale image of clothing fabric to obtain a Gaussian pyramid; the DOG algorithm is used to obtain the Gaussian difference image of two adjacent scale images at each level of the Gaussian pyramid; the SIFT algorithm is used to obtain the scale-invariant feature points in all Gaussian difference images.

[0012] Preferably, the edge detection algorithm is used to obtain the fitting ellipse and main direction vector of each single structure graph in the edge binary graph of the clothing fabric grayscale image, including:

[0013] An edge detection algorithm is used to obtain an edge binary image of the clothing fabric grayscale image; regions with closed connected domains in the edge binary image are recorded as single structure graphs;

[0014] The least square method is used to fit the minimum outer bounding ellipse to each single structure diagram to obtain each fitting ellipse;

[0015] Get the major axis of the fitted ellipse, calculate the curvature of the straight line where the major axis is located passing through each edge point in the single structure graph, and use the direction vector composed of the edge points from the maximum curvature to the minimum curvature as the main direction vector of the single structure graph.

[0016] Preferably, determining the trend vector of the single structure graph based on the fitted ellipse in the single structure graph includes: obtaining the center of gravity of the single structure graph; obtaining the geometric center of the fitted ellipse in the single structure graph; and using the direction vector formed from the geometric center to the center of gravity as the trend vector of the single structure graph.

[0017] Preferably, the determining the main direction of the single structure diagram by combining the trend vector and the main direction vector of the single structure diagram comprises:

[0018] Calculate the cosine similarity between the trend vector and the main direction vector of a single structure graph;

[0019] When the cosine similarity is greater than or equal to 0, the trend vector is taken as the main direction of the single structure graph; otherwise, the direction opposite to the trend vector is taken as the main direction of the single structure graph.

[0020] Preferably, the step of determining the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window according to the distribution of edge points in the pixel window of the scale-invariant feature point comprises:

[0021] A pixel window of a preset size is set with the scale-invariant feature point as the center; curve fitting is performed on all edge points in the pixel window to obtain a fitting curve; and the tangent slope and curvature of each edge point on the fitting curve are obtained;

[0022] For each edge point in the pixel window of the scale-invariant feature point, obtain the Euclidean distance between the scale-invariant feature point and each edge point in its pixel window as a distance description between the scale-invariant feature point and each edge point in its pixel window;

[0023] Calculate the tangent value of the tangent slope of each edge point in the pixel window of the scale-invariant feature point; use the absolute value of the difference between the main direction of the single structure graph where the scale-invariant feature point is located and the tangent value of each edge point in its pixel window as a direction description of the scale-invariant feature point and each edge point in its pixel window;

[0024] The curvature of each edge point in the pixel window of the scale-invariant feature point is described as the curvature of the scale-invariant feature point and each edge point in its pixel window.

[0025] Preferably, determining the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window comprises:

[0026] The product of the modulus of the distance description and the direction description is used as the modulus of the distance vector between the scale-invariant feature point and each edge point in its pixel window, and the direction description is used as the direction of the distance vector between the scale-invariant feature point and each edge point in its pixel window;

[0027] The product of the curvature description of the scale-invariant feature point and each edge point in its pixel window and the modulus of the distance vector is used as the modulus of the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window, and the direction description is used as the direction of the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window.

[0028] Preferably, determining the feature descriptors of the scale-invariant feature point in each dimension according to the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window includes:

[0029] The directions and moduli of the curvature distance vectors of all edge points of the scale-invariant feature point in the pixel window correspond to the abscissa and ordinate of the direction histogram of the scale-invariant feature point in the pixel window, respectively; the ordinate is the sum of the moduli of all curvature distance vectors in the direction corresponding to the abscissa;

[0030] The abscissa of the directional histogram is used as the direction of the feature descriptor of each dimension of the scale-invariant feature point, and the ordinate of the directional histogram is used as the modulus of the feature descriptor of the dimension corresponding to the abscissa of the scale-invariant feature point.

[0031] Preferably, the feature descriptors based on scale-invariant feature points in various dimensions use SIFT algorithm to complete image matching, and defect recognition is performed according to the matching results to judge the quality of clothing fabrics, including:

[0032] The feature descriptors of each dimension of each scale-invariant feature point are used, and the SIFT algorithm is used to match the grayscale image of clothing fabrics in the actual production process with the grayscale image of normal clothing fabrics without defects, and the corresponding matching feature points in the two images are obtained;

[0033] Calculate the number of scale-invariant feature points in the grayscale image of clothing fabrics in the actual production process, and calculate the ratio of the number of scale-invariant feature points with high matching in the grayscale image of clothing fabrics in the actual production process and the grayscale image of normal and defect-free clothing fabrics; the highly matching scale-invariant feature points are: matching feature points for which the ratio of the Euclidean distance between the corresponding matching feature points in the two images to the minimum Euclidean distance is less than a preset distance threshold; the minimum Euclidean distance is the minimum value of the Euclidean distance between all corresponding matching feature points in the two images;

[0034] When the ratio is greater than a preset matching threshold, it is determined that the clothing fabric is of qualified quality; otherwise, it is determined that the clothing fabric has defects.

[0035] In a second aspect, an embodiment of the present invention further provides a clothing fabric defect identification system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.

[0036] The present invention has at least the following beneficial effects:

[0037] The present invention improves the recognition of clothing fabric defects. By acquiring the grayscale image of clothing fabric in the actual production process, the main direction of a single structure graph is calculated according to the characteristics of the leaf-like structure pattern in the grayscale image of clothing fabric, and rotation-invariant feature analysis is realized; and according to the distance, direction and curvature information of the edge points near the scale-invariant feature points, the curvature distance vector index of each scale-invariant feature point is jointly constructed, and the direction histogram of the edge points near the scale-invariant feature points is designed accordingly, and finally the feature descriptors in different dimensions for characterizing the scale-invariant feature points are obtained, that is, the main direction of the scale-invariant feature points in the SIFT algorithm and the feature descriptors are optimized, so that the description accuracy of the descriptors is higher and the matching speed is faster. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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 work.

[0039] Figure 1 A flowchart of a method for identifying clothing fabric defects provided by the present invention;

[0040] Figure 2 for images with leaf-like patterns;

[0041] Figure 3 It is a single structure diagram;

[0042] Figure 4 Construct a flow chart for the feature descriptor's metrics. DETAILED DESCRIPTION

[0043] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a method and system for identifying clothing fabric defects proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0044] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0045] The following is a detailed description of a method and system for identifying clothing fabric defects provided by the present invention in conjunction with the accompanying drawings.

[0046] An embodiment of the present invention provides a method and system for identifying clothing fabric defects.

[0047] Specifically, the following clothing fabric defect recognition method is provided, please refer to Figure 1 , the method comprises the following steps:

[0048] Step S001, collecting grayscale images of clothing fabrics.

[0049] In the clothing fabric production process, a fixed stable LED light source and a high-resolution industrial camera are used to capture a color RGB image of the clothing fabric, the color RGB image of the clothing fabric is preprocessed, a weighted average method is used to obtain a grayscale image, and Gaussian noise reduction is performed on the grayscale image, thereby obtaining a grayscale image of the clothing fabric for subsequent analysis. Among them, the weighted average method and Gaussian noise reduction are both well-known technologies and will not be described in detail in this embodiment.

[0050] At this point, the grayscale image of the clothing fabric can be obtained.

[0051] Step S002, multi-scale decomposition is performed on the grayscale image of clothing fabric, a feature descriptor is designed according to the structural pattern characteristics, and the grayscale image of clothing fabric in the actual production process is matched with the grayscale image of normal clothing fabric without defects according to the feature descriptor.

[0052] Most common clothing fabrics are composed of a single structure diagram with a regular shape that is rotated and scaled. The patterns in the fabric have certain regularities, and based on these regularities, defects in the clothing production process under the same structure diagram can be detected. This embodiment performs defect recognition on clothing fabrics with such regular single structure diagrams, and takes clothing fabrics with a single structure diagram with leaf-like patterns as an example for analysis:

[0053] In view of the scaling change characteristics of a single structure image, this embodiment performs multi-scale decomposition on the grayscale image of clothing fabric, uses the Gaussian pyramid algorithm to downsample the image to obtain a Gaussian pyramid; for two adjacent images at each level of the Gaussian pyramid, the DOG (Difference of Gaussian Functions) algorithm is used to obtain a Gaussian difference image.

[0054] The SIFT algorithm is used to obtain scale-invariant feature points and their optimal scales in all Gaussian difference images. In the traditional SIFT algorithm, the optimal scale of the scale-invariant feature points is used to match the feature points in the grayscale image of clothing fabrics in the actual production process with the grayscale image of normal clothing fabrics without defects. However, this method will lose the unique characteristics of the pattern in the clothing fabric. Therefore, this embodiment analyzes the clothing fabric pattern and constructs a feature descriptor of the scale-invariant feature points, so that the image matching is more accurate, thereby more accurately identifying the defects in the clothing fabric. Among them, the Gaussian pyramid, the DOG algorithm and the SIFT algorithm are all well-known technologies and will not be described in detail.

[0055] Figure 2 For an image with a leaf-like pattern, the image is composed of three single structural images rotated and changed. For all patterns in the entire grayscale image of clothing fabric, they are also composed of this single structural image rotated and changed. Therefore, the structural image is subjected to rotation invariance analysis. For clothing fabric with a leaf-like pattern, the leaf-like structural image is an elliptical structure. For this structure, it has a relatively obvious directionality. The main direction of the structure can be used as the direction of the pixel points in the structure, thereby achieving a rotation invariant effect.

[0056] For the ellipse-like structure, the major axis direction of the ellipse is the direction of the straight line where the main direction of the structure is located. Therefore, the Canny edge detection is first performed on the grayscale image of the clothing fabric to obtain an edge binary image. The regions with closed connected domains in the edge binary image are recorded as single structure images. Figure 3 It is a single structure diagram. And based on the least squares method, the minimum outer ellipse is fitted to the single structure diagram, and the major axis of the fitted ellipse is obtained at the same time. In fact, the major axis directions of the ellipse are in two opposite directions. Here, further analysis is required to obtain the single main direction of the single structure diagram. For the single structure diagram of the leaf-like tree, the end where adjacent single structure diagrams are gathered is sharper, and the other end where they are dispersed is relatively rounded. In this embodiment, the direction vector of the edge point with the maximum curvature to the minimum curvature is calculated by the straight line in the major axis direction passing through all the edge points on the fitted ellipse, and the direction vector is taken as the main direction vector of the single structure diagram. Among them, the Canny edge detection algorithm and the least squares ellipse fitting are well-known technologies and will not be described in detail.

[0057] According to the above content, the main direction vector of each single structure diagram can be calculated. Let the geometric center of the fitting ellipse be , the center of gravity of the single structure graph is , then for the single structure diagram, if it is a complete symmetrical figure, then the main direction of the single structure diagram is through the geometric center To the center of gravity The vector direction will be from the geometric center To the center of gravity The vector formed is recorded as the trend vector .

[0058] However, the single structural pattern in the actual grayscale image of clothing fabric is not necessarily a complete symmetrical figure, that is, the trend vector The direction is not necessarily in the direction of the major axis of the fitted ellipse. The rotation invariant indicator constructed here should be based on the main direction of the major axis. It is also necessary to determine the direction of the trend vector The relationship between the main direction vector and the final main direction of the single structure diagram is determined.

[0059] For trend vector Although its direction may not be the same as the long axis direction, combined with the above analysis of the leaf-like shape structure diagram, the difference between the two directions is not very large, so the approximation between the two can be calculated to determine the final main direction of the structure diagram.

[0060] The cosine similarity between the main direction vector and the trend vector of the single structure graph is calculated. When the cosine similarity is greater than or equal to 0, it means that the directions of the two vectors are relatively close, and the direction of the trend vector is taken as the main direction of the single structure graph; otherwise, the direction opposite to the trend vector is taken as the main direction of the single structure graph.

[0061] For the feature description of the scale-invariant feature point C, first rotate the main direction of the single structure graph where the scale-invariant feature point is located to the vertical direction, and define a 7×7 pixel window with the scale-invariant feature point C as the center. Obtain the edge points in the pixel window at the rotation angle that are on the same single structure graph as the feature point , use the least squares method to fit all edge points in the pixel window to get the fitting curve, and calculate the tangent line of each edge point on the fitting curve, record the edge point The slope of the tangent line at is , the curvature of the point can be calculated based on the curve equation and the tangent slope, which is recorded as .

[0062] In this way, the edge points near the feature point C have corresponding tangent slopes and curvatures. The tangent slope of the edge point can represent the direction of the point, and the main direction of the single structure graph where the edge point is located is Here, the direction represented by the slope of the tangent line of the edge point is subtracted from the main direction of the single structure graph to eliminate the influence of the slope value range being too large and possibly negative. For the feature point C, there are three feature descriptions with its nearby edge points, namely, distance description, direction description, and curvature description. The above three descriptions are integrated to obtain the final feature point descriptor.

[0063] The above distance description is the Euclidean distance between the feature point C and the edge point o in its pixel window, which is recorded as , the direction description is the slope of the tangent line between the main direction of the single structure graph where the feature point C is located and the edge point in its pixel window The difference is recorded as , calculated as follows:

[0064]

[0065] in is the main direction of the single structure graph where the scale-invariant feature point C is located, is the tangent value of the tangent slope of the edge point o, representing the direction of the point, It is a description of the direction of the scale-invariant feature point C and the edge point o within its pixel window.

[0066] Then for the edge points in the pixel window of the scale-invariant feature point C, there are corresponding as well as , combining the above two feature descriptions into a vector form, Description with directions The product of the modulus lengths is taken as the modulus length of the distance vector, and the direction of the distance vector is The direction of is recorded as the distance vector between the scale-invariant feature point C and the edge point o .

[0067] For the curvature description, the curvature of the edge point o is As the curvature description of the scale-invariant feature point C and the edge point o , the curvature of the edge point o is described by With distance vector The product of the modulus lengths is taken as the modulus length of the curvature distance vector, and the direction of the curvature distance vector is recorded as The direction is recorded as the curvature distance vector between the scale-invariant feature point C and the edge point o .

[0068] Within the pixel window of the scale-invariant feature point C, each edge point corresponds to a curvature distance vector.

[0069] A directional histogram is constructed in the pixel window of each scale-invariant feature point. The horizontal coordinate in the directional histogram is the direction of the curvature distance vector, that is, the direction description , the ordinate is the sum of the modulus of the curvature distance vector corresponding to each direction. The abscissa in the direction histogram is used as the direction of the feature descriptor of each dimension of the scale-invariant feature point, and the ordinate value of the corresponding abscissa is used as the modulus of the feature descriptor of the corresponding dimension of the scale-invariant feature point to obtain the feature descriptor of each dimension of the scale-invariant feature point. Among them, the indicator construction flow chart of the feature descriptor is as follows: Figure 4 shown.

[0070] At this point, feature descriptors of various dimensions can be obtained for each scale-invariant feature point.

[0071] Based on the feature descriptors of each dimension of each scale-invariant feature point constructed above, the SIFT algorithm is used to match the grayscale image of clothing fabric taken during the actual production process with the grayscale image of normal non-defective clothing fabric to generate a matching result, and the matching result is the corresponding matching feature points in the two images. By improving the feature descriptors of the scale-invariant feature points, a more accurate clothing matching result is achieved by combining the pattern features of clothing fabrics. Among them, the SIFT algorithm is a well-known technology and will not be described in detail in this embodiment.

[0072] Step S003, performing defect identification based on the matching results, thereby detecting the quality of the clothing fabric.

[0073] The matching results of the clothing fabric surface image taken during the actual production process and the normal defect-free clothing fabric surface image are analyzed. In this embodiment, the number of scale-invariant feature points in the clothing fabric grayscale image during the actual production process is , the number of scale-invariant feature points that are highly matched with the grayscale image of normal defect-free clothing fabric is Q, and the highly matched scale-invariant feature points are: the ratio of the Euclidean distance between the corresponding matching feature points in the two images to the minimum Euclidean distance is less than the distance threshold T, which is 1.5 in this embodiment.

[0074] The number of scale-invariant feature points that do not have a high degree of matching in the grayscale image of clothing fabrics in the actual production process is the number of feature points in the defect area. Suppose the overall image matching degree is , then the following calculation formula is available:

[0075]

[0076] in, is the number of scale-invariant feature points that are highly matched between the grayscale image of clothing fabrics in the actual production process and the grayscale image of normal clothing fabrics without defects. The larger its value, the higher the overall matching degree of the grayscale image of clothing fabrics in the actual production process, and the better the quality of the clothing fabrics. is the number of scale-invariant feature points in the grayscale image of clothing fabric in the actual production process.

[0077] In this embodiment, the matching threshold is set to , when the matching degree When it is greater than the matching threshold, it is considered that the clothing fabric in the image area is of qualified quality; otherwise, the clothing fabric in the image area is defective.

[0078] Based on the same inventive concept as the above method, an embodiment of the present invention also provides a clothing fabric defect identification system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned clothing fabric defect identification methods when executing the computer program.

[0079] In summary, the embodiment of the present invention improves the recognition of clothing fabric defects. By acquiring the grayscale image of clothing fabric in the actual production process, the main direction of the single structure graph is calculated according to the characteristics of the leaf-like structure pattern in the grayscale image of the clothing fabric, and the rotation-invariant feature analysis is realized; and according to the distance, direction and curvature information of the edge points near the scale-invariant feature points, the curvature distance vector index of each scale-invariant feature point is jointly constructed, and the direction histogram of the edge points near the scale-invariant feature points is designed accordingly, and finally the feature descriptors in different dimensions for characterizing the scale-invariant feature points are obtained, that is, the main direction of the scale-invariant feature points in the SIFT algorithm and the feature descriptors are optimized, so that the descriptor description accuracy is higher and the matching speed is faster.

[0080] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0081] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0082] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Modifications to the technical solutions recorded in the aforementioned embodiments, or equivalent replacement of some of the technical features therein, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for identifying clothing fabric defects, It is characterized in that The method comprises the following steps: Collect grayscale images of clothing fabrics; Obtain scale-invariant feature points in the grayscale image of clothing fabrics; use an edge detection algorithm to obtain the fitting ellipse and its main direction vector of each single structure graph in the edge binary image of the clothing fabric grayscale image; for each single structure graph, determine the trend vector of the single structure graph based on the fitting ellipse in the single structure graph; determine the main direction of the single structure graph by combining the trend vector and the main direction vector of the single structure graph; The single structure graph where the scale-invariant feature point is located is rotated along the main direction to the vertical direction, and the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window are determined according to the distribution of edge points in the pixel window of the scale-invariant feature point; the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window is determined based on the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window; the feature descriptors of the scale-invariant feature point in each dimension are determined according to the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window; The SIFT algorithm is used to complete image matching based on the feature descriptors of scale-invariant feature points in various dimensions, and defects are identified based on the matching results to judge the quality of clothing fabrics.

2. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that The step of obtaining scale-invariant feature points in the grayscale image of clothing fabric comprises: The Gaussian pyramid is used to downsample the grayscale image of clothing fabric to obtain a Gaussian pyramid; the DOG algorithm is used to obtain the Gaussian difference image of two adjacent scale images at each level of the Gaussian pyramid; the SIFT algorithm is used to obtain the scale-invariant feature points in all Gaussian difference images.

3. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that The edge detection algorithm is used to obtain the fitting ellipse and main direction vector of each single structure graph in the edge binary graph of the clothing fabric grayscale image, including: An edge detection algorithm is used to obtain an edge binary image of the clothing fabric grayscale image; regions with closed connected domains in the edge binary image are recorded as single structure graphs; The least square method is used to fit the minimum outer bounding ellipse to each single structure diagram to obtain each fitting ellipse; The major axis of the fitted ellipse is obtained, the curvature of the straight line where the major axis is located passing through each edge point in the single structure graph is calculated, and the direction vector composed of the edge points from the maximum curvature to the minimum curvature is used as the main direction vector of the single structure graph.

4. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that The method of determining the trend vector of a single structure diagram based on a fitted ellipse in the single structure diagram includes: obtaining the center of gravity of the single structure diagram; obtaining the geometric center of the fitted ellipse in the single structure diagram; and using the direction vector formed from the geometric center to the center of gravity as the trend vector of the single structure diagram.

5. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that Determining the main direction of the single structure diagram by combining the trend vector and the main direction vector of the single structure diagram comprises: Calculate the cosine similarity between the trend vector and the main direction vector of a single structure graph; When the cosine similarity is greater than or equal to 0, the trend vector is taken as the main direction of the single structure graph; otherwise, the direction opposite to the trend vector is taken as the main direction of the single structure graph.

6. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that The step of determining the distance, direction and curvature description between the scale-invariant feature point and each edge point in its pixel window according to the distribution of edge points in the pixel window of the scale-invariant feature point comprises: A pixel window of a preset size is set with the scale-invariant feature point as the center; curve fitting is performed on all edge points in the pixel window to obtain a fitting curve; and the tangent slope and curvature of each edge point on the fitting curve are obtained; For each edge point in the pixel window of the scale-invariant feature point, obtain the Euclidean distance between the scale-invariant feature point and each edge point in its pixel window as a distance description between the scale-invariant feature point and each edge point in its pixel window; Calculate the tangent value of the tangent slope of each edge point in the pixel window of the scale-invariant feature point; use the absolute value of the difference between the main direction of the single structure graph where the scale-invariant feature point is located and the tangent value of each edge point in its pixel window as a direction description of the scale-invariant feature point and each edge point in its pixel window; The curvature of each edge point in the pixel window of the scale-invariant feature point is described as the curvature of the scale-invariant feature point and each edge point in its pixel window.

7. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that Determining the curvature distance vector of the scale-invariant feature point and each edge point in its pixel window includes: The product of the modulus of the distance description and the direction description is used as the modulus of the distance vector between the scale-invariant feature point and each edge point in its pixel window, and the direction description is used as the direction of the distance vector between the scale-invariant feature point and each edge point in its pixel window; The product of the curvature description of the scale-invariant feature point and each edge point in its pixel window and the modulus of the distance vector is used as the modulus of the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window, and the direction description is used as the direction of the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window.

8. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that Determining the feature descriptors of the scale-invariant feature point in each dimension according to the curvature distance vector between the scale-invariant feature point and each edge point in its pixel window includes: The directions and moduli of the curvature distance vectors of all edge points of the scale-invariant feature point in the pixel window correspond to the abscissa and ordinate of the direction histogram of the scale-invariant feature point in the pixel window, respectively; the ordinate is the sum of the moduli of all curvature distance vectors in the direction corresponding to the abscissa; The abscissa of the directional histogram is used as the direction of the feature descriptor of each dimension of the scale-invariant feature point, and the ordinate of the directional histogram is used as the modulus of the feature descriptor of the dimension corresponding to the abscissa of the scale-invariant feature point.

9. A method for identifying clothing fabric defects as claimed in claim 1, It is characterized in that The feature descriptors based on scale-invariant feature points in various dimensions use the SIFT algorithm to complete image matching, and perform defect recognition based on the matching results to judge the quality of clothing fabrics, including: The feature descriptors of each dimension of each scale-invariant feature point are used, and the SIFT algorithm is used to match the grayscale image of clothing fabrics in the actual production process with the grayscale image of normal clothing fabrics without defects, and the corresponding matching feature points in the two images are obtained; Calculate the number of scale-invariant feature points in the grayscale image of clothing fabrics in the actual production process, and calculate the ratio of the number of scale-invariant feature points with high matching in the grayscale image of clothing fabrics in the actual production process and the grayscale image of normal and defect-free clothing fabrics; the highly matching scale-invariant feature points are: matching feature points for which the ratio of the Euclidean distance between the corresponding matching feature points in the two images to the minimum Euclidean distance is less than a preset distance threshold; the minimum Euclidean distance is the minimum value of the Euclidean distance between all corresponding matching feature points in the two images; When the ratio is greater than a preset matching threshold, it is determined that the clothing fabric is of qualified quality; otherwise, it is determined that the clothing fabric has defects.

10. A clothing fabric defect recognition system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.