A wool fabric defect detection method based on data analysis

By adjusting the incident angle and height of the light source, and combining the analysis of texture roughness and grayscale deviation, an adaptive segmentation strategy was adopted to solve the problems of low contrast and shadow occlusion in the detection of defects in wool fabrics, thus achieving high-precision defect recognition and segmentation.

CN121577645BActive Publication Date: 2026-05-08ZHANGJIAGANG SHEPHERD INC
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHANGJIAGANG SHEPHERD INC
Filing Date
2026-01-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, the detection of defects in wool fabrics suffers from low contrast between defects and normal texture under light due to surface wrinkles, and the shadows covering the defects lead to a decrease in recognition accuracy.

Method used

By adjusting the incident angle and height of the light source, and combining the analysis of the texture roughness and grayscale deviation values ​​of local blocks, a bimodal characteristic valley segmentation strategy and a non-bimodal threshold segmentation method are adopted to segment out the defective area and perform optical magnification imaging.

Benefits of technology

It improves the accuracy and segmentation precision of defect detection in wool fabrics, reduces the masking of defect features by texture shadows, enhances the visibility of low-contrast defects, and compensates for the loss of small defect details in long-distance imaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121577645B_ABST
    Figure CN121577645B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of fabric detection, and more particularly to a wool fabric defect detection method based on data analysis, comprising: illuminating the wool fabric to be detected; collecting a first fabric surface image; obtaining a texture roughness value of the first fabric surface image; adjusting the light incidence angle according to the texture roughness value; collecting a second fabric surface image according to the light incidence angle; obtaining a histogram of the gray scale deviation value of a plurality of pixel positions of the second fabric surface image; determining a segmentation mode of the defect area according to the histogram, wherein the segmentation mode includes a bimodal characteristic valley bottom segmentation mode and a non-bimodal characteristic threshold segmentation mode; segmenting out a first defect area according to the segmentation mode; adjusting the height of the light source according to the area of the first defect area to obtain a second defect area; and obtaining a defect classification result. The present application improves the accuracy of fabric defect recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fabric testing technology, and in particular to a method for detecting defects in wool fabrics based on data analysis. Background Technology

[0002] In existing technologies, defect detection of wool fabrics involves extracting texture, color, and shape, and then classifying or identifying the defect category using a classifier or image classification model. Traditional defect detection mainly relies on manual labor, which has problems such as low efficiency and strong subjectivity, and cannot meet the modern textile industry's demand for high-precision and high-speed detection.

[0003] Chinese Patent Publication No. CN120912581A discloses an AI vision-based fabric defect detection method. The specific steps of this AI vision-based fabric defect detection method are as follows: S1: Using an industrial-grade linear scan camera and a synchronous light source array, high-speed, high-resolution images of fabrics in continuous production are acquired in real time to ensure low noise and high clarity of the image data, providing a high-quality base image for subsequent processing; S2: Noise filtering, histogram equalization, and edge enhancement are performed on the acquired raw images to significantly improve the grayscale difference between defects and the background, outputting a clear image as input for subsequent feature extraction; S3: The enhanced image is input into an improved ResNet multi-scale convolutional neural network. By optimizing the convolution kernel and residual structure, multi-level features of fabric texture, edges, and potential defects are extracted, outputting a high-dimensional feature map; S4: A residual attention mechanism is embedded in the feature map to focus on strengthening the features of local suspected abnormal areas, outputting a feature map of areas with significantly enhanced defects. S5: Provides accurate defect location for subsequent standard sample matching; Dynamically matches the defect enhancement feature map with images in the standard sample library, automatically filters suspected defect areas using cosine similarity, and completes the initial screening of abnormal areas in the image; S6: Inputs the suspected defect areas obtained from the initial screening into the self-supervised anomaly detection model, accurately identifies abnormal areas deviating from the pattern by learning the distribution of normal fabric features, and outputs a defect confidence map; S7: Combines the anomaly detection results with the detection errors of historical batches, and uses a dynamic threshold adjustment formula to optimize the detection threshold in real time, ensuring a dynamic balance between detection sensitivity and error rate; S8: Based on the dynamic threshold, classifies the detected defects into multiple categories, including color difference, broken yarn, skipped yarn, and knots, and outputs detection images and statistical reports in real time for visualization; S9: Compares the detection results with the results of manual review, and dynamically feeds the review data back to the training sample set. Through online incremental learning, the feature extraction and anomaly detection models are updated in real time to continuously optimize the detection performance. Therefore, it can be seen that the AI ​​vision-based fabric defect detection method has problems such as low contrast between defects and normal texture under light due to wrinkles on the surface of wool fabric, and reduced defect recognition accuracy due to shadows covering defects. Summary of the Invention

