Precise image segmentation method applied to fabric defect detection

Through technical means such as image preprocessing, decomposition and morphological processing, the precise segmentation and detection of defect areas in complex textured fabric images is achieved, and the problem of poor results in traditional methods when dealing with complex textures and high-similar defects is solved, which significantly improves the accuracy and efficiency of detection.

CN119810137AInactive Publication Date: 2025-04-11JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510014935.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional fabric defect detection methods are poor in dealing with complex textures and high similarity defects, and are highly consuming in computing resources, making it difficult to meet the needs of efficient production.

Method used

Through the steps of image preprocessing, image decomposition, binarization processing and morphological processing, grayscale processing, denoising technology, image decomposition algorithm, two-dimensional Otsu threshold segmentation method and morphological operations are used to accurately segment and detect defective areas in fabric images.

Benefits of technology

It improves the accuracy and efficiency of fabric defect detection, can effectively deal with complex textures and high similarity defects, reduce false alarms and missed reports, and provides intuitive defect information for subsequent analysis and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005229606100000031
    Figure BDA0005229606100000031
  • Figure BDA0005229606100000061
    Figure BDA0005229606100000061
  • Figure FDA0005229606090000011
    Figure FDA0005229606090000011
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an accurate image segmentation method applied to fabric defect detection, which comprises the following steps: an image preprocessing stage: carrying out graying processing on an input printed pattern fabric image, simplifying image color information, removing redundant noise in the image by using a denoising technology, and carrying out image segmentation; images are ensured to be clear and pure; in the image decomposition link, the preprocessed image is finely divided into a flaw area and a fabric texture area by means of an image decomposition algorithm, and a foundation is laid for subsequent processing; and carrying out binarization processing on the defective part, specifically, aiming at the decomposed defective part, applying a two-dimensional Otsu threshold segmentation method, calculating an optimal threshold, clearly distinguishing a defective region from a background, and generating a binary image. The purpose of the image precise segmentation method applied to fabric flaw detection is to decompose a printed fabric image into a flaw part and a texture part through a specific algorithm and model so as to realize precise segmentation of flaws.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image precision segmentation method applied to fabric defect detection. Background Art

[0002] Precise image segmentation for fabric defect detection is a key technology that aims to accurately identify and separate defect areas from complex fabric images. This technology uses advanced image processing algorithms to carefully analyze the texture, color and shape characteristics of the fabric to accurately define the defect area. Compared with traditional methods, precise image segmentation can significantly improve the accuracy and efficiency of defect detection, especially when dealing with defects with complex textures and high similarity. Through precise segmentation, the system can quickly locate the defect position, reduce false alarms and missed alarms, and provide a reliable basis for subsequent defect classification and rating. In addition, this technology can also adapt to fabrics of different types and specifications, showing strong versatility and flexibility, and providing strong support for the intelligent upgrading of the textile industry.

[0003] Traditional fabric defect detection methods have shown obvious limitations when facing the complex needs of the modern textile industry. These methods, such as model-based detection, statistical analysis, structural analysis, spectral analysis, and machine learning-based technology, have achieved certain results in specific scenarios, but there are generally some problems that are difficult to ignore. First, these methods generally involve a lot of calculations, have high requirements for hardware resources, and have slow processing speeds, making it difficult to meet the actual needs of efficient production. Secondly, the types of defects they can detect are relatively limited. For fabric images with new or complex textures, the detection effect is often unsatisfactory. This is mainly because most of these methods rely on preset models or rules and are difficult to flexibly adapt to changing texture features. In addition, traditional methods have obvious deficiencies in global feature analysis. They often pay too much attention to local details and ignore the overall structure and texture information of the image, which leads to poor results in detecting small defects. Small defects are easily obscured by background textures due to their small size and low contrast, making them difficult to accurately identify. Summary of the invention

[0004] The purpose of the present invention is to decompose a printed fabric image into a defect part and a texture part through a specific algorithm and model, so as to achieve accurate segmentation of defects, and to propose an image accurate segmentation method for fabric defect detection.

[0005] The technical solution of the present invention to solve the above technical problems is as follows:

