A low-illumination color fabric defect rapid detection method and system

By employing adaptive enhancement and dual-path feature fusion, the problem of feature extraction for fabric defect detection in low-light environments is solved, achieving high-precision and high-speed fabric defect detection, which is suitable for online real-time quality inspection in the textile industry.

CN121582261BActive Publication Date: 2026-04-07WUHAN TEXTILE UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies for detecting fabric defects in low-light environments suffer from poor feature discrimination, low robustness, high computational cost, difficulty in achieving real-time performance, and failure to fully utilize color information.

Method used

A three-level processing method is adopted, consisting of adaptive Gamma correction, CLAHE enhancement, and multi-scale Retinex enhancement. This method combines dual-path feature extraction to simulate visual attention mechanisms and quantify texture patterns. By dynamically calculating adaptive fusion weights through local information entropy, a two-level threshold segmentation combining global and local approaches is performed to achieve accurate defect localization.

Benefits of technology

It achieves high-precision and high-speed fabric defect detection under low-light conditions, possesses excellent robustness and generalization ability, and is suitable for online real-time quality inspection in the textile industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582261B_ABST
    Figure CN121582261B_ABST
Patent Text Reader

Abstract

The application provides a low-illumination color fabric defect rapid detection method and system, aiming at solving the core technical problems of low detection precision, slow speed, insufficient use of color information and weak generalization ability of the prior art in a low-illumination environment. The application comprises the following steps: firstly, performing three-level processing of adaptive Gamma correction, CLAHE enhancement and multi-scale Retinex enhancement on an input image to restore details and colors; then, extracting significant features simulating a visual attention mechanism and structural features quantifying texture rules through a double-path parallel method; further, dynamically calculating a fusion weight based on local information entropy of a feature map to realize adaptive feature fusion; finally, completing accurate positioning of defects by using a two-level threshold segmentation technology combining a global threshold with a local threshold, and outputting a detection result containing a defect binary image and a confidence heat map. The application has the advantages of strong robustness, fast processing speed and good generalization ability, and is suitable for online real-time quality detection of the textile industry.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of industrial machine vision and digital image processing, and particularly relates to a method and system for automatically detecting defects of an RGB color fabric image collected in a poor light environment in the textile industry. BACKGROUND

[0002] In the textile industry production, automatic detection of defects (such as broken warp, weft, stains, holes, etc.) on the surface of the fabric is a key link to ensure product quality. The traditional method mainly relies on manual visual inspection, which has the problems of low efficiency, strong subjectivity and easy fatigue. The existing detection method based on machine vision performs well under uniform and sufficient illumination, but in the actual workshop environment, the image often presents low illumination, uneven illumination, low contrast, color distortion and other problems due to equipment shielding, light source aging or cloth movement, which makes the performance of traditional algorithms drop sharply.

[0003] The current mainstream methods mainly have the following limitations:

[0004] 1) The method based on manual features (such as gray scale statistics, Gabor filtering, wavelet transform) has poor feature discrimination and low robustness under low illumination;

[0005] 2) The method based on deep learning has high accuracy, but it depends on a large amount of labeled data, has high computational cost, is difficult to meet the real-time requirements of the production line, and has limited direct processing capability for low-illumination images;

[0006] 3) The existing methods mainly focus on gray-scale images or single features, and do not fully utilize the joint information of residual color and texture in low-illumination color images.

[0007] Therefore, there is an urgent need for a new fabric defect detection method that can adapt to low-illumination environments, balance detection accuracy and speed, and fully utilize color information. SUMMARY

[0008] In order to overcome the shortcomings of the prior art, the present application provides a color fabric defect detection method and system that can maintain high precision and high speed under low-illumination environments, aiming to solve the three core technical problems faced by automatic defect detection of RGB color fabric images under low-illumination conditions:

[0009] 1) The defect features are difficult to extract due to the quality degradation of low-illumination images;

[0010] 2) The contradiction between real-time and high-precision requirements of the detection algorithm;

[0011] 3) The interference of complex fabric background texture to the defect target.

[0012] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a rapid detection method for defects in low-illuminance colored fabrics, comprising the following steps:

[0013] Step 1: Perform three-level processing on the input low-light RGB fabric image: adaptive Gamma correction, CLAHE enhancement, and multi-scale Retinex enhancement, to obtain the enhanced image;

