A method and system for detecting defects in knitted fabrics based on machine vision

By constructing a multi-scale edge detection model, dynamic threshold adjustment, gradient information fusion, optical flow analysis and complexity evaluation model, the problems of knitted fabric detection systems in the existing technology in unstable image quality and small defect recognition are solved, and efficient and accurate defect detection effects are achieved.

CN119228805BActive Publication Date: 2025-07-01PCCS GARMENTS (SUZHOU) LTD

Patent Information

Application Number
CN202411764182.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-07-01
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The existing machine vision detection system has unstable image quality in the knitted fabric production environment, making it difficult to accurately identify small defects, and a single image processing algorithm is difficult to meet the needs of multiple defect detection.

Method used

By constructing a multi-scale edge detection model of scarf, dynamically adjusting the threshold, and generating edge feature sets; combining background dynamic images to fusion, constructing a region segmentation model, and obtaining the time-sequential segmentation image set and defect edge data; using optical flow method to analyze the defect edge data to obtain the timing edge defect trajectory data; building a complexity evaluation model, and analyzing the complexity of defect edges through fractal dimensions.

Benefits of technology

Improve the accuracy and adaptability of edge detection, ensure accurate distinction between scarf areas under complex backgrounds, improve the accuracy and efficiency of defect detection, and be able to analyze dynamic changes in real time, and automatically identify and locate defect areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228805B_ABST
    Figure CN119228805B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of knitting fabric defect detection, and specifically to a knitting fabric defect detection method and system based on machine vision. First, a first image set is obtained by collecting the production process data of the scarf; a multi-scale edge detection model of the scarf is constructed to identify the first image set, and the threshold is dynamically adjusted according to the actual brightness and gradient distribution of the image to generate a first edge feature set; the background dynamic image and the first edge feature set are subjected to gradient information fusion to construct a scarf region segmentation model, and the real-time production image of the scarf is segmented to obtain a time-series segmentation image set and scarf defect edge data; the scarf defect edge data and the time-series segmentation image set are analyzed in real time to obtain scarf time-series edge defect trajectory data; a scarf defect edge complexity evaluation model is constructed to analyze the scarf time-series edge defect trajectory data, obtain the fractal dimension of the scarf defect edge, and generate the complexity of the scarf defect edge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knitted fabric defect detection, and specifically to a method and system for detecting defects in knitted fabrics based on machine vision. Background Art

[0002] With the continuous development of the textile industry, the production processes of knitted fabrics such as scarves have been significantly improved. However, during the production of scarves, various defects often occur due to the influence of raw materials, production equipment, environmental factors, and operators. These defects not only affect the appearance quality of the scarves but also have a negative impact on the user experience of consumers. Therefore, efficient and accurate defect detection of knitted fabrics such as scarves has become an important link that cannot be ignored in the textile manufacturing process.

[0003] In recent years, defect detection methods based on machine vision have gradually become a research hotspot in the field of textile detection. The machine vision system can obtain the production process images of scarves in real time and extract the edge features, texture information, and defect areas therein through image processing algorithms, realizing fast and accurate detection of fabrics. However, the existing machine vision detection systems still face some problems in practical applications. First, the lighting conditions and external noise in the knitted fabric production environment vary greatly, resulting in unstable image quality of the collected images, which affects the accuracy and sensitivity of detection. Second, due to the complex structure of knitted fabrics, small defects (such as tiny broken threads or color differences) are difficult to be accurately identified, and different types of defects have different shapes and sizes, so a single image processing algorithm is difficult to meet the requirements of multiple defect detections. Currently, many studies have proposed defect detection methods based on edge detection, image segmentation, and image recognition technologies. However, these methods usually rely on the analysis of static images and still have limitations in the detection of complex shapes and small defects.

[0004] Therefore, a method and system for detecting defects in knitted fabrics based on machine vision are proposed. Summary of the Invention

[0005] The object of the present invention is to provide a method and system for detecting defects in knitted fabrics based on machine vision. First, a first image set is obtained by collecting production process data of a scarf; a multi-scale edge detection model for the scarf is constructed to identify the first image set, and the threshold is dynamically adjusted according to the actual brightness and gradient distribution of the images to generate a first edge feature set; the background dynamic image and the first edge feature set are subjected to gradient information fusion to construct a scarf region segmentation model, and the real-time production image of the scarf is segmented to obtain a time-series segmentation image set and scarf defect edge data; the scarf defect edge data and the time-series segmentation image set are analyzed in real time to obtain scarf time-series edge defect trajectory data; a scarf defect edge complexity evaluation model is constructed to analyze the scarf time-series edge defect trajectory data, the fractal dimension of the scarf defect edge is obtained, and the complexity of the scarf defect edge is generated.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] A method for detecting defects in knitted fabrics based on machine vision, including.

[0008] The production process data of the scarf is collected in real time by a high-resolution camera to obtain a first image set; the first image set includes the real-time production image of the scarf and the background dynamic image;

[0009] A multi-scale edge detection model for the scarf is constructed to identify the first image set. By obtaining the image brightness of the standard image set at different scales and dynamically adjusting the threshold according to the actual brightness and gradient distribution of the images, a first edge feature set is generated;

[0010] The background dynamic image and the first edge feature set are subjected to gradient information fusion to construct a scarf region segmentation model; the real-time production image of the scarf is segmented by the scarf region segmentation model to obtain a time-series segmentation image set of different regions of the scarf and scarf defect edge data;