[0006] An image accurate segmentation method for fabric defect detection comprises the following steps:

[0007] S10, image preprocessing stage, grayscale processing is performed on the input printed pattern fabric image to simplify the image color information, and then denoising technology is used to remove excess noise in the image to ensure that the image is clear and pure;

[0008] S20, image decomposition step, using image decomposition algorithm, the pre-processed image is divided into defect area and fabric texture area, laying the foundation for subsequent processing;

[0009] S30, binary processing of the defect part, applying the two-dimensional Otsu threshold segmentation method to the decomposed defect part, by calculating the optimal threshold, clearly distinguishing the defect area from the background, and generating a binary image;

[0010] S40, defect detection and visualization step, based on the binary image, automatically identifies the defect area and marks it, and uses visualization methods, such as highlighting or contour display, to intuitively display the defect information for subsequent analysis and processing.

[0011] Based on the above technical solution, the present invention can also be improved as follows.

[0012] Furthermore, in the image preprocessing stage of step S10, a Fourier transform operation is performed to convert the image to the frequency domain. Subsequently, a Gaussian filter is used to filter according to the image characteristics to filter out high-frequency noise and interference. After filtering, an inverse Fourier transform is performed to restore the image to the spatial domain for subsequent processing. The standard deviation σ of the Gaussian filter is flexibly adjusted according to the image noise conditions. When the noise is dense, σ takes a larger value; when the noise is sparse, σ takes a smaller value to ensure the optimization of the filtering effect.

[0013] Furthermore, in the step S20, when the image is decomposed, a specific algorithm is used, which involves the selection of parameters τ and μ, and the correlation between the texture part v and the flawless fabric W is calculated.

[0014]

[0015] , find the parameter combination that makes the correlation close to 1 and achieve the optimal solution for image decomposition. In the image decomposition algorithm, the filtering step also uses a Gaussian filter.

[0016] Furthermore, when the defective part is binarized in step S30, the two-dimensional Otsu method first calculates the grayscale histogram, sets the initial threshold T, and divides the image into foreground and background. By iteratively adjusting T, the ratio of the between-class variance σ2B to the within-class variance σ2W is maximized to determine the optimal threshold T. In the two-dimensional Otsu threshold segmentation, the iterative threshold T adjustment strategy is specifically as follows: with ΔT as the step size, the T value is gradually adjusted. Each iteration calculates the ratio of the current between-class variance to the within-class variance. If the current ratio is improved compared with the previous iteration, T continues to be adjusted with a step size of ΔT; if the current ratio has not improved, the iteration is stopped and the previous T value is taken as the optimal threshold.

[0017] Furthermore, in the defect detection and visualization step S40, the binarized image is subjected to morphological processing, and small noise points are removed and small holes are filled by using dilation, erosion, opening and closing operations to obtain a clearer defect area, and then visualization processing is performed according to the position and shape of the defect area;

[0018] Formula: Dilation operation

[0019] Formula: Dilation operation Corrosion Operation

[0020] Among them, A is the binary image, B is the structural element, (B) z It represents the result of translating the structural element B by z units. In morphological processing, the expansion and erosion operations follow Formula, the structural element B is flexibly selected according to the image characteristics to ensure the processing effect.

[0021] Furthermore, in the morphological processing stage, in addition to the basic expansion and corrosion operations, the opening and closing operations are also introduced. The opening operation is defined as Used to remove small objects and disconnect small connections between objects; the closing operation is defined as It is used to fill tiny holes in objects and connect adjacent objects. By combining the opening and closing operations, the morphology of the defect area is optimized and the accuracy of defect detection is improved. In addition, the shape and size of the structural element B in the morphological processing are flexibly adjusted according to the characteristics of the defect and detection requirements to achieve the best processing effect.

[0022] Furthermore, after step S40, defect feature extraction and classification are added to extract shape, texture, and color features, and classification is carried out using machine learning or deep learning algorithms. Defect classification uses SVM, Random Forest machine learning algorithm or CNN, RNN deep learning model, and classification accuracy is improved through training optimization.

