Method and system for detecting fabric defects
By employing methods such as periodic matching and morphological processing, the problem of the inability to detect defects in checkered fabrics in existing technologies has been solved, achieving efficient and accurate defect detection and reducing costs.
Patent Information
- Application Number
- CN202211041417.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Existing detection technologies cannot effectively detect defects in checkered fabrics with patterned cycles, resulting in insufficient detection accuracy and cost-effectiveness.
We employ a combination of periodic matching, transform filtering, block edge removal, feature extraction, binary segmentation, and contour recognition, along with histogram matching, maximum entropy threshold segmentation, and morphological processing, to extract and identify fabric defect features.
It has achieved high-quality and stable detection of defects in checkered fabrics, reduced detection costs, and improved detection accuracy and efficiency.
Smart Images

Figure CN115393325B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital image processing and defect detection technology, specifically to a method and system for detecting fabric defects, and more particularly to a method and system for detecting defects in checkered fabrics based on periodic segmentation and template subtraction. Background Technology
[0002] With the rapid development of digital image processing technology, computer vision technology has been widely used in the field of industrial defect detection. In recent years, the application theories and technologies of pattern recognition, artificial intelligence and image processing have been greatly developed. Algorithms such as two-dimensional Fourier transform, wavelet transform, artificial neural network and Bayesian model classification have been applied to the texture representation and defect identification of fabrics. However, most existing algorithms are only for raw fabrics, and their application to patterned fabrics with periodic patterns is still difficult and remains in the experimental exploration stage.
[0003] Checkered fabric is made of yarns of two or more colors interwoven together. The dyeing of the yarns in the bottom layer and the density of the interweaving will affect the texture and color uniformity of the fabric.
[0004] Therefore, in order to build a relevant system and apply it to actual industrial production, it is necessary to provide an improved fabric defect detection technology based on the shortcomings of existing technologies. This technology can effectively solve the problem that existing detection technologies cannot detect defects in checkered fabrics with pattern cycles, and achieve stable quality, accurate detection, and cost savings. This has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The problem that the invention aims to solve
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for detecting fabric defects, effectively solving the problem that existing detection technologies cannot detect defects in checkered fabrics with pattern cycles.
[0007] Methods for solving problems
[0008] The first aspect of this invention relates to a method for detecting fabric defects, comprising the following steps:
[0009] The periodic matching step involves acquiring and creating multiple detection images of the fabric, detecting the positional period of the fabric pattern based on the histogram matching method, and obtaining the matching results of the longitudinal periodic positions of the detection images.
[0010] The transformation filtering step converts the detection image to the frequency domain through a two-dimensional discrete Fourier transform, and then filters out high-frequency noise that interferes with the detection image, thereby reducing the regularity of the fabric texture.
[0011] The block-based edge removal step involves dividing and removing edges from the periodic unit regions of the detection image according to the matching results, thereby dividing the detection image into cells.
[0012] The extraction and filtering step involves extracting the texture period within the cell and performing mean filtering to further optimize noise interference.
[0013] In the feature extraction step, a mean template is automatically generated according to the cell, and the difference between the detected image and the mean template is calculated to extract the information of defect features.
[0014] In the binary segmentation step, the maximum entropy threshold segmentation method is used to binarize the result of the subtraction difference operation to enhance the information of defect features.
[0015] The morphological processing step involves performing morphological operations on the defect features to integrate the defect information and remove some noise interference to obtain the defect feature image.
[0016] The contour recognition step involves detecting the defect feature image through the connected component contour recognition method, determining the contour size and location of the defect, and outputting the defect detection result on the detection image.
[0017] Preferably, in the periodic matching step, the histogram correlation coefficient is used as the matching basis to detect the position period of the fabric pattern based on the histogram matching method.
[0018] Preferably, in the transformation filtering step, the filter is a Gaussian low-pass filter.
[0019] Preferably, in the extraction and filtering step, an autocorrelation function is used to identify the texture period within the cell to extract and perform mean filtering on the texture period within the cell.
[0020] Preferably, in the feature extraction step, a mean template is automatically generated for each cell by calculating the mean gray value.
[0021] Preferably, in the binary segmentation step, the maximum entropy threshold segmentation method is implemented by calculating the probability distribution entropy.
[0022] A second aspect of the present invention relates to a fabric defect detection system, comprising:
[0023] The periodic matching unit acquires and produces multiple detection images of the fabric, detects the position period of the fabric pattern based on the histogram matching method, and obtains the matching result of the longitudinal periodic position of the detection image.
[0024] The transformation filtering unit converts the detection image to the frequency domain through two-dimensional discrete Fourier transform, and then separates the interference of high-frequency noise on the detection image through filter operation, so as to reduce the regularity of the fabric texture.
[0025] The block edge removal unit divides and removes edges from the periodic unit region of the detection image according to the matching results, thereby dividing the detection image into cells.
[0026] The extraction and filtering unit performs texture period extraction and mean filtering operations on the cell to further optimize noise interference.
[0027] The feature extraction unit automatically generates a mean template based on the cell, and performs a subtraction difference operation between the detection image and the mean template to extract information about defect features;
[0028] The binary units are segmented, and the result of the subtraction difference operation is binarized using the maximum entropy threshold segmentation method to enhance the information of defect features.
[0029] The morphological processing unit performs morphological operations on the defect features to integrate the defect information and remove some noise interference to obtain the defect feature image.
[0030] The contour recognition unit detects the defect feature image through the connected component contour recognition method, determines the contour size and location of the defect, and outputs it as the defect detection result on the detection image.
[0031] The effects of the invention
[0032] The fabric defect detection method and system of the present invention effectively solves the technical problem of excessively high image quality requirements in existing detection technologies, and achieves stable quality, accurate detection, and cost savings. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating the steps of the fabric defect detection method according to the first embodiment of the present invention.
[0034] Figure 2 This is a schematic diagram of the image histogram matching position in the first embodiment.
[0035] Figure 3 This is a schematic diagram of the parameter model of the Gaussian filter in the first embodiment.
[0036] Figure 4 This is a schematic diagram of the filtering results in the first embodiment.
[0037] Figure 5 This is a schematic diagram of the image periodic unit segmentation result in the first embodiment.
[0038] Figure 6 This is a schematic diagram of the pixel region for the periodic unit edge removal operation in the first embodiment.
[0039] Figure 7 This is a schematic diagram of the mean filtering result within the unit period in the first embodiment.
[0040] Figure 8 This is a schematic diagram of generating the mean template in the first embodiment.
[0041] Figure 9 This is a schematic diagram of the image subtraction result in the first embodiment.
[0042] Figure 10 This is a schematic diagram of the maximum entropy threshold segmentation result in the first embodiment.
[0043] Figure 11 This is a schematic diagram of the image resulting from the morphological operation in the first embodiment.
[0044] Figure 12 This is a schematic diagram of the final result output in the first embodiment.
[0045] Figure 13 This is a schematic diagram of a fabric defect detection system according to a second embodiment of the present invention. Detailed Implementation
[0046] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0048] Figure 1 This is a flowchart illustrating the defect detection method according to the first embodiment of the present invention. Figure 1As shown, the defect detection method includes the following steps: Periodic matching step S1: In this step, multiple fabric detection images are acquired and produced. The position period of the fabric pattern is detected based on the histogram matching method to obtain the matching result of the longitudinal periodic position of the detection image. Transformation filtering step S2: In this step, the detection image is transformed to the frequency domain through a two-dimensional discrete Fourier transform. High-frequency noise interference to the detection image is separated through filter operations to reduce the regularity of the fabric texture. Block segmentation and edge removal step S3: In this step, according to the matching result, the periodic unit region of the detection image is segmented and edge-removed to divide the detection image into cells. Extraction filtering step S4: In this step, the texture period within the cell is extracted and mean filtered to further optimize noise interference. Feature extraction step S5: In this step, a mean template is automatically generated according to the cell. The detection image and the mean template are subtracted to extract the defect feature information. In the segmentation and binarization step S6, the result of the subtraction difference operation is binarized using the maximum entropy threshold segmentation method to enhance the information of the defect features. In the morphological processing step S7, morphological operations are performed on the defect features to integrate the defect information and remove some noise interference to obtain the defect feature image. In the contour recognition step S8, the defect feature image is detected using connected component contour recognition to determine the contour size and location of the defects, which is then output as the defect detection result on the detection image.
[0049] More specifically, the execution method of the periodic matching step S1 is as follows.
[0050] First, using flawless fabric as a sample for template making, starting from a complete vertical cycle position, collect and create multiple consecutive images with equal pixel intervals at different positions as matching templates, so that the pixel size of the collected images satisfies n cycles in both the horizontal and vertical directions.
[0051] Matching the positional periodic template of the input image. The method is as follows: extract samples of the four corner regions of the image. Extract the positions of the eight corner points of the input image and the eight corner points of the i-th template, and then... Figure 2 The 16 regions shown are then cropped. The vertical position meets the size of the minimum periodic unit, and 25 pixels are removed from each boundary in the horizontal position to reduce boundary error, so that the pixel size is 300px*250px. Histogram similarity comparison is then performed, where (i=1,2,3…n), and n is the number of templates. In this embodiment, n=50.
[0052] The histogram correlation coefficient is used as the basis for template matching, and its formula is as follows:
[0053]
[0054]
[0055] In the formula, d(H1,H2) represents the correlation coefficient between histograms H1 and H2, and N is the number of bins in the histogram. It is the mean.
[0056] The similarity comparison method is as follows: After converting the three-channel feature values of the image BGR to the HSV color space, the corresponding histograms of the sample and template are calculated and normalized to the same scale space. The correlation is calculated using the correlation coefficient formula in statistics. Eight sets of data results of matching the corresponding positions of 16 regions are taken, the maximum and minimum values are removed and weighted average is calculated, and the template with the maximum similarity is used as the template of the detection image.
[0057] To prevent defects in the region from affecting the judgment result, the maximum and minimum values of the 8 regions are removed and weighted averaged to obtain the final corresponding longitudinal period position matching numerical result. The template with the maximum similarity is then used as the position recognition result of the detected image.
[0058] More specifically, the specific execution method of the transform filtering step S2 is as follows.
[0059] First, the detected image is transformed to the frequency domain using a two-dimensional discrete Fourier transform, and then a filter is set to filter and separate the information content from the interference.
[0060] The formula for the two-dimensional discrete Fourier transform (DFT) is:
[0061]
[0062] e ix =cosx + isinx (4)
[0063] In formula (3), F(k,l) represents the Fourier transform of f(I,j), f is the image value in the spatial domain, and F is the image value in the frequency domain. Formula (4) is Euler's formula.
[0064] Secondly, a Gaussian low-pass filter is set up, with the parameter model as follows: Figure 3 As shown, filtering out high-frequency information with periodic patterns in the image and enhancing low-frequency irregular information reduces the interference of fabric texture on defect information judgment. The processing result is as follows. Figure 4 As shown.
[0065] High-frequency noise is removed by filtering a frequency domain image using a Gaussian low-pass filter, and its transfer function is defined as:
[0066]
[0067] Where D0 is the cutoff frequency, and D(u,v) is the distance from the center of the frequency rectangle. The width of the Gaussian filter is characterized by the parameter D0, which determines the smoothness. The larger D0 is, the wider the bandwidth of the Gaussian filter and the better the smoothness.
[0068] More specifically, the specific execution method of the block edge removal step S3 is as follows.
[0069] Based on the period of the template matched in step one, the period of the image being inspected is divided, and the result is as follows: Figure 5 As shown.
[0070] Then, the edges at the intersection of the divided units are removed.
[0071] The complete periodic region in the middle part of the image, such as Figure 6 As shown, taking a 300px*300px captured image period cell as an example, it is cropped to a 270px*270px monochrome cell area to remove the area boundary.
[0072] For incomplete periodic regions at the top and bottom of the image, based on the actual segmented pixel size, remove 15px pixels from each boundary. If the vertical pixel size of the incomplete period is no more than 30px, then ignore this part of the incomplete period.
[0073] More specifically, the specific execution method of the extraction filtering step S4 is as follows.
[0074] Take any set of non-repeating minimum periodic unit images from the matching template, and use the autocorrelation function to identify the periodicity of the fabric texture within the minimum periodic unit block, based on the discrete sequence correlation calculation formula in Equation 3.
[0075] The correlation formula for discrete sequences is:
[0076]
[0077] In the formula, r(n) is the cross-correlation function, reflecting the similarity between vector x(k) and shift vector y(k), and is a lag function, with n being a parameter. Based on the horizontal and vertical texture period sizes, the parameters of the mean filter kernel are set, and mean filtering is performed to reduce the fabric texture period and uniformly decrease the color difference within the periodic unit blocks. The processed detection image is shown below. Figure 7 As shown.
[0078] More specifically, the specific execution method of feature extraction step S5 is as follows.
[0079] To highlight the texture information of defects and remove the influence of differences in colored backgrounds, the local grayscale statistics within the smallest periodic unit block are used as a description of the region's mean color and illumination. The mean pixel grayscale statistics within the segmented periodic unit block are calculated, and a mean template image for that location is automatically generated. The effect is as follows: Figure 8 As shown.
[0080] The average gray value of a monochrome grid region within a periodic unit of an image is calculated using the following formula:
[0081]
[0082]
[0083] In the formula, p(z) k ) represents the gray level z in the image. k The probability of occurrence, n k It is grayscale z k The number of times a pixel appears in the image, MN is the total number of pixels. m is the average gray value of the image pixels, k = 0, 1, 2, ..., L-1 represents all possible gray values in the digital image, and L is the number of pixels.
[0084] Image pixel grayscale subtraction difference operation:
[0085] dst(I)c=abs(src1(I)c-src2(I)c) (9)
[0086] dst is the output matrix, and src1 and src2 are the two input matrices, respectively.
[0087] According to Equation 4, the grayscale values of corresponding pixels in the detected image and the mean template image are subtracted. The absolute value of the difference is then used as the grayscale image output, generating a feature image of the defect information. The result is as follows: Figure 9 As shown.
[0088] More specifically, the specific execution method of the binary segmentation step S6 is as follows.
[0089] Binarization is performed using the maximum entropy thresholding method. Based on the global calculation of the gray-level probability density distribution of the image, the optimal segmentation threshold is sought to maximize the sum of the entropy values of the foreground and background. The segmented image extracts blemish features from key defect areas and eliminates interference from background information such as noise. The results are as follows: Figure 10 As shown.
[0090] The formula for calculating the entropy of a probability distribution is:
[0091]
[0092]
[0093] In the formula, H(T) and H(B) are the formulas for calculating the background and foreground probability distribution entropy, respectively, and Pn, 1-Pn
[0094] These are the cumulative probabilities of background and foreground pixels segmented by threshold t, respectively, and their sum is 1. It is a probability grayscale distribution. T is a distribution of i∈{0,1,...,t}, and B is a distribution of i∈{t+1,...,L-1}.
[0095] Let φ(t) be the sum of H(T) and H(B), then
[0096] φ(t)=H(T)+H(B) (12)
[0097] φ(t) represents the total entropy of the image, and the threshold value t for threshold segmentation is arg. t maxφ(t).
[0098] Furthermore, the formula for calculating entropy can also be defined as:
[0099]
[0100] In the formula, the estimated probability density function p(g) refers to the probability of each gray level g occurring in the image grayscale, g = I(u,v) is the gray value in the u-th row and v-th column of the matrix, log b (x) denotes the logarithmic function of x to the base b. H() is always a positive number greater than 0, and p(g) ranges from [0,1] for any logarithm logb. b (x) is always less than or equal to 0.
[0101] More specifically, the specific execution method of morphological processing step S7 is as follows.
[0102] Morphological operations are performed on defect information to integrate discrete defect information within a region. The structural elements of the defect feature image are extracted as the operation kernel, and a dilation-erosion closing operation is performed on the image to connect partially adjacent scattered information and fuse the overall features of the defects.
[0103] Next, a threshold is set based on the area of the connected components, and area filtering is performed. In this example, the area connected component parameter is set to 150px to remove noise and other small area interference smaller than the minimum defect feature connected component. The result is as follows. Figure 11 As shown.
[0104] More specifically, the specific execution method of contour recognition step S8 is as follows.
[0105] The defect contours are identified and detected, the smallest bounding box is drawn, and the bounding box is marked on the color input image as the final detection result output. Figure 12 As shown.
[0106] The fabric defect detection method of the first embodiment solves the technical problem of excessively high image quality requirements in existing detection technologies compared with previous processes, and achieves stable quality, accurate detection and cost savings.
[0107] (Example)
[0108] The following is for reference Figures 2-12 An embodiment of the present invention will be described below.
[0109] Step 1: Using a flawless piece of fabric as a sample for creating the template, collect 50 consecutive images at equally spaced pixel intervals at different locations as the matching template. The pixel size of the collected images should satisfy n periods both horizontally and vertically. In this example, the collected image size is 3000px * 1800px, and the smallest period unit size is 300px * 300px. Therefore, the template image contains 10 smallest period units horizontally and at least 5 complete smallest period units vertically. Since a vertical period of 600px constitutes one image collection period, images are collected every 12px starting from the complete period position to create the flawless template.
[0110] The image is sampled for the four corner regions. Eight corner points of the input image and the i-th template are extracted, resulting in 16 regions. These regions are then cropped to meet the minimum periodic unit size of 300px vertically and have 25 pixels removed from each horizontal boundary to reduce boundary error, resulting in a pixel size of 300px * 250px. Histogram similarity is then compared, where (i = 1, 2, 3…n), and n is the number of templates; in this example, n = 50.
[0111] According to the calculation formula (1), the calculation results of the eight regions of the example input image and the 10th template are as follows: 0.985421, 0.772881, 0.982031, 0.983192, 0.977481, 0.788631, 0.975305, 0.980612. The result after removing the maximum and minimum values and taking the weighted average is: 0.947875. This result is the maximum value of the matching results of 50 templates. Therefore, the 10th template image is the optimal matching template result.
[0112] Step 2: First, the detected image is transformed into the frequency domain using a two-dimensional discrete Fourier transform, and the filter function is multiplied by the DFT result.
[0113] Next, set up a Gaussian low-pass filter with a filter width parameter D0 of 50. The parameter model is as follows: Figure 3 As shown, based on the transfer function defined by formula (5), high-frequency information with periodic regularity in the image is filtered out, low-frequency irregular information in the image is enhanced, and the interference of fabric texture on the judgment of defect information is weakened. The processing result is as follows: Figure 4 As shown.
[0114] Step 3: First, according to the period of the template matched in Step 1, divide the period of the image being inspected, as shown in the following figure. Figure 5 As shown.
[0115] Next, edge removal is performed on the boundaries of the segmented units. The complete periodic region in the middle of the image, such as... Figure 6 As shown, taking a 300px*300px captured image period cell as an example, it is cropped to a 270px*270px monochrome grid area to remove the area boundary. For incomplete period areas at the top and bottom of the image, based on the actual segmented pixel size, 15px pixels are removed from each boundary. If the vertical pixel size of the incomplete period is no more than 30px, this part of the incomplete period is ignored.
[0116] Step 4: Take any set of non-repeating minimum periodic unit images from the matching template. Based on the calculation formula of discrete sequence correlation in formula (6), use the autocorrelation function to identify the periodicity of the fabric texture within the minimum periodic unit block.
[0117] The correlation coefficient between pixels is calculated within the smallest periodic unit. Based on the calculation results above, with the horizontal coordinate as the pixel position and the vertical coordinate as the correlation coefficient, the extreme coordinates of the horizontally separated regions are: [0,1],[29,0.971],[58,0.967],[84,0.957],[113,0.959],[142,0.971].
[0118] Similarly, using the horizontal axis as the correlation coefficient and the vertical axis as the pixel position, the extreme coordinates of the vertically spaced regions can be obtained as follows:
[0119] [1,0],[0.981,24],[0.982,48],[0.978,72],[0.976,96],[0.977,120].
[0120] From the above data, it can be seen that within the smallest periodic unit, the fabric texture period is [29, 24]. Setting the mean filter kernel size to [29, 24] and performing mean filtering reduces the fabric texture period and uniformly decreases the color difference within the periodic unit block. The processed detection image is as follows: Figure 7 As shown.
[0121] Step 5: Using the local grayscale statistics within the smallest periodic unit block as a description of the region's mean color and illumination, calculate the mean pixel grayscale statistics within the segmented periodic unit block, and automatically generate the mean template image for that location. The effect is as follows: Figure 8 As shown. The image pixel grayscale subtraction difference operation uses the above calculation formula (9).
[0122] According to formula (9), the difference between the gray levels of corresponding pixel positions in the detected image and the mean template image is calculated. The absolute value of the difference is then used as the grayscale image output to generate a feature image of the defect information. The result is as follows: Figure 9 As shown.
[0123] Step 6: Perform binarization using the maximum entropy thresholding method. Based on the global calculation of the probability density distribution of gray levels in the image, seek the optimal segmentation threshold to maximize the sum of the entropy values of the foreground and background.
[0124] The formulas for calculating the probability distribution entropy are the above formulas (10), (11), and (12).
[0125] Based on the above formula, the threshold value t for threshold segmentation is found to be arg. t maxφ(t). According to the calculation results, when t=35, the foreground entropy (frontEntropy) is 3.39518, the background entropy (backEntropy) is 2.47355, and the maximum entropy (maxEntropy) is 5.86873.
[0126] Image segmentation using a threshold t extracts defect features from key defect areas, eliminating interference from background information such as noise. The results are as follows: Figure 10 As shown.
[0127] Step 7: Perform morphological operations on the defect information to integrate the discrete defect information within the region. Extract the structural elements of the defect feature image as the operation kernel, set it as a rectangular kernel with a size of [50, 50], and the anchor point is located at the center point. Perform a dilation-erosion closing operation on the image to connect the scattered information of some adjacent parts and fuse the overall features of the defects.
[0128] Next, a threshold is set based on the area of the connected components, and area filtering is performed. In this example, the area connected component parameter is set to 150px to remove noise and other small area interference smaller than the minimum defect feature connected component. The result is as follows. Figure 11 As shown.
[0129] Step 8: Identify and detect the defect contours, draw the smallest bounding box, and mark it on the color input image as the final detection result output, such as... Figure 12 As shown.
[0130] After adopting the template matching method in the above embodiments, the detection is convenient and fast, does not rely on a large hardware system, has a lower detection cost, has higher recognition efficiency and stability, can improve the feature value error caused by uneven global illumination of the image, and can extract the feature contour information of the defect, with a more accurate ability to locate the defect location range, overcoming the shortcomings of existing detection technologies that cannot detect defects in checkered fabrics with patterned periods.
[0131] Figure 13 This is a schematic diagram of a fabric defect detection system according to a second embodiment of the present invention. Figure 13 As shown, the detection system includes the following components: Periodic matching unit 1, which performs cropping, segmentation, and histogram equalization on the template image, and then calculates the feature values of the template image by analyzing the statistical values of the gray-level co-occurrence matrix features. Transform filtering unit 2, which creates templates by segmenting the image based on the feature values obtained in feature value calculation unit 1. Detection image processing unit 3, which performs cropping, segmentation, and histogram equalization on the detection image after it has been captured by a camera, and then calculates the feature values of each segment of the detection image by analyzing the statistical values of the gray-level co-occurrence matrix features. Template matching unit 4, which reads the template information of each segmented detection image, inputs the feature values of that segment into the model, and determines whether the segment is a defective segment.
[0132] Since the detection system of the second embodiment is a detection system corresponding to the detection method of the first embodiment, the various details and variations of the first embodiment also apply to the second embodiment, and will not be repeated here.
[0133] Industrial application
[0134] The fabric defect detection method and system of the present invention effectively solves the problem that existing detection technologies cannot detect defects in checkered fabrics with pattern cycles, achieving stable quality, accurate detection, and cost savings.
[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting fabric defects, characterized in that, Includes the following steps: The periodic matching step involves acquiring and creating multiple detection images of the fabric, detecting the positional period of the fabric pattern based on the histogram matching method, and obtaining the matching results of the longitudinal periodic positions of the detection images. The transformation filtering step converts the detection image to the frequency domain through a two-dimensional discrete Fourier transform, and then filters out high-frequency noise that interferes with the detection image, thereby reducing the regularity of the fabric texture. The block-based edge removal step involves dividing and removing edges from the periodic unit regions of the detection image according to the matching results, thereby dividing the detection image into cells. The extraction and filtering step involves extracting the texture period within the cell and performing mean filtering to further optimize noise interference. In the feature extraction step, a mean template is automatically generated according to the cell, and the difference between the detected image and the mean template is calculated to extract the information of defect features. In the binary segmentation step, the maximum entropy threshold segmentation method is used to binarize the result of the subtraction difference operation to enhance the information of defect features. The morphological processing step involves performing morphological operations on the defect features to integrate the defect information and remove some noise interference to obtain the defect feature image. The contour recognition step involves detecting the defect feature image through the connected component contour recognition method, determining the contour size and location of the defect, and outputting the defect detection result on the detection image.
2. The method for detecting fabric defects according to claim 1, characterized in that, In the periodic matching step, the histogram correlation coefficient is used as the matching basis to detect the position period of the fabric pattern based on the histogram matching method.
3. The method for detecting fabric defects according to claim 1, characterized in that, In the transform filtering step, the filter is a Gaussian low-pass filter.
4. The method for detecting fabric defects according to claim 1, characterized in that, In the extraction and filtering step, the autocorrelation function is used to identify the texture period within the cell to extract and perform mean filtering on the texture period within the cell.
5. The method for detecting fabric defects according to claim 1, characterized in that, In the feature extraction step, a mean template is automatically generated for each cell by calculating the mean gray value.
6. The method for detecting fabric defects according to claim 1, characterized in that, In the binary segmentation step, the maximum entropy threshold segmentation method is implemented by calculating the probability distribution entropy.
7. A fabric defect detection system, characterized in that, include: The periodic matching unit acquires and produces multiple detection images of the fabric, detects the position period of the fabric pattern based on the histogram matching method, and obtains the matching result of the longitudinal periodic position of the detection image. The transformation filtering unit converts the detection image to the frequency domain through two-dimensional discrete Fourier transform, and then separates the interference of high-frequency noise on the detection image through filter operation, so as to reduce the regularity of the fabric texture. The block edge removal unit divides and removes edges from the periodic unit region of the detection image according to the matching results, thereby dividing the detection image into cells. The extraction and filtering unit performs texture period extraction and mean filtering operations on the cell to further optimize noise interference. The feature extraction unit automatically generates a mean template based on the cell, and performs a subtraction difference operation between the detection image and the mean template to extract information about defect features; The binary units are segmented, and the result of the subtraction difference operation is binarized using the maximum entropy threshold segmentation method to enhance the information of defect features. The morphological processing unit performs morphological operations on the defect features to integrate the defect information and remove some noise interference to obtain the defect feature image. The contour recognition unit detects the defect feature image through the connected component contour recognition method, determines the contour size and location of the defect, and outputs it as the defect detection result on the detection image.
Citation Information
Patent Citations
A cloth defect detection method based on Fourier transform and image morphology
CN109934802A
Cloth defect detection method using hierarchical gradient direction histogram and support vector machine
CN110580698A