[0004] To address this, the present invention provides a data analysis-based method for detecting defects in wool fabrics, thereby overcoming the problems in the prior art where the low contrast between defects and normal texture under light due to wrinkles on the surface of wool fabrics, and the decrease in defect recognition accuracy due to shadows covering defects.

[0005] To achieve the above objectives, the present invention provides a data analysis-based method for detecting defects in wool fabrics, comprising:

[0006] Turn on the light source to illuminate the wool fabric to be tested;

[0007] Acquire a first fabric surface image of the wool fabric to be tested;

[0008] Obtain the texture roughness value of a local block of the first fabric surface image;

[0009] Adjust the incident angle of the light source according to the texture roughness value;

[0010] The second fabric surface image was acquired a second time according to the adjusted incident light angle.

[0011] Obtain a histogram of grayscale deviation values ​​at several pixel positions in the second fabric surface image;

[0012] The segmentation method of the defect area in the second fabric surface image is determined based on the histogram of the grayscale deviation value. The segmentation method includes bimodal valley segmentation and non-bimodal threshold segmentation.

[0013] The second fabric surface image is segmented into several first defect areas according to the segmentation method described above;

[0014] The height of the light source is adjusted according to the area of ​​the first defective area, and the position of the first defective area on the wool fabric to be tested is magnified and photographed to obtain the second defective area.

[0015] Based on the first defect area and / or its corresponding second defect area, each defect is classified to obtain the final defect classification result.

[0016] Further, obtaining the texture roughness value of a local block of the first fabric surface image includes:

[0017] The first fabric surface image is divided into several local blocks of the same size;

[0018] Calculate the LBP value of each pixel in each of the local blocks;

[0019] The variance of the LBP values ​​of several pixels within a single local block is calculated to serve as the texture roughness value of the single local block.

[0020] Further, adjusting the incident angle of the light source based on the texture roughness value includes:

[0021] Obtain the maximum texture roughness value among the texture roughness values ​​of several local blocks;

[0022] The maximum texture roughness value is compared with the preset roughness value;

[0023] If the maximum texture roughness value is greater than or equal to the preset roughness value, then the light incidence angle is increased.

[0024] Furthermore, the increase in the incident light angle is determined based on the difference between the maximum texture roughness value and the preset roughness value.

[0025] Further, obtaining a histogram of grayscale deviation values ​​at several pixel positions in the second fabric surface image includes:

[0026] Calculate the absolute value of the difference between the gray level of a single pixel in the second fabric surface image and the average gray level of all pixels in the local block where the single pixel is located, and record the absolute value as the gray level deviation value;

[0027] Divide the continuous grayscale deviation value sequence from small to large into several equally spaced intervals;

[0028] The histogram is plotted based on the number of pixels that fall within the range for a single grayscale deviation value.

[0029] Further, determining the segmentation method of the defective region based on the histogram of the grayscale deviation values ​​includes:

[0030] Obtain the peak value in the histogram;

[0031] If the peak value meets the bimodal condition, then the valley segmentation method of the bimodal characteristic is adopted;

[0032] If the peak value does not meet the bimodal condition, then the pixels with grayscale deviation values ​​greater than or equal to the preset deviation value are judged as defects.

[0033] Furthermore, the bimodal condition is that the heights of the two local maximum peaks are both greater than or equal to a preset height, and the distance between the two local maximum peaks is greater than or equal to a preset distance.

[0034] Furthermore, the method of using the bimodal valley segmentation involves using the grayscale deviation value corresponding to the lowest point between the two local maximum peaks as the segmentation value, and determining pixels with grayscale deviation values ​​greater than the segmentation value as defects.