[0011] The scarf defect edge data and the time-series segmentation image set are analyzed in real time by the optical flow method to obtain scarf time-series edge defect trajectory data;

[0012] A scarf defect edge complexity evaluation model is constructed to analyze the scarf time-series edge defect trajectory data. By comprehensively analyzing the trajectory change amplitude, trajectory smoothness, and time-series coherence of the defect edge, the fractal dimension of the scarf defect edge is obtained; the specific calculation formula for the fractal dimension of the scarf defect edge is:

[0013] ;

[0014] Wherein, is the fractal dimension of the scarf defect edge, is the logarithmic function, is the fractal scale, is the number of divisions of the defect edge at scale and is the coefficient of the trajectory change amplitude of the defect edge, is the trajectory smoothness index of the defect edge;

[0015] Based on the fractal dimension of the scarf defect edge, the complexity of the scarf defect edge is obtained.

[0016] Preferably, the scarf multi-scale edge detection model includes a first image preprocessing layer, a multi-scale edge feature extraction layer, and an edge feature map fusion layer;

[0017] The first image preprocessing layer obtains a first standard image set by performing grayscale processing on the real-time scarf production images in the first image set; and obtains a second standard image set by performing Gaussian filtering and smoothing processing on the first standard image set;

[0018] The multi-scale edge feature extraction layer performs multi-scale processing on the second standard image set to obtain standard image sets of different scales; extracts features from the standard image sets of different scales according to the edge detection algorithm to generate an initial edge feature map; and performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales;

[0019] The edge feature map fusion layer obtains a first edge feature set by enlarging the edge feature maps of different scales to the size of the original image in the first image set.

[0020] Preferably, the multi-scale processing is performed by performing Gaussian pyramid decomposition on the second standard image set of real-time scarf production to obtain standard image sets of different scales;

[0021] The multi-scale edge detection algorithm obtains the image brightness of the standard image sets of different scales;

[0022] Obtains the high threshold and low threshold of the images of different scales according to the image brightness;

[0023] Extracts the edge features of different scales in the image according to the high threshold, low threshold, and gradient intensity of the image; the specific calculation formula of the edge detection algorithm is:

[0024] ;

[0025] where is the edge image, is the horizontal direction edge, is the vertical direction edge, is the gray value of the input image, is the gradient in the horizontal direction, is the gradient in the vertical direction, is the high threshold of the edge gradient intensity, is the low threshold of the edge gradient intensity, is the mean value of the gradient intensity, is the standard deviation of the gradient intensity, is the weight of the mean value of the gradient intensity, is the weight of the standard deviation of the gradient intensity, is the high threshold weight.

[0026] Preferably, the edge feature map fusion layer introduces a multi-scale fusion mechanism to weight and fuse the edge feature points extracted under different pixel points according to the gradient intensity; the calculation formula for the gradient intensity weighted fusion is:

[0027] ;

[0028] wherein, is the edge feature point after the gradient intensity weighted fusion of different pixel points, is the fractal scale, is the number of scales, is the weight of the th scale, is the th scale image,

[0029] Preferably, the scarf area segmentation model includes a second image preprocessing layer, a temporal boundary detection layer, a temporal area segmentation layer, a defect change analysis layer, and a defect edge data extraction layer;

[0030] The second image preprocessing layer generates a standard segmentation image set by graying, denoising, and contrast enhancement of the real-time scarf production images in the first image set; an initial defect change area is obtained by performing differential operations on the images in the background dynamic image;

[0031] The temporal boundary detection layer determines the scarf area and the non-scarf area by fusing the gradient information of the first edge feature set and the background dynamic image, and generates the boundary of the scarf temporal image area;

[0032] The temporal area segmentation layer identifies through the boundary of the scarf temporal image area to obtain a set of temporal segmentation images of different areas of the scarf;

[0033] The defect change analysis layer obtains the abnormal edge features in the dynamically changing area detected by the first edge feature set by comparing the edge distribution patterns of the normal areas;

[0034] The defect edge data extraction layer obtains the defect area by segmenting the time-series image set of different areas of the scarf, analyzes the feature of the edge points of the defect area, and generates the scarf defect edge data, where the scarf defect edge data includes defect edge coordinates and edge feature values.

[0035] Preferably, the time-series area segmentation layer finely segments the scarf area by using the segmentation model energy function, and the energy function formula is:

[0036] ;

[0037] Wherein, is the total energy of segmentation, is a pixel point in the image, is the set of image pixel points, is the logarithmic function, the feature value of the pixel point , the segmentation label of the pixel point , is the pixel feature value belonging to the segmentation label probability, are two adjacent pixel points in the pixel neighborhood, is the set of all adjacent pixel pairs, is to determine whether the pixel points and belong to the same segmentation area, is the exponential function, the feature value of the pixel point , is the smoothing factor.

[0038] Preferably, the defect edge pixel points are extracted through the scarf defect edge data;

[0039] The time change information of each area of the scarf is obtained by segmenting the time-series image set of different areas of the scarf;

[0040] Based on the defect edge pixel points and the time change information of each area of the scarf, the defect edge spatial coordinates are obtained;

[0041] Based on the optical flow equation, the motion vector of each pixel point is obtained, and the scarf time-series edge defect trajectory data is generated.

[0042] A knitting fabric defect detection system based on machine vision includes:

[0043] A data acquisition unit for real-time collecting production process data of a scarf through a high-resolution camera to obtain a first image set; the first image set includes real-time scarf production images and background dynamic images;

