Textile defect detection method and system based on image recognition

By calculating the suspected abnormality index and dyeing abnormality degree value of the neighborhood window in the textile dyeing image, and updating the grayscale value in combination with gradient information, the problem that the existing technology cannot comprehensively detect textile dyeing defects is solved, and a higher precision defect detection is achieved.

CN119671966AActive Publication Date: 2025-03-21湖北顺和棉业有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411727839.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-21
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

When detecting textile dyeing defects, the prior art cannot fully detect dyeing defects caused by the texture of the fabric or fiber structure, and the detection results are relatively single.

Method used

By obtaining the dyed image of the textile, the suspected anomaly index and staining anomaly degree value of the neighborhood window are calculated, and the gray value of the image is updated to enhance contrast, and the defect area is segmented and identified by the Otsu method.

Benefits of technology

It realizes more comprehensive and accurate detection of textile dyeing defects, overcomes the limitations of traditional methods relying on color or single features, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119671966A_ABST
    Figure CN119671966A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, in particular to a textile defect detection method and system based on image recognition, an industrial camera is used for shooting a textile image, preprocessing operations such as graying and noise filtering are carried out on the textile image, and then the gray features and gradient directions of pixel points in the image are analyzed to detect the defects of the textile. And the dyeing abnormity degree value of each pixel point in the textile image is calculated, and finally an accurate textile defect area is obtained by adjusting the image gray level and using Otsu method threshold segmentation. According to the method, the dyeing abnormity of the multi-component fabric textile is detected through graying, gradient calculation and neighborhood window analysis, and the defect region is segmented by combining an Otsu method threshold value, so that the accurate textile dyeing defect automatic detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a textile defect detection method and system based on image recognition. Background Art

[0002] As an important product in daily life and industry, the quality of textiles is related to the consumer experience and the reliability of industrial applications. Modern textile fabrics are diverse, covering natural fibers, synthetic fibers, recycled fibers, etc., and also include multi-component textile fabrics, which are composed of a variety of fibers, colors or materials to meet diverse functional requirements, such as comfort, wear resistance, decorativeness and functionality. However, due to the complexity of dyeing multi-component textile fabrics during the production process, textiles often have dyeing defects caused by uneven dye concentration or differences in fiber properties, which are difficult to detect with the naked eye.

[0003] With the advancement of modern image processing technology, image-based detection methods can be used to provide comprehensive quality assessment. Image processing technology can accurately capture subtle color changes on fabrics and ensure the objectivity and consistency of detection results. For example, a Chinese patent document with announcement number CN114882034B discloses a fabric dyeing quality assessment method based on image processing, which obtains the HSV map of the fabric surface and the saturation of each pixel in the map; traverses the HSV map through the designed statistical kernel to obtain three features of the statistical kernel after each sliding window; constructs a three-dimensional dyeing uniform co-occurrence matrix based on the three features and performs uniform entropy calculation to complete the evaluation of fabric dyeing quality. However, this method still has some technical defects: it relies on the S channel of the HSV space as well as saturation and adjacent difference to evaluate the dyeing quality, and cannot fully detect the dyeing defects caused by the texture or fiber structure of the fabric, and the detection results are relatively single. Summary of the invention

[0004] In view of the problem that the above-mentioned detection results are relatively single, in the first aspect, the present invention proposes a textile defect detection method based on image recognition, comprising: obtaining an image after the textile is dyed, taking any pixel point in the image as a target pixel point, determining a first window centered on the target pixel point and multiple adjacent second windows, and calculating the suspected abnormality index of the first window and the multiple second windows; updating the grayscale value of each pixel point in the image based on the dyeing abnormality degree value to obtain a contrast enhanced image, performing threshold segmentation on the contrast enhanced image, and marking the image area less than the segmentation threshold as a dyeing defect area; the dyeing abnormality degree value is positively correlated with the sum of the suspected abnormality indexes of the multiple second windows, and negatively correlated with the suspected abnormality index of the first window and the total number of second windows; the suspected abnormality index is positively correlated with the concentration characteristic value and gradient amplitude of each pixel point in the corresponding window, and negatively correlated with the angle difference between the sum of the gradient directions of all the pixels in the corresponding window and the gradient direction of the central pixel point of the corresponding window; the concentration characteristic value is positively correlated with the grayscale variance in the window where the corresponding pixel point is located, and negatively correlated with the grayscale mean in the window where the corresponding pixel point is located.