[0014] Step 2: For the enhanced image, extract the salient features of the simulated visual attention mechanism and the structural features of the quantified texture pattern through the dual-path feature extraction module;

[0015] Step 3: Dynamically calculate the adaptive fusion weights based on the local information entropy of saliency features and structural features, and perform weighted fusion accordingly to obtain the fused feature map;

[0016] Step 4: Use a two-level threshold segmentation technique that combines global and local thresholds to accurately locate defects in the fused feature map, obtain the final segmentation result, and output the detection result containing the defect binary map and the confidence heatmap.

[0017] Furthermore, the correction coefficient for adaptive Gamma correction is: According to pixels Local brightness mean Dynamic calculation:

[0018] ;

[0019] in, As a preset adjustment factor, This is the brightness normalization constant;

[0020] The overall brightness is dynamically adjusted based on the above correction coefficients:

[0021] ;

[0022] in, This is the original brightness channel. This is the brightness channel after adaptive Gamma correction.

[0023] Furthermore, an improved adaptive multi-scale Retinex enhancement method is used to separate the illumination and reflection components to obtain the enhanced result;

[0024] ;

[0025] in It is an adaptive multi-scale Retinex augmentation result. This is the result of the contrast-limited adaptive histogram equalization operator, i.e., the CLAHE enhancement result, where K is the total number of scales. It is the first Gaussian wrapping function of scale The corresponding weights are calculated as follows:

[0026] ;

[0027] in, It is the first Sensitivity coefficient at each scale For the total number of scales, The calculation is as follows:

[0028] ;

[0029] in Therefore The local standard deviation of the neighborhood of a window with a fixed center size. yes The domain of the image size, i.e. ;

[0030] Finally, the enhanced luminance channel With the original Channel merging and conversion back Space, to obtain enhanced images .

[0031] Furthermore, the process for extracting salient features is as follows:

[0032] Calculate multi-scale local contrast :

[0033] ;

[0034] in, It is a grayscale image. For Centered on, scale is The mean of the pixels in the neighborhood of . For a predefined set of scales, The number of scales; subsequently, a multi-directional Gabor filter bank is used. Enhance directional texture differences, soon Convolution with a multi-directional Gabor filter bank and take the maximum response:

[0035] ;

[0036] in, For the direction set, For direction Gabor filters, This represents a convolution operation, and the output is a visual saliency feature map. .

[0037] Furthermore, the structural features specifically refer to the local binary pattern features, i.e. The weighted sum of normalized texture features, gradient consistency features, and color dispersion features;

[0038] Texture features: Calculate rotation-invariant uniform mode Values ​​that characterize the local texture structure;

[0039] ;

[0040] in, For rotation-invariant unified mode value, The number of sampling points in the neighborhood. The sampling radius is... The grayscale value of the center pixel. For the first grayscale values ​​of neighboring pixels It is a step function. This represents the number of binary mode transitions.

[0041] Gradient consistency feature: Calculate the local standard deviation of the gradient magnitude at multiple scales to characterize texture regularity;

[0042] ;

[0043] in, This is a gradient consistency feature. The standard deviation across scales, For scale The image gradient below, This represents the gradient magnitude.

[0044] Color dispersion characteristics: Calculate the standard deviation of pixel colors within a local area in the RGB space to characterize color consistency;

[0045] ;

[0046] in, For color dispersion characteristics, For the first Each color channel value For channel Standard deviation within a local window;

[0047] After normalizing the above features, a weighted fusion is performed to obtain the texture structure feature map. ;

[0048] ;

[0049] in, , They are respectively the corresponding Gradient consistency and color dispersion feature normalization results , , Let be the weight coefficient, and satisfy... + + .

[0050] Furthermore, the adaptive fusion weights are calculated as follows:

[0051] First, calculate the local information entropy of the two feature maps respectively. :

[0052] ;

[0053] in, For gray levels, represent or , Therefore The local area centered on grayscale The probability of occurrence within a local window; dynamically generating a fusion weight map based on local entropy:

[0054] ;

[0055] ;

[0056] in, The sensitivity coefficient, and These are saliency feature maps. and structural feature diagram At point Local information entropy at a given location.

[0057] Furthermore, in step 4, the global threshold is obtained using the Otsu method. Perform coarse segmentation to obtain a preliminary binary image;

