Cord fabric production defect detection method based on machine vision

By calculating the texture continuity and periodicity of the curtain fabric image blocks, and combining the nonlinear fusion of grayscale standard deviation and gradient magnitude, adaptive weights are generated to enhance local contrast, solving the problems of misjudgment and missed detection in machine vision inspection, and achieving high-accuracy curtain fabric defect detection.

CN120953288AActive Publication Date: 2025-11-14XIAN ZHONGYANG WINDOW BLINDS ARTICLE CO LTD

Patent Information

Application Number
CN202511484923.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-11-14
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

Existing machine vision-based defect detection technologies for curtain fabrics are prone to misjudging normal textures as defects when faced with high-density, strongly periodic background textures, and have difficulty identifying weak feature defects that are obscured by the background, resulting in insufficient accuracy and robustness of the detection results.

Method used

By calculating the texture continuity score and periodicity of image patches, and combining the nonlinear fusion of grayscale standard deviation and gradient magnitude, a defect metric is generated. Adaptive weights are used to adjust the cropping limit value to enhance local contrast, and finally the result is input into a classification model for detection.

Benefits of technology

It effectively distinguishes between real structural defects and normal texture fluctuations, reduces interference from false defects, improves detection accuracy and robustness, and is suitable for curtain fabric detection scenarios with different texture densities and defect types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953288A_ABST
    Figure CN120953288A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to a cord fabric production defect detection method based on machine vision, which comprises the following steps: acquiring a gray level image of a cord fabric and dividing the gray level image into image blocks; calculating a texture continuity score by fusing the local texture continuity and the periodic rule of the image block, and screening a defect area according to the texture continuity score; extracting the gray level, gradient and texture disorder degree of the defect area to calculate an adaptive weight, and adjusting a cutting limit value of a local contrast enhancement algorithm by using the adaptive weight; performing local contrast enhancement processing on each defect area by adopting the cutting limit value; and classifying the processed defect areas so as to output a defect detection result. According to the method, weak defects can be effectively highlighted, background noise is suppressed, high-precision defect recognition is completed in combination with a deep learning model, and the accuracy and robustness of detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology, and in particular to a method for detecting defects in curtain fabric production based on machine vision. Background Technology

[0002] As the main structural material for industrial products such as tires and conveyor belts, the quality of tire cord fabric directly affects the safety performance and service life of the final product. In modern high-speed production environments, tire cord fabric is highly susceptible to various defects during production, such as warp breaks, weft breaks, yarn knots, oil stains, and uneven density. If these defects are not detected and addressed in a timely manner, they may lead to serious safety hazards in subsequent product applications, such as the risk of tire blowouts during operation and conveyor belt breakage during operation.

[0003] Traditional methods for detecting defects in curtain fabric production rely primarily on manual visual inspection. This method has revealed significant limitations in modern large-scale industrial production. Manual visual inspection requires highly experienced inspectors, and prolonged work can easily lead to visual fatigue, resulting in missed detections or misjudgments. Furthermore, the speed of manual inspection is difficult to match the pace of high-speed production, making it extremely inefficient and unable to meet the requirements of large-scale industrial production for both inspection efficiency and accuracy.

[0004] In recent years, machine vision-based defect detection methods for tire cord fabric have gradually attracted attention. Related technologies involve capturing images of the tire cord fabric with a camera and then using image processing algorithms to identify defects. However, in practical applications, this detection technology exposes several problems when faced with the high-density, highly periodic background texture of the tire cord fabric: On the one hand, the periodic fluctuations of normal textures are highly similar to some defects in grayscale and morphological features, causing the detection system to often misjudge normal textures as defects, resulting in a large number of false alarms; on the other hand, for defects with weak features such as minor yarn breaks, their signals are easily masked by dense background textures, making it difficult for traditional algorithms to effectively separate defects from background information, leading to inaccurate identification by the detection system and missed detections. These problems affect the accuracy and robustness of the detection results, thus restricting the improvement of tire cord fabric production quality and efficiency. Summary of the Invention