[0005] The present invention calculates the concentration characteristic value by the ratio of the grayscale variance to the grayscale value mean of the neighborhood window, and captures the concentration distribution and flow characteristics of the textile dye in combination with the gradient direction and amplitude, ensuring that subtle dyeing anomalies can be identified. In addition, the dyeing anomaly degree value is obtained by the suspected anomaly index of the adjacent window to update the grayscale value of the original image to further improve the comprehensiveness and accuracy of the detection. This method breaks through the limitation of the existing technology that relies solely on color or saturation for detection, and is more suitable for complex multi-component fabric textiles.

[0006] Furthermore, the calculation method of the suspected abnormality index is specifically as follows:

[0007]

[0008] Where G(W i ) represents the suspected abnormality index of the first window; C(W i j ) represents the concentration characteristic value of the j-th pixel in the first window; represents the absolute value of the gradient amplitude of the jth pixel in the first window; It represents the angle difference between the gradient direction of the j-th pixel in the first window and the sum of the gradient directions of all pixels in the first window; norm[] is the normalization function; J represents the total number of pixels in the ith window; γ is the parameter adjustment factor.

[0009] Furthermore, the calculation method of the concentration characteristic value is specifically as follows:

[0010]

[0011] Among them C i represents the concentration characteristic value of the target pixel; B(W i ) represents the grayscale variance of all pixels in the first window; A(W i j ) represents the gray value of the jth pixel in the first window; J represents the total number of pixels in the first window; ∈ is the parameter adjustment factor.

[0012] Furthermore, the calculation method of the abnormal staining degree value is specifically as follows:

[0013]

[0014] Among them, H i Indicates the abnormal staining degree of the target pixel; G(W i(k) ) represents the suspected abnormality index of the kth second window; G(W i ) represents the suspected anomaly index of the first window; K represents the total number of the second windows; δ is the parameter adjustment factor.

[0015] Furthermore, the grayscale value of each pixel in the image is updated based on the staining abnormality value to obtain a contrast enhanced image, and it also includes: normalizing the grayscale value of the target pixel in the textile image to obtain a normalized grayscale value; multiplying the normalized grayscale value with the staining abnormality value of the corresponding target pixel to obtain a new value; proportionally amplifying the new value according to the grayscale value range to obtain an updated grayscale value of the target pixel, and all updated grayscale values ​​of the target pixel constitute a contrast enhanced image.

[0016] By updating the grayscale value of the target pixel point with the value of the abnormal degree of dyeing, the contrast between the defective area and the normal area is enhanced, which is convenient for subsequent image processing and analysis, and is particularly suitable for subsequent automated defect segmentation and marking. In terms of image enhancement, the existing technology usually cannot make specific grayscale value adjustments for abnormal dyeing, resulting in insufficient contrast between the defective area and the normal area, which is easy to miss.

[0017] Furthermore, obtaining the image of the textile after dyeing also includes: using an industrial camera to photograph the textile after dyeing; converting the photographed image into a grayscale image using a weighted grayscale algorithm; and performing a preprocessing operation on the grayscale image to obtain the image of the textile after dyeing.

[0018] Furthermore, the preprocessing operation on the grayscale image also includes: smoothing the grayscale image using a median filter; and enhancing the grayscale image using a histogram equalization algorithm.

[0019] Image preprocessing uses median filtering and histogram equalization to effectively eliminate noise in the acquisition process and enhance the details of the textile surface.