[0058] ;

[0059] in, The binary result of global threshold segmentation. This is the globally optimal threshold for Otsu;

[0060] Within the candidate region of the preliminary binary map, based on the local mean... and standards Calculate an adaptive threshold for fine segmentation to distinguish between textured backgrounds and real defects:

[0061] ;

[0062] in, It is a pixel Local adaptive threshold, It is the fusion of feature maps at location The value at that location, It is to fuse feature maps to The total number of pixels within the center's neighboring window. Therefore Local standard deviation within the center window, As the adjustment factor; using a local adaptive threshold, a refined binary map is obtained after two-stage segmentation. ;

[0063] Will and By performing a logical union operation, the final segmentation result B is obtained. :

[0064] B .

[0065] Furthermore, the final segmentation result is subjected to an opening-then-closing morphological operation to eliminate noise and smooth the boundaries:

[0066] ;

[0067] in For the final segmentation result, As a structural element, and These represent opening and closing operations, respectively.

[0068] Then, area filtering is performed to remove connected areas whose area is smaller than a set threshold.

[0069] ;

[0070] in This is the area filtering function. The minimum defect area threshold. This represents the connected region after area filtering.

[0071] Finally, connected regions are extracted, a binary mask for defects is generated, and the bounding boxes and confidence heatmaps of defect locations are obtained.

[0072] Secondly, the present invention also provides a rapid detection system for defects in low-light colored fabrics, including a processor and a memory. The memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute a rapid detection method for defects in low-light colored fabrics as described in the above technical solution.

[0073] Thirdly, the present invention also provides a computer-readable storage medium, including a readable storage medium on which a computer program is stored, wherein when the computer program is executed, it implements a method for rapid detection of defects in low-light colored fabrics as described in the above technical solution.

[0074] This invention effectively solves the technical challenge of balancing weak defect features and detection accuracy and speed in low-light environments. It boasts advantages such as strong robustness, fast processing speed, and good generalization ability, making it suitable for online real-time quality inspection in the textile industry. The beneficial effects of this invention are: 1) Excellent low-light robustness. Through three-level adaptive enhancement, it effectively overcomes the problems of low contrast, high noise, and color distortion caused by low light, providing high-quality input for subsequent detection. 2) A balance between high precision and high speed. The dual-path feature design simultaneously considers the rapid perception capability of human vision and the machine's precise quantification capability of texture patterns; the adaptive fusion mechanism maximizes feature efficiency; the overall algorithm complexity is low, achieving sub-second (<0.4 seconds) processing of 512×512 images on a conventional CPU while maintaining a high detection rate (>98%) and a low false alarm rate. 3) Powerful generalization ability: It does not rely on massive data training for specific fabric textures or defect types. Through physical feature modeling, it exhibits good adaptability to various plain weave, twill weave, satin weave fabrics, and multiple defect types. 4) High engineering practicality. The algorithm is complete, requiring no complex offline training. The physical meaning of the parameters is clear and easy to debug on-site, allowing for rapid deployment on existing industrial quality inspection platforms. Attached Figure Description

[0075] Figure 1 This is a general flowchart of an embodiment of the present invention.

[0076] Figure 2 This is a flowchart of the three-level adaptive enhancement module in an embodiment of the present invention.

[0077] Figure 3 This is a flowchart illustrating the improved multi-scale Retinex enhancement process in an embodiment of the present invention.

[0078] Figure 4 This is a flowchart of the dual-path feature extraction process in an embodiment of the present invention.

[0079] Figure 5 This is a flowchart of the adaptive feature fusion process in an embodiment of the present invention.

[0080] Figure 6 This is a flowchart illustrating the rapid decision-making and location of defects in an embodiment of the present invention.

[0081] Figure 7 This describes the process of generating a binary image in an embodiment of the present invention.

[0082] Figure 8 This is a schematic diagram of the detection results in an embodiment of the present invention. Detailed Implementation

[0083] The implementation of the technical solution of the present invention will be described in detail below with reference to the embodiments. The embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operation processes, but the protection scope of the present invention is not limited to the following embodiments.