[0005] To address the problems of machine vision-based tire cord fabric defect detection technologies, which are prone to misidentifying normal textures as defects due to the high density and strong periodicity of the background texture of the tire cord fabric, resulting in false alarms, and struggle to identify subtle feature defects obscured by the background, leading to missed detections, this invention provides a machine vision-based tire cord fabric production defect detection method, comprising the following steps: A grayscale image of the curtain fabric is acquired and divided into multiple image blocks. The texture continuity score of each image block is calculated, and when the texture continuity score is lower than a preset threshold, the corresponding image block is identified as a defect region. The texture continuity score is determined based on the local texture continuity and periodicity of the image block. The local texture continuity characterizes the similarity of texture features between the central region of the image block and its annular neighborhood, and the periodicity characterizes the energy concentration of the image block within a preset frequency domain. For each defect region, its grayscale standard deviation and gradient magnitude are extracted, and the two are nonlinearly fused to obtain a defect metric. The gradient direction information entropy is calculated to obtain the texture disorder degree. An adaptive weight is determined based on the defect metric and texture disorder degree. A clipping constraint value is calculated based on the adaptive weight of each defect region, and the clipping constraint value is negatively correlated with the adaptive weight. Local contrast enhancement processing is performed on each defect region using the clipping constraint value to obtain the processed defect region. This processed defect region is then input into a classification model for processing to output the defect detection result.

[0006] This invention captures local structural integrity by using the texture similarity between the central region of an image patch and its annular neighborhood. Simultaneously, it leverages the correlation between frequency domain energy concentration and the periodic distribution characteristics of the warp and weft yarns in the fabric to fuse these two factors and calculate a texture continuity score. This effectively distinguishes between genuine structural defects and normal texture fluctuations, reducing interference from false defects in subsequent detection. For the selected defect areas, a defect metric is first generated through nonlinear fusion of grayscale standard deviation and gradient amplitude. Then, adaptive weights are calculated using gradient direction information entropy: higher weights result in lower clipping limits, strongly enhancing subtle defects such as minor yarn breaks and light oil stains, making them more prominent; lower weights result in higher clipping limits, suppressing background over-enhancement and noise amplification, avoiding artifacts, and improving the signal-to-noise ratio of defect features. After targeted enhancement, the effective features of the defect areas are more prominent, reducing the learning difficulty of deep learning classification models and allowing the model to efficiently focus on the core features of genuine defects. Ultimately, this achieves high accuracy and robustness in detection, reducing missed and false detections while adapting to different texture densities and defect types in fabric detection scenarios.

[0007] Preferably, the defect measurement value of the defective region Satisfying the relation: ; in, It is the first The first defect area The standard deviation of grayscale values ​​for each pixel; It is the first The first defect area Gradient magnitude of each pixel; It is the first The total number of pixels in each defective region; It is the standard normalization function.

[0008] This invention calculates defect metrics using a nonlinear logarithmic fusion method. These metrics can sensitively respond to grayscale anomalies caused by oil stains and capture edge mutations caused by broken warp and weft threads. The structure of the logarithmic part can smoothly amplify weak signals and suppress the excessive influence of extreme peaks, ensuring that both grayscale and structural defects can be evaluated in a balanced manner, thereby obtaining a more comprehensive defect severity assessment index.

[0009] Preferably, determining the adaptive weight based on the defect metric and texture disorder includes: using the sum of the square of the defect metric and the square of the normalized texture disorder as the numerator, and the sum of the defect metric, the normalized texture disorder, and a preset small value as the denominator, with the ratio of the two being the adaptive weight.

[0010] The adaptive weighting of this invention is calculated by using the ratio of the sum of the squares of the defect metric and the normalized texture disorder as the numerator, and the sum of the two with a preset small value as the denominator. This enables differentiated attention to different types of defects. The design of the squared term amplifies the contribution of the feature itself. When the defect is mainly characterized by gray-level anomalies or edge abrupt changes, such as broken warp or weft threads, the proportion of the defect metric will increase significantly, and the weight will tilt towards it. When the core feature of the defect is texture disorder, such as disordered yarn arrangement, the influence of texture disorder will be strengthened, and the weight will focus on the latter. The algorithm decision can more accurately match the core performance of the defect, providing a more realistic basis for the intensity control of subsequent contrast enhancement.

[0011] Preferably, the step of calculating the clipping limit value based on the adaptive weight of each defective region includes: using the product of the adaptive weight and the preset global clipping limit value as the clipping adjustment amount, and the difference between the preset global clipping limit value and the clipping adjustment amount as the clipping limit value.

[0012] Preferably, the texture continuity score of the image patch Satisfying the relation: ; in, It refers to the local texture continuity of image patches; It is the periodic pattern of image patches; It is the preset sensitivity coefficient.