[0020] Furthermore, the Sobel operator is used to obtain the gradient direction and gradient amplitude of the target pixel.

[0021] The use of the Sobel operator ensures the accurate extraction of the gradient direction and amplitude of the pixel point, making the capture of the flow of the pigment liquid more sensitive.

[0022] Furthermore, the segmentation threshold is obtained using the Otsu threshold method.

[0023] In a second aspect, the present invention provides a textile defect detection system based on image recognition, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the textile defect detection method based on image recognition of the present invention is implemented.

[0024] The technical effects of the present invention are:

[0025] The present invention uses the ratio of the grayscale variance of the neighborhood window to the grayscale mean to calculate the concentration characteristic value, combines the gradient direction and amplitude to effectively capture the dye concentration distribution and flow characteristics, and accurately identifies dyeing anomalies. And through the calculation of the suspected anomaly index and the degree of dyeing anomaly value, combined with the adjacent window linkage analysis, it overcomes the limitations of the traditional method that only relies on color information or a single feature. Finally, through grayscale value adjustment and Otsu method segmentation, the defect area in the optimized image is made more prominent, thereby improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0027] Figure 1 is a flowchart schematically illustrating a textile defect detection method based on image recognition in an embodiment of the present invention;

[0028] Figure 2 is a grayscale diagram schematically showing a partial dyeing defect of a textile product according to an embodiment of the present invention;

[0029] Figure 3 is a grayscale schematic diagram schematically showing the multi-directional reversal of the pigment liquid flow in the embodiment of the present invention;

[0030] Figure 4It is a schematic diagram schematically showing the grayscale of a partial dyeing defect image of a textile in an embodiment of the present invention after being optimized.

[0031] Figure 5 The figure schematically shows a structural block diagram of a textile defect detection system based on image recognition according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0033] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0034] Example of a method for detecting defects in textile fabrics based on an image:

[0035] like Figure 1 As shown, a textile defect detection method based on image recognition of the present invention comprises:

[0036] S1. Obtain images of textiles after dyeing and perform preprocessing operations.

[0037] Multi-component fabric textiles are made of a combination of multiple fibers or colors, with complex structures and color expressions. During the dyeing process, problems such as uneven dyeing and color difference are prone to occur, such as Figure 2 As shown. In order to accurately detect the details of multi-component fabric textiles, after the multi-component fabric textiles are dyed, an industrial camera (for example, with a resolution of more than 10 million pixels) can be used to capture images of the fabrics. At the same time, an LED cold light source can be used to illuminate the textiles when capturing images to avoid reflection or shadow problems; then the captured images can be converted into grayscale images using a weighted grayscale algorithm; then the grayscale images can be smoothed using a median filter and the images can be enhanced using a histogram equalization algorithm to highlight the subtle defects on the textiles. The above-mentioned weighted grayscale algorithm, median filter, and histogram equalization algorithm are well-known technologies and will not be described in detail here.

[0038] Image preprocessing uses median filtering and histogram equalization to effectively eliminate noise in the acquisition process and enhance the details of the textile surface.

[0039] S2. Obtain the concentration characteristic value of the pixel point based on the grayscale feature in the neighborhood window of the pixel point; obtain the flow vector of the pixel point and the main flow vector of the window based on the gradient feature in the neighborhood window; and obtain the suspected anomaly index of the neighborhood window.

[0040] S201. Obtaining a concentration characteristic value of a pixel based on a grayscale feature within a neighborhood window of the pixel.

[0041] When dyeing textiles, since the concentration of the pigment liquid gradually decreases and the liquid has flow characteristics, as the dyeing progresses, the gray value changes from high concentration to low concentration of the pigment liquid. Therefore, the concentration feature value of each pixel in the image is calculated, and the i-th pixel in the textile image obtained in step S1 is used as an example for explanation.