[0035] Further, adjusting the height of the light source according to the area of ​​the first defective region includes:

[0036] Obtain the area of ​​several of the first defective regions;

[0037] Compare the area of ​​the first defective area with the preset area;

[0038] If the area of ​​the first defective region is less than or equal to the preset area, then the height of the light source is increased.

[0039] Furthermore, the increase in the height of the light source is determined based on the difference between the preset area and the area of ​​the first defective region.

[0040] Compared with existing technologies, the beneficial effects of this invention are as follows: The method of this invention illuminates the wool fabric to be tested by turning on a light source and acquiring an image of the first fabric surface to obtain the texture roughness value of its local areas. Because the wool fabric surface has complex textures, the contrast between defects and normal areas is low under traditional fixed lighting conditions, especially under shadow, leading to blurred defect edges and indistinct features, thus reducing recognition accuracy. By calculating the LBP variance of each local area as the texture roughness value, the complexity of the texture in different areas can be effectively quantified. Furthermore, by adjusting the incident angle of the light source, the masking effect of texture shadows on defect features can be reduced. To enhance the grayscale contrast between defective areas and normal fabric, this method innovatively introduces a bimodal adaptive segmentation strategy by analyzing the grayscale deviation histogram of the second fabric image: if the histogram shows a bimodal distribution, the valley segmentation method is used to separate defects from the background; if it is not bimodal, a preset deviation threshold is used to quickly filter suspected defective areas, avoiding misjudgment by the single threshold method in complex texture scenes. For the first defective area obtained from the initial screening, the height of the light source is adjusted according to the area to reduce the field of view of the light on the defect, enabling optical magnification imaging of the original defective area during image acquisition, thereby improving the accuracy of defect identification.

[0041] Furthermore, the method of the present invention adjusts the incident angle of the light source. When the texture complexity is high, the incident angle of the light is increased. The oblique light enhances the shadow effect of the small undulations on the surface, highlights the optical difference between the defect area and the background texture, improves the visibility of low-contrast defects, and reduces the problem of defects being submerged in the texture due to uniform or vertical illumination, thereby improving the quality of the initial image acquisition.

[0042] Furthermore, the method of the present invention constructs a histogram based on grayscale deviation values. The grayscale deviation values ​​reflect the degree of deviation of each pixel from the average grayscale of its local block, which can suppress the influence of global brightness changes and highlight local abnormal areas. By dividing the grayscale deviation values ​​into intervals and drawing histograms, the distribution characteristics of normal fabric pixels and defective pixels in the grayscale deviation dimension are presented.

[0043] Furthermore, the method of the present invention selects the segmentation method based on the peak characteristics of the histogram. If there are two significant and separate peaks, it indicates that the defect and the background have a relatively clear grayscale distinction. The bimodal valley segmentation method is adopted, and the grayscale deviation value corresponding to the valley between the two peaks is selected as the optimal segmentation threshold to improve the segmentation accuracy. If the bimodal condition is not met, the threshold segmentation is based on the preset deviation value, thereby improving the adaptability to the detection of defects in various wool fabrics.

[0044] Furthermore, the method of the present invention adjusts the height of the light source by the size of the area. If the area is small, the light source is raised to achieve magnified shooting of the target area, thereby obtaining a higher resolution image of the second defect area and compensating for the loss of small defect details caused by long-distance imaging. Attached Figure Description

[0045] Figure 1 This is an overall flowchart of the data analysis-based defect detection method for wool fabrics according to an embodiment of the present invention;

[0046] Figure 2 This is a schematic diagram of the detection platform structure of the data analysis-based defect detection method for wool fabrics according to an embodiment of the present invention;

[0047] Figure 3 This is a flowchart illustrating the adjustment of the light incident angle of the light source in the data analysis-based wool fabric defect detection method of this invention.

[0048] Figure 4 This is a flowchart illustrating the process of adjusting the height of a light source to adjust the incident angle of light from the light source, according to an embodiment of the present invention.

[0049] The following are the reference numerals: 1-Detection platform, 2-Camera, 3-Uniform surface light source plate, 4-Adjustable connecting rod, 5-Placement stage. Detailed Implementation

