Differential Extraction Method of Interlaced Contour Features for Visual Detection of Yarn Evenness
Through radial differential convolution and deep neural network of texture corrosion masks, the contour extraction problem caused by the interweaving of hair and fiber texture in yarn images is solved, and a higher precision yarn dry uniformity detection is achieved.
Patent Information
- Application Number
- CN202210262133.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-03-17
AI Technical Summary
The prior art is difficult to accurately extract the pure yarn main contour from the yarn image, resulting in low detection accuracy of yarn strip uniformity, especially in the case of interweaving of yarn hair and fiber textures.
The deep neural network is extracted by radial differential convolution and texture corrosion mask profile. Combining the graphic characteristics of the yarn image, hair interference is eliminated through radial differential convolution, and texture interference is eliminated through texture corrosion mask, and the pure yarn backbone profile is extracted.
It realizes more accurate yarn dry uniformity detection, improves the accuracy and accuracy of yarn detection, can effectively eliminate interference from hair and texture, and extracts the pure yarn main trunk profile.
Smart Images

Figure CN114842060B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an interlaced contour feature differential extraction method for visual detection of yarn evenness, belonging to the fields of spinning, machine vision, and image processing. Background Art
[0002] The evenness of yarn (the degree of uniformity of the thickness of the yarn along the axial segment) is an important indicator for measuring the quality of yarn. Accurate detection of yarn evenness is an important link to ensure the quality of yarn. With the development of machine vision technology, due to its convenience, speed, and low cost, in recent years, some research or patents have proposed to use machine vision technology to detect yarn evenness. However, it is still difficult to replace the traditional capacitance and photoelectric yarn evenness detection methods. One of the main reasons is that it is difficult to accurately extract the pure main body contour of the yarn from the image, resulting in the detection accuracy being difficult to meet the requirements of industrial applications.
[0003] Since the yarn is formed by twisting a large number of non-uniformly arranged fibers, the texture of the yarn body is complex, and there are a large number of interlaced hairs around it. This requires the image processing method to exclude the interference of hairs and textures from the interlaced objects and accurately extract the pure main body contour of the yarn to measure the yarn body diameter and analyze the evenness. Traditional contour extraction methods, such as Sobel, Prewitt, Canny operators, etc., extract the target contour in the image through pixel gradient changes (such as brightness, color, or texture, etc.). However, the features at the boundary of the yarn body are interlaced, and the brightness, color, and texture are almost the same, which causes the traditional method to extract the hair and texture contours together and regard them as the pixel statistics of the main body of the yarn, resulting in an evenness measurement error.
[0004] In recent years, the contour extraction method based on deep learning is gradually replacing the traditional image processing method and achieving an effect close to human vision. However, the current methods are all pursuing global high-precision contour detection and ignoring the detection of the interesting boundaries of the interlaced objects in the local complex regions of the image. Summary of the Invention
[0005] The purpose of the present invention is to accurately extract the continuous contour of the yarn evenness and improve the detection accuracy of the yarn evenness in view of the problem that the yarn hairs, textures, and the yarn body are interlaced in the visual detection scenario of the yarn evenness.
[0006] In order to achieve the above purpose, the technical solution of the present invention is to provide an interlaced contour feature differential extraction method for visual detection of yarn evenness, which is characterized by including the following steps:
[0007] S000. Deploy a vision system to continuously collect ≥500 groups of yarn images, and use a high-precision measuring instrument to mark the yarn evenness contour to form a one-to-one corresponding data set;
[0008] S100. Construct a contour extraction deep neural network model with radial difference convolution and texture erosion mask layer;
[0009] S200. Use the labeled dataset to iteratively train the contour extraction deep neural network model. After training is completed, load the model parameters, input the image to be processed, and obtain the preliminary extracted contour image;
[0010] S300. Calculate the Euclidean distance from the target pixel point to the nearest background point, extract the foreground pixel skeleton in the distance transformation result, and refine the preliminary extracted contour into a single-pixel contour;
[0011] S400. Scan the pixel coordinates of the yarn contour row by row, subtract the coordinates of each row to obtain the contour diameter of that row in the image space, convert it to the physical diameter through the pixel size, and calculate the coefficient of variation based on the continuous physical diameter values of each row, which is the evenness of yarn evenness.
[0012] Preferably, in step S100, the contour extraction deep neural network model includes four groups of radial difference convolution layers. Among them, each group of radial difference convolution layers first calculates the pixel gradient matrix from 8 radial directions, as shown in the following formula (1):
[0013]
[0014] In the formula, M 3×3 is the radial pixel gradient matrix, represents the difference operation, x 5×5 represents the local image block, and x rc represents the gray value of the pixel point at the r-th row and c-th column of the image;
[0015] The radial difference convolution layer multiplies the radial pixel gradient matrix M 3×3 by different weights respectively for radial difference convolution operation, as shown in the following formula (2):
[0016]
[0017] In formula (2), y RPDC represents the extracted radial feature map of interest, w 3×3 represents the weight matrix, * represents the convolution operation, and w′ 5×5 represents the weight matrix after differential conversion.
[0018] Preferably, in step S100, in the contour extraction deep neural network model, a texture erosion mask layer is designed according to the yarn texture and the distribution of the main trunk contour. The contour extraction deep neural network model includes four texture erosion mask layers and a fusion gate, where:
[0019] The texture erosion mask layer further filters the radial features of interest extracted by each group of radial difference convolution layers, including the following steps:
[0020] First, construct a texture erosion convolution kernel and perform a convolution operation with the radial features extracted by the radial difference convolution layer, as shown in the following formula (3):
[0021]
[0022] In formula (3), ω m is a matrix of size 1×α with all elements being 1, representing its corresponding output;
[0023] Design an inhibition function to inhibit smaller values and make them close to 0, as shown in the following formula (4):
[0024]
[0025] In formula (4), β represents the sensitivity coefficient, which is used to adjust the discrimination threshold and the smoothness of the contour;
[0026] For Perform interpolation reconstruction to restore it to the original image size, as shown in the following formula (5):
[0027]
[0028] In formula (5), scale_factor represents the interpolation upsampling method, and the bilinear interpolation upsampling is adopted in this embodiment;
[0029] Finally, through the fusion gate, the outputs Y m of each texture erosion mask layer are fused to obtain the image Y 3×3 0>of the extracted contour, as shown in the following formula (6):
[0030] Y O = ω F * Y m + b F (6)
[0031] In formula (6), ω F represents the weight of the fusion gate, and b F corresponds to its bias.
[0032] In view of the problems in the visual inspection of yarn evenness, such as the interference of hairiness and fiber texture, which lead to inaccurate contour extraction and low detection accuracy, by analyzing the graphics features of yarn images, a contour extraction deep neural network with radial difference convolution and texture erosion mask is designed. The present invention extracts radial features through radial difference convolution to exclude most of the hairiness interference, and further eliminates texture interference through the texture erosion mask, so as to extract a pure yarn body backbone contour from the intertwined yarn contour features, and realize more accurate yarn evenness detection.
[0033] Compared with the prior art, the present invention has the following advantages:
[0034] (1) By combining the yarn image gradient and the prior knowledge of graphics with the contour extraction deep neural network, the contour of the region of interest can be extracted from complex images according to the graphics distribution difference.
[0035] (2) The designed radial difference convolution and texture erosion mask can effectively exclude hairiness and texture interference, extract a pure yarn body backbone contour from the intertwined yarn contour features, and improve the accuracy of yarn evenness visual inspection. Description of the Drawings
[0036] Figure 1 is a schematic diagram of contour extraction for yarn evenness visual inspection;
[0037] Figure 2 is a structural diagram of the neural network for differential extraction of intertwined contour features;
[0038] Figure 3 is a schematic diagram of the principle of radial difference convolution;
[0039] Figure 4 is a schematic diagram of the principle of texture erosion mask;
[0040] Figure 5 is a comparison diagram of the effects of the present invention and the prior art. Detailed Embodiments
[0041] The following further elaborates the present invention in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims of this application.
[0042] The present invention combines the advantages of traditional edge detection operators and contour extraction deep neural networks, injects the yarn image gradient and the prior knowledge of graphics into the contour extraction neural network, so as to extract a pure yarn body backbone contour from the intertwined yarn contour features, and realize more accurate yarn evenness detection.
[0043] The differential extraction method of interlaced contour features for visual detection of yarn evenness disclosed by the present invention includes the following steps:
[0044] S000. Deploy a vision system to continuously collect ≥500 groups of yarn images, and use a high-precision measuring instrument to mark the yarn evenness contour to form a corresponding data set.
[0045] S100. Construct a contour extraction deep neural network model with radial differential convolution and texture erosion mask layers. The contour extraction deep neural network model includes 1 input layer, 4 groups of radial differential convolution layers, 4 texture erosion mask layers, 1 fusion gate, and 1 output layer. The input layer is the original image to be detected, and the output is the extracted contour image. Each group of radial differential convolution layers consists of 3 consecutive radial differential convolutions and max-pooling operations.
[0046] In this embodiment, the specific network structure and parameter settings of the contour extraction deep neural network model are shown in Table 1 below.
[0047]
[0048]
[0049] Table 1. Network structure parameter table
[0050] As Figure 3 shown, the radial differential convolution layer first calculates the pixel gradient matrix from 8 radial directions, as shown in the following formula (1):
[0051]
[0052] In the formula, M 3×3 is the radial pixel gradient matrix, represents the differential operation, x 5×5 represents the local image block, and x rc represents the gray value of the pixel at the r-th row and c-th column of the image.
[0053] The radial differential convolution layer multiplies the radial pixel gradient matrix M 3×3 by different weights for radial differential convolution operations, as shown in the following formula (2):
[0054]
[0055] In formula (2), y RPDC represents the extracted radial feature map of interest, w 3×3 represents the weight matrix, * represents the convolution operation, and w′ 5×5 represents the weight matrix after differential conversion.
[0056] The texture erosion mask layer further filters the radial features of interest extracted by each group of radial difference convolutional layers, as Figure 4 shown, including the following steps:
[0057] First, construct a texture erosion convolution kernel and perform a convolution operation on the radial features extracted by the radial difference convolutional layer, as shown in the following formula (3):
[0058]
[0059] In formula (3), ω m is a matrix of size 1×α with all elements being 1, representing its corresponding output. In this way, the vertical features will obtain larger values, while the features in other directions will obtain smaller values.
[0060] Then design an inhibition function to inhibit the smaller values to make them close to 0, as shown in the following formula (4):
[0061]
[0062] In formula (4), β represents the sensitivity coefficient, which is used to adjust the discrimination threshold and the smoothness of the contour.
[0063] Then, perform interpolation reconstruction on to restore it to the original image size, as shown in the following formula (5):
[0064]
[0065] In formula (5), scale_factor represents the interpolation upsampling method, and the bilinear interpolation upsampling is adopted in this embodiment.
[0066] Finally, fuse the outputs Y m of each texture erosion mask layer through a fusion gate to obtain the image Y O of the extracted contour, as shown in the following formula (6):
[0067] Y O = ω F *Y m + b F (6)
[0068] In formula (6), ω F represents the weight of the fusion gate, and b F corresponds to its bias.
[0069] S200. Use the labeled dataset to iteratively train the model. After the training is completed, load the model parameters, input the image to be processed, and obtain the preliminary extracted contour image.
[0070] The network training parameters are shown in Table 2 below.
[0071]
[0072] Table 2. Network training parameter table
[0073] S300. Calculate the Euclidean distance from the target pixel point to the nearest background point, extract the foreground pixel skeleton in the distance transformation result, and refine the initially extracted contour into a single-pixel contour.
[0074] Among them, the foreground pixel skeleton in the distance transformation result is extracted based on the following rules, and the initially extracted contour is refined into a single-pixel contour:
[0075] Step 1. Take the central pixel P1 and its adjacent 8 pixel points. The pixel point directly above P1 is P2, and the remaining pixel points are sequentially marked as P3,..., P9 in the clockwise direction;
[0076] Step 2. When the following conditions are simultaneously satisfied: Condition 1) The sum of the number of foreground pixel points around P1 is between 2 and 6; Condition 2) Among the 8-neighborhood pixels, in the clockwise direction, the number of times that adjacent two pixels change from 0 to 1 is equal to 1; Condition 3) P2 P4 P6 = 0; Condition 4) P4 P6 P8 = 0, then delete the central element P1:
[0077] Step 3. Reset the central pixel P1, and continuously repeat Step 1 to Step 2 until no element is eroded.
[0078] S400. Scan the pixel coordinates of the yarn contour row by row, subtract the coordinates of each row to obtain the contour diameter of that row in the image space, convert it to the physical diameter through the pixel size, and calculate the coefficient of variation based on the continuous physical diameter values of each row, which is the evenness.
[0079] In this embodiment, the evenness is calculated using the following formula (7)
[0080]
[0081] In formula (7), cv(l) is the coefficient of variation of the diameter of the yarn segment with length l, d i represents the diameter of the i-th row, represents the average diameter of all m rows, and m represents the total number of rows.
[0082] The comparison of the final result with the result of the existing contour extraction method is as Figure 5 shown. It can be seen that the present invention can accurately extract the pure and continuous evenness contour features.
Claims
1. An interlaced contour feature differential extraction method for visual detection of yarn evenness, characterized in that It includes the following steps: S000. Deploy a vision system to continuously collect ≥500 groups of yarn images, and use a high-precision measuring instrument to mark the yarn evenness contour to form a corresponding dataset. S100. Construct a contour extraction deep neural network model with radial difference convolution and texture erosion mask layers, where: The contour extraction deep neural network model includes four groups of radial difference convolution layers. Among them, each group of radial difference convolution layers first calculates the pixel gradient matrix from 8 radial directions, as shown in the following formula (1): where M 3×3 is the radial pixel gradient matrix, represents the difference operation, x 5×5 represents the local image patch, and x rc represents the gray value of the pixel at the r-th row and c-th column of the image; The radial difference convolution layer multiplies the radial pixel gradient matrix M 3×3 by different weights respectively to perform a radial difference convolution operation, as shown in the following formula (2): In formula (2), y RPDC represents the extracted radial feature map of interest, w 3×3 represents the weight matrix, * represents the convolution operation, w ′ 5×5 represents the weight matrix after differential transformation; In the contour extraction deep neural network model, a texture erosion mask layer is designed according to the yarn texture and the distribution of the main trunk contour. The contour extraction deep neural network model includes four texture erosion mask layers and a fusion gate, where: The texture erosion mask layer further filters the radial features of interest extracted by each group of radial difference convolution layers, including the following steps: First, construct a texture erosion convolution kernel and perform a convolution operation with the radial features extracted by the radial difference convolution layer, as shown in the following formula (3): In formula (3), ω m is a matrix of size 1×α with all elements being 1, and Y m1 represents its corresponding output; Design an inhibition function to inhibit smaller values to make them close to 0, as shown in the following formula (4): In formula (4), β represents the sensitivity coefficient, which is used to adjust the discrimination threshold and the smoothness of the contour. Interpolate and reconstruct Y m2 to restore it to the original image size, as shown in Equation (5) below: Y m = Y m2 × scale_factor(5) In formula (5), scale_factor represents the interpolation upsampling method. In this embodiment, bilinear interpolation upsampling is used. Finally, the output Y of each texture erosion mask layer is fused through a fusion gate m to obtain an image Y with the extracted contour fused O , as shown in the following formula (6): Y O = ω F * Y m + b F (6) In Equation (6), ω F represents the weight of the fusion gate, and b F corresponds to its bias; S200. Use the labeled dataset to iteratively train the contour extraction deep neural network model. After the training is completed, load the model parameters, input the image to be processed, and obtain the preliminary extracted contour image. S300. Calculate the Euclidean distance from the target pixel point to the nearest background point, extract the foreground pixel skeleton in the distance transformation result, and refine the preliminary extracted contour into a single-pixel contour. S400. Scan the pixel coordinates of the yarn contour row by row, subtract the coordinates of each row to obtain the contour diameter of that row in the image space, convert it to the physical diameter through the pixel size, and calculate the coefficient of variation based on the continuous physical diameter values of each row, which is the evenness.