[0044] An edge feature acquisition unit for constructing a multi-scale edge detection model of the scarf to identify the first image set, generating a first edge feature set by obtaining the image brightness of a standard image set at different scales and dynamically adjusting the threshold according to the actual brightness and gradient distribution of the image;

[0045] An image segmentation unit for fusing gradient information of the background dynamic image and the first edge feature set to construct a scarf region segmentation model; segmenting the real-time scarf production image through the scarf region segmentation model to obtain a time-sequential segmentation image set of different regions of the scarf and scarf defect edge data;

[0046] A defect trajectory acquisition unit for real-time analyzing the scarf defect edge data and the time-sequential segmentation image set through an optical flow method to obtain scarf time-sequential edge defect trajectory data;

[0047] A defect edge complexity acquisition unit for constructing a scarf defect edge complexity evaluation model to analyze the scarf time-sequential edge defect trajectory data, obtaining the fractal dimension of the scarf defect edge by comprehensively analyzing the trajectory change amplitude, trajectory smoothness, and time-sequential coherence of the defect edge; the specific calculation formula for the fractal dimension of the scarf defect edge is:

[0048] ;

[0049] where is the fractal dimension of the scarf defect edge, is the logarithmic function, is the fractal scale, is at scale the number of segments of the defect edge, is the trajectory change amplitude coefficient of the defect edge, is the trajectory smoothness index of the defect edge;

[0050] Based on the fractal dimension of the scarf defect edge, obtaining the complexity of the scarf defect edge.

[0051] Preferably, the multi-scale edge detection model of the scarf includes a first image preprocessing layer, a multi-scale edge feature extraction layer, and an edge feature map fusion layer;

[0052] The first image preprocessing layer obtains a first standard image set by performing grayscale processing on the real-time scarf production images in the first image set; performing Gaussian filtering and smoothing processing on the first standard image set to obtain a second standard image set;

[0053] The multi-scale edge feature extraction layer obtains standard image sets of different scales by performing multi-scale processing on the second standard image set; extracts features from the standard image sets of different scales according to the edge detection algorithm to generate an initial edge feature map; performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales;

[0054] The edge feature map fusion layer obtains a first edge feature set by enlarging the edge feature maps of different scales to the size of the original images in the first image set.

[0055] Preferably, defective edge pixel points are extracted through the scarf defective edge data; temporal change information of each area of the scarf is obtained through the temporal segmentation image set of different areas of the scarf; defective edge spatial coordinates are obtained based on the defective edge pixel points and the temporal change information of each area of the scarf; a motion vector of each pixel point is obtained based on the optical flow equation, and scarf temporal edge defect trajectory data is generated.

[0056] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0057] 1. The present invention constructs a scarf multi-scale edge detection model to identify the first image set and obtain a first edge feature set; obtains a second standard image set by performing grayscale processing and Gaussian filter smoothing processing on the real-time scarf production images in the first image set, performs multi-scale processing and feature extraction on the obtained second standard image set, extracts edge features of different scales in the image according to the high threshold, low threshold and gradient intensity of the image, performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales; introduces a dynamic adjustment parameter, dynamically adjusts the threshold according to the actual brightness and gradient distribution of the image, makes the edge detection more adaptable to images under different lighting environments, forms a more continuous edge structure, and improves the accuracy of the edge detection result.

[0058] 2. The present invention constructs a scarf area segmentation model. First, gradient information fusion is performed on the background dynamic image and the first edge feature set to generate the boundary of the scarf temporal image area, and the initial accuracy of the segmentation model is improved by fusing gradient information, ensuring that the scarf area can still be accurately distinguished under a complex background; the boundary of the scarf temporal image area is identified to obtain a temporal segmentation image set of different areas of the scarf; and for the temporal segmentation image set of different areas of the scarf, a defective area is obtained; feature analysis is performed on the edge points of the defective area to generate scarf defective edge data, combining area segmentation and edge feature extraction to ensure the accuracy of the temporal segmentation image set in space and time.

[0059] 3. The present invention analyzes the scarf time-series edge defect trajectory data by constructing a scarf defect edge complexity evaluation model, comprehensively analyzes the trajectory change amplitude, trajectory smoothness, and time-series coherence of the defect edge, obtains the fractal dimension of the scarf defect edge, and specifically analyzes the dynamic change characteristics of the defect edge. By combining the traditional fractal dimension and dynamic characteristics, it shows a stronger analysis effect on irregular and rapidly changing defect edges, and improves the accuracy of scarf edge complexity evaluation. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a schematic flowchart of a method for detecting defects in knitted fabrics based on machine vision provided by the present invention;

[0061] Figure 2 is a schematic structural diagram of a system for detecting defects in knitted fabrics based on machine vision provided by the present invention;

[0062] Figure 3 is a schematic structural diagram of a scarf multi-scale edge detection model provided by an embodiment of the present invention;

[0063] Figure 4 is a schematic structural diagram of a scarf region segmentation model provided by an embodiment of the present invention;

[0064] Figure 5 is a schematic diagram of scarf defects provided by an embodiment of the present invention.

[0065] Figure 5 In which: 1. Local abnormal pulling of the scarf; 2. Local frayed edge of the scarf. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0066] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0067] The present invention provides a method for detecting defects in knitted fabrics based on machine vision. This method is applied to a system for detecting defects in knitted fabrics based on machine vision. The specific method flowchart and system structure diagram are referred to Figure 1 and Figure 2 .