[0013] The nonlinear response function introduced in this invention plays a role in sensitive adjustment at low scores and smooth convergence at high scores. When either the local texture continuity or periodicity is at a low level, the function will produce a more obvious adjustment effect than simple multiplication, causing the texture continuity score to decrease rapidly, thereby capturing the texture destruction situation.

[0014] Preferably, the determination of local texture continuity includes: obtaining candidate regions and annular neighborhoods with the center of the image patch as the center point; calculating the rotation-invariant local binary pattern feature values ​​of the candidate regions and annular neighborhoods respectively to obtain their respective feature histograms; calculating the Bach coefficients of the two feature histograms, and determining the local texture continuity based on the Bach coefficients.

[0015] Preferably, the local texture continuity of the image patch Satisfying the relation: ; in, , These are the candidate regions and the annular neighborhood of the image patch in the th... Normalized frequencies over a given interval; It represents the total number of intervals in the feature histogram.

[0016] This invention compares the RI-LBP feature distribution of the central region with that of the surrounding normal region using the Barthel coefficient, which can more stably determine whether the texture of the central region is consistent with the texture features of the surrounding region, thus enabling the identification of local texture anomalies caused by defects even under complex working conditions.

[0017] Preferably, the determination of the periodicity includes: processing the image block using a fast Fourier transform to obtain a spectrogram, and using the ratio of the total energy in a preset region of the spectrogram to the total energy of the entire spectrogram as the degree of energy concentration.

[0018] Preferably, the classification model is a pre-trained deep learning classification model.

[0019] Preferably, the local contrast enhancement process is a contrast-limited adaptive histogram equalization process.

[0020] The beneficial effects of this invention are as follows: This invention captures the local structural integrity by measuring the texture similarity between the central region of an image block and its annular neighborhood. Simultaneously, it utilizes the characteristic that the frequency domain energy concentration aligns with the periodic distribution of warp and weft yarns in a fabric, fusing the two to calculate a texture continuity score. This effectively distinguishes between genuine structural defects and normal texture fluctuations, reducing interference from false defects in subsequent detection. For defect areas, a defect metric is generated through nonlinear fusion of grayscale standard deviation and gradient amplitude. Adaptive weights are then calculated using gradient direction information entropy. Higher weights indicate more obvious defect features or a higher probability of a defect, corresponding to lower clipping limits. This allows for strong contrast stretching of subtle defects such as broken yarns and light oil stains, making them clearly stand out from complex backgrounds. Conversely, areas with low weights, close to normal textures, are subject to higher clipping limits, gently suppressing excessive background texture enhancement and noise amplification, avoiding artifacts caused by over-enhancement, and improving the signal-to-noise ratio of defect features. Attached Figure Description

[0021] Figure 1 This is a flowchart of a machine vision-based method for detecting defects in curtain fabric production, provided as an embodiment of the present invention. Detailed Implementation

[0022] This embodiment provides a machine vision-based method for detecting defects in curtain fabric production, such as... Figure 1 As shown, the method includes steps S100-S400: Step S100: Obtain the grayscale image of the curtain fabric and divide it into multiple image blocks.

[0023] It should be noted that to detect defects on the surface of the curtain fabric, firstly, it is necessary to acquire an original image that fully presents the surface condition of the curtain fabric. Only by comprehensively capturing the surface information of the curtain fabric can basic data be provided for subsequent defect detection, avoiding the omission of defects due to incomplete image information. Secondly, defects on the surface of the curtain fabric are generally manifested as changes in brightness or texture, rather than differences between colors. Grayscale processing can remove redundant color information in the image, simplify the image data dimensions, and make the defect features more focused. Finally, in order to reduce the amount of data in the subsequent calculation process and avoid low processing efficiency due to the large size of the entire image data, and at the same time, dividing the image into blocks allows for independent analysis of each image block, enabling more accurate location of possible subtle defects in local areas.

[0024] Specifically, the process begins with capturing original images from multiple angles using professional shooting equipment such as cameras. During the capture process, the camera's frame rate and field of view need to be adjusted according to the production speed and width of the curtain fabric to ensure that the captured images clearly show the texture details and potential defects on the surface of the curtain fabric. Subsequently, the captured original curtain fabric images are converted to grayscale to obtain grayscale images. Grayscale conversion can be performed using traditional processing methods. Finally, the obtained grayscale images are divided into blocks to obtain multiple image blocks.