[0023] Furthermore, in the defect feature extraction stage, in addition to extracting the basic features of shape, texture, and color, local binary pattern and grayscale co-occurrence matrix advanced features are also introduced. The local binary pattern feature can capture the local texture information of the image; the grayscale co-occurrence matrix feature can reflect the spatial relationship between the gray levels of the image and provide rich texture information. By combining these advanced features, the accuracy and robustness of defect classification can be improved. At the same time, in the feature extraction process, dimensionality reduction techniques such as principal component analysis or linear discriminant analysis are used to reduce feature dimensions and reduce computational complexity.

[0024] Compared with the prior art, the technical solution of this application has the following beneficial technical effects:

[0025] The present invention uses grayscale processing and denoising technology. The method simplifies image color information and removes redundant noise, thereby ensuring the clarity and purity of the image. With the help of an image decomposition algorithm, the preprocessed image is finely divided into a defect area and a fabric texture area. This step realizes effective decomposition of the image, provides a clear distinction for subsequent processing, and makes defect detection more targeted. The two-dimensional Otsu threshold segmentation method is applied to clearly distinguish the defect area from the background by calculating the optimal threshold and generate a binary image. This step can automatically determine the optimal threshold, effectively separate the defect area from the background, and improve the accuracy and efficiency of defect detection. At the same time, the two-dimensional Otsu threshold segmentation method has good adaptability to images of different gray levels, and can process defect images with complex textures and high similarity. At the same time, the defect information is intuitively displayed using visualization means. This step not only improves the accuracy of defect detection, but also provides an intuitive and convenient way for subsequent analysis and processing. Through visualization means such as highlighting or contour display, users can quickly identify and locate defect areas, thereby achieving accurate processing and quality control of defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 The present invention is a method flow chart of a method for accurate image segmentation applied to fabric defect detection. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] Combination Figure 1 As shown, an image accurate segmentation method for fabric defect detection of the present invention comprises the following steps:

[0029] S10, image preprocessing stage, grayscale processing is performed on the input printed pattern fabric image to simplify the image color information, and then denoising technology is used to remove excess noise in the image to ensure that the image is clear and pure;

[0030] S20, image decomposition step, using image decomposition algorithm, the pre-processed image is divided into defect area and fabric texture area, laying the foundation for subsequent processing;

[0031] S30, binary processing of the defect part, applying the two-dimensional Otsu threshold segmentation method to the decomposed defect part, by calculating the optimal threshold, clearly distinguishing the defect area from the background, and generating a binary image;

[0032] S40, defect detection and visualization step, based on the binary image, automatically identifies the defect area and marks it, and uses visualization methods, such as highlighting or contour display, to intuitively display the defect information for subsequent analysis and processing.

[0033] In a preferred embodiment, the present invention can be further configured as follows: in the image preprocessing stage of step S10, a Fourier transform operation is performed to convert the image to the frequency domain, and then a Gaussian filter is used to filter according to the image characteristics to filter out high-frequency noise and interference. After filtering, an inverse Fourier transform is performed to restore the image to the spatial domain for subsequent processing. The standard deviation σ of the Gaussian filter is flexibly adjusted according to the image noise condition. When the noise is dense, the value of σ is relatively large; when the noise is sparse, the value of σ is relatively small to ensure the optimization of the filtering effect. By performing the Fourier transform operation, the image is converted from the spatial domain to the frequency domain. This step greatly simplifies the subsequent processing process. In the frequency domain, the high-frequency components of the image often correspond to details and edge information, while the low-frequency components represent the overall structure and background of the image. By separating these components, filtering can be performed more effectively for high-frequency noise and interference. Next, a Gaussian filter is used for filtering, and its weight coefficient conforms to the Gaussian distribution, which can effectively smooth the image, filter out high-frequency noise, and retain key information in the image. In particular, the standard deviation σ of the Gaussian filter is flexibly adjusted according to the image noise conditions. This design enables the filtering effect to be optimized for different types of image noise, effectively filtering out noise when the noise is dense, and avoiding loss of details caused by over-smoothing when the noise is sparse. After filtering, the image is restored to the spatial domain through inverse Fourier transform, providing a clear and pure image basis for subsequent defect detection. This series of operations not only improves the efficiency of image processing, but also significantly improves the accuracy of defect detection. When processing fabric images with complex textures, adaptive threshold segmentation can automatically adjust the threshold according to the density of the texture and the contrast of the defect, thereby achieving accurate segmentation of the defect area.

