CN-121577645-B - Wool fabric flaw detection method based on data analysis
Abstract
The invention relates to the technical field of fabric detection, in particular to a wool fabric flaw detection method based on data analysis, which comprises the following steps of illuminating wool fabric to be detected; the method comprises the steps of collecting a first surface image of a fabric, obtaining a texture roughness value of the first surface image of the fabric, adjusting an illumination incidence angle according to the texture roughness value, secondarily collecting a second surface image of the fabric according to the illumination incidence angle, obtaining histograms of gray level deviation values of a plurality of pixel positions of the second surface image of the fabric, determining a segmentation mode of a flaw area according to the histograms, wherein the segmentation mode comprises a bimodal characteristic valley segmentation mode and a non-bimodal characteristic threshold segmentation mode, segmenting the first flaw area according to the segmentation mode, adjusting the height of a light source according to the area of the first flaw area, obtaining a second flaw area, and obtaining flaw classification results. The invention realizes the improvement of the accuracy of identifying the defects of the fabric.
Inventors
- ZHENG JINHUA
- ZHENG QI
Assignees
- 张家港牧羊人服饰有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (10)
- 1. The wool fabric flaw detection method based on data analysis is characterized by comprising the following steps of: turning on a light source to illuminate the wool fabric to be detected; Collecting a first fabric surface image of the wool fabric to be detected; obtaining a texture roughness value of a local block of the first surface material image; adjusting the illumination incidence angle of the light source according to the texture roughness value; secondarily collecting a second surface image of the fabric according to the adjusted illumination incidence angle; acquiring histograms of gray level deviation values of a plurality of pixel positions of the second surface image; Determining a segmentation mode of a flaw area in the second surface image of the fabric according to the histogram of the gray level deviation value, wherein the segmentation mode comprises a bimodal characteristic valley segmentation mode and a non-bimodal characteristic threshold segmentation mode; dividing a plurality of first flaw areas of the second surface image according to the dividing mode; Adjusting the height of the light source according to the area of the first flaw area, and performing amplification shooting on the position of the first flaw area on the wool fabric to be detected to obtain a second flaw area; and classifying each flaw based on the first flaw area and/or the second flaw area corresponding to the first flaw area so as to obtain a final flaw classification result.
- 2. The method for detecting defects in a wool fabric based on data analysis according to claim 1, wherein obtaining texture roughness values of local areas of the first fabric surface image comprises: dividing the first surface image of the surface material into a plurality of local blocks with the same size; calculating the LBP value of each pixel point in each local block; The variance of the LBP values of a number of pixels within a single said local block is calculated as the texture roughness value of the single local block.
- 3. The method for detecting defects of wool fabric based on data analysis according to claim 2, wherein adjusting the illumination incidence angle of the light source according to the texture roughness value comprises: obtaining the maximum texture roughness value in the texture roughness values of a plurality of local blocks; Comparing the maximum texture roughness value with a preset roughness value; And if the maximum texture roughness value is greater than or equal to the preset roughness value, increasing the illumination incidence angle.
- 4. The method for detecting defects in a wool fabric based on data analysis according to claim 3, wherein the increase of the incident angle of illumination is determined according to the difference between the maximum texture roughness value and the preset roughness value.
- 5. The method for detecting defects in a wool fabric based on data analysis according to claim 4, wherein obtaining a histogram of gray scale deviation values for a plurality of pixel positions of the second fabric surface image comprises: Calculating the absolute value of the difference between the gray level of a single pixel point of the second surface image of the fabric and the gray level average value of all pixel points of a local block where the single pixel point is positioned, and recording the absolute value as the gray level deviation value; Dividing a continuous gray level deviation value sequence from small to large into a plurality of equally spaced intervals; and drawing the histogram according to the number of pixels of which the single gray level deviation value falls into an interval.
- 6. The method for detecting defects in a wool fabric based on data analysis according to claim 5, wherein determining the division manner of the defective region according to the histogram of the gray scale deviation values comprises: Obtaining a peak value in the histogram; If the peak value meets the double-peak condition, adopting the double-peak characteristic valley bottom segmentation mode; and if the peak value does not meet the bimodal condition, judging the pixel point with the gray level deviation value larger than or equal to a preset deviation value as a flaw.
- 7. The method for detecting defects of wool fabric based on data analysis according to claim 6, wherein the bimodal condition is that the heights of two existing local maximum peaks are equal to or greater than a preset height and the distance between the two local maximum peaks is equal to or greater than a preset distance.
- 8. The method for detecting defects of a wool fabric based on data analysis according to claim 7, wherein the bimodal characteristic valley bottom segmentation method is characterized in that a gray level deviation value corresponding to a lowest point between the two local maximum peaks is used as a segmentation value, and pixels with the gray level deviation value larger than the segmentation value are judged to be defects.
- 9. The method for detecting defects in a wool fabric based on data analysis according to claim 8, wherein adjusting the height of the light source according to the area of the first defective area comprises: Acquiring the areas of a plurality of first flaw areas; comparing the area of the first flaw area with a preset area; If the area of the first flaw area is smaller than or equal to the preset area, the height of the light source is increased.
- 10. The method for detecting defects in a wool fabric based on data analysis according to claim 9, wherein the increase of the height of the light source is determined according to the difference between the preset area and the area of the first defective area.
Description
Wool fabric flaw detection method based on data analysis Technical Field The invention relates to the technical field of fabric detection, in particular to a wool fabric flaw detection method based on data analysis. Background In the prior art, the defect detection of the wool fabric is performed by extracting textures, colors and shapes and then classifying the wool fabric by using a classifier or identifying the defect types by using an image classification model, the traditional defect detection mainly depends on manpower, and the problems of low efficiency, strong subjectivity and the like exist, so that the detection requirements of the modern textile industry on high precision and high speed cannot be met. The fabric flaw detection method based on AI vision comprises the following specific steps of S1, adopting an industrial linear array camera and a synchronous light source array, collecting high-speed and high-resolution images of fabrics in continuous production in real time, ensuring low noise and high definition of image data, providing high-quality basic images for subsequent processing, S2, carrying out noise filtering, histogram equalization and edge enhancement on the collected original images, remarkably improving flaw and background gray scale difference, outputting clear images as subsequent feature extraction input, S3, inputting an enhanced image into an improved ResNet multiscale convolutional neural network, extracting multi-level features of fabric textures, edges and potential flaws through optimizing a convolutional kernel and residual error structure, outputting a high-dimensional feature map, S4, embedding a residual attention mechanism into the feature map, intensively strengthening local suspected abnormal region features, outputting a region feature map with remarkably enhanced flaws, providing accurate flaw location for subsequent standard sample matching, S5, carrying out dynamic feature matching on the collected original images, carrying out dynamic feature screening on the feature map and the standard sample images, carrying out initial flaw detection by utilizing a dynamic feature matching mode, carrying out initial flaw detection by utilizing a threshold value, and a dynamic error correction mode, and carrying out initial flaw detection by adopting a dynamic error correction mode, and a dynamic error correction mode, wherein the initial flaw detection mode is based on a threshold value is used for detecting that a false error is 7, a false error is completely is detected, and a false error is detected by a dynamic error is based on a dynamic error is detected, and a dynamic error is a threshold value is detected, and a false error is detected by a dynamic error is completely is a dynamic threshold is a 7 is detected by a dynamic error is a threshold mode is a threshold is a detected, the method comprises the steps of color difference, yarn breakage, yarn jump and scarring, outputting a detection image and a statistical report in real time to realize visual presentation, and S9, comparing a detection result with a manual rechecking result, dynamically feeding back rechecking data to a training sample set, and updating a feature extraction and anomaly detection model in real time through online incremental learning to continuously optimize detection performance. Therefore, the fabric flaw detection method based on AI vision has the problems that the contrast of flaws and normal textures is low under illumination due to the wrinkles on the surface of the wool fabric, and the flaw identification accuracy is reduced due to shading and covering flaws. Disclosure of Invention Therefore, the invention provides a wool fabric flaw detection method based on data analysis, which is used for solving the problems of low contrast ratio of flaws and normal textures under illumination and flaw identification accuracy reduction caused by shadow coverage flaws due to wrinkling of the surface of the wool fabric in the prior art. In order to achieve the above purpose, the invention provides a wool fabric flaw detection method based on data analysis, comprising the following steps: turning on a light source to illuminate the wool fabric to be detected; Collecting a first fabric surface image of the wool fabric to be detected; obtaining a texture roughness value of a local block of the first surface material image; adjusting the illumination incidence angle of the light source according to the texture roughness value; secondarily collecting a second surface image of the fabric according to the adjusted illumination incidence angle; acquiring histograms of gray level deviation values of a plurality of pixel positions of the second surface image; Determining a segmentation mode of a flaw area in the second surface image of the fabric according to the histogram of the gray level deviation value, wherein the segmentation mode comprises a bimodal characteristic valley segmentation mode and a non-bim