[0068] Embodiment 1

[0069] As an implementation manner of the present invention, refer to Figure 1S10 in it is applied to the data acquisition unit of a knitting fabric defect detection system based on machine vision. The data acquisition unit is used to collect the production process data of the scarf in real time through a high-resolution camera, and obtain the first image set; the first image set includes the real-time production image of the scarf and the background dynamic image.

[0070] On the scarf production line, when the knitting machine is running at high speed, the data acquisition unit collects the dynamic state of the knitting fabric by continuous shooting. If there is a situation of broken stitches or uneven density in a certain frame of image, it can be immediately obtained and recorded for subsequent classification and processing. At the same time, the analysis of the background dynamic image can reduce the increase in picture noise caused by equipment vibration or light change.

[0071] Refer to Figure 1 S20 in it is applied to the edge feature acquisition unit of a knitting fabric defect detection system based on machine vision. The edge feature acquisition unit is used to construct a multi-scale edge detection model of the scarf to identify the first image set, obtain the image brightness of the standard image set at different scales, dynamically adjust the threshold according to the actual brightness and gradient distribution of the image, and generate the first edge feature set.

[0072] Furthermore, the multi-scale edge detection model of the scarf includes a first image preprocessing layer, a multi-scale edge feature extraction layer, and an edge feature map fusion layer. Refer to Figure 3 ;

[0073] The first image preprocessing layer obtains the first standard image set by grayscale processing the real-time production image of the scarf in the first image set. Grayscale processing can simplify the image data, thereby highlighting the scarf features; perform Gaussian filtering smoothing processing on the first standard image set to obtain the second standard image set. This process can reduce the random noise in the image and retain the image edge information.

[0074] The multi-scale edge feature extraction layer performs multi-scale processing on the second standard image set to obtain the standard image sets at different scales; extracts features from the standard image sets at different scales according to the edge detection algorithm to generate the initial edge feature map; performs direction and intensity analysis on the initial edge feature map to obtain the edge feature maps at different scales. This step provides a resolution range from coarse to fine for edge detection, ensuring the detection of defects of different sizes.

[0075] The edge feature map fusion layer obtains the first edge feature set by enlarging the edge feature maps at different scales to the size of the original image in the first image set.

[0076] In this embodiment, the multi-scale edge detection model for scarves includes a first image preprocessing layer, a multi-scale edge feature extraction layer, and an edge feature map fusion layer, which improves the integrity of edge detection for real-time images in scarf production. The first image preprocessing layer simplifies the image data effectively through grayscale conversion and Gaussian filtering smoothing, reducing the interference of random noise on the image. The multi-scale edge feature extraction layer combines multi-scale processing and edge detection algorithms to comprehensively extract different features of the scarf fabric within a resolution range from coarse to fine, ensuring the detection of defects of different sizes and types. The edge feature map fusion layer generates a unified edge feature set by magnifying and fusing multi-scale edge feature maps, avoiding information omission and redundancy, further improving the integrity and accuracy of detection, and achieving an efficient and robust defect detection effect.

[0077] Furthermore, the multi-scale processing performs Gaussian pyramid decomposition on the second standard image set in real-time scarf production to obtain a standard image set of different scales; the specific formula for the standard image set of different scales is expressed as:

[0078] ;

[0079] where is the image of the th scale, are the edge point coordinates, is the image of the th scale, is the Gaussian filter.

[0080] The multi-scale edge detection algorithm obtains the image brightness of the standard image set of different scales;

[0081] Based on the image brightness, high thresholds and low thresholds of images of different scales are obtained;

[0082] Based on the high threshold, low threshold, and gradient intensity of the image, edge features of different scales in the image are extracted; the specific calculation formula of the edge detection algorithm is:

[0083] ;

[0084] where is the edge image, is the horizontal direction edge, is the numerical direction edge, is the grayscale value of the input image, is the gradient in the horizontal direction, is the gradient in the vertical direction, is the high threshold of the edge gradient intensity, is the low threshold of the edge gradient intensity, is the mean value of the gradient intensity, is the standard deviation of the gradient intensity, is the weight of the gradient intensity mean, is the weight of the gradient intensity standard deviation, is the high threshold weight.

[0085] In this embodiment, multi-scale processing is achieved through Gaussian pyramid decomposition, effectively generating a standard image set of different scales, enhancing the detection ability for defects of different sizes. The edge detection algorithm is used to dynamically adjust the high and low thresholds, combined with the weight distribution of the gradient intensity, mean, and standard deviation, to extract accurate edge features, improving the sensitivity and robustness of the detection, and significantly increasing the recognition accuracy and reliability of knitting fabric defects.

[0086] Furthermore, the edge feature map fusion layer introduces a multi-scale fusion mechanism to weight and fuse the edge feature points extracted under different pixel points according to the gradient intensity; the calculation formula for the gradient intensity weighted fusion is:

[0087] ;

[0088] where, is the edge feature point after gradient intensity weighted fusion at different pixel points, is the number of scales, is the weight of the

[0089] The generation of the edge feature set: Summarize the edge points on all scales to generate the edge feature set. The edge feature set is expressed as:

[0090] ;

[0091] where, is the edge feature set.

[0092] In this embodiment, through the multi-scale fusion mechanism, the edge feature points of different pixel points are weighted and fused according to the gradient intensity, ensuring the significance of high-intensity feature points, effectively integrating the key features at different scales, and enhancing the detection ability of the system for complex knitting fabric defects. For details, refer to Table 1.