[0084] The technical solution adopted in this invention is a fast detection method for low-light fabric defects that combines three-level adaptive enhancement and dual-path feature fusion. The method includes the following steps: First, the input image undergoes three-level processing: adaptive Gamma correction, CLAHE enhancement, and multi-scale Retinex enhancement, to restore details and color. Then, salient features simulating visual attention mechanisms and structural features quantifying texture patterns are extracted through parallel dual-path extraction. Next, fusion weights are dynamically calculated based on the local information entropy of the feature map to achieve adaptive feature fusion. Finally, a two-level threshold segmentation technique combining global and local methods is used to accurately locate defects, outputting detection results including a binary image of the defect and a confidence heatmap.

[0085] The core of this invention lies in: firstly, restoring image quality through a three-level enhancement strategy based on biomimetic vision; then, simulating the dual-path mechanism of human visual cognition to extract saliency features and quantitative texture structure features in parallel; and finally, making a decision through an adaptive fusion mechanism based on information reliability. The method is generally composed of four core modules connected in series: firstly, an adaptive low-light enhancement module restores the quality of the original input image; secondly, the processed image enters the dual-path feature extraction module in parallel, extracting saliency features simulating the human eye's visual attention mechanism and texture structure features describing the inherent regularity of the fabric, respectively; finally, an adaptive feature fusion module intelligently weights and fuses the dual-path features, and a fast decision-making and localization module outputs accurate defect detection and localization results. This architecture diagram clearly reveals the innovative approach of this invention, which systematically solves the problem of defect detection in low-light environments through an "enhancement-dual-path analysis-fusion decision" process. The specific algorithm flowchart is as follows... Figure 1 . Figure 1 This paper provides a detailed breakdown of the specific implementation steps of the method of this invention. The process begins with the input and preprocessing of low-light images, and the core innovation lies in:

[0086] 1. Adaptive three-level enhancement: Three complementary enhancement strategies are processed in parallel and then weighted and fused to ensure that details can be effectively restored in low-light images with different degrees of degradation.

[0087] 2. Dual-path feature extraction: Path 1 (left side) captures the "abruptness" of defect areas by simulating the human eye's visual mechanism; Path 2 (right side) captures areas where the "regularity" of the normal fabric background is disrupted by quantifying texture, gradient, and color patterns. The dual paths operate in parallel, balancing rapid response with in-depth analysis.

[0088] 3. Adaptive Feature Fusion: "Local Information Entropy" is introduced as an indicator to measure the richness and reliability of information within the feature map. Based on this, the fusion weights are dynamically allocated, realizing intelligent fusion that "relies more on salient features in information-rich regions and more on statistical features in regions with uniform texture".

[0089] 4. Two-level decision-making localization: A coarse-to-fine segmentation strategy is adopted. First, potential defect areas are identified, then the boundaries are refined, and finally, noise is eliminated through morphological operations, ensuring the accuracy and completeness of the localization results.

[0090] The core modules are described in detail below:

[0091] 1. Adaptive low-light enhancement module

[0092] like Figure 2 As shown, this module employs a three-level cascaded enhancement strategy, mathematically expressed as follows: Let the input low-light RGB image be... First, it is converted to the Lab color space, and only the luminance channel L is processed to keep the chromaticity unchanged.

[0093] Level 1: Adaptive Gamma correction, dynamically adjusting overall brightness.

[0094] (1)

[0095] Where the correction coefficient , This represents the average local brightness. As a regulating factor, For pixel coordinates, This is the original brightness channel. This is the brightness channel after adaptive Gamma correction.

[0096] Level 2: Limit contrast adaptive histogram equalization to enhance contrast in local areas.

[0097] (2)

[0098] in, The result is from the contrast-limited adaptive histogram equalization operator. This is a contrast-limited adaptive histogram equalization operator. This is the block size parameter, such as a typical value [8,8], which divides the image into blocks. Each region is a distinct, non-overlapping typical region, and histogram equalization is performed independently within each region. This is the contrast limiting threshold, typically 0.02. Its function is to limit the intensity of local contrast enhancement and prevent noise from being excessively amplified in uniform areas.

[0099] Level 3: Improved adaptive multi-scale Retinex enhancement, separating illumination and reflection components to enhance details, such as... Figure 3 As shown.

[0100] (3)

[0101] in This is the result of adaptive multi-scale Retinex augmentation, where K is the total number of scales, typically 3. It is the first Gaussian wrapping function of scale Its adaptive weights are calculated as follows:

[0102] (4)

