Garment fabric defect detection method and system based on image recognition
By constructing a texture structure tensor and using adaptive filtering techniques to dynamically adjust the filtering radius, the problem of spectral energy leakage in the detection of flexible fabrics using traditional FFT algorithms is solved, achieving higher accuracy and precision in defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANMA GARMENT GRP CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-21
AI Technical Summary
When processing flexible fabrics, traditional FFT algorithms suffer from spectral energy leakage due to the non-rigid deformation of the fabric, which fails to effectively suppress background textures and retain minor imperfections, thus reducing the accuracy of garment fabric defect detection.
An image recognition-based approach is adopted to obtain the principal angle and gradient intensity features of local sub-blocks by constructing a texture structure tensor. Combined with the frequency domain energy divergence potential, the filtering radius is dynamically adjusted. An adaptive filtering attenuation weight matrix is constructed using a multi-notch model for frequency domain filtering. Defects are identified through binarized threshold segmentation and morphological processing.
It improves the accuracy of garment fabric defect detection, effectively suppresses artifacts caused by spectral leakage, preserves minute defect signals, and enhances the accuracy of defect identification and positioning precision.
Smart Images

Figure CN121904005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to a method and system for detecting defects in clothing fabrics based on image recognition. Background Technology
[0002] In the modern textile industry, fabric quality inspection is a key link in ensuring the quality of clothing. With the advancement of industrialization, automated inspection systems based on machine vision have gradually replaced traditional manual visual inspection.
[0003] Currently, for fabrics with periodic textures such as jacquard and plaid, the Fast Fourier Transform (FFT) algorithm is commonly used. The FFT algorithm utilizes the characteristic that fabric textures represent high-energy concentration points in the frequency domain. By setting a specific mask in the frequency domain to filter out the dominant frequency components representing the background texture, and then reconstructing the image through inverse Fourier transform, the background texture is suppressed, and periodic defect signals, such as holes and stains, become prominent in the reconstructed image, thus achieving defect detection.
[0004] However, when traditional FFT algorithms process flexible fabrics in actual production, the fabrics, being typical non-rigid materials, are easily affected by mechanical traction forces on high-speed conveyor belts, resulting in non-rigid deformations such as stretching, shearing, or micro-wrinkles. This spatial geometric deformation causes the dominant frequency energy of the texture in the frequency domain to no longer be concentrated at a sharp point, but to diverge and leak irregularly in all directions. The fixed radius filter of the traditional FFT algorithm cannot cover these dynamically diverging spectral components, resulting in a large amount of high-frequency texture noise, i.e., artifacts, remaining in the filtered image. If the fixed filter range is simply expanded to cover the diverging area, it will also cause the frequency domain signals of minor defects, such as pinholes and fine fraying, to be filtered out, thereby reducing the accuracy of defect detection in clothing fabrics. Summary of the Invention
[0005] To address the problem that traditional FFT algorithms suffer from spectral energy leakage due to the non-rigid deformation of clothing fabrics, which leads to incomplete background suppression or accidental deletion of minor defects and thus reduces the accuracy of clothing fabric defect detection, this invention provides a method and system for clothing fabric defect detection based on image recognition.
[0006] In a first aspect, the present invention provides a method for detecting defects in clothing fabrics based on image recognition, employing the following technical solution: A method for detecting defects in clothing fabrics based on image recognition includes: acquiring a grayscale image of the clothing fabric surface and dividing the grayscale image into several local sub-blocks using a sliding window strategy; for each local sub-block, constructing a texture structure tensor in the spatial domain, and calculating the principal angle and gradient intensity features of the texture of each local sub-block based on the texture structure tensor; based on the principal angle and gradient intensity features, and combined with the global reference angle of a standard fabric image, calculating the frequency domain energy divergence potential energy characterizing the degree of energy diffusion of each local sub-block in the frequency domain; and based on a multi-notch filter model... An adaptive filtering attenuation weight matrix is constructed for each local sub-block, wherein the filtering radius of the notch region in the multi-notch model is dynamically adjusted according to the frequency domain energy divergence potential, and the filtering radius is positively correlated with the frequency domain energy divergence potential. A Fourier transform is performed on each local sub-block to obtain a spectrum image, and the spectrum image is frequency domain filtered using the adaptive filtering attenuation weight matrix. An inverse Fourier transform is then performed on the filtered spectrum image to obtain a reconstructed image of each local sub-block. The reconstructed image is then subjected to binarization thresholding segmentation and morphological processing to identify and locate defects in the clothing fabric.
[0007] This invention achieves precise analysis of local sub-block texture characteristics by constructing a texture structure tensor and calculating the principal angle and gradient intensity features of the texture. This more accurately reflects the geometric characteristics of the fabric texture and provides a reliable spatial domain feature basis for calculating the frequency domain energy divergence potential. By calculating the frequency domain energy divergence potential, it achieves the assessment of energy diffusion caused by non-rigid deformation of flexible fabrics, more accurately reflecting the divergence degree of the texture's principal frequency energy and providing a reliable dynamic adjustment basis for adaptive filtering. By constructing an adaptive filtering attenuation weight matrix through a multi-notch model, it achieves dynamic adjustment of the filtering radius, ensuring that the filter can automatically adapt according to the degree of energy divergence, effectively suppressing artifacts caused by spectral leakage, while preserving the frequency domain signal of minor defects. Based on the binarization segmentation and morphological processing of the reconstructed image, it improves the accuracy of defect identification and provides reliable technical support for the quality inspection of clothing fabrics.
[0008] Furthermore, the construction of the texture structure tensor in the spatial domain includes: obtaining the gradient information of each pixel in each local sub-block; and using a Gaussian weighted window function in each local sub-block to perform a weighted summation of the outer products of the gradients of all pixels to obtain the texture structure tensor.
[0009] This invention achieves a comprehensive evaluation of the directionality and intensity of local sub-block textures by constructing a texture structure tensor. The Gaussian weighted window function ensures a higher weight for the center pixel, and the weighted summation of the gradient outer product accurately reflects the local structural features of the texture, thus providing a reliable tensor basis for the extraction of texture principal angle and gradient intensity features.
[0010] Furthermore, the frequency domain energy divergence potential satisfies: In the formula, To characterize the first The frequency domain energy divergence potential of a local sub-block in the frequency domain represents the degree of energy diffusion. The potential energy cutoff threshold is used to prevent numerical runaway caused by extreme deformation. and The first The first and second eigenvalues in the gradient intensity features of each local sub-block, and , For the first The dominant angle of the texture of a local sub-block This is the global reference angle for standard fabric images. Hyperparameters used to prevent the denominator from being zero. It is a minimum value function. It is a natural exponential function.
[0011] This invention achieves a scientific assessment of frequency domain energy divergence potential by constructing a composite function that includes an eigenvalue ratio and an angle deviation exponent. The eigenvalue ratio accurately reflects the degree of anisotropy of the texture, the angle deviation exponent reflects the influence of deformation on energy divergence, and the truncation of the minimum function ensures numerical stability, thereby enabling accurate assessment of the degree of non-rigid deformation of flexible fabrics.
[0012] Furthermore, the method for obtaining the principal angle and gradient intensity features of the texture is as follows: the principal feature vector of the texture structure tensor is used... The function obtains the principal angle of the texture in each local sub-block; the matrix eigenvalue solving function is used to solve the eigenvalues of the texture structure tensor to obtain the gradient intensity features of each local sub-block. The gradient intensity features include a first eigenvalue representing the intensity of the texture in the principal direction within the local sub-block, and a second eigenvalue representing the intensity of the texture in the vertical direction within the local sub-block.
[0013] Furthermore, the range of the potential energy cutoff threshold is as follows: .
[0014] Furthermore, the adaptive filter attenuation weight matrix satisfies: In the formula, For the first The internal frequency domain coordinates of the adaptive filtering attenuation weight matrix of each local sub-block Adaptive filtering attenuation weights at the location, The number of notch regions, For frequency domain coordinates, For the first The center coordinates of each notch region Based on the basic filter radius, This is a sensitivity adjustment coefficient used to control the degree of influence of frequency domain energy divergence potential on the filter radius. To characterize the first The frequency domain energy divergence potential of a local sub-block in the frequency domain represents the degree of energy diffusion. It is a natural exponential function. To calculate the Euclidean distance from the frequency domain coordinates to the center coordinates.
[0015] This invention achieves a scientific evaluation of the adaptive filtering attenuation weight matrix by constructing a composite function containing multiple notch region product terms. The filtering radius is dynamically adjusted according to the frequency domain energy divergence potential, ensuring that the notch region can cover the energy divergence spectral components, thereby effectively balancing the requirements of texture suppression and defect preservation, and improving the adaptability and accuracy of frequency domain filtering.
[0016] Furthermore, the notch region is obtained by performing a Fourier transform on a standard fabric image and using a peak detection algorithm.
[0017] Furthermore, the range of values for the basic filter radius is: The sensitivity adjustment coefficient has a range of values of [value missing]. .
[0018] Furthermore, the identification and localization of defects in clothing fabrics includes: processing the reconstructed image using the Otsu threshold segmentation method to obtain a binary image; performing morphological connection operations on the binary image to locate and mark connected regions as the final defects, thereby realizing defect detection of clothing fabrics based on image recognition.
[0019] This invention achieves binarization of reconstructed images through the Otsu threshold segmentation method, automatically determines the optimal segmentation threshold, and effectively connects adjacent defect pixels through morphological connection operations, accurately marking connected regions as defects, thereby improving the accuracy of defect identification and positioning precision, and providing reliable technical support for the quality inspection of clothing fabrics.
[0020] Secondly, the present invention provides a garment fabric defect detection system based on image recognition, employing the following technical solution: A garment fabric defect detection system based on image recognition includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned garment fabric defect detection method based on image recognition is implemented.
[0021] By adopting the above technical solution, a computer program for detecting defects in clothing fabrics based on image recognition is generated and stored in a memory so that it can be loaded and executed by a processor. This allows for the creation of a terminal device based on the memory and processor, making it convenient to use.
[0022] The present invention has the following technical effects: (1) In view of the problem that the fixed radius filter of the traditional FFT algorithm cannot cope with the frequency domain energy divergence caused by the non-rigid deformation of the fabric, the present invention extracts the texture principal angle and gradient intensity features of the local sub-blocks through the texture structure tensor, and calculates the frequency domain energy divergence potential energy by combining the global reference angle of the standard fabric, so as to accurately evaluate the spectral diffusion degree of each local sub-block; the filtering radius of the multi-notch model is dynamically adjusted according to the potential energy in areas with significant deformation and obvious energy divergence, and the filtering radius is automatically increased to fully cover the divergent principal frequency component, filter out background texture noise, and avoid artifact residue; in areas with slight deformation and concentrated energy, the filtering radius is kept at a small value to ensure that the frequency domain signals of small defects such as pinholes and fine fraying are not over-filtered out. The adaptive mechanism effectively solves the problem that the traditional fixed filter either leaves noise or misses small defects, and improves the accuracy of defect detection.
[0023] (2) Breaking through the limitations of traditional global FFT filtering in adapting to local deformation, the grayscale image is divided into several local sub-blocks by adopting a sliding window strategy. Texture features are extracted and filtering parameters are optimized separately for each sub-block. Non-rigid deformation of fabric usually manifests as differential deformation in local areas, such as edge stretching and slight wrinkles in the middle. Local sub-block processing can accurately capture the deformation characteristics of different areas and avoid the inadequacy of global filtering in adapting to local deformation. At the same time, the texture structure tensor can effectively characterize the texture direction and gradient intensity of local sub-blocks, providing accurate spatial domain basis for the calculation of frequency domain energy divergence potential, making the dynamic adjustment of the filtering radius more in line with the actual deformation state of the fabric. Compared with traditional filtering methods that only rely on frequency domain information, it has stronger adaptability and robustness.
[0024] (3) Compared with the fixed mask filtering of the traditional FFT algorithm, the adaptive filter attenuation weight matrix constructed by the present invention based on the multi-notch model can realize the differential adjustment of the filtering intensity according to the frequency domain energy divergence potential. In the region where the main frequency energy is concentrated, the filter attenuation weight is high, which strongly suppresses the background texture. In the edge region where the energy diverges, the weight transitions smoothly, avoiding the generation of new artifacts at the filtering boundary. In the non-main frequency region, the weight is maintained at a low level, preserving the defect signal to the maximum extent. It can more effectively separate the background texture and the defect signal, making the contours of various defects such as holes, stains, pinholes, and unraveling in the reconstructed image clearer and with higher contrast. This lays a high-quality foundation for subsequent binarization segmentation and morphological processing, and further improves the accuracy of defect recognition and localization. Attached Figure Description
[0025] Figure 1 This is a flowchart of a method for detecting defects in clothing fabrics based on image recognition, according to an embodiment of the present invention.
[0026] Figure 2 This is a schematic diagram of the pixel distribution of an image on the surface of a garment fabric in an image recognition-based garment fabric defect detection method according to an embodiment of the present invention.
[0027] Figure 3 This is a schematic diagram of the pixel distribution of a reconstructed image in an image recognition-based method for detecting defects in clothing fabrics according to an embodiment of the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] This invention discloses an image recognition-based method for detecting defects in clothing fabrics, referring to... Figure 1 This includes steps S001-S006: S001: Obtain a grayscale image of the surface of the clothing fabric, and divide the grayscale image into several local sub-blocks using a sliding window strategy.
[0030] Specifically, surface images of garment fabric on the production line are acquired using an industrial line scan camera. These images are then converted to grayscale. Considering the local non-uniformity of fabric deformation—that is, different regions have different degrees of stretching—a uniform Fourier transform cannot be performed on the entire image. Therefore, a sliding window strategy is used to divide the grayscale image into several overlapping local sub-blocks. For example, the sliding window size is set to 2-3 times the fabric texture period, and the overlap rate between adjacent local sub-blocks is set to 50% to ensure the continuity of information between adjacent sub-blocks. Subsequent steps process each local sub-block independently.
[0031] S002: For each local sub-block, construct the texture structure tensor of the spatial domain, and calculate the principal angle and gradient intensity features of the texture of each local sub-block based on the texture structure tensor of each local sub-block.
[0032] It should be noted that non-rigid deformations of clothing fabrics, such as stretching, shearing, and wrinkling, directly cause changes in the direction and intensity distribution of local textures. Filtering based solely on global texture features cannot capture these localized texture variations, leading to insufficient filtering accuracy. Therefore, this step requires quantizing the inherent texture characteristics of each local sub-block using texture structure tensors. This provides a precise spatial domain basis for subsequent evaluation of frequency domain energy diffusion, ensuring that the filtering parameters are adapted to the local deformation state.
[0033] Specifically, the texture structure tensor satisfies: ; In the formula, For the first The structure tensor of each local sub-block represents the covariance matrix of the main texture direction and gradient intensity within that local sub-block; and These are the pixels of the local sub-block. Gradients in the horizontal and vertical directions; For pixels The Gaussian weighted window function is used to smooth local noise. By calculating the gradient information of all pixels in the local sub-block and averaging it with weights, the eigenvalues and eigenvectors of the matrix are obtained, which represent the main direction and intensity of the texture in the local sub-block. The texture structure tensor can be used to quantify the degree of fabric deformation in the spatial domain and is the basis for subsequent calculations.
[0034] S003: Based on the principal angle and gradient intensity characteristics of the texture, and combined with the global reference angle of the standard fabric image, calculate the frequency domain energy divergence potential energy that characterizes the degree of energy diffusion of each local sub-block in the frequency domain.
[0035] It should be noted that local texture changes in the spatial domain directly lead to changes in the diffusion range of the dominant frequency energy in the frequency domain. The greater the deviation of the dominant texture angle from the standard angle and the more significant the gradient intensity anisotropy, the more severe the local deformation, and the more pronounced the diffusion of the corresponding dominant frequency energy in the frequency domain. Traditional FFT algorithms do not establish a correlation between spatial domain texture features and frequency domain energy diffusion, resulting in the inability to dynamically adapt the filtering radius. Therefore, this step requires quantizing the frequency domain energy divergence potential to transform the local deformation state in the spatial domain into a quantifiable index that can be directly used to adjust the filtering parameters, providing a core basis for adaptive filtering.
[0036] Specifically, the frequency domain energy divergence potential satisfies: ; In the formula, To characterize the first The frequency domain energy divergence potential energy, representing the degree of energy diffusion in a local sub-block, indicates the degree of deformation in a local area of the fabric. A larger value indicates more severe energy diffusion of the texture in that area in the frequency domain, requiring a larger filtering range to effectively suppress background texture. The value range is... ; The potential energy cutoff threshold, used to prevent numerical runaway caused by extreme deformation, has a range of values. ; and The first The first and second eigenvalues in the gradient intensity features of each local sub-block, and The gradient intensity features of local sub-blocks are obtained by using a matrix eigenvalue solving function on the eigenvalues of the texture structure tensor. The gradient intensity features include a first eigenvalue representing the intensity of the texture in the main direction within the local sub-block, and a second eigenvalue representing the intensity of the texture in the vertical direction within the local sub-block. For the first The principal angle of the texture of each local sub-block is obtained by using the principal eigenvector of the texture structure tensor. The function obtains the principal angle of the texture of a local sub-block; This serves as a global reference angle for the standard fabric image, which is a grayscale image of a standard, non-deformable garment fabric surface. The hyperparameter used to prevent the denominator from being zero has a value of [value missing]. ; It is a minimum value function. It is a natural exponential function.
[0037] S004: Based on the multi-notch model, an adaptive filtering attenuation weight matrix is constructed for each local sub-block, wherein the filtering radius of the notch region in the multi-notch model is dynamically adjusted according to the frequency domain energy divergence potential energy, and the filtering radius is positively correlated with the frequency domain energy divergence potential energy.
[0038] It should be noted that fixed-radius notch filtering, in areas with severe energy diffusion, cannot completely cover the divergent dominant frequency components, resulting in residual background texture. In areas with concentrated energy, an excessively large fixed radius may mistakenly filter out the frequency domain signal of minor defects, leading to missed detections. In contrast, the multi-notch model can accurately match multiple dominant frequency peak regions of a standard fabric and dynamically adjust the filtering radius of each notch region based on the frequency domain energy divergence potential. This enables differentiated suppression by expanding the filtering range in severely deformed areas and retaining a smaller filtering range in slightly deformed areas. Therefore, this step constructs an adaptive filter attenuation weight matrix, transforming the dynamically adjusted filtering radius into suppression weights at various points in the frequency domain, ensuring that background texture is effectively filtered out without damaging the frequency domain signal of minor defects.
[0039] Specifically, the adaptive filter attenuation weight matrix satisfies: ; In the formula, For the first The internal frequency domain coordinates of the adaptive filtering attenuation weight matrix of each local sub-block The adaptive filter attenuation weight at each frequency point represents the degree to which each frequency component should be suppressed. A value closer to 0 indicates that the frequency component is more likely to be background texture and should be suppressed; a value closer to 1 indicates that the frequency component is more likely to be a defect signal and should be retained. The value is always within a certain range. Within a certain range, to ensure that the filtering process does not introduce negative weighting issues; The number of notch regions is obtained by performing a Fourier transform on a standard fabric image and using a peak detection algorithm, typically selecting the 3-5 peak points with the highest energy. These are the frequency domain coordinates, and the frequency domain coordinates after FFT transformation. For the first The center coordinates of each notch region; The basic filtering radius is determined by analyzing the spectrum of a standard fabric, taking the radius that covers 95% of the dominant frequency energy, with a value range of [value missing]. Pixel; The sensitivity adjustment coefficient, used to control the influence of frequency domain energy divergence potential on the filter radius, can be determined through cross-validation, and its value range is [value range missing]. ; To characterize the first The frequency domain energy divergence potential of a local sub-block in the frequency domain represents the degree of energy diffusion. It is a natural exponential function. To calculate the Euclidean distance from the frequency domain coordinates to the center coordinates.
[0040] S005: Perform a Fourier transform on each local sub-block to obtain a spectrum, use the adaptive filtering attenuation weight matrix to perform frequency domain filtering on the spectrum, and perform an inverse Fourier transform on the filtered spectrum to obtain a reconstructed image of each local sub-block.
[0041] It should be noted that the Fourier transform is the core method connecting the spatial and frequency domains. By transforming the spatial domain image of a local sub-block into a frequency domain spectrum, the dominant frequency component corresponding to the background texture and the anomalous component corresponding to the defect can be clearly separated. Then, by using an adaptive weighting matrix to weight the spectrum point by point, the dominant frequency component (i.e., the background texture) within each notch region can be precisely suppressed, while the anomalous component (i.e., the defect) in the non-notch regions is fully preserved. Therefore, this step, through the process of Fourier transform, adaptive weighted filtering, and inverse Fourier transform, maps the differentiated filtering effect in the frequency domain back to the spatial domain, obtaining a reconstructed image where the background texture is suppressed and the defect signal is highlighted, providing a high-quality image foundation for subsequent defect segmentation and localization.
[0042] Specifically, the spectrum of each frequency domain coordinate in the spectrum diagram is multiplied by the adaptive filtering attenuation weight of the corresponding frequency domain coordinate in the adaptive filtering weight matrix to obtain the corrected spectrum of each frequency domain coordinate in the spectrum diagram, thereby completing the frequency domain filtering of the spectrum diagram and obtaining the filtered spectrum diagram.
[0043] like Figure 2 and Figure 3 As shown in the figure, the horizontal axis represents the pixel grayscale value, and the vertical axis represents the number of pixels with the corresponding grayscale value. Figure 2 The curve represents the pixel distribution characteristics of the original grayscale image of the clothing fabric: because the original image contains a large number of periodic background textures, the high-frequency components corresponding to these textures result in a wide range of pixel grayscale values, with dispersed and flat peaks. The feature pixels corresponding to the defect area are masked by the noise pixels of the background texture, making them difficult to distinguish directly. Figure 3 The curve represents the pixel distribution characteristics of the image after reconstruction by the adaptive filtering of the present invention: by accurately suppressing the frequency domain main frequency component representing the background texture through the adaptive filtering attenuation weight matrix, the redundant pixels corresponding to the background texture are weakened, the pixel gray value distribution is more concentrated, and the difference in pixel gray value between the defect area and the background area is amplified, forming a clear distribution boundary, thus demonstrating the effectiveness of the background suppression of the present invention.
[0044] S006: Perform binarization thresholding and morphological processing on the reconstructed image to identify and locate defects in clothing fabrics.
[0045] It should be noted that while the defect area and background area in the reconstructed image have formed a clear grayscale difference, there may still be a small number of noise points and broken defect areas. Therefore, this step uses binarization thresholding to convert the grayscale difference into a black and white binary image, and then uses morphological operations to eliminate noise and connect broken defect areas, ultimately achieving accurate identification and localization of defects.
[0046] Specifically, the identification and location of defects in clothing fabrics includes: The reconstructed image is processed using the Otsu thresholding method, which automatically calculates the threshold and generates a binary image. Perform morphological concatenation operations on the binary image, for example, using... The structural elements are expanded and eroded to connect suspected fractured areas, and finally the connected areas are located and marked as the final defects, realizing defect detection of clothing fabrics based on image recognition.
[0047] This invention also discloses an image recognition-based garment fabric defect detection system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement an image recognition-based garment fabric defect detection method according to the present invention.
[0048] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0049] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting defects in clothing fabrics based on image recognition, characterized in that, include: A grayscale image of the surface of the clothing fabric is acquired, and the grayscale image is divided into several local sub-blocks using a sliding window strategy; For each local sub-block, construct the texture structure tensor of the spatial domain, and calculate the principal angle and gradient intensity features of each local sub-block based on the texture structure tensor of each local sub-block; Based on the texture principal angle and gradient intensity characteristics, and combined with the global reference angle of the standard fabric image, the frequency domain energy divergence potential energy characterizing the degree of energy diffusion of each local sub-block in the frequency domain is calculated. Based on the multi-notch model, an adaptive filtering attenuation weight matrix is constructed for each local sub-block. The filtering radius of the notch region in the multi-notch model is dynamically adjusted according to the frequency domain energy divergence potential energy, and the filtering radius is positively correlated with the frequency domain energy divergence potential energy. A Fourier transform is performed on each local sub-block to obtain a spectrum. The spectrum is then filtered in the frequency domain using the adaptive filtering attenuation weight matrix, and an inverse Fourier transform is performed on the filtered spectrum to obtain a reconstructed image of each local sub-block. Binarization thresholding and morphological processing are performed on the reconstructed image to identify and locate defects in clothing fabrics.
2. The method for detecting defects in clothing fabrics based on image recognition according to claim 1, characterized in that, The texture structure tensor for constructing the spatial domain includes: Obtain the gradient information of each pixel within each local sub-block; Within each local sub-block, a Gaussian weighted window function is used to sum the gradient outer products of all pixels in a weighted manner to obtain the texture structure tensor.
3. The method for detecting defects in clothing fabrics based on image recognition according to claim 1, characterized in that, The frequency domain energy divergence potential energy satisfies: ; In the formula, To characterize the first The frequency domain energy divergence potential of a local sub-block in the frequency domain represents the degree of energy diffusion. The potential energy cutoff threshold is used to prevent numerical runaway caused by extreme deformation. and The first The first and second eigenvalues in the gradient intensity features of each local sub-block, and , For the first The dominant angle of the texture of a local sub-block This is the global reference angle for standard fabric images. Hyperparameters used to prevent the denominator from being zero. It is a minimum value function. It is a natural exponential function.
4. A method for detecting defects in clothing fabrics based on image recognition according to claim 1 or 3, characterized in that, The method for obtaining the principal angle and gradient intensity features of the texture is as follows: Use the principal eigenvector of the texture structure tensor The function obtains the principal angle of the texture for each local sub-block; The gradient intensity features of each local sub-block are obtained by using a matrix eigenvalue solving function on the eigenvalues of the texture structure tensor. The gradient intensity features include a first eigenvalue representing the intensity of the texture in the main direction within the local sub-block, and a second eigenvalue representing the intensity of the texture in the vertical direction within the local sub-block.
5. The method for detecting defects in clothing fabrics based on image recognition according to claim 3, characterized in that, The range of the potential energy cutoff threshold is: .
6. The method for detecting defects in clothing fabrics based on image recognition according to claim 1, characterized in that, The adaptive filter attenuation weight matrix satisfies: ; In the formula, For the first The internal frequency domain coordinates of the adaptive filtering attenuation weight matrix of each local sub-block Adaptive filtering attenuation weights at the location, The number of notch regions, For frequency domain coordinates, For the first The center coordinates of each notch region Based on the basic filter radius, This is a sensitivity adjustment coefficient used to control the degree of influence of frequency domain energy divergence potential on the filter radius. To characterize the first The frequency domain energy divergence potential of a local sub-block in the frequency domain represents the degree of energy diffusion. It is a natural exponential function. To calculate the Euclidean distance from the frequency domain coordinates to the center coordinates.
7. The method for detecting defects in clothing fabrics based on image recognition according to claim 6, characterized in that, The notch region is obtained by performing a Fourier transform on a standard fabric image and using a peak detection algorithm.
8. The method for detecting defects in clothing fabrics based on image recognition according to claim 6, characterized in that, The range of values for the basic filter radius is: The sensitivity adjustment coefficient has a range of values of [value missing]. .
9. The method for detecting defects in clothing fabrics based on image recognition according to claim 1, characterized in that, The identification and location of defects in clothing fabrics includes: The reconstructed image is processed using the Otsu thresholding method to obtain a binary image; Morphological connection operations are performed on the binary image to locate and mark connected regions as final defects, thereby realizing defect detection of clothing fabrics based on image recognition.
10. A garment fabric defect detection system based on image recognition, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement a method for detecting defects in clothing fabrics based on image recognition according to any one of claims 1-9.
Citation Information
Patent Citations
Visual inspection method for textile quality
CN116843688A
Seamless steel tube defect detection method based on image processing
CN119338809A
Method for evaluating surface flatness of autoclaved aerated concrete plate
CN120747042A
Fabric defect intelligent detection method and system based on AI visual identification
CN120747091A
Adaptable spatial notch filter
US20040066162A1