[0093] Through the improved multi-scale edge detection model, a large number of edge feature points can be effectively extracted for different defect types of knitting fabrics; the number of edge points extracted by the multi-scale edge detection model reflects the detailed features of the defect area; as Figure 5 shown, local abnormal pulling 1 of the scarf will reduce the edge point density, while local fraying 2 of the scarf will significantly increase the number of edge points.

[0094] The accuracy rate of edge feature points is calculated by the ratio of the extracted edge feature points that are consistent with the actual defect area. Through dynamic threshold adjustment and multi-scale fusion, the accuracy rate of edge points is above 97%. In terms of detection accuracy, the optimization of the multi-scale decomposition and edge feature fusion algorithm ensures the comprehensive analysis ability of edge features at different scales.

[0095] Table 1 Data table of scarf defect detection

[0096]

[0097] Through techniques such as grayscale conversion, Gaussian pyramid decomposition, dynamic threshold adjustment, and gradient intensity weighted fusion, the improved multi-scale edge detection model shows significant advantages in the accuracy of feature extraction and the efficiency of detection, effectively improving the integrity and accuracy of knitted fabric defect detection.

[0098] Refer to Figure 1 S30 in [reference], S30 is applied to the image segmentation unit of a knitted fabric defect detection system based on machine vision. The image segmentation unit is used to perform gradient information fusion on the background dynamic image and the first edge feature set to construct a scarf area segmentation model; the scarf production real-time image is segmented through the scarf area segmentation model to obtain a set of sequential segmentation images of different areas of the scarf and scarf defect edge data.

[0099] Furthermore, the scarf area segmentation model includes a second image preprocessing layer, a sequential boundary detection layer, a sequential area segmentation layer, a defect change analysis layer, and a defect edge data extraction layer. Refer to Figure 4 ;

[0100] The second image preprocessing layer generates a standard segmentation image set by performing grayscale conversion, denoising, and contrast enhancement on the scarf production real-time images in the first image set; an initial defect change area is obtained by performing differential operations on the images in the background dynamic image.

[0101] The sequential boundary detection layer determines the scarf area and the non-scarf area by performing gradient information fusion on the first edge feature set and the background dynamic image, and generates the boundary of the scarf sequential image area.

[0102] The sequential area segmentation layer identifies through the boundary of the scarf sequential image area to obtain a set of sequential segmentation images of different areas of the scarf.

[0103] The defect change analysis layer obtains abnormal edge features in the dynamically changing area detected by the first edge feature set by comparing the edge distribution patterns of normal areas.

[0104] The defect edge data extraction layer obtains the defect area by segmenting the image set of different regions of the scarf in time series, analyzes the feature of the edge points of the defect area, and generates the scarf defect edge data. The scarf defect edge data includes defect edge coordinates and edge feature values.

[0105] In this embodiment, the image segmentation unit realizes the accurate segmentation of the real-time image of scarf production through gradient information fusion and the scarf area segmentation model. The second image preprocessing layer uses grayscale conversion, denoising, and contrast enhancement technologies to generate a standard segmentation image set and preliminarily detect the defect change area. The time series boundary detection layer fuses the background dynamic image and the first edge feature set to accurately distinguish the scarf area from the non-scarf area, generates the time series image boundary, and improves the accuracy of boundary recognition. The time series area segmentation layer combines the segmentation boundary to realize the dynamic segmentation of different regions of the scarf, ensuring the time series consistency and regional integrity of the segmentation result. The defect change analysis layer quickly locates the defect change area through dynamic abnormal edge feature contrast analysis. The defect edge data extraction layer further extracts the edge coordinates and feature values of the defect area to generate high-precision scarf defect edge data, providing an accurate and reliable basis for defect detection and analysis, thereby improving the detection efficiency and reliability of knitted fabric defects.

[0106] Further, the time series area segmentation layer performs refined segmentation on the scarf area by using the segmentation model energy function, and the energy function formula is:

[0107] ;

[0108] Wherein, is the total energy of segmentation, is a pixel point in the image, is the set of image pixel points, is the logarithmic function, The feature value of pixel point , The segmentation label of pixel point , is the pixel feature value belonging to the segmentation label probability, are two adjacent pixel points in the pixel neighborhood, is the set of all adjacent pixel pairs, To determine whether pixel points and belong to the same segmentation region, is the exponential function, The feature value of pixel point , is the smoothing factor.

[0109] By introducing the energy function of the segmentation model, the refined segmentation of the scarf area is achieved. The energy function comprehensively considers the probability relationship between the pixel feature values and the segmentation labels, as well as the correlation between neighboring pixel points, ensuring the accuracy and consistency of the segmentation results. The boundary smoothness of the segmentation area is adjusted by the smoothing factor, effectively reducing the segmentation error and noise interference.

[0110] Referring to Figure 1 S40 in [reference], S40 is applied to the defect trajectory acquisition unit of a knitting fabric defect detection system based on machine vision. The defect trajectory acquisition unit is used to perform real-time analysis on the scarf defect edge data and the time-series segmentation image set by the optical flow method to obtain the scarf time-series edge defect trajectory data.

[0111] Furthermore, the defect edge pixel points extracted from the scarf defect edge data;

[0112] The time change information of each area of the scarf is obtained through the time-series segmentation image set of different areas of the scarf;

[0113] Based on the defect edge pixel points and the time change information of each area of the scarf, the spatial coordinates of the defect edge are obtained;