[0042] First, take the ith pixel as the center and determine a 5×5 neighborhood window, denoted as W i , which can also be recorded as the first window. The implementer can also select the size of the neighborhood window according to the actual situation, such as 3×3, 7×7, etc. Then the concentration characteristic value calculation method of the pixel point is as follows:

[0043]

[0044] Among them C i represents the concentration characteristic value of the i-th pixel; B(W i ) represents the neighborhood window W i The grayscale variance of all pixels within the neighborhood window W is as follows: i All refer to a 5×5 neighborhood window determined by the i-th pixel in the image, and the neighborhood window does not include the central pixel, which will not be described in detail later; A(W i j ) represents the neighborhood window W i The gray value of the jth pixel in the neighborhood window W i The total number of internal pixels is J=25-1=24 in this embodiment; ∈ is a parameter adjustment factor to avoid the situation where the denominator is 0. In this embodiment, an empirical value of 0.01 can be taken.

[0045] When B(W i ) is larger, indicating that the change of gray value in the neighborhood window is more uneven, and the color difference is more likely to be caused by the flow of pigment liquid from the high concentration area. Then the concentration characteristic value C of the pixel point i The bigger; when The smaller it is, the smaller the overall gray value in the neighborhood window is. Figure 2 As shown in the figure, the smaller the gray value, the more likely it is that the concentration of the pigment liquid is high. The concentration characteristic value C of the pixel point i The bigger.

[0046] S202: Acquire the flow vector of the pixel point and the main flow vector of the window based on the gradient feature in the neighborhood window.

[0047] Under normal circumstances, during the dyeing process of multi-component fabric textiles, the pigment should be directly attached to a specific area that has been set. However, due to the fluidity of the pigment liquid, it will inevitably stain the surrounding area within a certain range of the colored area, causing a blurring phenomenon, thereby causing defects in the multi-component fabric textiles.

[0048] If the pigment liquid has already diffused, the flow and diffusion of the liquid will not be unimpeded because the multi-component fabric of the textile may have texture or pattern obstructions. Then, the flow and diffusion of the liquid will be hindered by the mutual interference of the texture, which may lead to pigment accumulation and a higher liquid concentration.

[0049] In general, the smudged area is only caused by slight smudges of the pigment liquid, and its concentration is relatively light and tends to occur at the edge of the dyed area. However, when diffusion is blocked, the concentration of the smudged area increases, making it difficult to distinguish from the normal dyed area with a higher concentration. Therefore, the defective area is more likely to be close to the concentration characteristic value in the normal area and is not easy to detect. Therefore, further analysis is performed based on the direction of the concentration characteristic value to determine the area where the pigment liquid flow defect may exist.

[0050] Similarly, the neighborhood window W i Take this as an example: First, use the Sobel operator to obtain the neighborhood window W i The gradient direction and gradient magnitude of each pixel in the neighborhood window W are used to calculate the gradient direction as the direction of the flow vector of the corresponding pixel, and the gradient magnitude as the value of the flow vector of the corresponding pixel. i The flow vector of the j-th pixel in is Then calculate the neighborhood window W i The flow vector sum of all pixels in is recorded as And as the main flow vector of the neighborhood window; finally, the flow vector The direction of the flow principal vector The angle difference in the direction of The angle range can be set in [0°,180°].

[0051] The use of the Sobel operator ensures the accurate extraction of the gradient direction and amplitude of the pixel point, making the capture of the flow of the pigment liquid more sensitive.

[0052] S203: Obtain a suspected anomaly index of a pixel point neighborhood window.

[0053] For the neighborhood window W i, and obtain its suspected abnormality index to quantify the possibility of dyeing defects in multi-component fabric textiles within this neighborhood window. The specific calculation process is as follows:

[0054]