[0050] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0051] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0052] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0053] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0054] Please see Figure 1 , Figure 2 , Figure 3 as well as Figure 4 The diagrams shown are, respectively, an overall flowchart, a schematic diagram of the detection platform structure, a flowchart for adjusting the incident light angle of the light source, and a flowchart for adjusting the height of the light source, all based on data analysis, according to embodiments of the present invention. An embodiment of the present invention provides a method for detecting defects in wool fabric based on data analysis, comprising:

[0055] Turn on the light source to illuminate the wool fabric to be tested;

[0056] Acquire a first fabric surface image of the wool fabric to be tested;

[0057] Obtain the texture roughness value of a local block of the first fabric surface image;

[0058] Adjust the incident angle of the light source according to the texture roughness value;

[0059] The second fabric surface image was acquired a second time according to the adjusted incident light angle.

[0060] Obtain a histogram of grayscale deviation values ​​at several pixel positions in the second fabric surface image;

[0061] The segmentation method of the defect area in the second fabric surface image is determined based on the histogram of the grayscale deviation value. The segmentation method includes bimodal valley segmentation and non-bimodal threshold segmentation.

[0062] The second fabric surface image is segmented into several first defect areas according to the segmentation method described above;

[0063] The height of the light source is adjusted according to the area of ​​the first defective area, and the position of the first defective area on the wool fabric to be tested is magnified and photographed to obtain the second defective area.

[0064] Based on the first defect area and / or its corresponding second defect area, each defect is classified to obtain the final defect classification result.

[0065] Specifically, during the process of turning on the light source to illuminate the wool fabric to be tested, the wool fabric to be tested is laid flat on the testing platform 1. A placement table 5 for placing the wool fabric is set above the testing platform 1. A camera 2 and a light source are respectively set above the placement table. The light source is connected to an adjustable linkage 4 for adjusting the height and the incident angle of the light. The light source adopts a uniform surface light source plate 3, with an initial incident angle of 30° and a light source height of 50cm. The camera adopts a 20-megapixel industrial camera with an image resolution of 3000×3000 pixels.

[0066] Specifically, the incident angle of the light is the angle between the direction of the light source and the normal to the fabric surface, and the direction of the light source can be taken as the normal to the uniform surface light source plate 3.

[0067] Specifically, for small defects that trigger magnified imaging, a clearer image of the second defect area is used for classification, replacing the initial judgment of the first defect area; for large defects that do not trigger magnified imaging, the image of the first defect area is used directly for classification; the process of classifying each defect based on the first defect area and / or its corresponding second defect area to obtain the final defect classification result is as follows: extract the area, perimeter, roundness, grayscale mean, and contrast of the first defect area and / or its corresponding second defect area, input them into the SVM classifier, classify the defects into stains, knots, and scratches, and output the coordinates of the first defect area and / or its corresponding second defect area on the wool fabric to be detected.

[0068] In practice, the method of this invention illuminates the wool fabric to be tested by turning on a light source and acquiring an image of the first fabric surface to obtain the texture roughness value of local areas. Because the wool fabric surface has complex textures, the contrast between defects and normal areas is low under traditional fixed lighting conditions, especially under shadow, leading to blurred defect edges and indistinct features, thus reducing recognition accuracy. By calculating the LBP variance of each local area as the texture roughness value, the complexity of the texture in different areas can be effectively quantified. By adjusting the incident angle of the light source, the masking of defect features by texture shadows can be reduced, improving the accuracy of defect area recognition. By analyzing the grayscale contrast between the second fabric image and the normal fabric image using histogram analysis of grayscale deviation, this method innovatively introduces a bimodal adaptive segmentation strategy: if the histogram shows a bimodal distribution, the valley segmentation method is used to separate defects from the background; if it is not a bimodal distribution, a preset deviation threshold is used to quickly filter suspected defect areas, avoiding misjudgment by the single threshold method in complex texture scenes; for the first defect area obtained from the initial screening, the height of the light source is adjusted according to the area to reduce the field of view of the light on the defect, enabling optical magnification imaging of the original defect area during image acquisition, thereby improving the accuracy of defect identification.