[0025] The segmentation strategy can be flexibly chosen. To reduce data redundancy and improve processing speed, a non-overlapping segmentation method can be used, which divides the image sequentially according to a fixed size, with no pixel overlap between adjacent image blocks. To avoid defects at the block boundaries being cut off, an overlapping segmentation method can be used, allowing a certain proportion of pixel overlap between adjacent image blocks. The block size can be set according to the image resolution and the requirements of subsequent algorithms, for example, dividing a grayscale image into... A block of pixels in an image.

[0026] At this point, multiple image patches have been obtained.

[0027] Step S200: Calculate the texture continuity score of each image block, and when the texture continuity score is lower than a preset threshold, determine the corresponding image block as a defect area.

[0028] It should be noted that the fabric texture of qualified curtain fabric products typically exhibits two main characteristics in images: Firstly, in local areas of images of defect-free curtain fabric products, the arrangement of warp and weft yarns is usually uniform, dense, and uninterrupted. This physical continuity is reflected in digital images as highly consistent pixel grayscale values, gradient directions, or texture features within local neighborhoods, or as a smooth, gradual change pattern. Secondly, the reciprocating motion of the loom according to a fixed pattern causes the grid-like structure formed by the interlacing of warp and weft yarns to exhibit a stable and predictable repeating pattern on the macroscopic scale of the entire curtain fabric. This physical periodicity is reflected in digital images, especially in the frequency domain.

[0029] Images of defective curtain fabric products, such as small defects like broken warp or weft, knots, or foreign fibers, usually directly disrupt the physical continuity of their location, forming an abrupt change or abnormal structure on the image that is incompatible with the surrounding smooth texture. Larger defects, such as sparse or dense weft, oil stains, or wrinkles, will disrupt or even completely break the physical periodicity of the fabric texture, causing the texture pattern of large areas to deviate from the normal repeating pattern.

[0030] Based on the feature differences between qualified and defective curtain fabric images, the background texture area without defects and the defective area can be distinguished by verifying whether the image area conforms to the two major features of physical continuity and physical periodicity.

[0031] For the physical continuity of image patches, this invention preferably uses Rotation Invariant Local Binary Pattern (RI-LBP) to construct this index. RI-LBP is a classic local texture descriptor that generates a binary code by comparing the gray values ​​of the center pixel with those of its neighboring pixels, and makes it robust to image rotation by taking the minimum value through cyclic displacement. This invention chooses RI-LBP because it combines rotation invariance and gray-level invariance in the context of curtain fabric detection. It can effectively handle slight shaking or tilting of the curtain fabric that may occur on the production line, and it is insensitive to uniform changes in illumination based on the characteristics of relative gray-level comparison, thereby ensuring stable extraction of normal texture features and avoiding misjudgments caused by illumination fluctuations.

[0032] Based on this, the present invention characterizes the continuity of local fabric texture by evaluating the difference in RI-LBP texture feature distribution between the central region and the adjacent annular neighborhood within an image patch.

[0033] Specifically, first, take any image patch as the target image patch, and take the center of this image patch as the center pixel, selecting a size of... Candidate region The value can be adjusted according to the texture density of the curtain fabric; for example, 3 for finer texture and 5 for coarser texture. Next, taking the candidate region as the center, obtain its immediate annular neighborhood. The radius R of the annular neighborhood can be set to 10-15 to ensure coverage of the normal texture area surrounding the candidate region. Then, calculate the RI-LBP feature values ​​of the candidate region and the annular neighborhood respectively, and statistically plot their RI-LBP histograms based on the feature values ​​to obtain the feature distribution data of the candidate region and the normal texture distribution data of the annular neighborhood. Then, calculate the distribution difference measure between the two histograms using the Bach distance. Finally, evaluate the physical continuity of the target image patch based on the distribution difference measure between the two regions, denoted as local texture continuity. .

[0034] Preferably, the local texture continuity of the target image patch Satisfying the relation: ; in, , These are the candidate regions and the annular neighborhood of the target image patch in the th... Normalized frequencies over a given interval; This is the total number of intervals in the RI-LBP histogram, which depends on the number of neighborhood points and the radius of the LBP operator. For example, for... The LBP mode can have 256 bins.