[0103] in, It is the first The sensitivity coefficients at each scale are selected using a strategy of choosing values ​​for small scales (high frequency). ) Mesoscale (mid-frequency) ) Large scale (low frequency) ) , The total number of scales is 3. The calculation is as follows:

[0104] C , (5)

[0105] in Therefore Center size is Local standard deviation of the window neighborhood yes The domain of the image size, i.e. .

[0106] Finally, the enhanced luminance channel With the original Channel merging and conversion back Space, to obtain enhanced images .

[0107] 2. Dual-path feature extraction module

[0108] like Figure 4 As shown, the enhanced image is input into a parallel dual-path.

[0109] Path 1: Visual saliency feature extraction. This simulates the rapid attention mechanism of human vision by calculating multi-scale local contrast. To highlight areas that stand out abruptly from the background.

[0110] (6)

[0111] in, It is a grayscale image. For Centered on, scale is The mean of the pixels in the neighborhood of . For a predefined set of scales, the typical value is , The number of scales is then used. Subsequently, a multi-directional Gabor filter bank is employed. Enhance directional texture differences, soon Convolution with a multi-directional Gabor filter bank and take the maximum response:

[0112] (7)

[0113] in, For the direction set, For direction Gabor filters, This represents a convolution operation. The output is a visual saliency feature map. .

[0114] Path 2: Texture structure feature extraction, specifically, local binary pattern features, i.e. The normalized weighted sum of texture features, gradient consistency features, and color dispersion features is used to quantify the normal pattern of fabric texture and detect defects by analyzing the degree of damage.

[0115] Texture features: Calculate rotation-invariant uniform mode The value represents the local texture structure.

[0116] (8)

[0117] in For rotation-invariant unified mode value, This represents the number of neighboring sampling points, with a typical value. , Sampling radius, typical value Pixels The grayscale value of the center pixel. For the first grayscale values ​​of neighboring pixels For step functions:

[0118] (9)

[0119] in, This represents the number of binary mode transitions.

[0120] Gradient consistency feature: Calculate the local standard deviation of the gradient magnitude at multiple scales to characterize the regularity of the texture.

[0121] (10)

[0122] in This is a gradient consistency feature. The standard deviation across scales, For scale The image gradient below, This represents the gradient magnitude.

[0123] Color dispersion characteristics: Calculate the standard deviation of pixel colors in a local area in the RGB space to characterize color consistency.

[0124] (11)

[0125] in For color dispersion characteristics, For the first Each color channel value For channel Standard deviation within a local window.

[0126] After normalizing the above features, a weighted fusion is performed to obtain the texture structure feature map. .

[0127]

[0128] in, , They are respectively the corresponding Gradient consistency and color dispersion feature normalization results , , Let be the weight coefficient, and satisfy... + + .

[0129] 3. Adaptive Feature Fusion Module

[0130] like Figure 5 As shown, an attention mechanism based on local information entropy is introduced to dynamically evaluate and fuse dual-path features.

[0131] First, calculate the local information entropy of the two feature maps respectively. :

[0132] (12)

[0133] in For gray levels, represent or , Therefore The local area centered on grayscale The probability of occurrence within a local window. A fusion weight map is dynamically generated based on local entropy.

[0134] (13)

[0135] (14)

[0136] in This is the sensitivity coefficient, with a typical value of 0.8. and Feature maps and At point The local information entropy at that location. The final fused feature map is:

[0137] (15)

[0138] This mechanism can assign higher weights to salient features in regions with complex textures and rich information, while relying more on statistical texture features in flat regions.

[0139] 4. Defect Rapid Decision-Making and Location Module like Figure 6 and Figure 7 As shown, efficient threshold segmentation and post-processing are performed on the fused feature map.

[0140] Two-level threshold segmentation:

[0141] Level 1: Obtain the global threshold using the Otsu method. Perform coarse segmentation.

[0142] (16)

[0143] in, The binary result of global threshold segmentation. This is the globally optimal threshold for Otsu.

[0144] Level 2: Based on the local mean of the feature map from the adaptive feature fusion module after Level 1 segmentation. and standards Calculate an adaptive threshold for fine segmentation (refined screening) to distinguish between textured backgrounds and real defects:

[0145] (17)

