CN115131348A - Method and system for detecting textile surface defects - Google Patents

Method and system for detecting textile surface defects Download PDF

Info

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
Application number
CN202211044200.8A
Other languages
Chinese (zh)
Other versions
CN115131348B (en
Inventor
唐琴
华真珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haimen Ximanting Textile Co ltd
Original Assignee
Haimen Ximanting Textile Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Haimen Ximanting Textile Co ltd filed Critical Haimen Ximanting Textile Co ltd
Priority to CN202211044200.8A priority Critical patent/CN115131348B/en
Publication of CN115131348A publication Critical patent/CN115131348A/en
Application granted granted Critical
Publication of CN115131348B publication Critical patent/CN115131348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30124Fabrics; 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

Method and system for detecting textile surface defects
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
Figure 942700DEST_PATH_IMAGE001
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
Figure 954780DEST_PATH_IMAGE002
The expression for calculating the cycle length probability in the s-th direction is:
Figure DEST_PATH_IMAGE003
wherein,
Figure 655889DEST_PATH_IMAGE004
represents the maximum frequency column point pair length in the direction perpendicular to the s-th angle from the k-th row,
Figure 614880DEST_PATH_IMAGE005
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,
Figure 22727DEST_PATH_IMAGE001
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,
Figure 907507DEST_PATH_IMAGE006
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 probability
Figure 263621DEST_PATH_IMAGE007
As the extension direction of the period, the row with the largest period length probability is obtained
Figure 790417DEST_PATH_IMAGE008
As the beginning of the cycle, choose from
Figure 787192DEST_PATH_IMAGE008
Go out of
Figure 875496DEST_PATH_IMAGE007
Maximum frequency point pair length of angle direction straight line
Figure 957722DEST_PATH_IMAGE009
For the length of the periodic line, will be perpendicular to the second
Figure 22629DEST_PATH_IMAGE008
Go out of
Figure 640955DEST_PATH_IMAGE007
Maximum frequency point pair length on angle direction straight line of angle direction
Figure 398695DEST_PATH_IMAGE010
As 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 direction
Figure 233796DEST_PATH_IMAGE011
The sliding window has the size of
Figure 72701DEST_PATH_IMAGE012
The sliding direction of the sliding window is
Figure 44069DEST_PATH_IMAGE013
Direction, sliding step length of the sliding window
Figure 972710DEST_PATH_IMAGE014
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 value
Figure 525133DEST_PATH_IMAGE015
And 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:
Figure 197423DEST_PATH_IMAGE016
wherein,
Figure DEST_PATH_IMAGE017
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,
Figure 118237DEST_PATH_IMAGE018
representing the total number of high contrast pixels within the sliding window,
Figure 483359DEST_PATH_IMAGE019
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:
Figure 856834DEST_PATH_IMAGE020
wherein,
Figure 332815DEST_PATH_IMAGE021
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,
Figure 13195DEST_PATH_IMAGE022
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,
Figure 785104DEST_PATH_IMAGE023
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 row
Figure 550935DEST_PATH_IMAGE024
In the angular direction, the pixels with the same gradient value are formed into a point pair, and the point pair is recorded as
Figure 565027DEST_PATH_IMAGE025
,
Figure 884536DEST_PATH_IMAGE026
Respectively representing the start and end positions of the pair.
Note that one pixel may have a plurality of dot pairs. For example as
Figure 591461DEST_PATH_IMAGE027
The value of the angle of the gradient is 23 degrees,at the pixel
Figure 844587DEST_PATH_IMAGE024
The other 6 pixels in the direction have 23 gradient angles, thus from the coordinate
Figure 898256DEST_PATH_IMAGE027
The number of starting point pairs is 7.
Counting the kth of the kth line
Figure 287649DEST_PATH_IMAGE028
Point 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
Figure 634317DEST_PATH_IMAGE029
. 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
Figure 141784DEST_PATH_IMAGE030
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 probability
Figure 497679DEST_PATH_IMAGE031
As the extension direction of the period, the row with the maximum period length probability in the direction is selected
Figure 7158DEST_PATH_IMAGE032
As the beginning of the cycle, choose from
Figure 26192DEST_PATH_IMAGE032
Go out of
Figure 253911DEST_PATH_IMAGE031
Length of point pair of angular direction line
Figure 147917DEST_PATH_IMAGE033
For the length of the periodic line, perpendicular to the slave
Figure 273087DEST_PATH_IMAGE032
Go out of
Figure 961558DEST_PATH_IMAGE031
Length of point pair on angle direction line of angle direction
Figure 676573DEST_PATH_IMAGE034
As 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 threshold
Figure 875735DEST_PATH_IMAGE035
The 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 windows
Figure 94227DEST_PATH_IMAGE036
The 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 of
Figure 219178DEST_PATH_IMAGE037
The Gaussian filter pair cloth gray level image
Figure 155910DEST_PATH_IMAGE038
Filtering to obtain processed picture
Figure 814555DEST_PATH_IMAGE039
Processing images with sober operators
Figure 389018DEST_PATH_IMAGE040
Obtaining a gradient image
Figure 419291DEST_PATH_IMAGE041
.
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 line
Figure 843319DEST_PATH_IMAGE024
In the angular direction, pixels with the same gradient value are grouped into a point pair, and the point pair is marked as
Figure 378425DEST_PATH_IMAGE025
,
Figure 571509DEST_PATH_IMAGE026
Respectively representing the starting and ending positions of the pair. Note: one pixel may have a plurality of point pairs. For example as
Figure 772683DEST_PATH_IMAGE027
At a value of 23 degrees for the gradient angle, at the pixel
Figure 684007DEST_PATH_IMAGE024
The other 6 pixels in the direction have a 23-gradient angle, and thus are from the coordinate
Figure 763084DEST_PATH_IMAGE027
The number of starting point pairs is 7. Obtaining point pair set by the method
Figure 76254DEST_PATH_IMAGE042
Analogy to this approach yields point pairs in the s-th angular direction for the remaining columns.
Counting the kth of the kth line
Figure 713908DEST_PATH_IMAGE028
Point 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
Figure 879573DEST_PATH_IMAGE029
. 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
Figure 260875DEST_PATH_IMAGE030
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
Figure 428552DEST_PATH_IMAGE001
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
Figure 472993DEST_PATH_IMAGE002
The expression for calculating the cycle length probability in the s-th direction is:
Figure 93330DEST_PATH_IMAGE043
wherein,
Figure 12745DEST_PATH_IMAGE004
denotes that the line k starts perpendicularly to the sThe most frequent column pair length in the angular direction,
Figure 34928DEST_PATH_IMAGE005
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,
Figure 775570DEST_PATH_IMAGE001
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,
Figure 883203DEST_PATH_IMAGE006
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 probability
Figure 606308DEST_PATH_IMAGE007
As the extension direction of the period, the row with the largest period length probability is obtained
Figure 984462DEST_PATH_IMAGE008
As the beginning of the cycle, choose from
Figure 400400DEST_PATH_IMAGE008
Go out of
Figure 995329DEST_PATH_IMAGE007
Maximum frequency point pair length of angular direction straight line
Figure 758011DEST_PATH_IMAGE009
For the length of the periodic line, will be perpendicular to the second
Figure 489207DEST_PATH_IMAGE008
Go out of
Figure 76046DEST_PATH_IMAGE007
Maximum frequency point pair length on angle direction straight line of angle direction
Figure 659736DEST_PATH_IMAGE010
As 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 direction
Figure 724644DEST_PATH_IMAGE011
The sliding window has the size of
Figure 310347DEST_PATH_IMAGE012
The sliding direction of the sliding window is
Figure 68087DEST_PATH_IMAGE013
Direction, sliding step length of the sliding window is
Figure 156652DEST_PATH_IMAGE014
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 value
Figure 25250DEST_PATH_IMAGE015
And 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:
Figure 996617DEST_PATH_IMAGE044
wherein,
Figure 161145DEST_PATH_IMAGE017
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,
Figure 217963DEST_PATH_IMAGE018
representing the total number of high contrast pixels within the sliding window,
Figure 624673DEST_PATH_IMAGE019
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,
Figure 952012DEST_PATH_IMAGE045
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:
Figure 51555DEST_PATH_IMAGE046
wherein,
Figure 861248DEST_PATH_IMAGE021
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,
Figure 838693DEST_PATH_IMAGE022
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,
Figure 784652DEST_PATH_IMAGE023
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,
Figure 55097DEST_PATH_IMAGE047
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,
Figure 582112DEST_PATH_IMAGE022
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.
Figure 65046DEST_PATH_IMAGE023
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 windows
Figure 131091DEST_PATH_IMAGE036
Considering the sliding window as defective, the threshold value is empirically determined
Figure 73902DEST_PATH_IMAGE048
Usually 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
Figure 178179DEST_PATH_IMAGE001
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
Figure 199224DEST_PATH_IMAGE002
The expression for calculating the cycle length probability in the s-th direction is:
Figure 588618DEST_PATH_IMAGE003
wherein,
Figure 935285DEST_PATH_IMAGE004
represents the maximum frequency column point pair length in the direction perpendicular to the s-th angle from the k-th row,
Figure 911594DEST_PATH_IMAGE005
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,
Figure 1909DEST_PATH_IMAGE001
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,
Figure 980230DEST_PATH_IMAGE006
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 probability
Figure 497799DEST_PATH_IMAGE007
As the extension direction of the period, the row with the largest period length probability is obtained
Figure 961403DEST_PATH_IMAGE008
As the beginning of the cycle, choose from
Figure 324252DEST_PATH_IMAGE008
Go out of
Figure 422658DEST_PATH_IMAGE007
Maximum frequency point pair length of angular direction straight line
Figure 845549DEST_PATH_IMAGE009
For the length of the periodic line, will be perpendicular to the second
Figure 796449DEST_PATH_IMAGE008
Go out of
Figure 697409DEST_PATH_IMAGE007
Maximum frequency point pair length on angle direction straight line of angle direction
Figure 915901DEST_PATH_IMAGE010
As 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 direction
Figure 509694DEST_PATH_IMAGE011
The sliding window has the size of
Figure 180846DEST_PATH_IMAGE012
The sliding direction of the sliding window is
Figure 912261DEST_PATH_IMAGE013
Direction, sliding step length of the sliding window
Figure 719680DEST_PATH_IMAGE014
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:
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 value
Figure 749953DEST_PATH_IMAGE015
And taking the pixel points with the contrast ratio larger than the first threshold value as high-contrast pixel points.
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:
Figure 908402DEST_PATH_IMAGE016
wherein,
Figure 918208DEST_PATH_IMAGE017
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,
Figure 845713DEST_PATH_IMAGE018
representing the total number of high contrast pixels within the sliding window,
Figure 46887DEST_PATH_IMAGE019
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:
Figure 692632DEST_PATH_IMAGE020
wherein,
Figure 506130DEST_PATH_IMAGE021
indicating the probability of defects in an ith sliding window image filtered using an ith sliding window intersection with a jth sliding window,
Figure 553720DEST_PATH_IMAGE022
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,
Figure 925796DEST_PATH_IMAGE023
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.
CN202211044200.8A 2022-08-30 2022-08-30 Method and system for detecting textile surface defects Active CN115131348B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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