[0069] Specifically, obtaining the texture roughness value of a local block of the first fabric surface image includes:

[0070] The first fabric surface image is divided into several local blocks of the same size;

[0071] Calculate the LBP value of each pixel in each of the local blocks;

[0072] The variance of the LBP values ​​of several pixels within a single local block is calculated to serve as the texture roughness value of the single local block.

[0073] In this embodiment, the size of the local block is 100×100 pixels, which is divided into 900 local blocks. The LBP value of each pixel is calculated for each local block, using a radius of 1 and 8 neighborhood mode.

[0074] Specifically, adjusting the incident angle of the light source based on the texture roughness value includes:

[0075] Obtain the maximum texture roughness value among the texture roughness values ​​of several local blocks;

[0076] The maximum texture roughness value is compared with the preset roughness value;

[0077] If the maximum texture roughness value is greater than or equal to the preset roughness value, then the light incidence angle is increased.

[0078] Specifically, the increase in the incident light angle is determined based on the difference between the maximum texture roughness value and the preset roughness value.

[0079] Specifically, under the conditions that the camera is a 20-megapixel industrial camera with an image resolution of 3000×3000 pixels, a local block size of 100×100 pixels, and the wool fabric to be tested is made of 100-count Merino wool, the general range of the preset roughness value is [100, 130], and the preferred embodiment of the preset roughness value is 110.

[0080] Those skilled in the art will understand that the range of preset roughness values ​​and preferred embodiments provided in this embodiment are the values ​​that best address the technical problem solved by the present invention, selected under the conditions of using a 20-megapixel industrial camera, an image resolution of 3000×3000 pixels, a local block size of 100×100 pixels, and a wool fabric to be tested made of 100-count Merino wool. In actual applications or experiments, those skilled in the art can adaptively adjust the preset roughness values ​​according to the actual application environment and application scenario.

[0081] In practice, for every difference between the maximum texture roughness value and the preset roughness value exceeding 1, the incident angle of the light increases by 0.5°. For example, if the maximum texture roughness value is 120, the incident angle of the light increases to 30° + 0.5° × 10 = 35°.

[0082] In practice, the method of the present invention adjusts the incident angle of the light source. When the texture complexity is high, the incident angle of the light is increased. The oblique light enhances the shadow effect of the small undulations on the surface, highlights the optical difference between the defect area and the background texture, improves the visibility of low-contrast defects, and reduces the problem of defects being submerged in the texture due to uniform or vertical illumination, thereby improving the quality of the initial image acquisition.

[0083] Specifically, obtaining a histogram of grayscale deviation values ​​at several pixel positions in the second fabric surface image includes:

[0084] Calculate the absolute value of the difference between the gray level of a single pixel in the second fabric surface image and the average gray level of all pixels in the local block where the single pixel is located, and record the absolute value as the gray level deviation value;

[0085] Divide the continuous grayscale deviation value sequence from small to large into several equally spaced intervals;

[0086] The histogram is plotted based on the number of pixels that fall within the range for a single grayscale deviation value.

[0087] Specifically, the horizontal axis of the histogram represents the grayscale deviation value, in grayscale, and the vertical axis represents the number of pixels whose grayscale deviation value falls into each interval, in pixels.

[0088] In practice, the method of the present invention constructs a histogram based on grayscale deviation values. The grayscale deviation values ​​reflect the degree of deviation of each pixel from the average grayscale of its local block, which can suppress the influence of global brightness changes and highlight local abnormal areas. By dividing the grayscale deviation values ​​into intervals and drawing histograms, the distribution characteristics of normal fabric pixels and defective pixels in the grayscale deviation dimension are presented.

[0089] Specifically, determining the segmentation method of the defective region based on the histogram of the grayscale deviation values ​​includes:

[0090] Obtain the peak value in the histogram;

[0091] If the peak value meets the bimodal condition, then the valley segmentation method of the bimodal characteristic is adopted;

[0092] If the peak value does not meet the bimodal condition, then the pixels with grayscale deviation values ​​greater than or equal to the preset deviation value are judged as defects.