[0146] in It is a pixel of , It is the fusion of feature maps at location The value at that location, It is to fuse feature maps to The total number of pixels within the center's neighboring window. Therefore Local standard deviation within the adjacent window centered on the target. As a regulating factor, Increased detection speed reduces false positives, but may result in missed detections. Reduce the threshold to decrease false negatives but may result in false positives; a typical value is 1.5. Using a local adaptive threshold, a binary image is obtained after two-stage segmentation. .

[0147] The results of the secondary segmentation and Logical operations are used, meaning that a defect must pass both levels of inspection simultaneously to be identified as a defect, resulting in the final segmentation result B. :

[0148] B (18)

[0149] Morphological optimization and positioning:

[0150] Perform opening-then-closing morphological operations on the binary image to eliminate noise and smooth the boundaries:

[0151] (19)

[0152] in This is the final binary segmentation result. It is a circular structural element with a radius of 3. and They represent opening and closing operations, respectively.

[0153] Area filtering removes connected areas whose area is smaller than a set threshold.

[0154] (20)

[0155] in This is the area filtering function. The minimum defect area threshold. This represents the connected regions after area filtering. The purpose of area filtering is to remove regions that are too small, as these are likely noise rather than actual defects.

[0156] Finally, connected regions are extracted, a binary mask for defects is generated, and the bounding box of the defect location (i.e., defect marker) and confidence heatmap are obtained.

[0157] Figure 8 This is a schematic diagram of the detection results in an embodiment of the present invention. Figure 8 The original 512x512 image had an average brightness of 0.31, a contrast ratio of 0.087, and a signal-to-noise ratio of 4.2dB. The enhanced image showed an 88% improvement in brightness, a 93% improvement in contrast, and a 107% improvement in signal-to-noise ratio. In the visual saliency feature map, defect areas showed high response, while background areas showed low response. In the texture structure feature map, gradient consistency contributed 30%, and color dispersion contributed 30%. In the thermal map, the confidence levels for defect areas ranged from 0.75 to 0.95, and for background areas from 0.05 to 0.30. The gradient value of defect boundaries, reflecting boundary clarity, was greater than 0.4, and the thermal values ​​of background areas, reflecting noise suppression effectiveness, were uniformly distributed. Finally, broken threads and oil stains were detected, with a false detection rate of 2.8% under complex textures and a detection time of 0.35 seconds, which is 23-36% faster than traditional methods. Simulation experiments and industrial application verification validated the invention's real-time performance, accuracy, robustness, and versatility.

[0158] This invention also provides a rapid detection system for defects in low-light colored fabrics, including a processor and a memory. The memory stores program instructions, and the processor calls the program instructions in the memory to execute a rapid detection method for defects in low-light colored fabrics as described in the above technical solution.

[0159] This invention also provides a computer-readable storage medium, including a readable storage medium on which a computer program is stored. When the computer program is executed, it implements a method for rapid detection of defects in low-light colored fabrics as described in the above technical solution.

[0160] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A rapid detection method for defects in low-illuminance colored fabrics, characterized in that, Includes the following steps: Step 1: Perform parallel processing of adaptive Gamma correction, CLAHE enhancement and multi-scale Retinex enhancement on the input low-light RGB fabric image, and then perform weighted fusion on the processing results to obtain the enhanced image; Step 2: For the enhanced image, extract the salient features of the simulated visual attention mechanism and the structural features of the quantified texture pattern through the dual-path feature extraction module; Step 3: Dynamically calculate the adaptive fusion weights based on the local information entropy of saliency features and structural features, and perform weighted fusion accordingly to obtain the fused feature map; Step 4: Use a two-level threshold segmentation technique that combines global and local thresholds to accurately locate defects in the fused feature map, obtain the final segmentation result, and output the detection result containing the defect binary map and the confidence heatmap.

2. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: The correction factor for adaptive Gamma correction is According to pixels Local brightness mean Dynamic calculation: ; in, As a preset adjustment factor, This is the brightness normalization constant; The overall brightness is dynamically adjusted based on the above correction coefficients: ; in, This is the original brightness channel. This is the brightness channel after adaptive Gamma correction.

3. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: An improved adaptive multi-scale Retinex enhancement method was used to separate the illumination and reflection components, and the enhanced result was obtained. ; in It is an adaptive multi-scale Retinex augmentation result. This is the result of the contrast-limited adaptive histogram equalization operator, i.e., the CLAHE enhancement result, where K is the total number of scales. It is the first Gaussian wrapping function of scale The corresponding weights are calculated as follows: ; in, It is the first Sensitivity coefficient at each scale For the total number of scales, The calculation is as follows: ; in Therefore The local standard deviation of the neighborhood of a window with a fixed center size. yes The domain of the image size, i.e. ; Finally, the enhanced luminance channel With the original Channel merging and conversion back Space, to obtain enhanced images .

4. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: The process for extracting salient features is as follows: Calculate multi-scale local contrast : ; in, It is a grayscale image. For Centered on, scale is The mean of the pixels in the neighborhood of . For a predefined set of scales, The number of scales; subsequently, a multi-directional Gabor filter bank is used. Enhance directional texture differences, soon Convolution with a multi-directional Gabor filter bank and take the maximum response: ; in, For the direction set, For direction Gabor filters, This represents a convolution operation, and the output is a visual saliency feature map. .

5. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: Structural features specifically refer to local binary pattern features, i.e. The weighted sum of normalized texture features, gradient consistency features, and color dispersion features; Texture features: Calculate rotation-invariant uniform mode Values ​​that characterize the local texture structure; ; in, For rotation-invariant unified mode value, The number of sampling points in the neighborhood. The sampling radius is... The grayscale value of the center pixel. For the first grayscale values ​​of neighboring pixels It is a step function. This represents the number of binary mode transitions. Gradient consistency feature: Calculate the local standard deviation of the gradient magnitude at multiple scales to characterize texture regularity; ; in, This is a gradient consistency feature. The standard deviation across scales, For scale The image gradient below, This represents the gradient magnitude. Color dispersion characteristics: Calculate the standard deviation of pixel colors within a local area in the RGB space to characterize color consistency; ; in, For color dispersion characteristics, For the first Each color channel value For channel Standard deviation within a local window; After normalizing the above features, a weighted fusion is performed to obtain the texture structure feature map. ; ; in, , They are respectively the corresponding Gradient consistency and color dispersion feature normalization results , , Let be the weight coefficient, and satisfy... + + .

6. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: The adaptive fusion weights are calculated as follows: First, calculate the local information entropy of the two feature maps respectively. : ; in, The number of gray levels, * represents or , Therefore The local area centered on grayscale The probability of occurrence within a local window; dynamically generating a fusion weight map based on local entropy: ; ; in, The sensitivity coefficient, and These are saliency feature maps. and structural feature diagram At point Local information entropy at a given location.

7. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: In step 4, the global threshold is obtained using the Otsu method. Perform coarse segmentation to obtain a preliminary binary image; ; in, The binary result of global threshold segmentation. This is the globally optimal threshold for Otsu; Within the candidate region of the preliminary binary map, based on the local mean... and standards Calculate an adaptive threshold for fine segmentation to distinguish between textured backgrounds and real defects: ; in, It is a pixel of , It is the fusion of feature maps at location The value at that location, It is to fuse feature maps to The total number of pixels within the center's neighboring window. Therefore Local standard deviation within the center window, The adjustment factor is used; a refined binary map is obtained after two-stage segmentation using a local adaptive threshold. ; Will and By performing a logical union operation, the final segmentation result B is obtained. : B 。 8. The method for rapid detection of defects in low-illuminance colored fabrics as described in claim 1, characterized in that: The final segmentation result is subjected to an opening-then-closing morphological operation to eliminate noise and smooth the boundaries: ; in For the final segmentation result, As a structural element, and These represent opening and closing operations, respectively. Then, area filtering is performed to remove connected areas whose area is smaller than a set threshold. ; in This is the area filtering function. The minimum defect area threshold. This represents the connected region after area filtering. Finally, connected regions are extracted, a binary mask for defects is generated, and the bounding boxes and confidence heatmaps of defect locations are obtained.

9. A rapid detection system for defects in low-light colored fabrics, characterized in that: It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to call the program instructions in the memory to execute the method for rapid detection of defects in low-light colored fabrics as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The method includes a readable storage medium on which a computer program is stored, which, when executed, implements a method for rapid detection of defects in low-light colored fabrics as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Transform-based automobile part defect detection method and system

    CN118967566A

  • Fabric defect real-time identification method and device based on deep learning

    CN120783127A