[0034] In a preferred embodiment, the present invention can be further configured as follows: in step S20, when the image is decomposed, a specific algorithm is used, involving the selection of parameters τ and μ, by calculating the correlation between the texture part v and the flawless fabric W.

[0035]

[0036] , find the parameter combination that makes the correlation close to 1, and achieve the optimal solution for image decomposition. In the image decomposition algorithm, the filtering step also uses a Gaussian filter. By using a specific algorithm to decompose the image, and involving the selection of parameters, this step aims to accurately divide the image into defect areas and fabric texture areas. The algorithm calculates the correlation between the texture part v and the defect-free fabric W, and finds the parameter combination that makes the correlation close to 1. This process is actually looking for the parameter setting that best reflects the fabric texture characteristics, thereby ensuring the accuracy of image decomposition. This correlation-based optimization strategy not only improves the accuracy of image decomposition, but also helps the accuracy of subsequent defect detection. In addition, the filtering step in the image decomposition algorithm uses a Gaussian filter to further smooth the noise and interference in the image, providing a clearer and purer image basis for subsequent defect recognition. Under the combined effect of this series of operations, the efficiency and accuracy of fabric defect detection are significantly improved.

[0037] In a preferred embodiment, the present invention can be further configured as follows: when the defective part is binarized in step S30, the two-dimensional Otsu method first calculates the grayscale histogram, sets the initial threshold T, and divides the image into foreground and background. By iteratively adjusting T, the ratio of the inter-class variance σ2B to the intra-class variance σ2W is maximized, and the optimal threshold T is determined. In the two-dimensional Otsu threshold segmentation, the iterative threshold T adjustment strategy is specifically as follows: taking ΔT as the step length, gradually adjusting the T value, calculating the current inter-class variance to the intra-class variance ratio in each iteration, if the current ratio is improved compared with the previous iteration, then continue to adjust T with a step length of ΔT; if the current ratio is not improved, then stop the iteration, take the previous T value as the optimal threshold, and perform threshold segmentation through the two-dimensional Otsu method. This method not only considers the grayscale information, but also combines the spatial information, thereby improving the recognition accuracy of the defective part. In the two-dimensional Otsu method, the grayscale histogram of the image is first calculated, and an initial threshold T is set to divide the image into the foreground (defective part) and the background (fabric texture part). Subsequently, by iteratively adjusting the threshold T to maximize the ratio of the between-class variance σ2B to the within-class variance σ2W, this strategy can automatically find an optimal threshold that makes the distinction between foreground and background most obvious. This step not only simplifies the tedious process of manually setting the threshold in traditional methods, but also significantly improves the accuracy and robustness of defect detection. In particular, the two-dimensional Otsu method shows its unique advantages when processing fabric images with complex textures and low-contrast defects.

[0038] In a preferred embodiment, the present invention can be further configured as follows: in the defect detection and visualization step S40, morphological processing is performed on the binarized image, and small noise points are removed and small holes are filled by using dilation, corrosion, opening operation and closing operation operations to obtain a clearer defect area, and then visualization processing is performed according to the position and shape of the defect area;

[0039] Formula: Dilation operation

[0040] Formula: Dilation operation Corrosion Operation

[0041] Among them, A is the binary image, B is the structural element, (B) z It represents the result of translating the structural element B by z units. In morphological processing, the expansion and erosion operations follow Formula, the structural element B is flexibly selected according to the image characteristics to ensure the processing effect. By performing morphological processing on the binarized image, small noise points are effectively removed and small holes are filled by using operations such as expansion, corrosion, opening and closing operations, so as to obtain a clearer and more accurate defect area. This step not only improves the accuracy of defect detection, but also reduces the complexity of subsequent processing. The expansion operation can expand the boundary of the defect area and make small defects more obvious; the corrosion operation is used to remove isolated noise points in the image and make the defect area purer. The opening operation (corrosion first and then expansion) helps to remove small connected parts, while the closing operation (expansion first and then corrosion) can fill the small holes inside the defect. The joint action of these morphological operations significantly improves the recognition and integrity of the defect area. In addition, the visualization processing is performed according to the position and shape of the defect area, making the detection results more intuitive and easy to understand, providing strong support for the subsequent defect classification, positioning and repair.