[0035] In this relation, It is the Bartholomew's coefficient. The range of values ​​for BC is The closer the value is to 1, the more similar the distributions of the two regions; conversely, the closer the value is to 0, the greater the difference in distribution. In this invention, BC is used to measure the similarity of the RI-LBP histogram distributions of the candidate region and the annular neighborhood. When the texture is continuous, the two distributions are similar, and the BC value is high; when the texture is discontinuous, that is, when there are defects, the two distributions are significantly different, and the BC value is low. To convert the BC similarity index into texture continuity, this invention employs... In the form of, Differences can be smoothed to avoid errors caused by minor fluctuations in BC. Sudden changes enhance the robustness of indicators; The term transforms the similarity of B and C into a distance metric, which has a value of 0 when the two distributions are completely identical, and close to 1 when they are completely different. By subtracting this distance metric from 1, it ensures that... The value range is [0,1], and a higher value indicates better texture continuity. Therefore, when the textures of the candidate region and the annular neighborhood are highly consistent, A value close to 1; conversely, if the candidate region has defects that cause texture discontinuities, The value will decrease; in this way, the present invention successfully transforms the continuity of fabric texture in the physical world into a robust index. .

[0036] For the global periodicity of image patches, this invention preferably uses Fast Fourier Transform (FFT) to construct this index. FFT is a classic frequency domain analysis tool that can transform image patches from the spatial domain to the frequency domain, converting the spatial repetition pattern of the periodic structure of warp and weft yarns into the energy concentration distribution at specific locations in the frequency domain, thereby capturing the periodic features of the texture. This invention chooses this method because it can globally analyze the texture of image patches and resist local interference, making it suitable for the periodic detection requirements of warp and weft yarns in curtain fabric.

[0037] Specifically, a Fast Fourier Transform is performed on the target image block to obtain its spectrum. Due to the high periodicity and directionality of normal curtain fabric, its spectrum will show bright, grid-like energy peaks at specific frequency positions. These peaks are characteristic signals of the fabric background. However, in areas with defects such as knots, oil stains, or broken warp threads, the texture structure is disrupted, and the corresponding spectrum will show diffuse energy, without clear periodic peaks, or with abnormal energy at non-periodic frequencies.

[0038] One method for assessing global periodicity is the peak energy ratio: Pre-define several Regions of Interest (ROIs), such as 3-5, in the spectrogram, corresponding to the main and secondary periodic peaks of the warp and weft yarns. These regions correspond to the characteristic peak positions of normal curtain fabric texture. For example, an ROI can be defined with the main frequency peak as the center and a certain radius around it, with the radius set to 2-5 pixels (adjustable according to the spectrogram resolution). Calculate the ratio of the total energy of these ROIs to the total energy of the entire spectrogram, and record this ratio as the periodicity of the target image patch. In this way, the periodic information in the frequency domain is represented as a periodic pattern, which can effectively distinguish between normal fabric regions with regular periodic structures and defective regions where the structure has been damaged. Furthermore, the Fast Fourier Transform is an existing technology and will not be elaborated upon here.

[0039] It should be noted that for a defect-free area of ​​the curtain fabric, its physical properties must simultaneously satisfy two conditions: local continuity and global periodicity. These two conditions are not independent but interdependent and indispensable. This logical relationship is most directly reflected in mathematics through multiplication. Therefore, this invention constructs a texture continuity score based on the product of these two indicators.

[0040] Based on this, the texture continuity score of the target image patch Satisfying the relation: ; in, It refers to the local texture continuity of the target image patch; It is the periodic pattern of the target image patch; It is the preset sensitivity coefficient.

[0041] In this relation, This indicates that if the local continuity or global periodicity of the target image patch is significantly degraded, the product of the two will approach 0, and the texture continuity score will decrease. This also approaches 0, reflecting the inherent requirement that local continuity and global periodicity must be satisfied simultaneously; failure to satisfy either one will significantly reduce the texture continuity score; the second part of the relation... It is a non-linear response function, which is relevant when the image patch may have defects. Approaching 0 strengthens the suppression of texture continuity score and amplifies defect signals; when and When both are close to 1, A score close to 1 will improve the texture continuity score. The texture converges smoothly to a high score, avoiding drastic jumps in texture continuity score in normal areas due to minor texture fluctuations, thus ensuring the stability of the judgment of normal background texture.

[0042] It should be noted that the preset sensitivity coefficient The adaptive weights are used to control the sensitivity of the response to defect features. Their values ​​typically range from 5 to 20, with the specific value determined based on actual inspection requirements and tire cord characteristics. In high-safety-standard scenarios, such as high-performance tire cord fabrics or when detecting extremely small defects, a higher value should be selected. Value, such as At this point, the texture continuity score right A slight decrease in the value produces strong suppression, rapidly approaching zero, thus maximizing the amplification of the defect signal; in scenarios with complex background textures, high noise, or where only obvious defects need to be detected, a lower value should be selected. Value, such as This can reduce the penalty and improve the texture continuity score. It converges more smoothly to high scores in normal regions, thereby effectively suppressing false alarms caused by normal texture fluctuations.