[0055] Where G(W i ) represents the neighborhood window W i Suspected abnormality index; C(W i j ) represents the neighborhood window W i The concentration characteristic value of the j-th pixel point is calculated in the same way as the concentration characteristic value of the i-th pixel point in step S201, and will not be described in detail here; Represents the neighborhood window W i The absolute value of the modulus of the flow vector of the j-th pixel; Represents the neighborhood window W i The direction of the flow vector of the j-th pixel in the neighborhood window W i The main flow vector The angle difference in the direction of the neighborhood window; norm[] is a normalization function, which is used to normalize the maximum and minimum values ​​of all corresponding angle differences in the neighborhood window; γ is a parameter adjustment factor to avoid the situation where the denominator is 0. In this embodiment, the empirical value 0.01 can be taken; J represents the neighborhood window W i The total number of pixels in the image.

[0056] When C(W i j ) is larger, indicating that the neighborhood window W i The larger the concentration characteristic value of the j-th pixel point in the neighborhood window, the greater the possibility that there is pigment liquid in the fabric in the neighborhood window, and the greater the possibility that the pigment liquid flows due to the concentration difference, that is, the greater the possibility that the textile in the neighborhood window has dyeing defects, the greater the suspected abnormality index G(W i ) is larger; when The larger the value, the larger the neighborhood window W. i The larger the gradient amplitude of the j-th pixel point in the neighborhood window, the more obvious the flow of the pigment liquid on the fabric in the neighborhood window may be, and the suspected anomaly index G(W i ) is larger; when The smaller the value, the smaller the neighborhood window W. i The smaller the angle between the flow vector of the jth pixel and the main flow vector, the more obvious the characteristics of the pigment liquid flow may be, and the more likely the suspected abnormality index G(W i ) is larger.

[0057] S3. Determine the staining abnormality value of the pixel point based on the suspected abnormality index of the neighborhood window and the adjacent window.

[0058] When the pigment liquid flows and diffuses, its flow may be affected by the texture or pattern on the textile fabric and may produce a return phenomenon. In addition, the returned pigment liquid will have a multi-directional return trend due to the shape of the obstacle, resulting in non-directional large-scale smudge phenomenon in the diffused area, such as Figure 3 Therefore, the final abnormal staining degree value of the pixel point is determined by combining the suspected abnormal index of other windows adjacent to the pixel point neighborhood window, as follows:

[0059] The neighborhood window W i For example, in step S203, the suspected abnormality index G(W i ), and then obtain the suspected abnormality index of the remaining 8 adjacent windows, namely, upper, lower, left, right, upper left, upper right, lower left, and lower right, and compare them with the neighboring window W i The adjacent k-th window is denoted as W i(k) , which can also be recorded as the second window, and its suspected abnormality index is recorded as G(W i(k) ). Then the final calculation method of the abnormal staining degree value of the i-th pixel is:

[0060]

[0061] Among them, H i represents the abnormal staining degree value of the i-th pixel; G(W i(k) ) represents the suspected abnormal index of the kth adjacent window; G(W i ) represents the neighborhood window W i The suspected anomaly index; K represents the neighborhood window W i The total number of adjacent windows is 8, which is an empirical value in this embodiment; δ is a parameter adjustment factor to avoid the denominator being 0, and an empirical value of 0.01 can be taken in this embodiment.

[0062] when The larger the value, the closer it is to the neighborhood window W. i The more likely it is that there is a dyeing defect caused by the flow of pigment liquid in other adjacent windows, the larger the neighboring window W i The probability of defects in the window will be greater, and as the suspected abnormality index of the surrounding adjacent windows increases, it is more likely that there will be a large area of ​​non-directional pigment liquid flow and the blooming phenomenon caused by the return in this range, and the greater the abnormality value of the i-th pixel; G(W i ) is used to standardize the staining abnormality value to facilitate the subsequent calculation of the gray value update of the pixel point.

[0063] S4. Adjusting the grayscale of the pixel points based on the abnormal dyeing degree value; performing threshold segmentation on the optimized textile image to obtain a defect detection result.