[0042] In a preferred embodiment, the present invention can be further configured as follows: in the morphological processing stage, in addition to the basic expansion and corrosion operations, an opening operation and a closing operation are introduced, and the opening operation is defined as Used to remove small objects and disconnect small connections between objects; the closing operation is defined as It is used to fill small holes in objects and connect adjacent objects. By combining the use of open and closed operations, the morphology of the defect area is optimized and the accuracy of defect detection is improved. In addition, the shape and size of the structural element B in the morphological processing are flexibly adjusted according to the characteristics of the defect and the detection requirements to achieve the best processing effect. By introducing open and closed operations, the claim further optimizes the morphology of the defect area in the morphological processing stage. The open operation can effectively remove small objects in the image and disconnect small connections between objects, which is of great significance for reducing noise interference and improving the recognition of defect areas. The closed operation can fill small holes in the defect area and connect adjacent defective objects, making the defect area more complete and continuous, which helps to improve the accuracy of defect detection. This strategy not only solves the problem of excessive corrosion or expansion that may occur in traditional morphological processing, but also enhances the characteristic performance of the defect area, providing a more reliable basis for subsequent detection and analysis. In addition, the shape and size of the structural element B can be flexibly adjusted according to the characteristics of the defect and the detection requirements. This design enables the morphological processing to be customized for defects of different types and sizes, further improving the accuracy and adaptability of defect detection.

[0043] In a preferred embodiment, the present invention can be further configured as follows: after step S40, defect feature extraction and classification are added, shape, texture, and color features are extracted, and machine learning or deep learning algorithms are used for classification. SVM, Random Forest machine learning algorithms or CNN, RNN deep learning models are used for defect classification, and classification accuracy is improved through training optimization. By adding the step of defect feature extraction and classification after step S40, the claim realizes the comprehensive capture and accurate classification of defect features. In the feature extraction stage, by extracting key features such as shape, texture, and color of the defects, a rich information basis is provided for subsequent defect classification. These features can fully reflect the essential attributes of the defects and help improve the accuracy of classification. In the classification stage, machine learning or deep learning algorithms, such as SVM (support vector machine), RandomForest (random forest) and other machine learning algorithms, or CNN (convolutional neural network), RNN (recurrent neural network) and other deep learning models, are used to accurately classify defects. These algorithms and models have strong learning and generalization capabilities, and can continuously improve the accuracy of classification through training and optimization, thereby achieving effective identification of defects. This strategy not only solves the problem of inaccurate classification in traditional defect detection, but also improves the efficiency and automation of detection.

[0044] In a preferred embodiment, the present invention can be further configured as follows: in the defect feature extraction link, in addition to extracting the basic features of shape, texture, and color, the local binary pattern and grayscale co-occurrence matrix advanced features are also introduced. The local binary pattern feature can capture the local texture information of the image; the grayscale co-occurrence matrix feature can reflect the spatial relationship between the gray levels of the image and provide rich texture information. By combining these advanced features, the accuracy and robustness of defect classification can be improved. At the same time, in the feature extraction process, dimensionality reduction techniques such as principal component analysis or linear discriminant analysis are used to reduce the feature dimension and reduce the computational complexity. By introducing the two advanced features of local binary pattern and grayscale co-occurrence matrix in the defect feature extraction link, the claim realizes a more comprehensive capture of defect texture information. The local binary pattern feature generates a binary code by comparing the grayscale value difference between each pixel and its neighboring pixels, thereby capturing the local texture structure information of the image. This feature has unique advantages in describing the slight changes and irregularities of the defect surface. The gray-level co-occurrence matrix feature provides statistical information about the image texture, such as contrast, energy, homogeneity, and correlation, by analyzing the spatial relationship between pairs of pixels with different gray levels in the image. The introduction of these advanced features not only enriches the dimension of defect features, but also enhances the ability of features to express defect texture information, thereby improving the accuracy and robustness of defect classification.

