Fabric Defect Identification and Marking Method for Fabric Quality Inspection
Through the fabric defect identification and annotation method, the fabric defect type is accurately identified by using grayscale images and LBP images, which solves the problems of high error detection rate and low recognition efficiency in the existing quality inspection methods, and achieves efficient and accurate fabric quality inspection.
Patent Information
- Application Number
- CN202211334388.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-10-28
AI Technical Summary
The existing fabric quality inspection methods rely on manual experience, and there are problems such as high error detection rate, high missed detection rate and low recognition efficiency. The defect detection accuracy of computer vision systems is poor, so it is impossible to accurately identify fabric defect types.
The fabric defect identification and annotation method is used to obtain the fabric surface image and convert it into grayscale image and LBP image to determine the significance of corner point changes and the boundary defect degree, and combine the preset number of standard defect areas to identify and mark the defect type.
It improves the labeling efficiency and accuracy of fabric quality inspection, accurately identify various types of defects, provides targeted repair basis, and improves the quality of fabric production.
Smart Images

Figure CN115861174B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material testing and analysis, and particularly to a method for identifying and labeling fabric defects for fabric quality inspection. Background Art
[0002] In the current production process of fabric textiles, various defects appear on the fabric due to relevant errors of machinery and equipment and subtle changes in the production environment. Fabric defects refer to regular warp or weft weaving defects on the fabric, and common defects include broken-end defects, broken-weft defects, and thick warps, etc. The appearance of defects on the fabric surface will affect the beauty of the subsequent fabric and even cause quality problems. Therefore, fabric quality inspection is a key link in the textile industrial production.
[0003] Currently, in most textile factories, fabric quality inspection relies on technicians to identify fabric surface defects based on their own experience. This method has great subjectivity, attention, and judgment, with too high false inspection rates and missed inspection rates and low recognition efficiency, which in turn leads to incorrect labeling of fabric defects. With the development of computer vision technology, in order to overcome the deficiencies of manual inspection, there is currently proposed an automatic positioning textile defect detection system with the publication number CN113322653A. This system can perform defect detection for multiple textile machines. However, through practice, it can be found that defect detection based on the vision system may have misjudgments, resulting in poor accuracy of fabric quality inspection results, being unable to identify the types of defects existing in the fabric, and being unable to complete targeted defect repair and treatment work. Summary of the Invention
[0004] In order to solve the technical problem of poor accuracy of the quality inspection results of the existing fabric quality inspection method, the purpose of the present invention is to provide a method for identifying and labeling fabric defects for fabric quality inspection.
[0005] The present invention provides a method for identifying and labeling fabric defects for fabric quality inspection, including the following steps:
[0006] Obtain each region to be labeled in the surface image of the fabric to be quality inspected, obtain the grayscale image of the fabric to be quality inspected according to the surface image of the fabric to be quality inspected, and obtain the LBP image of the fabric to be quality inspected according to the grayscale image;
[0007] According to each region to be labeled, determine each corner point of the corresponding edge of each region to be labeled, and determine the significant degree of corner point change of each region to be labeled according to each corner point of the corresponding edge of each region to be labeled and the LBP image of the fabric to be quality inspected;
[0008] Obtain the fabric standard region, and determine the boundary defect degree of each region to be labeled according to the fabric standard region, the significant degree of corner point change of each region to be labeled, and each corner point of the corresponding edge of each region to be labeled;
[0009] According to the boundary defect degree of each area to be labeled, determine whether there is a defective area in each area to be labeled. If there is a defective area, obtain a preset number of types of standard defective areas, and determine the defect type corresponding to each defective area according to each defective area and the preset number of types of standard defective areas;
[0010] Perform labeling processing on each area to be labeled in the surface image of the fabric to be inspected according to the defect type corresponding to each defective area, and determine whether the fabric to be inspected is qualified according to the labeling result of the surface image of the fabric to be inspected.
[0011] Further, determine the corner change significance of each area to be labeled according to each corner point of the corresponding edge of each area to be labeled and the LBP image of the fabric to be inspected, including:
[0012] According to each corner point of the corresponding edge of each area to be labeled, determine the position of each corner point of the edge and the number of all corner points in the edge, and determine the LBP value of each corner point of the corresponding edge of each area to be labeled according to the position of each corner point of the edge and the LBP image of the fabric to be inspected;
[0013] Calculate the absolute value of the difference between the LBP values corresponding to adjacent corner points of the corresponding edge of each area to be labeled according to the LBP values of each corner point of the corresponding edge of each area to be labeled;
[0014] Accumulatively calculate each absolute value of the difference of the corresponding edge of each area to be labeled according to the number of all corner points in the corresponding edge of each area to be labeled, and use the accumulated value obtained by the accumulative calculation as the corner change significance of the corresponding area to be labeled.
[0015] Further, determine the boundary defect degree of each area to be labeled according to the fabric standard area, the corner change significance of each area to be labeled, and each corner point of the corresponding edge of each area to be labeled, including:
[0016] Determine the connection slope of adjacent corner points of the corresponding edge of each area to be labeled according to the position of each corner point of the corresponding edge of each area to be labeled, and determine the slope variance corresponding to each area to be labeled according to the connection slope of the adjacent corner points;
[0017] Count the number of all edge pixel points of the corresponding edge of each area to be labeled according to the corresponding edge of each area to be labeled;
[0018] Determine the slope variance, corner change significance, and the number of all corner points in the corresponding edge corresponding to the fabric standard area according to the fabric standard area;
[0019] Determine the boundary defect degree of each area to be marked according to the slope variance corresponding to the fabric standard area, the significance of corner point changes, the number of all corner points in the corresponding edge, the significance of corner point changes in each area to be marked, the slope variance, the number of all edge pixels in the corresponding edge, and the number of all corner points.
[0020] Furthermore, the calculation formula for the boundary defect degree is:
[0021]
[0022] Wherein, is the boundary defect degree of the th area to be marked, is the number of all corner points in the corresponding edge of the th area to be marked, is the number of all corner points in the corresponding edge of the fabric standard area, is the variance of the connection slopes of adjacent corner points in the corresponding edge of the th area to be marked, is the significance of corner point changes in the th area to be marked, L is the th area to be marked, is the number of all edge pixels in the corresponding edge of the fabric standard area, is the variance of the connection slopes of adjacent corner points in the corresponding edge of the fabric standard area,
[0023] Furthermore, determine the defect type corresponding to each defect area according to each defect area and a preset number of types of standard defect areas, including:
[0024] Determine each corner point of the corresponding edge of each defect area according to each defect area, and determine the connection slope between adjacent corner points and the LBP value of each corner point of the corresponding edge of each defect area according to each corner point;
[0025] Obtain the LBP values of each corner point of the corresponding edge of a preset number of types of standard defect areas, and determine the first similarity between each defect area and a preset number of types of standard defect areas according to the LBP values of each corner point of the corresponding edge of each defect area and the LBP values of each corner point of the corresponding edge of a preset number of types of standard defect areas;
[0026] Obtain the connection slopes between adjacent corner points corresponding to the corresponding edge of a preset number of types of standard defect areas, and determine the second similarity between each defect area and a preset number of types of standard defect areas according to the connection slopes between adjacent corner points corresponding to the corresponding edge of each defect area and the connection slopes between adjacent corner points corresponding to the corresponding edge of a preset number of types of standard defect areas;
[0027] Determine the similarity between each defective area and the standard defective areas of a preset number of types according to the first similarity and the second similarity, and determine the defective type of each defective area according to the similarity.
[0028] Further, the calculation formula for the first similarity is:
[0029]
[0030] where is the first similarity between the P th defective area and the standard defective area of the D th type, is the P value of any corner point in the corresponding edge of the LBP th defective area, i is the serial number of each corner point in the corresponding edge of the P th defective area, I is the P number of all corner points in the corresponding edge of the th defective area, P is the i value of the LBP th corner point in the corresponding edge of the th defective area, D is the LBP value of any corner point in the corresponding edge of the standard defective area of the j th type, D is the serial number of each corner point in the corresponding edge of the standard defective area of the J th type, D is the number of all corner points in the corresponding edge of the standard defective area of the D th type, j is the LBP value of the max ( ) is the maximum value function.
[0031] Further, the calculation formula for the second similarity is:
[0032]
[0033] where is the second similarity between the P th defective area and the standard defective area of the D th type, is the P value of the lThe slope of the line connecting the corresponding adjacent corner points is the P slope of the line connecting the l +1 adjacent corner points among the edges corresponding to the l is the P sequence number of the slope of the line connecting each adjacent corner point among the edges corresponding to the L is the P quantity of the slopes of the lines connecting all adjacent corner points among the edges corresponding to the is the D slope of the line connecting the x adjacent corner points among the edges corresponding to the is the D slope of the line connecting the x +1 adjacent corner points among the edges corresponding to the x is the D sequence number of the slope of the line connecting each adjacent corner point among the edges corresponding to the X is the D quantity of the slopes of the lines connecting all adjacent corner points among the edges corresponding to the
[0034] Further, based on the first similarity and the second similarity, determining the similarity between each defect region and the standard defect regions of a preset number of types includes:
[0035] Calculating the product of the first similarity and the second similarity according to the first similarity and the second similarity, and using this product as the similarity between the corresponding defect region and the standard defect regions of a preset number of types.
[0036] Further, based on the similarity, determining the defect type of each defect region includes:
[0037] Determining the maximum similarity corresponding to each defect region according to the similarity between each defect region and the standard defect regions of a preset number of types;
[0038] If the maximum similarity corresponding to any defect region is greater than or equal to the similarity threshold, then it is determined that this defect region belongs to this type of defect; otherwise, it is determined that this defect region belongs to other types of defects, where the other types of defects are defect types that do not belong to the standard defect regions of a preset number of types.
[0039] Further, based on the boundary defect degree of each region to be labeled, determining whether there are defect regions in each region to be labeled includes:
[0040] If the boundary defect degree of any area to be marked is greater than the preset defect threshold, it is determined that there are defect areas in each area to be marked; otherwise, it is determined that there are no defect areas in each area to be marked.
[0041] The present invention has the following beneficial effects:
[0042] The present invention provides a method for identifying and marking fabric defects for fabric quality inspection. Through the analysis of the fabric to be inspected, this method obtains each area to be marked of the fabric to be inspected. Each area to be marked helps to improve the subsequent fabric marking efficiency and marking accuracy, and accurate marking helps to improve the accuracy of the subsequent fabric quality inspection results. According to the gray-scale change and edge change of each area to be marked, the corner change significance degree of each area to be marked is determined. Based on the corner change significance degree, the possibility that each area to be marked is a defect area is analyzed from multiple aspects of the image features of the area to be marked, and this possibility is quantified to obtain the boundary defect degree of each area to be marked. Compared with the visual system for judging the defect degree, analyzing the defect image features of each area to be marked from multiple aspects is more conducive to improving the accuracy of the boundary defect degree, realizing the accurate extraction of the image features of each area to be marked, and the reference value of each defect area screened based on the boundary defect degree is higher. Analyze the similarity between each defect area accurately identified and the standard defect areas of a preset number of types. According to the similarity, the defect type to which each defect area belongs can be determined, realizing the accurate identification and marking of multiple types of defects in the fabric to be inspected. The present invention not only realizes the detection of the defects of the fabric to be inspected, improves the accuracy rate of the fabric quality inspection results, but also extracts the defect areas on the fabric surface, can identify the defect categories of each defect area, and the identification and marking results will be used as a reference for relevant staff, that is, it prepares for the subsequent targeted repair treatment of different types of defect areas, and further promotes the development of fabric production. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0044] Figure 1 It is a flowchart of a method for identifying and marking fabric defects for fabric quality inspection according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0045] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following specifically describes the specific implementation manners, structures, features, and effects of the technical solutions proposed according to the present invention in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0047] This embodiment provides a method for identifying and labeling fabric defects for fabric quality inspection, as Figure 1 shown, the method includes the following steps:
[0048] (1) Obtain each region to be labeled in the surface image of the fabric to be inspected. Obtain the grayscale image of the fabric to be inspected based on the surface image of the fabric to be inspected, and obtain the LBP image of the fabric to be inspected based on the grayscale image. The steps include:
[0049] (1-1) Obtain each region to be labeled in the surface image of the fabric to be inspected.
[0050] In this embodiment, the surface image of the fabric to be inspected is collected by an industrial camera, and the surface image can be a visible light RGB image. In order to eliminate the noise influence when collecting the surface image of the fabric to be inspected, it is necessary to perform denoising processing on the surface image. There are many denoising methods, which are not specifically limited here. In this embodiment, the median filtering technology is used to perform denoising processing on the visible light RGB image of the fabric to be inspected, and the surface image of the fabric to be inspected after denoising processing is obtained. The implementation process of the median filtering technology is an existing technology and is not within the protection scope of the present invention, so it will not be elaborated in detail here. In order to facilitate subsequent defect identification and labeling of the fabric to be inspected, this embodiment divides the surface image of the fabric to be inspected after denoising processing into m pieces of small regions with the same area, m The empirical value of is 64, and 64 small regions are used as the regions to be labeled, obtaining each region to be labeled in the surface image of the fabric to be inspected. The number m of the regions to be labeled can be set by the implementer according to the area size of the fabric to be inspected. Obtaining each region to be labeled helps to improve the subsequent fabric labeling efficiency and labeling accuracy.
[0051] (1-2) Obtain the grayscale image of the fabric to be inspected based on the surface image of the fabric to be inspected, and obtain the LBP image of the fabric to be inspected based on the grayscale image.
[0052] In order to facilitate subsequent extraction of image features of each area to be labeled on the surface image of the fabric to be quality-inspected, it is necessary to determine the grayscale image and the LBP image of the fabric to be quality-inspected. By performing grayscale processing on the surface image of the fabric to be quality-inspected, the grayscale image of the fabric to be quality-inspected can be obtained. There are many grayscale processing methods, which are not specifically limited in this embodiment. The grayscale processing process is a prior art and will not be elaborated in detail here. Based on the grayscale image of the fabric to be quality-inspected, the LBP image of the fabric to be quality-inspected can be obtained. The specific steps for obtaining the LBP image of the fabric to be quality-inspected can be as follows:
[0053] Select any point in the grayscale image of the fabric to be quality-inspected and denote it as point M. Use the LBP algorithm to analyze each pixel point in the eight-neighborhood of point M. First, obtain the grayscale value of point M and denote the grayscale value of point M as , and make the grayscale values of the pixel points in the eight-neighborhood of point M be respectively compared with the grayscale value of point M. If the grayscale value of any pixel point in the eight-neighborhood of point M is less than , then assign the grayscale value of this pixel point in the eight-neighborhood of point M to 0; otherwise, assign the grayscale value of this pixel point in the eight-neighborhood of point M to 1. Based on the final comparison result, the LBP value of point M in the grayscale image of the fabric to be quality-inspected can be obtained. Traverse the entire grayscale image of the fabric to be quality-inspected, that is, take each pixel point in the grayscale image as the center point, obtain the eight-neighborhood of each center point, and refer to the steps for obtaining the LBP value of point M to obtain the LBP value of each pixel point in the grayscale image of the fabric to be quality-inspected. Based on the LBP value of each pixel point, the LBP image of the fabric to be quality-inspected can be obtained. The pixel value of each pixel point in the LBP image can be the LBP value. The implementation process of the LBP algorithm is a prior art and is not within the protection scope of the present invention, so it will not be elaborated in detail here.
[0054] (2) According to each area to be labeled, determine each corner point of the corresponding edge of each area to be labeled. According to each corner point of the corresponding edge of each area to be labeled and the LBP image of the fabric to be quality-inspected, determine the corner point change significance of each area to be labeled. The steps include:
[0055] (2-1) According to each area to be labeled, determine each corner point of the corresponding edge of each area to be labeled.
[0056] To facilitate subsequent calculation of the corner change saliency of each area to be marked, the intersection points of the warp and weft lines of the fabric in each area to be marked are found. Here, the intersection points of the warp and weft lines refer to the intersection points between the textile lines in the horizontal direction and the textile lines in the vertical direction. In this embodiment, edge detection is performed on each area to be marked, and the corresponding edges of each area to be marked can be obtained. Then, Harris (Harris Corner Detection, a corner detection algorithm) corner detection is performed on the corresponding edges of each area to be marked to obtain the corners of the corresponding edges of each area to be marked. The distribution of these corners reflects the warp and weft interweaving situation of the fabric in each area to be marked. The implementation processes of edge detection and Harris corner detection are both prior arts and not within the protection scope of the present invention, so no detailed elaboration will be made here.
[0057] (2-2) Determine the corner change saliency of each area to be marked according to the corners of the corresponding edges of each area to be marked and the LBP image of the fabric to be quality inspected. The steps include:
[0058] (2-2-1) According to the corners of the corresponding edges of each area to be marked, determine the positions of the corners of the edge and the number of all corners in the edge. According to the positions of the corners of the edge and the LBP image of the fabric to be quality inspected, determine the LBP values of the corners of the corresponding edges of each area to be marked.
[0059] In this embodiment, based on the corners of the corresponding edges of each area to be marked, the coordinate position information of the corners of the edge and the number of all corners in the edge can be obtained. Based on the coordinate position information of the corners of the edge, find the LBP values at the positions of the corners of the corresponding edges of each area to be marked in the LBP image of the fabric to be quality inspected, that is, obtain the LBP values of the corners of the corresponding edges of each area to be marked. According to the position coordinates of the corners of the corresponding edges of each area to be marked, arrange them in a row in the order from left to right and from top to bottom to obtain the LBP value sequence corresponding to each area to be marked. The LBP value sequence can characterize the change degree of the gray values of the corners of the corresponding edges of each area to be marked as the corner position changes, that is, the change of the gray value of the warp and weft intersection point.
[0060] (2-2-2) According to the LBP values of the corners of the corresponding edges of each area to be marked, calculate the absolute value of the difference between the LBP values corresponding to adjacent corners of the corresponding edges of each area to be marked.
[0061] For example, based on the LBP value of the Q th corner of the corresponding edge of the th area to be marked and the LBP value of the th corner, calculate the absolute value of the difference between the LBP value of the th corner and the LBP value of the The difference between the LBP values of the corner points is calculated, and then the absolute value of the difference is calculated to obtain the absolute value of the difference between the LBP values of the Q th corner point and the th corner point in the edge corresponding to the th area to be labeled.
[0062] (2-2-3) According to the number of all corner points in the edge corresponding to each area to be labeled, the absolute values of the differences of the edges corresponding to each area to be labeled are accumulated, and the accumulated value obtained by the accumulation is used as the corner point change significance of the corresponding area to be labeled.
[0063] In this embodiment, the pixel gray-scale distribution at the intersection of the warp and weft lines in the defect-free area of the fabric is uniform, and the gray-scale values in the neighborhood of the intersection point will not change significantly. The LBP value of the corner point in the edge corresponding to the defect-free area is close to 1. However, due to breakage or inconsistent thickness of the warp and weft lines in the defect area of the fabric, the pixel gray-scale distribution at the intersection is uneven, that is, the pixel gray-scale in the eight-neighborhood of the intersection point will change significantly, and the LBP value of the corner point in the edge corresponding to the defect area is relatively large. Different defect degrees correspond to different LBP values. The corner point change significance can be used to characterize the distribution of pixel gray-scale at the intersection of the warp and weft in the image. The calculation formula for the corner point change significance of each area to be labeled can be:
[0064]
[0065] Among them, S Q is the corner point change significance of the Q th area to be labeled, is the serial number of each corner point in the edge corresponding to the Q th area to be labeled, n is the Q number of all corner points in the edge corresponding to the th area to be labeled, Q is the LBP value of the th corner point in the edge corresponding to the th area to be labeled, Q is the LBP value of the th corner point in the edge corresponding to the
[0066] In the calculation formula of the corner point change significance, can characterize the gray-scale change of corner points at different positions. The larger the corner point change significance S Q , the greater the difference in the intersection of the warp and weft lines between the corner points in the edge corresponding to the Q th area to be labeled, and the Q th area to be labeled is more likely to be a defect area.
[0067] (3) Obtain the fabric standard area, and determine the boundary defect degree of each area to be marked according to the fabric standard area, the corner change saliency of each area to be marked, and each corner of the corresponding edge of each area to be marked.
[0068] In this embodiment, the fabric standard area can be obtained by an image acquisition device. The fabric standard area is the fabric area without any defects. For the convenience of calculating the boundary defect degree of each area to be marked subsequently, the size of the fabric standard area here should be the same as that of the area to be marked. After obtaining the fabric standard area, the feature extraction of the surface image is completed by setting scene indicators according to the gray-scale change of the warp and weft intersection points and the change law of the edge lines in the fabric standard area and the area to be marked. The gray-scale change of the warp and weft intersection points here can be characterized by the change of the LBP value of the corner points, and the change law of the edge lines can be characterized by the change of the connection slope of the adjacent corner points corresponding to the edge line. That is, according to the fabric standard area, the corner change saliency of each area to be marked, and each corner of the corresponding edge of each area to be marked, the boundary defect degree of each area to be marked is determined. The steps include:
[0069] (3-1) According to the positions of each corner of the corresponding edge of each area to be marked, determine the connection slope of the adjacent corner points of the corresponding edge of each area to be marked, and determine the slope variance corresponding to each area to be marked according to the connection slope of the adjacent corner points.
[0070] In this embodiment, based on the coordinate positions of each corner of the corresponding edge of each area to be marked, the connection slope of the adjacent corner points of the corresponding edge of each area to be marked can be calculated. Then, based on the connection slope of the adjacent corner points of the corresponding edge of each area to be marked, the variance of the connection slope of the adjacent corner points of the corresponding edge of each area to be marked is calculated, and this variance is used as the slope variance. Each area to be marked has its corresponding slope variance. So far, this embodiment has obtained the slope variance corresponding to each area to be marked. The process of calculating the connection slope and the slope variance is the prior art and is not within the protection scope of the present invention, so it will not be elaborated in detail here.
[0071] (3-2) According to the corresponding edge of each area to be marked, count the number of all edge pixel points of the corresponding edge of each area to be marked.
[0072] For the convenience of calculating the boundary defect degree of each area to be marked subsequently, it is necessary to count the number of all edge pixel points of the corresponding edge of each area to be marked. The number of all edge pixel points of the edge is the perimeter of the edge.
[0073] (3-3) According to the fabric standard area, determine the slope variance, corner change saliency, and the number of all corner points in the corresponding edge corresponding to the fabric standard area.
[0074] In this embodiment, according to the standard fabric area, by referring to the steps of determining the slope variance corresponding to each area to be marked in step (3-1) and the steps of determining the corner point change significance of each area to be marked in (2-2), the slope variance and the corner point change significance corresponding to the standard fabric area can be obtained. By performing edge detection on the standard fabric area, the edge corresponding to the standard fabric area can be obtained. Furthermore, by performing corner point detection on this edge, each corner point of the edge corresponding to the standard fabric area can be obtained, and the number of all corner points in the edge corresponding to the standard fabric area can be counted. So far, this embodiment has obtained the slope variance, the corner point change significance, and the number of all corner points in the corresponding edge of the standard fabric area. The processes of edge detection and corner point detection are prior arts and not within the protection scope of the present invention, so no detailed elaboration will be made here.
[0075] (3-4) Determine the boundary defect degree of each area to be marked according to the slope variance, the corner point change significance, and the number of all corner points in the corresponding edge of the standard fabric area, the corner point change significance, the slope variance, the number of all edge pixels in the corresponding edge, and the number of all corner points of each area to be marked.
[0076] According to the surface image of the textile fabric in this embodiment, in the defect-free area, not only is the pixel gray distribution uniform at the intersection of warp and weft, but also the edge of the defect-free area is flat and straight. Only at the corner points of the defect-free area does the gradient direction of the edge line change. In the defect area, the gradient direction change of the corner points is drastic. Compared with the standard fabric area, the number of corner points on the corresponding edge of the defect area is also relatively large, and the slope change of the edge is also significantly increased. Based on the above analysis of the image features of the defect-free area and the defect area, a boundary defect degree model for judging the defect degree of each area to be recognized can be constructed based on the difference degree between the corresponding edge of the area to be recognized and the corresponding edge of the standard fabric area. The calculation formula of this boundary defect degree model is also the calculation formula of the boundary defect degree of each area to be marked. The calculation formula of the boundary defect degree can be:
[0077]
[0078] Wherein, is the boundary defect degree of the th area to be marked, is the number of all corner points in the corresponding edge of the th area to be marked, is the number of all corner points in the corresponding edge of the standard fabric area, is the variance of the connection slopes of adjacent corner points of the corresponding edge of the th area to be marked, is the significance degree of corner point change of the th area to be marked,L is the number of all edge pixels corresponding to the edge of the th area to be marked, is the variance of the connection slopes of adjacent corner points corresponding to the edge of the fabric standard area, is the significant degree of corner point change in the fabric standard area.
[0079] In the calculation formula of the boundary defect degree, can characterize the difference degree of the number of corner points between the edge corresponding to the area to be recognized and the edge corresponding to the fabric standard area. If is larger, it indicates that the area to be recognized is more likely to be a defective area. If is smaller, it indicates that the possibility of the area to be recognized being a defective area is smaller. L can characterize the perimeter of the edge corresponding to the area to be recognized. Obtaining this perimeter is to determine the proportion of the difference in the number of corner points between the two areas in the perimeter of the edge corresponding to the area to be recognized. Here, 1 is to prevent ; can characterize the difference degree of the slope change between the edge corresponding to the area to be recognized and the edge corresponding to the fabric standard area. If the difference degree of the slope change is larger, it indicates that the area to be recognized is more likely to be a defective area. If the difference degree of the slope change is smaller, it indicates that the possibility of the area to be recognized being a defective area is smaller; can characterize the difference degree of the significant degree of corner point change between the area to be recognized and the fabric standard area. If the difference degree of the significant degree of corner point change is larger, it indicates that the area to be recognized is more likely to be a defective area. If the difference degree of the significant degree of corner point change is smaller, it indicates that the possibility of the area to be recognized being a defective area is smaller.
[0080] (4)According to the boundary defect degrees of each area to be marked, determine whether there is a defective area in each area to be marked. If there is a defective area, obtain a preset number of types of standard defective areas, and determine the defective type corresponding to each defective area according to each defective area and the preset number of types of standard defective areas. The steps include:
[0081] (4-1)According to the boundary defect degrees of each area to be marked, determine whether there is a defective area in each area to be marked.
[0082] If the boundary defect degree of any area to be marked is greater than the preset defect threshold, it is determined that there is a defective area in each area to be marked. Otherwise, it is determined that there is no defective area in each area to be marked.
[0083] In this embodiment, the preset defect threshold can be calculated from historical data as 50. The preset defect threshold is an index for judging whether each area to be recognized is a defective area, and this index can be set by the implementer according to specific actual situation data. This embodiment does not make specific limitations. Compare the boundary defect degrees of each area to be marked with the preset defect threshold of 50. If the boundary defect degree of any one of the areas to be marked is greater than the preset defect threshold of 50, it is determined that there are defective areas in each area to be marked, and this area to be marked in each area to be marked is a defective area. Select all the areas to be marked with a boundary defect degree greater than the preset defect threshold of 50, and each defective area in the surface image of the fabric to be inspected can be obtained. If the boundary defect degrees of each area to be marked are not greater than the preset defect threshold of 50, it is determined that there are no defective areas in each area to be marked, that is, there are no defects in the fabric to be inspected, and the fabric to be inspected is a qualified product.
[0084] (4-2) If there are defective areas, obtain standard defective areas of a preset number of types, and determine the defect type corresponding to each defective area according to each defective area and the standard defective areas of the preset number of types.
[0085] First, if there are defective areas, obtain standard defective areas of a preset number of types.
[0086] In this embodiment, if there are defective areas in each area to be marked, the number of defective areas can be 1, 2, 3, …, p , p and the numerical size of … shall not be greater than the number of areas to be marked. Then, obtain the thick warp defective area, broken weft defective area, and broken end defective area from the fabrics that have completed the production steps respectively. These three types of defective areas are common defects of the fabric. Since the staff can repair common defects through certain repair techniques, in this embodiment, the standard defective areas of the preset number of types are set as the thick warp defective area, broken weft defective area, and broken end defective area. The preset number can be 3. For the convenience of subsequent similarity calculation, the size of the standard defective area can be kept consistent with the size of the area to be marked. The preset number and defect type of the standard defective areas of the preset number of types can be set by the implementer according to the actual scenario. Different fabric processing factories have different common defect types, and no specific limitations are made.
[0087] Second, determine the defect type corresponding to each defective area according to each defective area and the standard defective areas of the preset number of types.
[0088] It should be noted that the boundary defect degree of each area to be marked can only reflect whether there are defect areas in the fabric to be inspected and the specific positions of each defect area, and cannot determine the defect types to which different defect areas belong. Based on the similarity degree between the image features of each defect area obtained by accurate recognition and the image features of various defect type areas, the defect type corresponding to each defect area can be determined. The steps include:
[0089] (4-2-1) According to each defect area, determine each corner point of the corresponding edge of each defect area, and determine the connection slope between the adjacent corner points of the corresponding edge of each defect area and the LBP value of each corner point according to the corner points.
[0090] In this embodiment, in order to facilitate the subsequent calculation of the second similarity corresponding to each defect area, based on the positions of each corner point of the corresponding edge of each defect area, calculate the connection slope between the adjacent corner points of the corresponding edge of each defect area. Specifically: taking any corner point of the corresponding edge of each defect area as the starting point, and denoting this starting point as n 1, in a certain order, this order can be clockwise or counterclockwise. In this embodiment, the clockwise order will be followed to calculate the connection slope between the corner points adjacent to this starting point n 1. In this embodiment, the corner point adjacent to this starting point n 1 can be denoted as n 2, and this connection slope can be denoted as k 1, and so on, to obtain the connection slopes corresponding to each defect area. The connection slope is one of the important parameters describing the image features of the defect area. The process of calculating the connection slope between adjacent corner points is a prior art and is not within the protection scope of the present invention, so no detailed description will be given here.
[0091] In this embodiment, in order to facilitate the subsequent calculation of the first similarity corresponding to each defect area, according to the positions of each corner point of the corresponding edge of each defect area, find the LBP values of each corner point of the corresponding edge of each defect area in the LBP map of the fabric to be inspected, and obtain the LBP values of each corner point of the corresponding edge of each defect area. The LBP value of each corner point is also one of the important parameters describing the image features of the defect area.
[0092] (4-2-2) Obtain the LBP values of each corner point of the corresponding edge of the standard defect areas of a preset number of types, and determine the first similarity between each defect area and the standard defect areas of the preset number of types according to the LBP values of each corner point of the corresponding edge of each defect area and the LBP values of each corner point of the corresponding edge of the standard defect areas of the preset number of types.
[0093] In this embodiment, first, obtain the LBP values of each corner point corresponding to the edges of the standard defect regions of a preset number of types. The standard defect regions of the preset number of types include thick warp defect regions, broken weft defect regions, and broken end defect regions. To facilitate the calculation of the first similarity between each defect region and the standard defect regions of the preset number of types, that is, to analyze the gray-scale distribution of the pixel points on the edges corresponding to each defect region, it is necessary to perform edge detection on the standard defect regions of 3 types to obtain the edges corresponding to the 3 types of standard defect regions. Then, perform corner detection on the edges corresponding to the 3 types of standard defect regions, and the corner points of the edges corresponding to the 3 types of standard defect regions can be obtained. Using the LBP algorithm, the LBP values of each corner point of the edges corresponding to the 3 types of standard defect regions can be obtained. It should be noted that this embodiment does not specifically limit the implementation methods of edge detection and corner detection. The implementation processes of edge detection, corner detection, and the LBP algorithm are all prior arts and are not within the protection scope of the present invention, so no detailed description will be given here.
[0094] Since the LBP value of a corner point can represent the gray-scale distribution of the pixels at the intersection of the warp and weft of the fabric, based on the LBP values of each corner point of the edges corresponding to each defect region and the LBP values of each corner point of the edges corresponding to the standard defect regions of a preset number of types, referring to the relevant knowledge of mathematical modeling, the first similarity between each defect region and the standard defect regions of the preset number of types can be calculated. The calculation formula for the first similarity can be:
[0095]
[0096] Wherein, is the first similarity between the P th defect region and the D th type of standard defect region, is the P value of any corner point on the edge corresponding to the LBP th defect region, i is the P serial number of each corner point on the edge corresponding to the I th defect region, P is the number of all corner points on the edge corresponding to the th defect region, P is the i value of the LBP th corner point on the edge corresponding to the th defect region, D is the LBP value of any corner point on the edge corresponding to the j th type of standard defect region, D is the serial number of each corner point on the edge corresponding to theJ is the number of all corner points in the edge corresponding to the D th type of standard defect area, is the D th value of the j th corner point in the edge corresponding to the LBP th type of standard defect area, max ( ) is the maximum value function.
[0097] In the calculation formula of the first similarity, the D th type of standard defect area can be a thick warp defect area, a broken weft defect area or a broken end defect area, can represent the proportion of the P th value of any corner point in the LBP th defect area in the sum of the P th values of all corner points in the LBP th defect area, can be the sequence composed of the proportions corresponding to each corner point in the P th defect area, can represent selecting the target corner point that best represents the P th defect area from each corner point. The proportion of this target corner point can be the maximum value in the proportion sequence corresponding to the P th defect area, The larger it is, the more uneven the pixel gray level distribution of the edge corresponding to the P th defect area is; can represent the proportion of the D th value of any corner point in the LBP th type of standard defect area in the sum of the D th values of all corner points in the LBP th type of standard defect area, can represent the target corner point that best represents the D th type of standard defect area. The proportion of this target corner point can be the maximum value in the proportion sequence corresponding to the D th type of standard defect area. The 1 in the denominator is to prevent .
[0098] It should be noted that in the calculation formula of the first similarity, the larger it is, the smaller the first similarity between the P th defect area and the D th type of standard defect area will be. It indicates that the pixel gray level situation of the edge corresponding to the P th defect area is less similar to the pixel gray level situation of the edge corresponding to the D th type of standard defect area. The P th defect area belongs to theD The possibility of this type of defect is smaller. Refer to the P first defect area and the D calculation process of the first similarity between the standard defect areas of the
[0099] (4-2-3) Obtain the connection slopes corresponding to the adjacent corner points of the edges corresponding to the standard defect areas of the preset number of types. Based on the connection slopes corresponding to the adjacent corner points of the edges corresponding to each defect area and the connection slopes corresponding to the adjacent corner points of the edges corresponding to the standard defect areas of the preset number of types, determine the second similarity between each defect area and the standard defect areas of the preset number of types.
[0100] In this embodiment, in order to facilitate the subsequent calculation of the second similarity between each defect area and the standard defect areas of the preset number of types, it is necessary to obtain the connection slopes corresponding to the adjacent corner points of the edges corresponding to the standard defect areas of the preset number of types. Specifically: Based on the standard defect areas of the preset number of types, where the preset number can be 3, referring to the steps of obtaining the corner points of the edges corresponding to the standard defect areas of 3 types in step (4-2-2), the positions of the corner points of the edges corresponding to the standard defect areas of the preset number of types can be obtained. Based on the positions of the corner points of the edges corresponding to the standard defect areas, the connection slopes corresponding to the adjacent corner points can be calculated. The process of calculating the connection slopes is a prior art and will not be elaborated in detail here.
[0101] Since the connection slope can represent the change of the gradient direction at the intersection of the warp and weft of the fabric, in this embodiment, based on the connection slopes corresponding to the adjacent corner points of the edges corresponding to each defect area and the connection slopes corresponding to the adjacent corner points of the edges corresponding to the standard defect areas of the preset number of types, using the relevant knowledge of mathematical modeling, the second similarity between each defect area and the standard defect areas of the preset number of types can be calculated. The calculation formula of the second similarity can be:
[0102]
[0103] Where, is the second similarity between the P th defect area and the D th type of standard defect area, is the connection slope corresponding to the P th adjacent corner point in the edge corresponding to the l th defect area, is the connection slope corresponding to the P th adjacent corner point in the edge corresponding to the l +1th adjacent corner point in the edge corresponding to the l is the PThe serial number of the slope of the line connecting each adjacent corner point on the edge corresponding to a defective area L is the P number of the slopes of the lines connecting all adjacent corner points on the edge corresponding to a defective area, is the D slope of the line connecting the x th adjacent corner point on the edge corresponding to the standard defective area of the th type, D is the x slope of the line connecting the x th + 1 adjacent corner point on the edge corresponding to the standard defective area of the D th type, X is the D serial number of the slopes of the lines connecting each adjacent corner point on the edge corresponding to the standard defective area of the
[0104] th type, and can both characterize the difference magnitude between adjacent line slopes, and can both characterize the product magnitude between adjacent line slopes. The 1 in the denominator is to prevent the denominator from being 0. can characterize the P stability degree of the change of the slope of the line connecting adjacent corner points on the edge corresponding to a defective area, while can characterize the D stability degree of the change of the slope of the line connecting adjacent corner points on the edge corresponding to the standard defective area of the th type. If P is larger, it indicates that the difference between the stability degree of the change of the slope of the line corresponding to a defective area and the stability degree of the change of the slope of the line corresponding to the standard defective area of the D th type is larger. When this difference is larger, the second similarity between the P th defective area and the D th type of standard defective area will be smaller, that is, the possibility that the P th defective area belongs to the D th type of defective area is smaller.
[0105] (4-2-4) Determine the similarity between each defective area and the standard defective areas of the preset number of types according to the first similarity and the second similarity, and determine the defective type of each defective area according to the similarity.
[0106] (4-2-4-1) Determine the similarity between each defect area and the standard defect areas of a preset number of types according to the first similarity and the second similarity.
[0107] Calculate the product of the first similarity and the second similarity, and use this product as the similarity between the corresponding defect area and the standard defect areas of a preset number of types.
[0108] In this embodiment, taking the calculation of the similarity between the P th defect area and the D th type of standard defect area as an example, according to the first similarity P between the D th defect area and the th type of standard defect area and the second similarity , calculate the product of the first similarity and the second similarity , that is . Use this product as the similarity between the P th defect area and the D th type of standard defect area. Since the D th type of standard defect area can be a thick warp defect area, a broken weft defect area or a broken end defect area, the P th defect area will calculate the similarity with 3 types of standard defect areas, that is, the P th defect area will correspond to 3 similarities. Referring to the calculation process of the similarity between the P th defect area and the D th type of standard defect area, the similarity between each defect area and the standard defect areas of a preset number of types can be obtained.
[0109] (4-2-4-2) Determine the defect type of each defect area according to the similarity.
[0110] According to the similarity between each defect area and the standard defect areas of a preset number of types, determine the maximum similarity corresponding to each defect area. If the maximum similarity corresponding to any defect area is greater than or equal to the similarity threshold, it is determined that this defect area belongs to this type of defect; otherwise, it is determined that this defect area belongs to other types of defects.
[0111] In this embodiment, each defect area will have 3 corresponding similarities. The maximum similarity is selected from these 3 similarities, and it is judged whether the maximum similarity is greater than or equal to the similarity threshold. If the maximum similarity is greater than or equal to the similarity threshold, the defect type of the standard defect area corresponding to the maximum similarity is used as the defect type to which the corresponding defect area belongs. If the maximum similarity is less than the similarity threshold, it means that the defect type of the standard defect area corresponding to the maximum similarity is not the defect type to which the corresponding defect area belongs, and the defect type of this defect area is marked as other types of defects. Other types of defects are defect types that do not belong to the standard defect areas of the preset number of types. Each defect area has its corresponding defect type. It should be noted that the requirements for the similarity threshold of different fabrics are different, so the similarity threshold can be set according to the specific actual situation.
[0112] For example, the similarity between the i th defect area and the thick warp defect area is a , the similarity between the i th defect area and the broken weft defect area is b , the similarity between the i th defect area and the broken end defect area is c . a > c > b indicates that the similarity a is the maximum similarity. When the similarity a is greater than or equal to the similarity threshold, it means that the i th defect area belongs to the thick warp defect. When the similarity a is less than the similarity threshold, it means that the i th defect area does not belong to the thick warp defect. At the same time, the i th defect area also does not belong to the broken weft defect and the broken end defect. The i th defect area belongs to other types of defects.
[0113] (5) According to the defect types corresponding to each defect area, label each area to be labeled in the surface image of the fabric to be inspected. According to the labeling result of the surface image of the fabric to be inspected, judge whether the fabric to be inspected is qualified. The steps include:
[0114] (5-1) According to the defect types corresponding to each defect area, label each area to be labeled in the surface image of the fabric to be inspected.
[0115] In this embodiment, based on the defect types corresponding to each defect area, 5 data labels are made, denoted as 0, 1, 2, 3, and 4. Based on the defect types corresponding to each defect area, more accurate defect category labels can be set. The accurate defect category labels help improve the recognition ability of the target detection network for fabric defects in different scenarios. Among them, data label 0 represents the normal area, data label 1 represents the thick warp defect area, data label 2 represents the broken weft defect area, data label 3 represents the broken end defect area, and data label 4 represents other types of defect areas. In this embodiment, one-hot encoding processing is performed on the data labels and the fabric to be quality inspected, that is, one-hot encoding. The encoding result is used as the input content of the target detection network. The target detection network can be used to perform annotation processing on the fabric to be quality inspected, and the fabric to be quality inspected after annotation is used as the output content of the target detection network to obtain the annotation result of the surface image of the fabric to be quality inspected. In the target detection network, the structure of the target detection network is Faster R-CNN, the optimization algorithm is the Adam (Adaptive Moment Estimation) optimization algorithm, and the loss function is the cross-entropy loss function.
[0116] It should be noted that the one-hot encoding processing process, the construction and training process of the target detection network are all prior arts and not within the protection scope of the present invention, so no detailed description will be given here. Compared with manually labeling data labels for each area to be annotated according to the defect types corresponding to each defect area, the accuracy of the annotation result of the target detection network will be higher and the annotation speed will be faster, thereby improving the efficiency of fabric quality inspection.
[0117] (5-2) According to the annotation result of the surface image of the fabric to be quality inspected, determine whether the fabric to be quality inspected is qualified.
[0118] In this embodiment, based on the output content of the target detection network, that is, the annotation result of the surface image of the fabric to be quality inspected, quality inspection processing is performed on the fabric to be quality inspected. If there are defect data labels in the fabric to be quality inspected, it is determined that the fabric to be quality inspected is an unqualified fabric. Based on the number of defect labels in the data labels of the fabric to be quality inspected, the unqualified degree of the fabric to be quality inspected can be evaluated. Subsequently, according to the unqualified degree of the fabric to be quality inspected and the positions of the areas of different defect types, specific processing and analysis are carried out on the common defect areas in the fabric to avoid the occurrence of the same defects in the same positions during subsequent fabric production, which helps improve the quality of fabric production.
[0119] The present embodiment provides a fabric defect identification and labeling method for fabric quality inspection. The method can use the identification and labeling of fabric defects as a material analysis task, extract features of the fabric defect conditions by setting defect indicators, and use the learning ability of neural networks to learn the features of different defect areas, accurately judge whether there are defects in the fabric to be inspected and the types of the defects, so that the defect categories and positions of the defect areas are more accurately labeled in the fabric surface image, thereby improving the accuracy of fabric quality inspection, facilitating the targeted adoption of different corresponding treatment measures, improving the efficiency of subsequent fabric defect treatment by production technicians, and enhancing the production automation level of the entire production line.
[0120] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions 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 fabric defect identification and marking method for fabric quality inspection, characterized in that, Including the following steps: Obtain each region to be labeled in the surface image of the fabric to be inspected for quality. Obtain the grayscale image of the fabric to be inspected for quality based on the surface image of the fabric to be inspected for quality, and obtain the LBP image of the fabric to be inspected for quality based on the grayscale image; Determine each corner point of the edge corresponding to each region to be labeled according to each region to be labeled, and determine the corner point change significance of each region to be labeled according to each corner point of the edge corresponding to each region to be labeled and the LBP image of the fabric to be inspected for quality; Obtain the standard fabric region, and determine the boundary defect degree of each region to be labeled according to the standard fabric region, the corner point change significance of each region to be labeled, and each corner point of the edge corresponding to each region to be labeled; Judge whether there is a defective region in each region to be labeled according to the boundary defect degree of each region to be labeled. If there is a defective region, obtain a preset number of types of standard defective regions, and determine the defect type corresponding to each defective region according to each defective region and the preset number of types of standard defective regions; Perform labeling processing on each region to be labeled in the surface image of the fabric to be inspected for quality according to the defect type corresponding to each defective region, and judge whether the fabric to be inspected for quality is qualified according to the labeling result of the surface image of the fabric to be inspected for quality.
2. The fabric defect identification and marking method for fabric quality inspection according to claim 1, wherein Determine the corner point change significance of each region to be labeled according to each corner point of the edge corresponding to each region to be labeled and the LBP image of the fabric to be inspected for quality, including: Determine the positions of each corner point of the edge and the number of all corner points in the edge according to each corner point of the edge corresponding to each region to be labeled, and determine the LBP value of each corner point of the edge corresponding to each region to be labeled according to the positions of each corner point of the edge and the LBP image of the fabric to be inspected for quality; Calculate the absolute value of the difference between the LBP values corresponding to adjacent corner points of the edge corresponding to each region to be labeled according to the LBP values of each corner point of the edge corresponding to each region to be labeled; Accumulatively calculate each absolute value of the difference of the edge corresponding to each region to be labeled according to the number of all corner points in the edge corresponding to each region to be labeled, and use the accumulated value obtained by the accumulative calculation as the corner point change significance of the corresponding region to be labeled.
3. A method for fabric defect identification and marking for fabric quality inspection according to claim 1, characterized in that, Determine the boundary defect degree of each region to be labeled according to the standard fabric region, the corner point change significance of each region to be labeled, and each corner point of the edge corresponding to each region to be labeled, including: Determine the connection slope of adjacent corner points of the edge corresponding to each region to be labeled according to the positions of each corner point of the edge corresponding to each region to be labeled, and determine the slope variance corresponding to each region to be labeled according to the connection slope of the adjacent corner points; Count the number of all edge pixel points of the edge corresponding to each region to be labeled according to the edge corresponding to each region to be labeled; Determine the slope variance, corner point change significance, and the number of all corner points in the corresponding edge of the standard fabric region according to the standard fabric region; Determine the boundary defect degree of each region to be labeled according to the slope variance, corner point change significance, and the number of all corner points in the corresponding edge of the standard fabric region, the corner point change significance, slope variance, the number of all edge pixel points in the corresponding edge, and the number of all corner points of each region to be labeled.
4. A method for identifying and marking fabric defects for fabric quality inspection according to claim 3, characterized in that, The calculation formula for the boundary defect degree is as follows: Wherein, is the boundary defect degree of the th area to be marked, is the number of all corner points in the corresponding edge of the th area to be marked, is the number of all corner points in the corresponding edge of the fabric standard area, is the variance of the connection slopes of adjacent corner points in the corresponding edge of the th area to be marked, is the significant degree of corner point change in the th area to be marked, L is the number of all edge pixel points in the corresponding edge of the th area to be marked, is the variance of the connection slopes of adjacent corner points in the corresponding edge of the fabric standard area, is the significant degree of corner point change in the fabric standard area.
5. A fabric defect identification and marking method for fabric quality inspection according to claim 1, characterized in that Based on each defect area and standard defect areas of a preset number of types, determine the defect type corresponding to each defect area, including: Based on each defect area, determine each corner point of the edge corresponding to each defect area, and based on each corner point, determine the connection slope between adjacent corner points of the edge corresponding to each defect area and the LBP value of each corner point; Obtain the LBP values of each corner point of the edges corresponding to standard defect areas of a preset number of types. Based on the LBP values of each corner point of the edge corresponding to each defect area and the LBP values of each corner point of the edges corresponding to standard defect areas of a preset number of types, determine the first similarity between each defect area and standard defect areas of a preset number of types; Obtain the connection slopes between adjacent corner points of the edges corresponding to standard defect areas of a preset number of types. Based on the connection slopes between adjacent corner points of the edge corresponding to each defect area and the connection slopes between adjacent corner points of the edges corresponding to standard defect areas of a preset number of types, determine the second similarity between each defect area and standard defect areas of a preset number of types; Based on the first similarity and the second similarity, determine the similarity between each defect area and standard defect areas of a preset number of types, and based on the similarity, determine the defect type of each defect area.
6. A fabric defect recognition and marking method for fabric quality inspection according to claim 5, characterized in that, The calculation formula for the first similarity is as follows: Wherein, is the first similarity between the P th defect region and the standard defect region of the D th type, is the P value of any corner point in the corresponding edge of the LBP th defect region, i is the serial number of each corner point in the corresponding edge of the P th defect region, I is the number of all corner points in the corresponding edge of the P th defect region, is the P value of the i th corner point in the corresponding edge of the LBP th defect region, is the D value of any corner point in the corresponding edge of the standard defect region of the LBP th type, j is the serial number of each corner point in the corresponding edge of the standard defect region of the D th type, J is the number of all corner points in the corresponding edge of the standard defect region of the D th type, is the D value of the j th corner point in the corresponding edge of the standard defect region of the LBP th type, max ( ) is the maximum value function.
7. A method for fabric defect identification and marking for fabric quality inspection according to claim 5, characterized in that, The calculation formula for the second similarity is as follows: Among them, is the second similarity between the P th defect region and the standard defect region of the D th type, is the connection slope corresponding to the P th adjacent corner point among the corresponding edges of the l th defect region, is the connection slope corresponding to the P th + 1 adjacent corner point among the corresponding edges of the l th defect region, l is the serial number of the connection slopes corresponding to each adjacent corner point among the corresponding edges of the P th defect region, L is the number of connection slopes of all adjacent corner points among the corresponding edges of the P th defect region, is the connection slope corresponding to the D th adjacent corner point among the corresponding edges of the standard defect region of the x th type, is the connection slope corresponding to the D th + 1 adjacent corner point among the corresponding edges of the standard defect region of the x th type, x is the serial number of the connection slopes corresponding to each adjacent corner point among the corresponding edges of the standard defect region of the D th type, X is the number of connection slopes of all adjacent corner points among the corresponding edges of the standard defect region of the D th type.
8. A fabric defect identification and marking method for fabric quality inspection according to claim 5, characterized in that, Based on the first similarity and the second similarity, determine the similarity between each defect area and standard defect areas of a preset number of types, including: Based on the first similarity and the second similarity, calculate the product of the first similarity and the second similarity, and use this product as the similarity between the corresponding defect area and standard defect areas of a preset number of types.
9. A fabric defect identification and marking method for fabric quality inspection according to claim 5, characterized in that, Based on the similarity, determine the defect type of each defect area, including: Based on the similarity between each defect area and standard defect areas of a preset number of types, determine the maximum similarity corresponding to each defect area; If the maximum similarity corresponding to any defect area is greater than or equal to the similarity threshold, then determine that this defect area belongs to the defect of this type. Otherwise, determine that this defect area belongs to other types of defects, where the other types of defects are defect types that do not belong to the standard defect areas of a preset number of types.
10. A method for identifying and marking fabric defects for fabric quality inspection according to claim 1, characterized in that, Based on the boundary defect degree of each area to be labeled, determine whether there are defect areas in each area to be labeled, including: If the boundary defect degree of any area to be labeled is greater than the preset defect threshold, then determine that there are defect areas in each area to be labeled. Otherwise, determine that there are no defect areas in each area to be labeled.
Citation Information
Patent Citations
Automatic positioning textile defect detection system
CN113322653A
Fabric defect detection method capable of resisting texture interference
CN114820631A
Audio-based 3D point cloud generation and analysis
US20180218537A1