[0043] For the selection of texture continuity score threshold, implementers can set it according to their needs. For example, if the texture continuity score threshold is set to 0.5, the image block belongs to the background texture area if the texture continuity score of the image block is less than 0.5; otherwise, it belongs to the defect area.

[0044] At this point, the image patch belonging to the defect area has been obtained.

[0045] Step S300: For the defective region, extract its grayscale standard deviation and gradient magnitude, and perform nonlinear fusion on the two to obtain a defect metric value. Calculate its gradient direction information entropy to obtain the texture disorder degree. Determine its adaptive weight based on the defect metric value and texture disorder degree. Calculate its clipping limit value according to the adaptive weight of each defective region.

[0046] It should be noted that in the inspection of curtain fabric, since defect features are often weak and background textures are complex, image contrast enhancement is an essential preprocessing step. Considering that the contrast-limited adaptive histogram equalization (CLAHE) algorithm can independently equalize multiple sub-regions and accurately enhance local contrast, while avoiding excessive noise amplification and ensuring texture integrity through cropping limits, this invention preferably uses it to enhance the local contrast of each defect area. However, the cropping limit of the CLAHE algorithm is usually a fixed global parameter, which makes it difficult to simultaneously meet the requirements of suppressing normal texture fluctuations against a strong texture background and fully highlighting weak defect features in the defect area. Therefore, this invention optimizes the setting of the cropping value, specifically including steps S310-S340: Step S310: Extract the basic features of each defect region and calculate its defect metric value.

[0047] It should be noted that curtain fabric defects are diverse in type and shape, with significant differences in contrast to the background. A single image feature cannot comprehensively and accurately characterize all defects or distinguish them from normal texture fluctuations. Considering that the grayscale standard deviation is sensitive to the degree of grayscale dispersion within the defect area, it is effective for defects with large differences in grayscale from the background, such as dark oil stains or large areas of sparse or dense lines, but it cannot capture the edge information of linear defects or damage to the fabric texture structure. Therefore, considering that the edge gradient amplitude can characterize the intensity and sharpness of the defect area edge, it responds strongly to linear defects with clear outlines. To fuse these two basic features and capture the logic that any anomaly is a suspected defect, this invention uses a nonlinear fusion method to calculate the defect metric value for each defect area. The defect metric value satisfies the following relationship: ; in, It is the first Defect metrics for each defective region; It is the first The first defect area The standard deviation of grayscale values ​​for each pixel; It is the first The first defect area Gradient magnitude of each pixel; It is the first The total number of pixels in each defective region; It is the standard normalization function.

[0048] Step S320: Calculate the texture disorder of each defect area.

[0049] It should be noted that edge gradient magnitude is primarily effective for identifying defects with clear and distinct edges, while grayscale standard deviation is more suitable for defects with significant differences in grayscale from the background. However, both have limitations in identifying defects without obvious edges, which only manifest as changes in texture structure, such as small knots and cotton knots. Therefore, this invention introduces information entropy based on texture direction features to characterize the directional regularity of fabric texture, thereby capturing local texture disorder caused by defects such as knots and holes. The information entropy of the defect area is preferably calculated using Shannon entropy. Specifically, the gradient direction distribution of all pixels within the defect area is first statistically analyzed, the directions are divided into preset discrete intervals, and the normalized probability of each interval is calculated. Then, based on this probability distribution, the entropy value is calculated using the Shannon entropy formula. This entropy value represents the texture disorder degree of the defect area. Shannon entropy is existing technology and will not be elaborated upon here.

[0050] Step S330: Determine the adaptive weight based on the defect metric and texture disorder.

[0051] It should be noted that there are many types of defects in curtain fabric, and different defects exhibit different performance in defect metrics and texture disorder. To enable the degree of influence of each feature to be dynamically determined based on its own performance, and to achieve adaptive fusion without prior knowledge, thereby more accurately evaluating various defects in curtain fabric, the adaptive weights of this invention satisfy the following relationship: ; in, It is the first Adaptive weights for each defect region; It is the first Defect metrics for each defective region; It is the first Texture disorder in each defective area; It is a standard normalized function; It is a preset small value used to prevent the denominator from being 0. It can be set to 0.001 or as needed.

[0052] In this relationship, when the defect metric value is greater than If the defect area is a linear oil stain, the numerator and denominator in the formula are mainly determined by the defect measurement value. The value will primarily reflect the level of the defect metric; conversely, when If the defect exceeds the defect metric value, such as when the defect area is a directional flaw or a hole, The value will be mainly determined by This dynamic allocation ensures that the model automatically focuses on the most prominent defect features. When the defect metric is greater than... When both values ​​are large, such as when the defect area is a yarn knot, it indicates that the defect area simultaneously exhibits significant grayscale anomalies or edge anomalies and texture disorder. In this case, the numerator of the relation will increase due to the square, while the denominator will increase linearly, resulting in a final value... The value also increases accordingly, thus accurately reflecting that this is a serious defect with high credibility.

[0053] Step S340: Calculate the trimming limit value based on the adaptive weight of each defect region.

[0054] It should be noted that after obtaining the adaptive weight values ​​for each defective region, the cropping value for that region can be adjusted. Generally speaking, regions with higher adaptive weights require stronger contrast enhancement to highlight their features; while normal regions with lower adaptive weights should be processed more gently to avoid noise amplification. Based on this, the cropping limit value satisfies the following relationship: ; in, It is the first Adaptive trimming limit values ​​for each defect region; It is the preset global clipping value; It is the first Adaptive weights for each defect region.

[0055] In this relation, The amount of cropping adjustment is determined by adaptive weights. The decision directly reflects the adjustment range of the defect probability to the clipping limit value: when the adaptive weight of the defect region... When the value approaches 1, it indicates that the area is highly likely to contain a real defect, and the trimming adjustment amount is appropriate at this point. Approaching the global clipping limit value Substitute into the relation Then, the calculated cutting limit value Approaching 0, low The value removes the limitation of the CLAHE algorithm on contrast enhancement, allowing the algorithm to strongly stretch the contrast of the defect area, thereby making subtle defect features such as minor yarn breaks and light oil stains, which were originally submerged in the complex fabric texture, clearly visible; when the adaptive weight of the defect area When the value approaches 0, it indicates that the area is closer to the normal fabric texture, and the cutting adjustment amount is appropriate at this point. Approaching 0, the clipping limit value is substituted into the relation. Approaching the preset global clipping limit value ,high The value strictly limits the contrast enhancement of the CLAHE algorithm, effectively avoiding excessive enhancement of background texture and amplification of image noise, thereby preventing artifacts and false alarms caused by texture abnormalities or noise.

[0056] It should be noted that the preset global clipping value... The settings need to be determined by combining the texture characteristics of the curtain fabric with the enhancement logic of the CLAHE algorithm. The main focus is on balancing normal texture suppression with defect enhancement. The typical value range is 0.01 to 0.05. For curtain fabrics with low texture density and relatively simple backgrounds, such as those woven with low-count yarns, the settings can be adjusted accordingly. Setting it to 0.01~0.02, with a lower global clipping limit, allows for greater enhancement space for subsequent adaptive adjustments; for curtain fabrics with dense textures and complex backgrounds, such as those woven with high-count yarns or with slightly uneven base colors, it is necessary to... Setting it to 0.03~0.05, a slightly higher global clipping limit is used to initially suppress excessive enhancement of the background texture, avoiding noise amplification in the initial enhancement stage, and then relying on adaptive weights... Targeted adjustments are made to the defective areas to ensure that the overall enhancement effect neither loses the subtle defects nor introduces unnecessary interference.

[0057] At this point, the adaptive clipping limit value for the defective region has been obtained.

[0058] Step S400: Perform local contrast enhancement processing on each defect region using the clipping limit value to obtain the processed defect region, and input it into the classification model for processing to output the defect detection result.

[0059] It should be noted that this step involves qualitative analysis of the defects in the defect regions processed by the CLAHE algorithm to determine whether each defect region contains a defect and the specific type of defect. The deep learning classification model is a machine learning model based on deep neural networks that automatically learns data features through multi-layer nonlinear transformations, ultimately achieving a mapping from input data to category labels. Its core advantage lies in the fact that it eliminates the need for manual feature design and can adaptively extract abstract features from the raw data from the bottom layer to the top layer. Based on this, this invention uses this model to determine defect types.

[0060] Specifically, a pre-trained deep learning classification model is used, with each defect region as input, and it is categorized into a predefined classifier containing... Category set of different types Among them This is the preset total number of defect types, an integer greater than or equal to 0. Within this set, the categories... This represents no defects; the other categories... to Each corresponds to a preset defect type. The defect type is determined based on actual production needs. In embodiments of the present invention, these defect types may include, but are not limited to, warp breakage, weft breakage, yarn knots, oil stains, and uneven yarn density. For example, in one feasible implementation, a set... At this time, the category Represents amenorrhea. Represents a break in latitude. Represents a knot, Represents oil stains. Represents sparse roads.

[0061] Understandably, the deep learning classification model needs to be trained using standard supervised learning methods. Specifically, this involves using a dataset containing a large number of labeled image patches and continuously adjusting the model parameters through optimization algorithms until the expected classification accuracy is achieved. The specific training techniques are existing technologies and will not be elaborated upon here.

[0062] 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 curtain fabric production based on machine vision, characterized in that, include: Obtain a grayscale image of the curtain fabric and divide it into multiple image blocks; The texture continuity score of each image patch is calculated, and when the texture continuity score is lower than a preset threshold, the corresponding image patch is determined as a defective region. The texture continuity score is determined based on the local texture continuity and periodicity of the image patch. The local texture continuity characterizes the similarity of texture features between the central region of the image patch and its annular neighborhood, and the periodicity characterizes the energy concentration of the image patch within a preset frequency range. For the defective region, its grayscale standard deviation and gradient magnitude are extracted, and the two are nonlinearly fused to obtain the defect metric. Its gradient direction information entropy is calculated to obtain the texture disorder degree. Based on the defect metric and texture disorder degree, its adaptive weight is determined. The clipping limit value is calculated based on the adaptive weight of each defect region, and the clipping limit value is negatively correlated with the adaptive weight; The cropping limit value is used to perform local contrast enhancement processing on each defect region to obtain the processed defect region, which is then input into the classification model for processing to output the defect detection result.

2. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The defect measurement value of the defect area Satisfying the relation: ; in, It is the first The first defect area The standard deviation of grayscale values ​​for each pixel; It is the first The first defect area Gradient magnitude of each pixel; It is the first The total number of pixels in each defective region; It is the standard normalization function.

3. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The process of determining the adaptive weight based on the defect metric and texture disorder includes: The sum of the square of the defect metric and the square of the normalized texture disorder is used as the numerator, and the sum of the defect metric, the normalized texture disorder, and a preset small value is used as the denominator. The ratio of the two is the adaptive weight.

4. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The step of calculating the clipping limit value based on the adaptive weight of each defect region includes: The product of the adaptive weight and the preset global clipping limit is used as the clipping adjustment amount, and the difference between the preset global clipping limit and the clipping adjustment amount is the clipping limit value.

5. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, Texture continuity score of the image patch Satisfying the relation: ; in, It refers to the local texture continuity of image patches; It is the periodic pattern of image patches; It is the preset sensitivity coefficient.

6. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The determination of the local texture continuity includes: Using the center of the image patch as the center point, obtain its candidate region and annular neighborhood; The rotation-invariant local binary pattern feature values ​​of the candidate region and the annular neighborhood are calculated respectively to obtain their respective feature histograms; Calculate the Bach coefficients of the two feature histograms and determine the local texture continuity based on the Bach coefficients.

7. The method for detecting defects in curtain fabric production based on machine vision according to claim 6, characterized in that, Local texture continuity of the image patch Satisfying the relation: ; in, , These are the candidate regions and the annular neighborhood of the image patch in the th... Normalized frequencies over a given interval; It represents the total number of intervals in the feature histogram.

8. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The determination of the periodicity includes: The image patch is processed using Fast Fourier Transform to obtain a spectrogram, and the ratio of the total energy in a preset region of the spectrogram to the total energy of the entire spectrogram is taken as the energy concentration degree.

9. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The classification model is a pre-trained deep learning classification model.

10. The method for detecting defects in curtain fabric production based on machine vision according to claim 1, characterized in that, The local contrast enhancement process is a contrast-limited adaptive histogram equalization process.

Citation Information

Patent Citations

  • Mirror reflection-based texture tile surface defect detection method

    CN118115468A

  • Cord fabric production defect identification and analysis system based on machine vision

    CN120219368A

  • Surface defect detection method, system, equipment, and terminal thereof

    US12307653B1

Cited By

  • Plastic mold surface defect image detection method and system

    CN122023412A