[0045] In the image preprocessing stage, the input printed pattern fabric image will undergo grayscale processing to simplify the color information for subsequent processing. Then, the denoising technology is used to remove the excess noise in the image to ensure that the image is clear and pure. In particular, this stage may also perform a Fourier transform operation to convert the image to the frequency domain, use a Gaussian filter to filter according to the image characteristics, filter out high-frequency noise and interference, and then perform an inverse Fourier transform to restore the image to the spatial domain for subsequent processing. The standard deviation σ of the Gaussian filter will be flexibly adjusted according to the image noise condition to ensure the optimal filtering effect;

[0046] Next, we enter the image decomposition phase. In this phase, a specific algorithm is used to divide the preprocessed image into defect areas and fabric texture areas. The algorithm involves the selection of parameters and finds the parameter combination that makes the correlation close to 1 by calculating the correlation between the texture part and the defect-free fabric, so as to achieve the optimal solution for image decomposition. In this process, the filtering step also uses a Gaussian filter.

[0047] Subsequently, the decomposed defect part is binarized, and the two-dimensional Otsu threshold segmentation method is applied to clearly distinguish the defect area from the background by calculating the optimal threshold to generate a binary image. The two-dimensional Otsu method first calculates the grayscale histogram, sets the initial threshold T, and iteratively adjusts the T value to maximize the ratio of the inter-class variance to the intra-class variance, thereby determining the optimal threshold T;

[0048] In the defect detection and visualization step, defect areas are automatically identified and marked based on binary images. At the same time, visualization methods such as highlighting or contour display are used to intuitively display defect information for subsequent analysis and processing. This stage also involves morphological processing, including dilation, erosion, opening and closing operations to remove small noise points and fill small holes to obtain clearer defect areas. The structural element B in morphological processing will be flexibly selected according to the image characteristics to ensure the best processing effect. The opening operation is used to remove small objects and disconnect small connections between objects; the closing operation is used to fill small holes in objects and connect adjacent objects.

[0049] Finally, after step S40, defect feature extraction and classification steps are added to extract basic features such as shape, texture, color, and advanced features such as local binary pattern and gray-level co-occurrence matrix. The local binary pattern feature can capture the local texture information of the image; the gray-level co-occurrence matrix feature can reflect the spatial relationship between the gray levels of the image. By combining these features and using machine learning or deep learning algorithms (such as SVM, Random Forest, CNN, RNN, etc.) for classification training and optimization, the accuracy and robustness of defect classification can be significantly improved. At the same time, in the feature extraction process, dimensionality reduction technology (such as principal component analysis or linear discriminant analysis) is used to reduce the feature dimension to reduce the computational complexity.

[0050] In summary, this image precise segmentation method achieves efficient and accurate detection of fabric defects through a series of carefully designed steps and algorithms, providing strong support for fabric quality inspection and production control.

[0051] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0052] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. An image accurate segmentation method for fabric defect detection, characterized in that: The following steps are involved: S10, image preprocessing stage, grayscale processing is performed on the input printed pattern fabric image to simplify the image color information, and then denoising technology is used to remove excess noise in the image to ensure that the image is clear and pure; S20, image decomposition step, using image decomposition algorithm, the pre-processed image is divided into defect area and fabric texture area, laying the foundation for subsequent processing; S30, binary processing of the defect part, applying the two-dimensional Otsu threshold segmentation method to the decomposed defect part, by calculating the optimal threshold, clearly distinguishing the defect area from the background, and generating a binary image; S40, defect detection and visualization step, based on the binary image, automatically identifies the defect area and marks it, and uses visualization methods, such as highlighting or contour display, to intuitively display the defect information for subsequent analysis and processing.