[0114] Based on the optical flow equation, the motion vector of each pixel point is obtained to generate the scarf time-series edge defect trajectory data;

[0115] The specific calculation formula of the optical flow equation is:

[0116] ;

[0117] Where is the gradient of the pixel point in the horizontal direction, is the motion speed component of the pixel point in the direction, is the gradient of the pixel point in the vertical direction, is the motion speed component of the pixel point in the direction, is the change rate of the pixel point in the time direction.

[0118] In the present invention, the scarf time-series edge defect trajectory data is obtained by performing real-time analysis on the scarf defect edge data and the time-series segmentation image set by the optical flow method. By extracting the defect edge pixel points and combining the time change information of each area of the scarf, the spatial coordinates of the defect edge are calculated. Based on the optical flow equation, the motion vector of the pixel point is obtained to form continuous and dynamic defect trajectory data. It comprehensively reflects the spatio-temporal change characteristics of the defect, effectively improving the accuracy and robustness of defect localization and trajectory tracking, and providing reliable data support for the automatic monitoring and dynamic analysis of scarf knitting fabric defects.

[0119] Referring toFigure 1 S50 in

[0120] ;

[0121] where is the fractal dimension of the scarf defect edge, is the logarithmic function, is the fractal scale, is at scale the number of segments of the defect edge, is the coefficient of the trajectory change amplitude of the defect edge, is the trajectory smoothness index of the defect edge;

[0122] where the coefficient of the trajectory change amplitude of the defect edge and the trajectory smoothness index of the defect edge are respectively:

[0123] ;

[0124] where is the number of time segments, is at scale the th time point at the defect edge motion vector, is the angle between adjacent time point defect edge trajectories, reflecting the trajectory smoothness, is the fractal scale, representing the resolution or window size of the image segmentation.

[0125] Based on the fractal dimension of the scarf defect edge, the complexity of the scarf defect edge is obtained.

[0126] Among them, the higher the complexity of the scarf defect edge, the more irregular the shape of the defect, the greater the trajectory change amplitude, the lower the smoothness, and the poorer the temporal coherence. It may be a serious process problem or mechanical failure in the production of the scarf fabric and needs to be processed first. The defects with low complexity of the scarf defect edge are simple edge features, which may be minor errors or local environmental interferences and have relatively little impact on the product quality. Through the analysis of the complexity, the defects are further classified and prioritized. For details, please refer to Table 2.

[0127] The trajectory change amplitude coefficient indicates the change amplitude of the defect edge in the time series. The higher the value, the more drastic the dynamic change of the defect edge. The trajectory smoothness index is used to measure the smoothness of the defect edge trajectory. The lower the value, the more irregular the trajectory. The fractal dimension is used to comprehensively reflect the shape complexity of the defect edge, including the influence of factors such as trajectory change amplitude and smoothness. Complexity and priority Through the analysis of complexity, high-complexity holes and abnormal pulling are judged as high-priority defects, which need to be handled in time to prevent further affecting product quality. Low-complexity yarn breakage and medium-complexity burrs may be minor problems or environmental interferences, which have little impact on production; and high-priority defects need to be handled as soon as possible.

[0128] Table 2 Scarf defect priority

[0129]

[0130] The present invention is a knitted fabric defect detection method based on machine vision. The image data in the scarf production process is collected in real time by a high-resolution camera, and the scarf edge features and defect information are extracted by combining a multi-scale edge detection model and gradient information fusion. The temporal segmentation of different regions of the scarf is realized by a regional segmentation model. At the same time, the motion trajectory of the defect edge is obtained by combining the optical flow method, and a complexity evaluation model is further constructed to quantify the defect characteristics, which significantly improves the accuracy and efficiency of defect detection. The method can analyze the dynamic changes in scarf production in real time, automatically identify and locate defect areas, generate quantifiable defect feature data, and provide strong support for intelligent production quality control.

[0131] Embodiment 2

[0132] In the modern textile industry, the production of knitted fabrics such as scarves has increasingly higher requirements for product quality, but due to the complex production process, diverse defect forms and limited manual detection efficiency, traditional detection methods are difficult to meet the needs of large-scale, high-quality production. Based on this, the present invention improves the accuracy and efficiency of detection through innovative detection methods and model design, providing strong support for quality control and automated production in the fabric production process.

[0133] The present invention also proposes a knitted fabric defect detection system using machine vision technology, such as Figure 2 As shown, including:

[0134] A data acquisition unit, used for collecting scarf production process data in real time through a high-resolution camera to obtain a first image set; the first image set includes a scarf production real-time image and a background dynamic image;

[0135] An edge feature acquisition unit for constructing a multi-scale edge detection model of a scarf to identify the first image set, generating a first edge feature set by obtaining the image brightness of a standard image set at different scales and dynamically adjusting the threshold according to the actual brightness and gradient distribution of the image;

[0136] An image segmentation unit for fusing gradient information of the background dynamic image and the first edge feature set to construct a scarf region segmentation model; segmenting the real-time scarf production image through the scarf region segmentation model to obtain a time-series segmentation image set of different regions of the scarf and scarf defect edge data;

[0137] A defect trajectory acquisition unit for performing real-time analysis on the scarf defect edge data and the time-series segmentation image set through an optical flow method to obtain scarf time-series edge defect trajectory data;