[0064] In step S3, the dyeing abnormality value of each pixel in the multi-component fabric textile image is obtained, and the corresponding pixel in the image is adjusted according to the dyeing abnormality value. Because the larger the dyeing abnormality value, the greater the possibility that the pixel is a pixel in the dyeing defect area, the new pixel grayscale is obtained according to the product of the dyeing abnormality value and the corresponding pixel grayscale, as shown below:

[0065] First, the grayscale values ​​of all pixels in the multi-component fabric textile image are normalized, and then the normalized grayscale value is multiplied by the dyeing abnormality value corresponding to the pixel to obtain a new value. Finally, the new value obtained by multiplying all pixels by the dyeing abnormality value is proportionally enlarged according to the grayscale value range [0,255] to obtain the updated grayscale values ​​of all pixels. The image after the updated grayscale value can also be recorded as a contrast enhanced image.

[0066] For example, if there is a pixel point ω in the multi-component fabric textile image, its grayscale value is 240, after normalization processing, it is The abnormal staining degree value of the pixel point obtained in step S3 in this embodiment is H ω =8.4, then the updated gray value of the pixel is:

[0067] 0.941×H ω =7.9

[0068] If the updated maximum grayscale value of all pixels in the entire image is 20 and the minimum grayscale value is 3, then the updated grayscale value of the pixel ω is:

[0069]

[0070] The above calculation process retains 3 decimal places, and the updated grayscale value is rounded to an integer. Finally, the pixel value of the original multi-component fabric textile image is updated by the dyeing abnormality value to increase the contrast between the dyeing area with possible defects and the normal area, such as Figure 4 As shown. The enhanced multi-component fabric textile grayscale image is threshold segmented using the Otsu threshold algorithm, and the area less than the segmentation threshold is marked as a dyeing defect area. According to the dyeing defect area, a specific analysis is performed and corresponding measures are taken to avoid further losses in the future. The above Otsu threshold algorithm belongs to the well-known technology and will not be described here.

[0071] By updating the grayscale value of the target pixel point with the value of the abnormal degree of dyeing, the contrast between the defective area and the normal area is enhanced, which is convenient for subsequent image processing and analysis, and is particularly suitable for subsequent automated defect segmentation and marking. In terms of image enhancement, the existing technology usually cannot make specific grayscale value adjustments for abnormal dyeing, resulting in insufficient contrast between the defective area and the normal area, which is easy to miss.

[0072] The present invention uses the ratio of the grayscale variance of the neighborhood window to the grayscale mean to calculate the concentration characteristic value, combines the gradient direction and amplitude to effectively capture the dye concentration distribution and flow characteristics, and accurately identifies dyeing anomalies. And through the calculation of the suspected anomaly index and the degree of dyeing anomaly value, combined with the adjacent window linkage analysis, it overcomes the limitations of the traditional method that only relies on color information or a single feature. Finally, through grayscale value adjustment and Otsu method segmentation, the defect area in the optimized image is made more prominent, thereby improving the detection accuracy.

[0073] Example of textile defect detection system based on image recognition:

[0074] On the other hand, the present invention also provides a textile defect detection system based on image recognition. Figure 5 As shown, the textile 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, a textile defect detection method based on image recognition according to the first aspect of the present invention is implemented.

[0075] The textile defect detection system based on image recognition also includes other components well known to those skilled in the art, such as a communication interface, and the configuration and functions of which are known in the art, and thus will not be described in detail here.

[0076] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that may be used to store the required information and may be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.