[0093] Specifically, under the conditions that the camera is a 20-megapixel industrial camera with an image resolution of 3000×3000 pixels, the size of the local block is 100×100 pixels, and the wool fabric to be tested is made of 100-count Merino wool, the general range of the preset deviation value is [10, 50], and the preferred embodiment of the preset deviation value is 40.

[0094] Those skilled in the art will understand that the selectable range of preset deviation values ​​and the preferred embodiments provided in this embodiment are the values ​​that best address the technical problem solved by the technical solution of the present invention, selected under the conditions that the camera is a 20-megapixel industrial camera, the image resolution is 3000×3000 pixels, the size of the local block is 100×100 pixels, and the wool fabric to be tested is made of 100-count Merino wool. In actual applications or experiments, those skilled in the art can make adaptive adjustments to the preset deviation values ​​according to the actual application environment and application scenario.

[0095] Specifically, the bimodal condition is that the heights of the two local maximum peaks are both greater than or equal to a preset height, and the distance between the two local maximum peaks is greater than or equal to a preset distance.

[0096] Specifically, the valley width corresponding to the local maximum peak is less than or equal to 15% of the grayscale width corresponding to the horizontal axis of the histogram.

[0097] Specifically, the preset height is such that the local maximum peak height is greater than 5% of the total number of pixels in the histogram. The general range of the preset distance within the grayscale range of 0-255 is [30, 40]. The preferred embodiment of the preset grayscale is 32.

[0098] In practice, the method of the present invention selects the segmentation method based on the peak characteristics of the histogram. If there are two significant and separate peaks, it indicates that the defect and the background have a relatively clear grayscale distinction. The bimodal valley segmentation method is adopted, and the grayscale deviation value corresponding to the valley between the two peaks is selected as the optimal segmentation threshold to improve the segmentation accuracy. If the bimodal condition is not met, the segmentation is based on the threshold value of the preset deviation value, thereby improving the adaptability to the detection of defects in various wool fabrics.

[0099] Specifically, the method of using the bimodal valley segmentation involves taking the grayscale deviation value corresponding to the lowest point between the two local maximum peaks as the segmentation value, and determining pixels with grayscale deviation values ​​greater than the segmentation value as defects.

[0100] Specifically, adjusting the height of the light source according to the area of ​​the first defective region includes:

[0101] Obtain the area of ​​several of the first defective regions;

[0102] Compare the area of ​​the first defective area with the preset area;

[0103] If the area of ​​the first defective region is less than or equal to the preset area, then the height of the light source is increased.

[0104] Specifically, the area of ​​the first defective region is the number of pixels judged as defective.

[0105] Specifically, under the conditions that the camera is a 20-megapixel industrial camera with an image resolution of 3000×3000 pixels, the size of the local block is 100×100 pixels, and the wool fabric to be tested is made of 100-count Merino wool, the general range of the preset area is [900, 1200], and the preferred embodiment of the preset area is 1000.

[0106] Those skilled in the art will understand that the range of preset areas and preferred embodiments provided in this embodiment are the values ​​that best address the technical problem solved by the present invention, under the conditions that the camera is a 20-megapixel industrial camera with an image resolution of 3000×3000 pixels, the size of the local block is 100×100 pixels, and the wool fabric to be tested is made of 100-count Merino wool. In actual applications or experiments, those skilled in the art can make adaptive adjustments to the preset area according to the actual application environment and application scenario.

[0107] Specifically, the increase in the height of the light source is determined based on the difference between the preset area and the area of ​​the first defective region.

[0108] In practice, for every 50 units of difference between the preset area and the area of ​​the first defective area, the height of the light source is increased by 1 cm. For example, if the preset area is 800, the height of the light source is increased to 50 cm + 1 cm × 4 = 54 cm.

[0109] In practice, the method of the present invention adjusts the height of the light source by the size of the area. If the area is small, the light source is raised to achieve magnified shooting of the target area, thereby obtaining a higher resolution image of the second defect area and making up for the loss of small defect details caused by long-distance imaging.