[0138] A defect edge complexity acquisition unit for constructing a scarf defect edge complexity evaluation model to analyze the scarf time-series edge defect trajectory data, and obtaining the fractal dimension of the scarf defect edge by comprehensively analyzing the trajectory change amplitude, trajectory smoothness, and time-series coherence of the defect edge; the specific calculation formula for the fractal dimension of the scarf defect edge is:

[0139] ;

[0140] where is the fractal dimension of the scarf defect edge, is the logarithmic function, is the fractal scale, is at scale the number of segments of the defect edge, is the trajectory change amplitude coefficient of the defect edge, is the trajectory smoothness index of the defect edge;

[0141] Based on the fractal dimension of the scarf defect edge, obtain the complexity of the scarf defect edge.

[0142] Furthermore, the multi-scale edge detection model of the scarf includes a first image preprocessing layer, a multi-scale edge feature extraction layer, and an edge feature map fusion layer;

[0143] The first image preprocessing layer obtains a first standard image set by performing grayscale processing on the real-time scarf production images in the first image set; performing Gaussian filter smoothing processing on the first standard image set to obtain a second standard image set;

[0144] The multi-scale edge feature extraction layer obtains standard image sets of different scales by performing multi-scale processing on the second standard image set; extracts features from the standard image sets of different scales according to an edge detection algorithm to generate an initial edge feature map; performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales.

[0145] The edge feature map fusion layer obtains a first edge feature set by enlarging the edge feature maps of different scales to the size of the original images in the first image set.

[0146] Further, defective edge pixel points are extracted through the scarf defect edge data; temporal change information of each region of the scarf is obtained through the temporal segmentation image set of different regions of the scarf; defective edge spatial coordinates are obtained based on the defective edge pixel points and the temporal change information of each region of the scarf; a motion vector of each pixel point is obtained based on the optical flow equation to generate scarf temporal edge defect trajectory data.

[0147] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A knitted fabric defect detection method based on machine vision, characterized in that: include: The production process data of the scarf is collected in real time by a high-resolution camera to obtain a first image set; the first image set includes a real-time image of the scarf production and a background dynamic image; Constructing a scarf multi-scale edge detection model to identify the first image set, obtaining the image brightness of standard image sets of different scales, dynamically adjusting the threshold according to the actual brightness and gradient distribution of the image, and generating a first edge feature set; The background dynamic image and the first edge feature set are subjected to gradient information fusion to construct a scarf region segmentation model; the scarf production real-time image is segmented by the scarf region segmentation model to obtain a time-series segmentation image set of different regions of the scarf and scarf defect edge data; Performing real-time analysis on the scarf defect edge data and the time-series segmented image set by an optical flow method to obtain scarf time-series edge defect trajectory data; A scarf defect edge complexity evaluation model is constructed to analyze the scarf temporal edge defect trajectory data. The fractal dimension of the scarf defect edge is obtained by comprehensively analyzing the trajectory change amplitude, trajectory smoothness and temporal continuity of the defect edge. The specific calculation formula of the fractal dimension of the scarf defect edge is: ; in, is the fractal dimension of the scarf defect edge, is a logarithmic function, is the fractal scale, For scale The number of divisions of the lower defect edge, is the trajectory variation coefficient of the defect edge, It is the trajectory smoothness index of the defect edge; Based on the fractal dimension of the scarf defect edge, the complexity of the scarf defect edge is obtained.

2. The method for detecting knitted fabric defects based on machine vision according to claim 1, characterized in that: The scarf multi-scale edge detection model includes a first image preprocessing layer, a multi-scale edge feature extraction layer and an edge feature map fusion layer; The first image preprocessing layer performs grayscale processing on the real-time images of scarf production in the first image set to obtain a first standard image set; and performs Gaussian filtering and smoothing processing on the first standard image set to obtain a second standard image set; The multi-scale edge feature extraction layer performs multi-scale processing on the second standard image set to obtain standard image sets of different scales; extracts features from the standard image sets of different scales according to an edge detection algorithm to generate an initial edge feature map; performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales; The edge feature map fusion layer obtains a first edge feature set by enlarging the edge feature maps of different scales to the original image size in the first image set.

3. The knitted fabric defect detection method based on machine vision according to claim 2, characterized in that: The multi-scale processing obtains standard image sets of different scales by performing Gaussian pyramid decomposition on the second standard image set of scarf production in real time; The edge detection algorithm obtains the image brightness of a standard image set of different scales; Obtaining high thresholds and low thresholds for images of different scales according to the brightness of the image; The edge features of different scales in the image are extracted according to the high threshold, the low threshold and the gradient strength of the image; the specific calculation formula of the edge detection algorithm is: ; in, is the edge image, is the horizontal edge, is the vertical edge, is the grayscale value of the input image, is the horizontal gradient, is the vertical gradient, is the high threshold of edge gradient strength, is the low threshold of edge gradient strength, is the mean value of the gradient strength, is the standard deviation of the gradient strength, is the weight of the mean gradient intensity, is the weight of the standard deviation of the gradient intensity, is the high threshold weight.

4. The method for detecting knitted fabric defects based on machine vision according to claim 2, characterized in that: The edge feature map fusion layer introduces a multi-scale fusion mechanism to fuse edge feature points extracted from different pixels by weighted gradient intensity; the calculation formula for weighted gradient intensity fusion is: ; in, It is the edge feature point after weighted fusion of gradient intensity of different pixels. is the fractal scale, is the number of scales, For the The weight of the scale, For the Scale image, For the Scale image, is a Gaussian filter.