[0077] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0078] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A textile defect detection method based on image recognition, characterized in that: The method comprises: Acquire an image of the textile after dyeing, take any pixel point in the image as a target pixel point, determine a first window centered on the target pixel point and a plurality of adjacent second windows, and calculate suspected abnormality indexes of the first window and the plurality of second windows; Based on the staining abnormality value, the grayscale value of each pixel in the image is updated to obtain a contrast-enhanced image, the contrast-enhanced image is segmented by a threshold value, and an image area smaller than the segmentation threshold value is marked as a staining defect area; The staining abnormality degree value is positively correlated with the sum of the suspected abnormality indexes of multiple second windows, and negatively correlated with the suspected abnormality index of the first window and the total number of second windows; The suspected anomaly index is positively correlated with the concentration characteristic value and gradient amplitude of each pixel point in the corresponding window, and negatively correlated with the angle difference between the sum of the gradient directions of all pixels in the corresponding window and the gradient direction of the central pixel point of the corresponding window; The concentration characteristic value is positively correlated with the grayscale variance in the window where the corresponding pixel point is located, and is negatively correlated with the grayscale mean in the window where the corresponding pixel point is located.

2. A textile defect detection method based on image recognition according to claim 1, characterized in that: The calculation method of the suspected abnormality index is specifically as follows: Where G(W i ) represents the suspected abnormality index of the first window; C(W i j ) represents the concentration characteristic value of the j-th pixel in the first window; represents the absolute value of the gradient amplitude of the jth pixel in the first window; It represents the angle difference between the gradient direction of the j-th pixel in the first window and the sum of the gradient directions of all pixels in the first window; norm[] is the normalization function; J represents the total number of pixels in the ith window; γ is the parameter adjustment factor.

3. The textile defect detection method based on image recognition according to claim 1, characterized in that: The calculation method of the concentration characteristic value is specifically as follows: Among them C i represents the concentration characteristic value of the target pixel; B(W i ) represents the grayscale variance of all pixels in the first window; A(W i j ) represents the gray value of the jth pixel in the first window; J represents the total number of pixels in the first window; ∈ is the parameter adjustment factor.

4. The textile defect detection method based on image recognition according to claim 1, characterized in that: The calculation method of the abnormal staining degree value is specifically as follows: Among them, H i Indicates the abnormal staining degree of the target pixel; G(W i(k) ) represents the suspected abnormality index of the kth second window; G(W i ) represents the suspected anomaly index of the first window; K represents the total number of the second windows; δ is the parameter adjustment factor.

5. The textile defect detection method based on image recognition according to claim 1, characterized in that: Updating the grayscale value of each pixel in the image based on the staining abnormality value to obtain a contrast enhanced image includes: Normalizing the grayscale value of the target pixel in the textile image to obtain a normalized grayscale value; Multiplying the normalized grayscale value by the staining abnormality value of the corresponding target pixel to obtain a new value; The new value is proportionally amplified according to the gray value range to obtain the updated gray value of the target pixel, and all the updated gray values ​​of the target pixel constitute a contrast enhanced image.

6. The textile defect detection method based on image recognition according to claim 1, characterized in that: Get images of textiles after dyeing, including: Use industrial cameras to photograph textiles after dyeing; The captured image is converted into a grayscale image using a weighted grayscale algorithm; The grayscale image is preprocessed to obtain an image of the textile after dyeing.

7. The textile defect detection method based on image recognition according to claim 6, characterized in that: The grayscale image is preprocessed, including: Using median filtering to smooth the grayscale image; The grayscale image is enhanced using a histogram equalization algorithm.

8. The textile defect detection method based on image recognition according to claim 1, characterized in that: The Sobel operator is used to obtain the gradient direction and gradient magnitude of the target pixel.

9. The textile defect detection method based on image recognition according to claim 1, characterized in that: The segmentation threshold is obtained using the Otsu threshold method.

10. A textile defect detection system based on image recognition, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for detecting textile defects based on image recognition according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Image Processing-Based Fabric Dyeing Quality Assessment Method

    CN114882034B

  • Device, system and method for detecting color development result of colloidal gold test paper

    CN110133261A

  • Textile dyeing quality intelligent evaluation method and system

    CN117808800A

  • Visual inspection system for defects of turbine guide blade of aero-engine

    CN117830298A

  • Method for detection and recognition of fog presence within an aircraft compartment using video images

    WO2004044683A2