2. The image accurate segmentation method for fabric defect detection according to claim 1 is characterized in that: In the image preprocessing stage of step S10, a Fourier transform operation is performed to convert the image into the frequency domain. Subsequently, a Gaussian filter is used to filter according to the image characteristics to filter out high-frequency noise and interference. After filtering, an inverse Fourier transform is performed to restore the image to the spatial domain for subsequent processing. The standard deviation σ of the Gaussian filter is flexibly adjusted according to the image noise conditions. When the noise is dense, σ takes a larger value; when the noise is sparse, σ takes a smaller value to ensure the optimization of the filtering effect.

3. The image accurate segmentation method for fabric defect detection according to claim 1 is characterized in that: In step S20, when the image is decomposed, a specific algorithm is used, which involves the selection of parameters τ and μ, and the correlation between the texture part v and the flawless fabric W is calculated. Find the parameter combination that makes the correlation close to 1 to achieve the optimal solution for image decomposition. In the image decomposition algorithm, the filtering step also uses a Gaussian filter.

4. The image accurate segmentation method for fabric defect detection according to claim 3 is characterized in that: When the defective part is binarized in step S30, the two-dimensional Otsu method first calculates the grayscale histogram, sets the initial threshold T, and divides the image into foreground and background. By iteratively adjusting T, the ratio of the between-class variance σ2B to the within-class variance σ2W is maximized, and the optimal threshold T is determined. In the two-dimensional Otsu threshold segmentation, the iterative threshold T adjustment strategy is specifically as follows: with ΔT as the step size, the T value is gradually adjusted, and the ratio of the current between-class variance to the within-class variance is calculated each iteration. If the current ratio is improved compared with the previous iteration, T is continued to be adjusted with a step size of ΔT; if the current ratio is not improved, the iteration is stopped and the previous T value is taken as the optimal threshold.

5. The image accurate segmentation method for fabric defect detection according to claim 1 is characterized in that: In the defect detection and visualization step S40, morphological processing is performed on the binarized image, and small noise points are removed and small holes are filled by using dilation, erosion, opening and closing operations to obtain a clearer defect area, and then visualization processing is performed according to the position and shape of the defect area; Formula: Dilation operation Formula: Dilation operation Corrosion Operation Among them, A is the binary image, B is the structural element, (B) z It represents the result of translating the structural element B by z units. In morphological processing, the expansion and corrosion operations follow A⊕B, Formula, the structural element B is flexibly selected according to the image characteristics to ensure the processing effect.

6. The image accurate segmentation method for fabric defect detection according to claim 5 is characterized in that: In the morphological processing stage, in addition to the basic expansion and corrosion operations, the opening and closing operations are introduced. The opening operation is defined as Used to remove small objects and disconnect small connections between objects; the closing operation is defined as It is used to fill tiny holes in objects and connect adjacent objects. By combining the opening and closing operations, the morphology of the defect area is optimized and the accuracy of defect detection is improved. In addition, the shape and size of the structural element B in the morphological processing are flexibly adjusted according to the characteristics of the defect and detection requirements to achieve the best processing effect.

7. The image accurate segmentation method for fabric defect detection according to claim 1 is characterized in that: After step S40, defect feature extraction and classification are added to extract shape, texture, and color features, and classified using machine learning or deep learning algorithms. Defect classification uses SVM, Random Forest machine learning algorithms or CNN, RNN deep learning models, and classification accuracy is improved through training optimization.

8. The image accurate segmentation method for fabric defect detection according to claim 7, characterized in that: In the defect feature extraction process, in addition to extracting the basic features of shape, texture, and color, local binary pattern and grayscale co-occurrence matrix advanced features are also introduced. The local binary pattern feature can capture the local texture information of the image; the grayscale co-occurrence matrix feature can reflect the spatial relationship between the gray levels of the image and provide rich texture information. By combining these advanced features, the accuracy and robustness of defect classification can be improved. At the same time, in the feature extraction process, dimensionality reduction techniques such as principal component analysis or linear discriminant analysis are used to reduce feature dimensions and reduce computational complexity.

Citation Information

Cited By

  • Wool fabric defect detection method based on data analysis

    CN121577645A

  • A wool fabric defect detection method based on data analysis

    CN121577645B