5. The knitted fabric defect detection method based on machine vision according to claim 1, characterized in that: The scarf region segmentation model includes a second image preprocessing layer, a temporal boundary detection layer, a temporal region segmentation layer, a defect change analysis layer and a defect edge data extraction layer; The second image preprocessing layer generates a standard segmented image set by graying, denoising and contrast enhancing the real-time image of scarf production in the first image set; and obtains an initial defect change area by performing a differential operation on the image in the background dynamic image; The temporal boundary detection layer determines the scarf area and the non-scarf area by fusing the gradient information of the first edge feature set and the background dynamic image, and generates the boundary of the scarf temporal image area; The time series region segmentation layer identifies the boundaries of the scarf time series image regions to obtain a time series segmentation image set of different regions of the scarf; The defect change analysis layer obtains a first edge feature set to detect abnormal edge features in the dynamic change area by comparing the edge distribution pattern of the normal area; The defect edge data extraction layer obtains defect areas by sequentially segmenting the image set of different areas of the scarf; performs feature analysis on edge points of the defect area to generate scarf defect edge data; the scarf defect edge data includes defect edge coordinates and edge feature values.

6. The method for detecting knitted fabric defects based on machine vision according to claim 5, characterized in that: The temporal region segmentation layer performs fine segmentation on the scarf region by using the segmentation model energy function, and the energy function formula is: ; in, is the total energy of the split, is a pixel in the image, is the set of image pixels, is a logarithmic function, Pixels The characteristic value of Pixels The segmentation label, is the pixel feature value Belongs to the segmentation label The probability of are two adjacent pixels in the pixel neighborhood, is the set of all adjacent pixel pairs, To determine the pixel and Whether they belong to the same segmentation area, is an exponential function, Pixels The characteristic value of is the smoothing factor.

7. The method for detecting knitted fabric defects based on machine vision according to claim 1, characterized in that: Defect edge pixel points extracted from the scarf defect edge data; Acquire the time variation information of each area of ​​the scarf by segmenting the image set of different areas of the scarf in time series; Acquire the spatial coordinates of the defect edge based on the time variation information of the defect edge pixel points and each area of ​​the scarf; The motion vector of each pixel is obtained based on the optical flow equation, and the temporal edge defect trajectory data of the scarf is generated.

8. A knitted fabric defect detection system based on machine vision, characterized in that: include: A data acquisition unit, used for collecting scarf production process data in real time through a high-resolution camera to obtain a first image set; the first image set includes a scarf production real-time image and a background dynamic image; An edge feature acquisition unit is used to construct a scarf multi-scale edge detection model to identify the first image set, acquire the image brightness of standard image sets of different scales, dynamically adjust the threshold according to the actual brightness and gradient distribution of the image, and generate a first edge feature set; An image segmentation unit is used to perform gradient information fusion on the background dynamic image and the first edge feature set to construct a scarf region segmentation model; segment the scarf production real-time image using the scarf region segmentation model to obtain a time-series segmentation image set of different scarf regions and scarf defect edge data; A defect track acquisition unit, used for performing real-time analysis on the scarf defect edge data and the time-series segmented image set by an optical flow method to obtain scarf time-series edge defect track data; The defect edge complexity acquisition unit is used to construct a scarf defect edge complexity evaluation model to analyze the scarf temporal edge defect trajectory data, and obtain the fractal dimension of the scarf defect edge by comprehensively analyzing the trajectory change amplitude, trajectory smoothness and temporal continuity of the defect edge; the specific calculation formula of the fractal dimension of the scarf defect edge is: ; in, is the fractal dimension of the scarf defect edge, is a logarithmic function, is the fractal scale, For scale The number of divisions of the lower defect edge, is the trajectory variation coefficient of the defect edge, It is the trajectory smoothness index of the defect edge; Based on the fractal dimension of the scarf defect edge, the complexity of the scarf defect edge is obtained.

9. The knitted fabric defect detection system based on machine vision according to claim 8, characterized in that: The scarf multi-scale edge detection model includes a first image preprocessing layer, a multi-scale edge feature extraction layer and an edge feature map fusion layer; The first image preprocessing layer performs grayscale processing on the real-time images of scarf production in the first image set to obtain a first standard image set; and performs Gaussian filtering and smoothing processing on the first standard image set to obtain a second standard image set; The multi-scale edge feature extraction layer performs multi-scale processing on the second standard image set to obtain standard image sets of different scales; extracts features from the standard image sets of different scales according to an edge detection algorithm to generate an initial edge feature map; performs direction and intensity analysis on the initial edge feature map to obtain edge feature maps of different scales; The edge feature map fusion layer obtains a first edge feature set by enlarging the edge feature maps of different scales to the original image size in the first image set.

10. The knitted fabric defect detection system based on machine vision according to claim 8, characterized in that: Defective edge pixel points are extracted through the scarf defect edge data; time change information of each area of ​​the scarf is obtained through the time-series segmentation image set of different areas of the scarf; the defect edge spatial coordinates are obtained based on the defect edge pixel points and the time change information of each area of ​​the scarf; the motion vector of each pixel point is obtained based on the optical flow equation, and the scarf time-series edge defect trajectory data is generated.

Citation Information

Patent Citations

  • Method for automatically detecting and classifying textile flaws based on pattern recognition and image processing

    CN102879401A

  • Fabric flaw detection method based on wavelet transformation and genetic algorithm

    CN105931246A

Cited By

  • Defect detection method and system for multi-texture-feature knitted fabric

    CN122367864A