CN115131348A - Method and system for detecting textile surface defects - Google Patents
Method and system for detecting textile surface defects Download PDFInfo
- Publication number
- CN115131348A CN115131348A CN202211044200.8A CN202211044200A CN115131348A CN 115131348 A CN115131348 A CN 115131348A CN 202211044200 A CN202211044200 A CN 202211044200A CN 115131348 A CN115131348 A CN 115131348A
- Authority
- CN
- China
- Prior art keywords
- sliding window
- image
- probability
- length
- point pair
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000007547 defect Effects 0.000 title claims abstract description 125
- 239000004753 textile Substances 0.000 title claims abstract description 51
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000001914 filtration Methods 0.000 claims abstract description 46
- 238000007781 pre-processing Methods 0.000 claims abstract description 17
- 238000001514 detection method Methods 0.000 claims abstract description 14
- 239000004744 fabric Substances 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 12
- 230000000737 periodic effect Effects 0.000 claims description 10
- 230000009466 transformation Effects 0.000 claims description 4
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 238000004519 manufacturing process Methods 0.000 description 7
- 238000013459 approach Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000002950 deficient Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30124—Fabrics; Textile; Paper
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Treatment Of Fiber Materials (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention discloses a method for detecting surface defects of textiles, relates to the field of artificial intelligence, and is mainly used for detecting broken threads of the textiles. The method comprises the following steps: acquiring a gray level image of the surface of the textile and preprocessing the gray level image; acquiring the maximum frequency point pair length in each direction in the gray level image, and calculating the point pair period length probability in each direction; acquiring the period length in the period extending direction, setting sliding window parameters to slide the gray level image, acquiring a frequency domain space image of each sliding window image, acquiring an intersection frequency value of the sliding window images, filtering each sliding window image, calculating the contrast value of each pixel point in each sliding window, and acquiring high-contrast pixel points in each sliding window; and calculating the defect probability of each sliding window, and judging whether the sliding window image has defects according to the defect probability. According to the technical means provided by the invention, the interference of the printing texture of the textile can be overcome, the defect area can be accurately positioned, and the detection efficiency is effectively improved.
Description
Technical Field
The invention relates to the field of artificial intelligence, in particular to a method and a system for detecting surface defects of textiles.
Background
In the detection process of the textile surface defects, the detected defects are not accurate enough due to the interference of the texture of the textile, and the textile surface defects cannot be accurately positioned.
Conventional thresholding and edge detection methods cannot detect textile defect locations due to texture and color interference. The conventional filtering detection method cannot simply acquire the frequency band of the background pattern, so that a lot of time is required for frequency band determination.
Disclosure of Invention
The invention provides a method and a system for detecting textile surface defects, which are used for solving the existing problems and comprise the following steps: acquiring a gray level image of the surface of the textile and preprocessing the gray level image; acquiring the maximum frequency point pair length in each direction in the gray level image, and calculating the point pair period length probability in each direction; acquiring the period length in the period extending direction, setting sliding window parameters to slide the gray level image, acquiring the frequency domain space image of each sliding window image, acquiring the intersection frequency value of the sliding window images, filtering each sliding window image, calculating the contrast value of each pixel point in each sliding window, and acquiring the high-contrast pixel point in each sliding window; and calculating the defect probability of each sliding window, and judging whether the sliding window image has defects or not according to the defect probability.
According to the technical means provided by the invention, the texture period information of the textile is obtained by analyzing the point pair texture information in the image, and the sliding window parameters are set by utilizing the period information, so that the further filtering treatment is carried out, the interference of the printing texture of the textile can be overcome, the defect area is accurately positioned, and the detection efficiency and the production quality are effectively improved.
The invention adopts the following technical scheme that the method for detecting the surface defects of the textile comprises the following steps:
and acquiring a gray level image of the surface of the textile, and preprocessing the gray level image to obtain a gradient image.
And acquiring a point pair formed by every two pixel points in each direction of each pixel point in the gradient image, and calculating the point pair period length probability of each direction of the gray image by using the point pair length corresponding to the maximum frequency point pair in each direction.
And taking the direction corresponding to the maximum value of the period length probability obtained by all the point pairs as the extension direction of the period, obtaining the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction.
And sliding the gray level images by using the windows with set parameters to obtain frequency domain space images of each sliding window image, and obtaining intersection frequency values corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows.
And respectively carrying out filtering processing on the sliding window image by using the intersection frequency value of each sliding window image and other sliding window images to obtain a filtering image of the sliding window image after filtering processing at different intersection frequency values.
And calculating the defect probability of each sliding window image by using the contrast value of each pixel point in all the filtering images corresponding to each sliding window image, and judging whether the sliding window image has defects or not according to the defect probability.
Further, a method for detecting textile surface defects, which calculates the probability of the point-to-period length of each direction of the gray image, is as follows:
calculating the point pair length of the kth line point pair in each direction in the gray scale image by using the Euclidean distance between the starting point and the ending point, and acquiring the line point pair length corresponding to the maximum frequency in the s direction;
Similarly, calculating all the point pair lengths in the direction perpendicular to the s-th direction from the k-th row to obtain the column point pair length, and obtaining the column point pair length with the maximum frequency in the corresponding direction;
The expression for calculating the cycle length probability in the s-th direction is:
wherein,represents the maximum frequency column point pair length in the direction perpendicular to the s-th angle from the k-th row,the s angular direction from the point pair of the k row is the first row, the point pair parallel to the lower i row has the maximum frequency point pair length in the s direction,represents the maximum frequency point pair length of the k-th row of point pairs in the s-th direction, N represents the total N rows of point pairs,and expressing the probability of the period length of the point pair in the s direction of the gray image.
Further, a method for detecting textile surface defects, which sets sliding window parameters according to the cycle length and the cycle extension direction, comprises the following steps:
obtaining the angular direction with the largest period length probabilityAs the extension direction of the period, the row with the largest period length probability is obtainedAs the beginning of the cycle, choose fromGo out ofMaximum frequency point pair length of angle direction straight lineFor the length of the periodic line, will be perpendicular to the secondGo out ofMaximum frequency point pair length on angle direction straight line of angle directionAs the periodic column length;
acquiring the initial position of a sliding window in the cloth according to the period starting point, the period length and the period extending directionThe sliding window has the size ofThe sliding direction of the sliding window isDirection, sliding step length of the sliding window。
Further, a method for detecting textile surface defects, which is used for acquiring intersection frequency values corresponding to two sliding window images, comprises the following steps:
fourier transformation is carried out on each sliding window image to obtain a frequency domain space image corresponding to the sliding window image, intersection processing is carried out on the frequency domain space of any two sliding windows, and an intersection frequency value corresponding to the two sliding window images is obtained.
Further, a method for detecting textile surface defects, wherein the contrast value of each pixel point in all filtered images corresponding to each sliding window image comprises:
computing each sliding window by 8 neighborhood pixelsThe contrast value of each pixel point is obtained, and all the contrast values are obtained and are larger than a first threshold valueAnd taking the pixel points with the contrast ratio larger than the first threshold value as high-contrast pixel points.
Further, a method for detecting textile surface defects calculates defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, and the expression is as follows:
wherein,indicating the number of high contrast pixels in the neighborhood of the e-th high contrast pixel 8 in the filtered sliding window image of the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window,representing the total number of high contrast pixels within the sliding window,indicating the defect probability of the filtered sliding window image of the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window.
Further, after calculating the defect probability corresponding to each sliding window, the method for detecting the textile surface defects further comprises the following steps:
calculating the comprehensive defect probability of the ith sliding window according to the filtered defect probability of the ith sliding window and the frequency intersection of each sliding window, wherein the expression is as follows:
wherein,indicating the defect probability of the ith sliding window image after filtering the ith sliding window by using the ith and jth intersection of the sliding window,the defect probability of the filtered sliding window image obtained by filtering the kth sliding window by using the frequency intersection of the ith sliding window and the kth sliding window is shown, Q represents the number of the sliding windows,representing the integrated defect probability of the ith sliding window.
A detection system for textile surface defects comprises an image preprocessing unit, a first calculating unit, a second calculating unit, a third calculating unit, a fourth calculating unit and a defect detecting unit;
the image preprocessing unit is used for acquiring a gray level image of the surface of the textile and preprocessing the gray level image to obtain a gradient image;
the first calculation unit is used for acquiring a point pair formed by every two pixel points in each direction of each pixel point in the gradient image, and calculating the point pair period length probability of each direction of the gray image by using the point pair length corresponding to the maximum frequency point pair in each direction;
the second calculation unit is used for taking the direction corresponding to the maximum value of the period length probability obtained by all the point pairs as the extension direction of the period, obtaining the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction;
the third calculation unit is used for performing sliding window on the gray level image by using a window with set parameters, acquiring a frequency domain space image of each sliding window image, and obtaining an intersection frequency value corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows;
the fourth calculation unit is used for respectively carrying out filtering processing on the sliding window image by using the intersection frequency value of each sliding window image and other sliding window images to obtain a filtering image of the sliding window image after filtering processing at different intersection frequency values;
and the defect detection unit is used for calculating the defect probability of each sliding window image by using the contrast value of each pixel point in all the filtering images corresponding to each sliding window image, and judging whether the sliding window image has defects or not according to the defect probability.
The invention has the beneficial effects that: according to the technical means provided by the invention, the texture period information of the textile is obtained by analyzing the point pair texture information in the image, and the sliding window parameters are set by utilizing the period information, so that the further filtering treatment is carried out, the interference of the printing texture of the textile can be overcome, the defect area is accurately positioned, and the detection efficiency and the production quality are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a method for detecting textile surface defects according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of another method for detecting defects on the surface of a textile according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a textile surface defect detection system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Example 1
As shown in fig. 1, a schematic structural diagram of a method and a system for detecting textile surface defects according to an embodiment of the present invention is provided, which includes:
101. and acquiring a gray level image of the surface of the textile, and preprocessing the gray level image.
The scenario addressed by the present embodiment is: a camera is arranged above a cloth production line with the same texture periodicity (note: color period may be different), when the cloth runs to the lower side of the camera, a cloth picture is collected, and the breakage phenomenon of the warp and weft of the cloth is realized by processing the cloth picture.
Converting the acquired image from an RGB color space into a grayed image, and preprocessing the grayscale image, wherein the preprocessing operation comprises the following steps:
in order to obtain periodic information of cloth printing textures and prevent interference of cloth warp and weft textures, the cloth warp and weft textures are removed through a low-pass filter, and a sober operator is used for processing a filtering image to obtain a gradient image.
102. And acquiring a point pair in each direction in the gray scale image, and calculating the probability of the point pair period length in each direction of the gray scale image according to the maximum frequency point pair length in each direction.
Starting from the first non-zero gradient coordinate point of the k-th rowIn the angular direction, the pixels with the same gradient value are formed into a point pair, and the point pair is recorded as,Respectively representing the start and end positions of the pair.
Note that one pixel may have a plurality of dot pairs. For example asThe value of the angle of the gradient is 23 degrees,at the pixelThe other 6 pixels in the direction have 23 gradient angles, thus from the coordinateThe number of starting point pairs is 7.
Counting the kth of the kth linePoint pair length in angular direction: counting the point pair frequency of each point pair length in the s-th angle direction of the k-th line to obtain the point pair length corresponding to the maximum frequency. Analogy to this approach yields the maximum frequency point pair lengths for the remaining columns in the s-th angular direction.
Obtaining the angle direction perpendicular to the s-th angle from the k-th line, and obtaining the point pair length with the highest frequency in the direction by analogy with the solving method for the point pair length in the s-th angle direction of the k-th line。
103. And taking the direction corresponding to the point pair period length probability maximum value as the extension direction of the period, acquiring the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction.
Selecting the angle direction with the largest period length probabilityAs the extension direction of the period, the row with the maximum period length probability in the direction is selectedAs the beginning of the cycle, choose fromGo out ofLength of point pair of angular direction lineFor the length of the periodic line, perpendicular to the slaveGo out ofLength of point pair on angle direction line of angle directionAs column point pair lengths.
Since the texture of the cloth changes periodically, the sliding window parameter needs to be set according to the periodic parameter.
104. And performing sliding window on the gray level image, acquiring a frequency domain space image of each sliding window image, and obtaining an intersection frequency value corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows.
Fourier transformation is carried out on each sliding window image to obtain a frequency domain space image, intersection set processing is carried out on the frequency domain space of any two sliding windows to obtain an intersection frequency value set of the two images, and the intersection frequency set is used for carrying out filtering processing on the two corresponding sliding window images respectively to obtain a filtered image.
The other sliding window filtering images based on the sliding window can be obtained through the method.
105. And filtering each sliding window image according to the intersection frequency value, calculating the contrast value of each pixel point in each sliding window after filtering, and acquiring the pixel point with the contrast value larger than a first threshold value in each sliding window as a high-contrast pixel point.
Calculating the contrast value of each pixel through 8 neighborhood pixels, and segmenting a possible defect region, namely the contrast ratio, through the contrast valueGreater than a set thresholdThe set of pixels of (1).
106. And calculating the defect probability of each sliding window according to the number of high-contrast pixel points in each sliding window, and judging whether the corresponding sliding window image has defects according to the defect probability.
Because each sliding window contains a complete single-period printed pattern, the filtered image without defects is smoother. When the defect exists, some texture information exists in the defect area, and the texture information of other areas is less and smoother, so that the probability of the defect in each sliding window is evaluated based on the characteristic.
In order to prevent the problem of low precision of evaluating the printing defects by a single window, the comprehensive defect probability of each sliding window needs to be comprehensively evaluated by combining the filtering effect of the sliding window set.
Screening out sliding windows with possible defects through defect probability, and determining the defect probability of the sliding windowsThe sliding window is considered defective.
According to the technical means provided by the invention, the texture period information of the textile is obtained by analyzing the point pair texture information in the image, and the sliding window parameters are set by utilizing the period information, so that the further filtering treatment is carried out, the interference of the printing texture of the textile can be overcome, the defect area is accurately positioned, and the detection efficiency and the production quality are effectively improved.
Example 2
As shown in fig. 2, another method and system for detecting textile surface defects according to an embodiment of the present invention are provided, which includes:
201. and acquiring a gray level image of the surface of the textile, and preprocessing the gray level image.
In this embodiment, the defect detection of the cloth needs to be implemented according to the acquired cloth image, so the cloth image needs to be acquired first, and the cloth area needs to be segmented.
A camera is arranged right above the textile production line, the camera takes a picture at intervals, and the interval time of the camera can be set according to the visual angle width of the camera and the running speed of the production line.
And converting the acquired image from the RGB color space into a gray-scale image.
In order to enable the system to be used in various situations and enhance the generalization capability of the textile products, the invention adopts a DNN semantic segmentation mode to identify cloth areas in segmented images.
The relevant content of the DNN network is as follows:
the dataset used is a textile image dataset acquired from a top view.
The pixels to be segmented are divided into two types, namely the labeling process of the training set corresponding to the labels is as follows: in the semantic label of the single channel, the label of the pixel at the corresponding position belonging to the background class is 0, and the label of the pixel belonging to the cloth is 1.
The task of the network is classification, so the loss function used is a cross entropy loss function.
In order to obtain the periodic information of the printing texture of the cloth and prevent the interference of the warp and weft textures of the cloth, the warp and weft textures of the cloth need to be removed by using a low-pass filter.
Using a dimension ofThe Gaussian filter pair cloth gray level imageFiltering to obtain processed picture。
202. And acquiring point pairs in each direction in the gray-scale image, and calculating the probability of the point pair period length in each direction of the gray-scale image according to the maximum frequency point pair length in each direction.
And (3) obtaining a 360-degree direction set by taking the horizontal right direction as a 0-degree direction set and taking 1 as an angle interval.
Starting from the first non-zero gradient coordinate point of the k-th lineIn the angular direction, pixels with the same gradient value are grouped into a point pair, and the point pair is marked as,Respectively representing the starting and ending positions of the pair. Note: one pixel may have a plurality of point pairs. For example asAt a value of 23 degrees for the gradient angle, at the pixelThe other 6 pixels in the direction have a 23-gradient angle, and thus are from the coordinateThe number of starting point pairs is 7. Obtaining point pair set by the method。
Analogy to this approach yields point pairs in the s-th angular direction for the remaining columns.
Counting the kth of the kth linePoint pair length in angular direction: counting the point pair frequency of each point pair length in the s-th angle direction of the k-th line to obtain the point pair length corresponding to the maximum frequency. Analogy to this approach yields the maximum frequency point pair lengths for the remaining columns in the s-th angular direction.
Calculating the angle direction perpendicular to the s-th angle from the k rows to obtain the length of the column point pair: obtaining the angle direction perpendicular to the s-th angle from the k-th line, and obtaining the point pair length with the highest frequency in the direction by analogy with the solving method of the point pair length of the s-th angle direction of the k-th line。
The method for calculating the probability of the point-to-period length of each direction of the gray level image comprises the following steps:
calculating the point pair length of the kth line point pair in each direction in the gray scale image by using the Euclidean distance between the starting point and the ending point, and acquiring the line point pair length corresponding to the maximum frequency in the s direction;
Similarly, calculating all the point pair lengths in the direction perpendicular to the s-th direction from the k-th row to obtain the column point pair length, and obtaining the column point pair length with the maximum frequency in each direction;
The expression for calculating the cycle length probability in the s-th direction is:
wherein,denotes that the line k starts perpendicularly to the sThe most frequent column pair length in the angular direction,the s angular direction from the point pair of the k row is the first row, the point pair parallel to the lower i row has the maximum frequency point pair length in the s direction,represents the maximum frequency point pair length of the k-th row of point pairs in the s-th direction, N represents the total N rows of point pairs,and expressing the probability of the period length of the point pair in the s direction of the gray image.
203. And taking the direction corresponding to the point pair period length probability maximum value as the extension direction of the period, acquiring the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction.
The method for setting the sliding window parameters according to the period length and the period extending direction comprises the following steps:
obtaining the angular direction with the largest period length probabilityAs the extension direction of the period, the row with the largest period length probability is obtainedAs the beginning of the cycle, choose fromGo out ofMaximum frequency point pair length of angular direction straight lineFor the length of the periodic line, will be perpendicular to the secondGo out ofMaximum frequency point pair length on angle direction straight line of angle directionAs the periodic column length;
acquiring the initial position of a sliding window in the cloth according to the period starting point, the period length and the period extending directionThe sliding window has the size ofThe sliding direction of the sliding window isDirection, sliding step length of the sliding window is。
2041. And performing sliding window on the gray level image, acquiring a frequency domain space image of each sliding window image, and obtaining an intersection frequency value corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows.
The method for acquiring the intersection frequency value corresponding to the two sliding window images comprises the following steps:
fourier transformation is carried out on each sliding window image to obtain a frequency domain space image corresponding to the sliding window image, intersection processing is carried out on the frequency domain space of any two sliding windows, and an intersection frequency value corresponding to the two sliding window images is obtained.
2042. And filtering each sliding window image according to the intersection frequency value, calculating the contrast value of each pixel point in each sliding window after filtering, and acquiring the pixel point with the contrast value larger than a first threshold value in each sliding window as a high-contrast pixel point.
The method for acquiring the pixel points with the contrast value larger than the first threshold value in each sliding window as the high-contrast pixel points comprises the following steps:
calculating the contrast value of each pixel point in each sliding window through 8 neighborhood pixels, and acquiring all the contrast values larger than a first threshold valueAnd taking the pixel points with the contrast ratio larger than the first threshold value as high-contrast pixel points.
2043. And calculating the defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, and judging whether the corresponding sliding window image has defects or not according to the defect probability.
Because each sliding window contains a complete single-period printed pattern, the filtered image without defects is smoother. When the defect exists, some texture information exists in the defect area, and the texture information of other areas is less and smoother, so that the probability of the defect in each sliding window is evaluated based on the characteristic.
Calculating the defect probability corresponding to each sliding window according to the number of high-contrast pixel points in each sliding window, wherein the expression is as follows:
wherein,indicating the number of high contrast pixels in the neighborhood of the e-th high contrast pixel 8 in the filtered sliding window image of the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window,representing the total number of high contrast pixels within the sliding window,indicating the use of the ith slideThe frequency intersection of the window and the jth sliding window gives the probability of a defect to the filtered sliding window image of the ith sliding window,and the defect probability value in the filtered sliding window image obtained by filtering the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window is shown, and the larger the value is, the larger the probability that the defect exists in the sliding window is, the larger the distribution of the texture region in the sliding window is, and the probability that the defect exists in the sliding window is also shown.
In order to prevent the problem of low precision of evaluating the printing defects by a single window, the method needs to comprehensively evaluate the comprehensive defect probability of each sliding window by combining the filtering effect of the sliding window set, and after calculating the defect probability corresponding to each sliding window, the method further comprises the following steps:
calculating the comprehensive defect probability of the ith sliding window according to the filtered defect probability of the ith sliding window and the frequency intersection of each sliding window, wherein the expression is as follows:
wherein,indicating the defect probability of the ith sliding window image after filtering the ith sliding window by using the ith and jth intersection of the sliding window,indicating the defect probability of the filtered sliding window image obtained by using the frequency intersection of the ith sliding window and the kth sliding window, Q indicating the number of the sliding windows,the comprehensive defect probability of the ith sliding window is expressed, when the ith sliding window has defects, the sliding window has larger frequency domain difference with other sliding windows, and therefore, the defect area is exposed after the sliding window is filtered by utilizing the intersection of the other sliding windows and the sliding window, and the defect probability in the sliding window after filtering is carried outThe size of the composite material is larger,the defect probability mean value of the ith sliding window after filtering is shown, the larger the value is, the higher the probability that the ith sliding window area has defects is,the larger the value is, the greater the defect probability of the filtered sliding window image obtained by filtering the kth sliding window by using the ith frequency intersection with the kth sliding window, the greater the frequency difference between the sliding window and other sliding windows is caused by the fact that part of frequencies of the ith sliding window image are lost due to defects, and therefore, the texture information of part of the cloth is not removed by filtering through the frequency intersection filtering, and is mistakenly identified as a defect, and the defect probability is improved.Indicating the defect probability of the ith sliding window.
Screening out sliding windows with possible defects through defect probability, and determining the defect probability of the sliding windowsConsidering the sliding window as defective, the threshold value is empirically determinedUsually 0.7 is taken.
The high contrast pixel area in the sliding window is the defect area.
As shown in fig. 3, the system for detecting textile surface defects of the present embodiment is disclosed, which includes an image preprocessing unit, a first calculating unit, a second calculating unit, a third calculating unit, a fourth calculating unit and a defect detecting unit;
the image preprocessing unit is used for acquiring a gray level image of the surface of the textile and preprocessing the gray level image to obtain a gradient image;
the first calculation unit is used for acquiring a point pair formed by every two pixel points in each direction of each pixel point in the gradient image, and calculating the point pair period length probability of each direction of the gray image by using the point pair length corresponding to the maximum frequency point pair in each direction;
the second calculation unit is used for taking the direction corresponding to the maximum value of the period length probability obtained by all the point pairs as the extension direction of the period, obtaining the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction;
the third calculation unit is used for performing sliding window on the gray level image by using a window with set parameters, acquiring a frequency domain space image of each sliding window image, and obtaining an intersection frequency value corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows;
the fourth calculation unit is used for respectively carrying out filtering processing on the sliding window image by using the intersection frequency value of each sliding window image and other sliding window images to obtain a filtering image of the sliding window image after filtering processing at different intersection frequency values;
and the defect detection unit is used for calculating the defect probability of each sliding window image by using the contrast value of each pixel point in all the filtering images corresponding to each sliding window image, and judging whether the sliding window image has defects or not according to the defect probability.
According to the technical means provided by the invention, the texture period information of the textile is obtained by analyzing the point pair texture information in the image, and the sliding window parameters are set by utilizing the period information, so that the further filtering treatment is carried out, the interference of the printing texture of the textile can be overcome, the defect area is accurately positioned, and the detection efficiency and the production quality are effectively improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (8)
1. A method for detecting textile surface defects, comprising:
acquiring a gray level image of the surface of the textile, and preprocessing the gray level image to obtain a gradient image;
acquiring a point pair formed by every two pixel points in each direction of each pixel point in the gradient image, and calculating the point pair period length probability of each direction of the gray image by using the point pair length corresponding to the maximum frequency point pair in each direction;
taking the direction corresponding to the maximum value of the period length probability obtained by all the point pairs as the extension direction of the period, obtaining the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction;
sliding windows are carried out on the gray level images by using windows with set parameters, frequency domain space images of all sliding window images are obtained, and intersection frequency values of two corresponding sliding window images are obtained according to the intersection of the frequency domain spaces of every two sliding windows;
respectively filtering the sliding window image by using the intersection frequency value of each sliding window image and other sliding window images to obtain a filtered image of the sliding window image after filtering at different intersection frequency values;
and calculating the defect probability of each sliding window image by using the contrast value of each pixel point in all the filtering images corresponding to each sliding window image, and judging whether the sliding window image has defects or not according to the defect probability.
2. A method of detecting textile surface defects according to claim 1, wherein the point-to-period length probability for each direction of the gray scale image is calculated as follows:
calculating the point pair length of the kth line point pair in each direction in the gray scale image by using the Euclidean distance between the starting point and the ending point, and acquiring the line point pair length corresponding to the maximum frequency in the s direction;
Similarly, calculating the lengths of all the point pairs in the direction perpendicular to the s-th direction starting from the k-th row to obtain the lengths of the column point pairs, and acquiring the frequency in the corresponding directionMaximum column point pair length;
The expression for calculating the cycle length probability in the s-th direction is:
wherein,represents the maximum frequency column point pair length in the direction perpendicular to the s-th angle from the k-th row,the s angular direction from the point pair of the k row is the first row, the point pair parallel to the lower i row has the maximum frequency point pair length in the s direction,represents the maximum frequency point pair length of the k-th row of point pairs in the s-th direction, N represents the total N rows of point pairs,and expressing the probability of the period length of the point pair in the s direction of the gray image.
3. A method of detecting textile surface defects as claimed in claim 2, wherein the method of setting the parameters of the sliding window in dependence on the period length and the period extension direction is as follows:
obtaining the angular direction with the largest period length probabilityAs the extension direction of the period, the row with the largest period length probability is obtainedAs the beginning of the cycle, choose fromGo out ofMaximum frequency point pair length of angular direction straight lineFor the length of the periodic line, will be perpendicular to the secondGo out ofMaximum frequency point pair length on angle direction straight line of angle directionAs the periodic column length;
4. The method for detecting textile surface defects of claim 1, wherein the method for obtaining the intersection frequency value corresponding to the two sliding window images comprises:
fourier transformation is carried out on each sliding window image to obtain a frequency domain space image corresponding to the sliding window image, intersection processing is carried out on the frequency domain space of any two sliding windows, and an intersection frequency value corresponding to the two sliding window images is obtained.
5. The method of claim 1, wherein the contrast value of each pixel point in all the filtered images corresponding to each sliding window image comprises:
6. The method for detecting textile surface defects of claim 5, wherein the defect probability corresponding to each sliding window is calculated according to the number of high-contrast pixel points in each sliding window, and the expression is as follows:
wherein,indicating the number of high contrast pixels in the neighborhood of the e-th high contrast pixel 8 in the filtered sliding window image of the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window,representing the total number of high contrast pixels within the sliding window,indicating the defect probability of the filtered sliding window image of the ith sliding window by using the frequency intersection of the ith sliding window and the jth sliding window.
7. A method as claimed in claim 6, wherein after calculating the probability of defects for each sliding window, the method further comprises:
calculating the comprehensive defect probability of the ith sliding window according to the filtered defect probability of the ith sliding window and the frequency intersection of each sliding window, wherein the expression is as follows:
wherein,indicating the probability of defects in an ith sliding window image filtered using an ith sliding window intersection with a jth sliding window,the defect probability of the filtered sliding window image obtained by filtering the kth sliding window by using the frequency intersection of the ith sliding window and the kth sliding window is shown, Q represents the number of the sliding windows,representing the integrated defect probability of the ith sliding window.
8. The textile surface defect detection system is characterized by comprising an image preprocessing unit, a first calculating unit, a second calculating unit, a third calculating unit, a fourth calculating unit and a defect detecting unit;
the image preprocessing unit is used for acquiring a gray level image of the surface of the textile and preprocessing the gray level image to obtain a gradient image;
the first calculation unit is used for acquiring a point pair formed by every two pixel points in each direction of each pixel point in the gradient image, and calculating the point pair period length probability of each direction of the gray image by using the point pair length corresponding to the maximum frequency point pair in each direction;
the second calculation unit is used for taking the direction corresponding to the maximum value of the period length probability obtained by all the point pairs as the extension direction of the period, obtaining the period length in the period extension direction, and setting a sliding window parameter according to the period length and the period extension direction;
the third calculation unit is used for performing sliding window on the gray level image by using a window with set parameters, acquiring a frequency domain space image of each sliding window image, and obtaining an intersection frequency value corresponding to two sliding window images according to the frequency domain space intersection of every two sliding windows;
the fourth calculation unit is used for respectively carrying out filtering processing on the sliding window image by using the intersection frequency value of each sliding window image and other sliding window images to obtain a filtering image of the sliding window image after filtering processing at different intersection frequency values;
and the defect detection unit is used for calculating the defect probability of each sliding window image by using the contrast value of each pixel point in all the filtering images corresponding to each sliding window image, and judging whether the sliding window image has defects or not according to the defect probability.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211044200.8A CN115131348B (en) | 2022-08-30 | 2022-08-30 | Method and system for detecting textile surface defects |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211044200.8A CN115131348B (en) | 2022-08-30 | 2022-08-30 | Method and system for detecting textile surface defects |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115131348A true CN115131348A (en) | 2022-09-30 |
CN115131348B CN115131348B (en) | 2022-11-15 |
Family
ID=83387648
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211044200.8A Active CN115131348B (en) | 2022-08-30 | 2022-08-30 | Method and system for detecting textile surface defects |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115131348B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115861310A (en) * | 2023-02-23 | 2023-03-28 | 深圳市富安娜艺术家居有限公司 | Method for detecting spinning defects on surface of bed sheet |
CN116721101A (en) * | 2023-08-09 | 2023-09-08 | 山东华航高分子材料有限公司 | Defect detection method for surface wave flow marks of plastic part |
CN116949732A (en) * | 2023-09-20 | 2023-10-27 | 济宁华晟服装股份有限公司 | Efficient ironing method for clothing production |
CN117132593A (en) * | 2023-10-25 | 2023-11-28 | 济宁华晟服装股份有限公司 | Cloth roughness detection method for resisting periodic texture influence |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114445387A (en) * | 2022-01-29 | 2022-05-06 | 泗阳富艺木业股份有限公司 | Fiberboard quality classification method based on machine vision |
CN114627111A (en) * | 2022-05-12 | 2022-06-14 | 南通英伦家纺有限公司 | Textile defect detection and identification device |
CN114723705A (en) * | 2022-03-31 | 2022-07-08 | 海门市恒创织带有限公司 | Cloth flaw detection method based on image processing |
CN114820610A (en) * | 2022-06-29 | 2022-07-29 | 数聚(山东)医疗科技有限公司 | Image processing-based defect detection method for new material medical instrument |
CN114820631A (en) * | 2022-07-04 | 2022-07-29 | 南通中豪超纤制品有限公司 | Fabric defect detection method capable of resisting texture interference |
CN114842007A (en) * | 2022-07-04 | 2022-08-02 | 南通东德纺织科技有限公司 | Textile wear defect detection method based on image processing |
-
2022
- 2022-08-30 CN CN202211044200.8A patent/CN115131348B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114445387A (en) * | 2022-01-29 | 2022-05-06 | 泗阳富艺木业股份有限公司 | Fiberboard quality classification method based on machine vision |
CN114723705A (en) * | 2022-03-31 | 2022-07-08 | 海门市恒创织带有限公司 | Cloth flaw detection method based on image processing |
CN114627111A (en) * | 2022-05-12 | 2022-06-14 | 南通英伦家纺有限公司 | Textile defect detection and identification device |
CN114820610A (en) * | 2022-06-29 | 2022-07-29 | 数聚(山东)医疗科技有限公司 | Image processing-based defect detection method for new material medical instrument |
CN114820631A (en) * | 2022-07-04 | 2022-07-29 | 南通中豪超纤制品有限公司 | Fabric defect detection method capable of resisting texture interference |
CN114842007A (en) * | 2022-07-04 | 2022-08-02 | 南通东德纺织科技有限公司 | Textile wear defect detection method based on image processing |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115861310A (en) * | 2023-02-23 | 2023-03-28 | 深圳市富安娜艺术家居有限公司 | Method for detecting spinning defects on surface of bed sheet |
CN116721101A (en) * | 2023-08-09 | 2023-09-08 | 山东华航高分子材料有限公司 | Defect detection method for surface wave flow marks of plastic part |
CN116721101B (en) * | 2023-08-09 | 2023-10-20 | 山东华航高分子材料有限公司 | Defect detection method for surface wave flow marks of plastic part |
CN116949732A (en) * | 2023-09-20 | 2023-10-27 | 济宁华晟服装股份有限公司 | Efficient ironing method for clothing production |
CN116949732B (en) * | 2023-09-20 | 2023-12-08 | 济宁华晟服装股份有限公司 | Efficient ironing method for clothing production |
CN117132593A (en) * | 2023-10-25 | 2023-11-28 | 济宁华晟服装股份有限公司 | Cloth roughness detection method for resisting periodic texture influence |
CN117132593B (en) * | 2023-10-25 | 2024-03-26 | 济宁华晟服装股份有限公司 | Cloth roughness detection method for resisting periodic texture influence |
Also Published As
Publication number | Publication date |
---|---|
CN115131348B (en) | 2022-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115131348B (en) | Method and system for detecting textile surface defects | |
CN114937055B (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
CN111179225B (en) | Test paper surface texture defect detection method based on gray gradient clustering | |
CN109685766B (en) | Cloth flaw detection method based on region fusion characteristics | |
CN109767445B (en) | High-precision PCB defect intelligent detection method | |
CN115330784B (en) | Cloth surface defect detection method | |
CN109540917B (en) | Method for extracting and analyzing yarn appearance characteristic parameters in multi-angle mode | |
CN110827235B (en) | Steel plate surface defect detection method | |
CN115100206B (en) | Printing defect identification method for textile with periodic pattern | |
CN113221861B (en) | Multi-lane line detection method, device and detection equipment | |
CN116630309B (en) | Cloth weft-break flaw detection method | |
CN115311507B (en) | Building board classification method based on data processing | |
CN115330795B (en) | Cloth burr defect detection method | |
CN107240086B (en) | A kind of fabric defects detection method based on integral nomography | |
CN110047063B (en) | Material drop detection method, device, equipment and storage medium | |
CN116523899A (en) | Textile flaw detection method and system based on machine vision | |
CN117635609B (en) | Visual inspection method for production quality of plastic products | |
CN113298769A (en) | FPC flexible flat cable appearance defect detection method, system and medium | |
CN113838038A (en) | Carbon fiber cloth cover defect detection method and device, electronic equipment and storage medium | |
CN116704516B (en) | Visual inspection method for water-soluble fertilizer package | |
CN114881960A (en) | Feature enhancement-based cloth linear defect detection method and system | |
CN110458809B (en) | Yarn evenness detection method based on sub-pixel edge detection | |
CN116109577A (en) | Printing label defect detection system and method | |
CN115311265A (en) | Loom intelligence control system based on weaving quality | |
CN110516725B (en) | Machine vision-based wood board stripe spacing and color detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |