A machine vision-based detection method for defects in the production of duck cloth

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. This solves the problems of misjudgment and missed detection in machine vision inspection, and achieves high accuracy and robustness in curtain fabric defect detection.

CN120953288BActive Publication Date: 2025-12-26XIAN ZHONGYANG WINDOW BLINDS ARTICLE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511484923.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-12-26
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 and adaptive weights are calculated. Local contrast enhancement processing is then performed, and a deep learning classification model is used for defect 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 adapts to different texture densities and defect types in curtain fabric inspection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953288B_ABST
    Figure CN120953288B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image data processing, and more particularly to a curtain fabric production defect detection method based on machine vision, which comprises: acquiring a gray image of the curtain fabric and dividing it into image blocks; calculating texture continuity scores by fusing the local texture continuity and periodicity of the image blocks, and screening defect areas according to the scores; extracting the gray scale, gradient and texture disorder degree of the defect areas to calculate adaptive weights, and adjusting the clipping limit value of the local contrast enhancement algorithm using the adaptive weights; performing local contrast enhancement processing on each defect area using the clipping limit value; and classifying the processed defect areas to output the defect detection results. The present application can effectively highlight weak defects, suppress background noise, and complete high-precision defect recognition in combination with a deep learning model, thereby improving the accuracy and robustness of the detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image data processing, and in particular to a curtain cloth production defect detection method based on machine vision. BACKGROUND

[0002] As the main framework material of industrial products such as tires and conveyor belts, the quality of the curtain cloth is related to the safety performance and service life of the final product. In the modern high-speed production environment, various defects such as broken warp, broken weft, yarn knot, oil stain, and density path may easily occur in the production process of the curtain cloth. If these defects are not detected and processed in time, they may cause serious safety hazards in subsequent product applications, such as the risk of tire blowout during driving and the rupture failure of the conveyor belt during operation.

[0003] The traditional curtain cloth production defect detection method mainly relies on manual visual inspection. This method has obvious limitations in modern large-scale industrial production. Manual inspection requires a high level of experience from the inspectors, and long-term work may cause visual fatigue, resulting in missed detection or misjudgment. The detection speed of manual inspection is difficult to match the high-speed production rhythm, and the efficiency is extremely low, which cannot meet the requirements of large-scale industrial production for detection efficiency and accuracy.

[0004] In recent years, the curtain cloth production defect detection method based on machine vision has gradually attracted attention. In related technologies, the camera is used to collect the image of the curtain cloth, and then the image processing algorithm is used to identify the defects. However, in actual application, when facing the high-density and strong periodic background texture of the curtain cloth, this detection technology exposes many problems. On the one hand, the periodic fluctuation of the normal texture is highly similar to the partial defect in terms of gray scale and morphological features, which leads to the misjudgment of the detection system and a large number of false positives. On the other hand, for defects with weak features such as fine broken yarn, the signal is easily covered by the dense background texture, and the traditional algorithm cannot effectively separate the defect and background information, which makes it difficult for the detection system to accurately identify and causes missed detection. These problems affect the accuracy and robustness of the detection results, and further restrict the improvement of the production quality and the increase of the production efficiency of the curtain cloth. SUMMARY

[0005] To solve the above technical problems of the curtain cloth defect detection technology based on machine vision, which is easily misjudged as a defect due to the influence of the high-density and strong periodic background texture of the curtain cloth, and cannot identify the weak feature defects covered by the background, the present application provides a curtain cloth production defect detection method based on machine vision, which comprises the following steps:

[0006] 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.

[0007] 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.

[0008] Preferably, the defect measurement value of the defective region Satisfying the relation:

[0009] ;

[0010] 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; is the total number of pixel points of the defect region; is a standard normalization function. is a standard normalization function.

[0011] The present application calculates the defect metric value by a non-linear logarithmic fusion method, which can sensitively respond to the gray level abnormality caused by oil stains and the like, and can capture the edge mutation caused by broken warp and weft and the like; the structure of the logarithmic part can smoothly amplify the weak signal and suppress the excessive influence of the extreme peak value, ensuring that both the gray level type defect and the structure type defect can be evaluated evenly, so that a more comprehensive defect severity evaluation index is obtained.

[0012] Preferably, the adaptive weight is determined based on the defect metric value and the texture disorder degree, including: taking the sum of the square of the defect metric value and the square of the normalized texture disorder degree as the numerator, taking the sum of the defect metric value, the normalized texture disorder degree and a preset small value as the denominator, and the ratio of the two is the adaptive weight.

[0013] The adaptive weight of the present application is calculated by the ratio of the sum of the defect metric value and the square of the normalized texture disorder degree as the numerator, and the sum of the two and a preset small value as the denominator, which can realize differentiated attention to different types of defects. The design of the square term will amplify the contribution degree of the feature itself. When the defect is mainly manifested as gray level abnormality or edge mutation such as broken warp and weft, the proportion of the defect metric value will be significantly improved, and the weight will be inclined to it. When the defect is mainly manifested as texture disorder such as disordered arrangement of yarns, the influence of the texture disorder degree will be strengthened, and the weight will be focused on the latter. The algorithm decision can more accurately match the core performance of the defect, and provide a more practical basis for the strength control of the subsequent contrast enhancement.

[0014] Preferably, the clipping limit value of each defect region is calculated according to the adaptive weight, including: taking the product of the adaptive weight and a preset global clipping limit value as a clipping adjustment amount, and the difference between the preset global clipping limit value and the clipping adjustment amount is the clipping limit value.

[0015] Preferably, the texture continuity score of the image block satisfies the relationship:

[0016] ;

[0017] wherein, is the local texture continuity of the image block; is the periodicity rule of the image block; is a preset sensitivity coefficient.

[0018] ​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.

[0019] 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.

[0020] Preferably, the local texture continuity of the image patch Satisfying the relation:

[0021] ;

[0022] 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.

[0023] 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.

[0024] 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.

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

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

[0027] The application has the beneficial effects that: the application captures the local structure integrity through the texture similarity of the center region of the image block and the annular neighborhood, and fuses the two to calculate the texture continuity score by using the characteristics that the frequency domain energy concentration degree is consistent with the periodic distribution characteristics of the warp and weft of the canvas, which can effectively distinguish the real structural defects and normal texture fluctuations, and reduce the false defect interference in the subsequent detection; for the defect region, the defect metric value is generated by nonlinear fusion of the gray standard deviation and the gradient amplitude, and then the adaptive weight is calculated combined with the gradient direction information entropy, the higher the weight, the more obvious the defect feature or the greater the defect possibility, and the corresponding lower clipping limit value can perform strong contrast stretching on weak defects such as fine broken yarns and light oil stains to make them clearly prominent from the complex background, and the area with low weight, i.e. close to normal texture, uses a higher clipping limit value to gently suppress the background texture over-enhancement and noise amplification, avoids false images caused by over-enhancement, and improves the signal-to-noise ratio of the defect feature. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 A machine vision-based canvas production defect detection method flowchart is provided for the embodiments of the application. DETAILED DESCRIPTION

[0029] The embodiment provides a machine vision-based canvas production defect detection method, as shown in the figure, which comprises the following steps S100-S400: Figure 1

[0030] Step S100, acquire a gray image of the canvas and divide it into multiple image blocks.

[0031] It should be noted that, in order to detect the surface defects of the canvas, firstly, an original image that can fully present the surface state of the canvas needs to be acquired, only by fully capturing the surface information of the canvas can the basic data for subsequent defect detection be provided, and the defect omission caused by incomplete image information can be avoided; secondly, the defects on the surface of the canvas are generally manifested as changes in brightness or texture, rather than differences between colors, and the color redundancy information in the image can be removed through grayscale processing, the image data dimension is simplified, and the defect features are focused; finally, in order to reduce the data amount in the subsequent calculation process and avoid low processing efficiency caused by too large image data, the image blocks can be analyzed independently after being divided, and the fine defects that may exist in the local area can be more accurately located.

[0032] ​Specifically, first, the original image is collected from multiple angles by a professional camera or other shooting device. During the collection process, the shooting frame rate and field of view of the camera need to be adjusted according to the production speed and width of the screen cloth to ensure that the collected image can clearly present the texture details and potential defects on the surface of the screen cloth. Then, the collected original screen cloth image is subjected to grayscale processing to obtain a grayscale image. The grayscale processing can be performed by using a traditional processing method. Finally, the obtained grayscale image is subjected to block processing to obtain a plurality of image blocks.

[0033] The block strategy can be flexibly selected. If it is necessary to reduce data redundancy and improve processing speed, a non-overlapping block method can be used, that is, the image is divided into blocks of a fixed size in sequence, and there is no pixel overlap between adjacent image blocks. If it is necessary to avoid defects at the block boundary from being split, an overlapping block method can be used, that is, a certain proportion of pixel overlap regions are reserved between adjacent image blocks. The block size can be set according to the image resolution and subsequent algorithm requirements. For example, the grayscale image is divided into image blocks of 128*128 pixels.

[0034] Thus, a plurality of image blocks are obtained.

[0035] In step S200, 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 determined as a defect region.

[0036] It should be noted that the fabric texture of the image of a qualified screen cloth product usually has two characteristics. On the one hand, in the local area of the image of a non-defective screen cloth product, the arrangement of warp yarns and weft yarns is usually uniform, close and uninterrupted. This physical continuity is reflected in the digital image, and the pixel grayscale value, gradient direction or texture feature in the local neighborhood has a high consistency or smooth gradient rule. On the other hand, the loom reciprocates according to a fixed rule, so that the grid-like structure formed by the interweaving of warp and weft yarns presents a stable and predictable repeating pattern on the macro scale of the entire screen cloth. This physical periodicity is reflected in the digital image, especially in the frequency domain.

[0037] The image of a defective screen cloth product, such as a screen cloth product with small-size defects such as broken warp, broken weft, knot or foreign fiber, usually directly destroys the physical continuity at the location thereof, forming a mutation point or abnormal structure incompatible with the surrounding smooth texture on the image. Larger-area defects such as sparse weft, dense weft, oil stains or wrinkles will disturb or even completely break the physical periodicity of the fabric texture, so that the texture pattern of a large area deviates from the normal repeating rule.

[0038] Based on the characteristic differences between the qualified and defective screen cloth images, the background texture area without defects and the defect area can be distinguished by verifying whether the image area meets the two characteristics of physical continuity and physical periodicity.​

[0039] 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.

[0040] 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.

[0041] 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. .

[0042] Preferably, the local texture continuity of the target image patch Satisfying the relation:

[0043] ;

[0044] 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.

[0045] In this relation, It is the Barthel 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. .

[0046] 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.

[0047] 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.

[0048] The method for evaluating the global periodicity rule can adopt a peak energy ratio: several ROI regions, such as 3-5, are preset in the spectrum diagram, corresponding to the main period peak and the secondary period peak of the warp and weft, which correspond to the characteristic peak positions of the normal screen cloth texture. For example, the region within a certain radius range centered on the main frequency peak can be set as the ROI, and the radius can be set to 2-5 pixels, which can be adjusted according to the resolution of the spectrum diagram. The ratio of the total energy of these ROI regions to the total energy of the entire spectrum diagram is calculated, and the ratio is recorded as the periodicity rule of the target image block In this way, the periodicity information in the frequency domain is characterized as the periodicity rule, which can effectively distinguish the normal fabric region with regular periodic structure from the defect region with destroyed structure. In addition, the fast Fourier transform is a prior art, which will not be described in detail here.

[0049] It should be noted that the defect-free screen cloth region must satisfy both the local continuity and the global periodicity, and the two conditions are not independent but interdependent and indispensable. The most direct manifestation of this logical relationship in mathematics is multiplication, and therefore, the texture continuity score is constructed based on the product of the two indicators.

[0050] Based on this, the texture continuity score of the target image block satisfies the relationship:

[0051] ;

[0052] wherein, is the local texture continuity of the target image block; is the periodicity rule of the target image block; is a preset sensitivity coefficient.

[0053] In the relationship, indicates that if the local continuity or the global periodicity of the target image block is significantly deteriorated, the product will tend to 0, and the texture continuity score will also tend to 0, which reflects the inherent requirement that the local continuity and the global periodicity must be satisfied at the same time, and any one not satisfied will significantly reduce the texture continuity score; the of the second part of the relationship is a nonlinear response function, which will strengthen the inhibition of the texture continuity score and amplify the defect signal when the image block may have defects approaches 0; when and both approach 1, approaches 1, which can make the texture continuity score smoothly converge to a high score, avoiding the dramatic jump of the texture continuity score due to the slight fluctuations of the normal region texture, and ensuring the stability of the judgment of the normal background texture.

[0054] It should be noted that the preset sensitivity coefficient is generally in the range of 5 to 20, and the specific value needs to be determined according to the actual detection requirements and the characteristics of the tire cord. In high security standard scenarios, such as high performance tire cord or the need to detect extremely small defects, a higher value, such as , should be selected. At this time, the texture continuity score is strongly inhibited by a small decrease in , quickly approaching zero, thereby maximizing the amplification of the defect signal; in scenarios where the background texture is complex, the noise is large, or only obvious defects are required to be detected, a lower value, such as , should be selected; this can slow down the punishment, making the texture continuity score converge more smoothly to a high score in the normal area, thereby effectively suppressing false positives caused by normal texture fluctuations.

[0055] For the selection of the texture continuity score threshold, the implementer can set it according to the requirements, for example, set the texture continuity score threshold to 0.5, if the texture continuity score of the image block is less than 0.5, the image block belongs to the background texture area; otherwise, it belongs to the defect area.

[0056] At this point, the image block belonging to the defect area is obtained.

[0057] Step S300, for the defect area, extract its gray standard deviation and gradient amplitude, and perform nonlinear fusion on the two to obtain a defect metric value, calculate its gradient direction information entropy to obtain a texture disorder degree, determine its adaptive weight based on the defect metric value and the texture disorder degree; calculate the clipping limit value of each defect area according to its adaptive weight.

[0058] It should be noted that in the detection of tire cord, since the defect features are often weak and the background texture is complex, contrast enhancement of the image is an indispensable preprocessing step. Considering that the adaptive histogram equalization (CLAHE) algorithm with limited contrast can independently equalize and accurately enhance the local contrast in multiple sub-regions, and can avoid excessive amplification of noise through the clipping limit value to protect the texture integrity, the present application preferably performs local contrast enhancement on each defect area using the CLAHE algorithm. However, the clipping limit value of the CLAHE algorithm is usually a fixed global parameter, which is difficult to meet the needs of suppressing normal texture fluctuations in a strong texture background and fully highlighting weak defect features in the defect area at the same time. Therefore, the present application optimizes the setting of the clipping value, including steps S310-S340:

[0059] Step S310, extract the basic features of each defect area and calculate its defect metric value.

[0060] 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:

[0061] ;

[0062] 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 normalized function.

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

[0064] 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.

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

[0066] It should be noted that the canvas cloth defect types are rich, and different defects have different performances on defect metric value and texture disorder degree. In order to make the influence degree of each feature be dynamically determined according to the performance of itself, realize adaptive fusion without prior knowledge, and thus more accurately evaluate various defects of the canvas cloth, the adaptive weight of the application satisfies the following relationship:

[0067] ;

[0068] wherein, is the adaptive weight of the first defect area; is the defect metric value of the first defect area; is the texture disorder degree of the first defect area; is the standard normalization function; is a preset tiny value, used for preventing the denominator from being 0, and can be 0.001, or can be set according to requirements. In the relationship, when the defect metric value is greater than If the defect area is a linear linear oil stain, the numerator and denominator in the relationship are mainly determined by the defect metric value, so the value of will mainly reflect the height of the defect metric value; on the contrary, when

[0069] is greater than the defect metric value, such as the defect area is a directional flaw or a hole, the value of will be mainly determined by , and this dynamic allocation ensures that the model can automatically focus on the most obvious defect feature. When the defect metric value is greater than both values are large, such as the defect area is a yarn knot, indicating that the defect area has obvious gray abnormality or edge abnormality and texture disorder at the same time, at this time, the numerator of the relationship will increase because of the square, and the denominator will increase linearly, so that the final value also increases, thereby accurately reflecting that this is a high-credibility serious defect. Step S340, calculating the clipping limit value of each defect area according to the adaptive weight thereof.

[0070] It should be noted that after obtaining the adaptive weight value of each defect area, the clipping value of the area can be adjusted. Generally, the higher the adaptive weight of the area, the more intense the contrast enhancement is needed to highlight the features thereof; the lower the adaptive weight of the normal area, the more moderate the processing is needed to avoid noise amplification. Based on this, the clipping limit value satisfies the following relationship:

[0071]

[0072] ; ​​

[0073] 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.

[0074] 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.

[0075] 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... The defect regions are adjusted in a targeted manner to ensure that the overall enhancement effect neither loses weak defects nor introduces redundant interference.

[0076] At this point, the adaptive clipping limit value of the defect region is obtained.

[0077] In step S400, the clipping limit value is used to perform local contrast enhancement processing on each defect region to obtain a processed defect region, which is input into a classification model for processing to output a defect detection result.

[0078] It should be noted that this step qualitatively analyzes the defects in the defect region processed by the CLAHE algorithm to determine whether each defect region contains defects and the specific type of defects. The deep learning classification model is a machine learning model that maps input data to class labels based on deep neural networks through multiple layers of nonlinear transformation to automatically learn data features. Its core advantage is that it does not require manual feature design and can automatically extract abstract features from raw data from the bottom to the top. Based on this, the model is used to determine the defect type.

[0079] Specifically, a pre-trained deep learning classification model is used to input each defect region and classify it into a predefined class set containing a certain number of classes , wherein is the total number of preset defect categories, and is an integer greater than or equal to 0. In this set, class represents no defects, and the remaining classes to correspond to a preset defect type, respectively. The defect type is determined according to actual production needs. In the embodiments of the present application, these defect types can include but are not limited to broken warp, broken weft, yarn knot, oil stain, and sparse dense path. For example, in a feasible implementation, it is assumed that , at this time, class represents broken warp, represents broken weft, represents yarn knot, represents oil stain, represents sparse dense path.

[0080] It can be understood that the deep learning classification model needs to be trained through a standard supervised learning method. Specifically, a large number of image blocks containing annotations can be used to continuously adjust the model parameters through an optimization algorithm until the desired classification accuracy is achieved. The specific training belongs to the prior art and will not be described in detail.

[0081] The above are preferred embodiments of the present application, and do not limit the protection scope of the present application, so: any equivalent changes made according to the structure, shape, principle of the present application should be covered within the protection scope of the present application.

Claims

1. A machine vision based method of detecting defects in the production of a cord fabric, characterized in that, The method comprises the following steps: acquire a gray image of the cord fabric and divide it into multiple image blocks; calculate the texture continuity score of each image block, and determine the corresponding image block as a defect area when the texture continuity score is lower than a preset threshold; the texture continuity score is determined according to the local texture continuity of the image block and the periodicity rule, wherein the local texture continuity represents the similarity of the texture features between the central region of the image block and its annular neighborhood, and the periodicity rule represents the energy concentration degree of the image block in a preset frequency domain range; for the defect area, extract its gray standard deviation and gradient amplitude, and perform nonlinear fusion on both to obtain a defect metric value, calculate its gradient direction information entropy to obtain a texture disorder degree, and determine its adaptive weight based on the defect metric value and the texture disorder degree; calculate the clipping limit value of each defect area according to its adaptive weight, wherein the clipping limit value is negatively correlated with the adaptive weight; perform local contrast enhancement processing on each defect area using the clipping limit value to obtain a processed defect area, input it into a classification model for processing, and output a defect detection result; 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.

2. The machine vision based cord fabric production defect detection method according to claim 1, wherein, the determination of the adaptive weight based on the defect metric value and the texture disorder degree comprises: taking the sum of the square of the defect metric value and the square of the normalized texture disorder degree as the numerator, taking the sum of the defect metric value, the normalized texture disorder degree and a preset infinitesimal value as the denominator, and taking the ratio of the two as the adaptive weight.

3. The machine vision based cord fabric production defect detection method according to claim 1, wherein, the calculation of the clipping limit value of each defect area according to its adaptive weight comprises: taking the product of the adaptive weight and a preset global clipping limit value as a clipping adjustment amount, and taking the difference between the preset global clipping limit value and the clipping adjustment amount as the clipping limit value.

4. The machine vision based cord fabric production defect detection method according to claim 1, wherein, texture continuity score of the image block satisfies the relationship ; wherein, is a local texture continuity of the image block; is a periodicity law of the image block; is a preset sensitivity coefficient.

5. The machine vision based cord fabric production defect detection method according to claim 1, wherein, the determination of the local texture continuity comprises: taking the center of the image block as the center point to obtain its candidate region and annular neighborhood; respectively calculate the rotation invariant local binary pattern feature value of the candidate region and the annular neighborhood to obtain their respective feature histograms; calculate the Bhattacharyya coefficient of the two feature histograms, and determine the local texture continuity based on the Bhattacharyya coefficient.

6. The machine vision-based cord fabric production defect detection method according to claim 5, characterized in that, Local texture continuity of the image block satisfies the relationship ; wherein , are the normalized frequencies of the candidate region and the annular neighborhood over the first interval, respectively; is the total number of intervals of the feature histogram.

7. The machine vision based cord fabric production defect detection method according to claim 1, wherein, the determination of the periodicity rule comprises: use fast Fourier transform to process the image block to obtain a frequency spectrum graph, and take the ratio of the total energy in the preset region of the frequency spectrum graph to the total energy of the entire frequency spectrum graph as the energy concentration degree.

8. The machine vision based cord fabric production defect detection method according to claim 1, wherein, The classification model is a pre-trained deep learning classification model.

9. The machine vision based cord fabric production defect detection method according to claim 1, wherein, The local contrast enhancement processing is a contrast limited adaptive histogram equalization processing.

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