[0110] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for detecting defects in wool fabrics based on data analysis, characterized in that, include: Turn on the light source to illuminate the wool fabric to be tested; Acquire a first fabric surface image of the wool fabric to be tested; Obtain the texture roughness value of a local block of the first fabric surface image; Adjust the incident angle of the light source according to the texture roughness value; The second fabric surface image was acquired a second time according to the adjusted incident light angle. Obtain a histogram of grayscale deviation values ​​at several pixel positions in the second fabric surface image; The segmentation method of the defect area in the second fabric surface image is determined based on the histogram of the grayscale deviation value. The segmentation method includes bimodal valley segmentation and non-bimodal threshold segmentation. The second fabric surface image is segmented into several first defect areas according to the segmentation method described above; The height of the light source is adjusted according to the area of ​​the first defective area, and the position of the first defective area on the wool fabric to be tested is magnified and photographed to obtain the second defective area. Based on the first defect area and / or its corresponding second defect area, each defect is classified to obtain the final defect classification result.

2. The method for detecting defects in wool fabrics based on data analysis according to claim 1, characterized in that, Obtaining the texture roughness value of a local block in the surface image of the first fabric includes: The first fabric surface image is divided into several local blocks of the same size; Calculate the LBP value for each pixel in each of the local blocks; The variance of the LBP values ​​of several pixels within a single local block is calculated to serve as the texture roughness value of the single local block.

3. The method for detecting defects in wool fabrics based on data analysis according to claim 2, characterized in that, Adjusting the incident angle of the light source based on the texture roughness value includes: Obtain the maximum texture roughness value among the texture roughness values ​​of several local blocks; The maximum texture roughness value is compared with the preset roughness value; If the maximum texture roughness value is greater than or equal to the preset roughness value, then the light incidence angle is increased.

4. The method for detecting defects in wool fabrics based on data analysis according to claim 3, characterized in that, The increase in the incident light angle is determined based on the difference between the maximum texture roughness value and the preset roughness value.

5. The method for detecting defects in wool fabrics based on data analysis according to claim 4, characterized in that, Obtain a histogram of grayscale deviation values ​​at several pixel locations in the second fabric surface image, including: Calculate the absolute value of the difference between the gray level of a single pixel in the second fabric surface image and the average gray level of all pixels in the local block where the single pixel is located, and record the absolute value as the gray level deviation value; Divide the continuous grayscale deviation value sequence from small to large into several equally spaced intervals; The histogram is plotted based on the number of pixels that fall within the range for a single grayscale deviation value.

6. The method for detecting defects in wool fabrics based on data analysis according to claim 5, characterized in that, Determining the segmentation method of the defective region based on the histogram of the grayscale deviation values ​​includes: Obtain the peak value in the histogram; If the peak value meets the bimodal condition, then the valley segmentation method of the bimodal characteristic is adopted; If the peak value does not meet the bimodal condition, then the pixels with grayscale deviation values ​​greater than or equal to the preset deviation value are judged as defects.

7. The method for detecting defects in wool fabrics based on data analysis according to claim 6, characterized in that, The bimodal condition is that the heights of the two local maximum peaks are both greater than or equal to a preset height, and the distance between the two local maximum peaks is greater than or equal to a preset distance.

8. The method for detecting defects in wool fabrics based on data analysis according to claim 7, characterized in that, The method of valley segmentation using the bimodal characteristic involves using the grayscale deviation value corresponding to the lowest point between the two local maximum peaks as the segmentation value, and determining pixels with grayscale deviation values ​​greater than the segmentation value as defects.

9. The method for detecting defects in wool fabrics based on data analysis according to claim 8, characterized in that, Adjusting the height of the light source according to the area of ​​the first defective region includes: Obtain the area of ​​several of the first defective regions; Compare the area of ​​the first defective area with the preset area; If the area of ​​the first defective region is less than or equal to the preset area, then the height of the light source is increased.

10. The method for detecting defects in wool fabrics based on data analysis according to claim 9, characterized in that, The increase in the height of the light source is determined based on the difference between the preset area and the area of ​​the first defective region.

Citation Information

Patent Citations

  • Fabric defect detection method based on AI vision

    CN120912581A

  • Precise image segmentation method applied to fabric defect detection

    CN119810137A

  • Textile and garment flaw pattern data processing method based on flaw judgment model

    CN120635092A