A method for detecting the CV value of spandex-covered yarn based on improved FRFCM
By processing images of spandex-covered yarn using an improved FRFCM algorithm, the problems of low efficiency, low accuracy, and material waste in manual inspection are solved, achieving efficient and accurate inspection of spandex-covered yarn.
Patent Information
- Application Number
- CN202310310571.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-03-27
AI Technical Summary
Current testing of spandex-covered yarn relies on manual labor, which is inefficient, inaccurate, and harmful to human health. Furthermore, the offline testing process leads to waste of raw materials.
An improved FRFCM algorithm was used to preprocess, smooth, cluster, and perform morphological opening operations on the images of spandex-covered yarn to calculate the average diameter and CV value of the spandex-covered yarn evenness.
It enables efficient and accurate detection of spandex-covered yarn, reducing harm to human health and waste of raw materials, and improving detection efficiency and accuracy.
Smart Images

Figure CN116342535B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a method for detecting the CV value of spandex-covered yarn based on an improved FRFCM. Background Technology
[0002] Spandex-covered yarn is an elastic yarn formed by covering elongated spandex filaments with long or short fiber yarns in a spiral pattern, using spandex filaments as the core. It is an elastic fiber that possesses the wrinkle-resistant, non-deformable, stable, and high-strength characteristics of synthetic fibers. Products containing spandex-covered yarn have advantages such as good tensile strength, comfortable wear, high flexibility, wrinkle resistance, good garment shape retention, and machine washability. It is an ideal fabric for making elastic casual wear and denim clothing and has a broad market prospect.
[0003] Currently, the detection of defects in spandex-covered yarn mainly relies on manual inspection, which involves rough visual inspection, visual inspection after sampling, and further inspection after cooking and dyeing. This process is extremely complex. Furthermore, spandex-covered yarn production workshops are extremely hot and noisy, and workers working in such environments for extended periods struggle to achieve high efficiency and accuracy, which also harms their health. In addition, current defect detection in spandex-covered yarn is mostly offline, resulting in significant waste of raw materials. Therefore, how to efficiently and accurately perform automated quality inspection of spandex-covered yarn is a crucial problem that urgently needs to be solved. Summary of the Invention
[0004] In view of the above-mentioned shortcomings in the prior art, the present invention provides a method for detecting the CV value of spandex covered yarn based on improved FRFCM, which solves the problems of low detection efficiency, low accuracy, great harm to human health and great waste of raw materials in traditional spandex covered yarn detection.
[0005] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: a method for detecting the CV value of spandex-covered yarn based on improved FRFCM, the method comprising the following steps:
[0006] S1: Preprocess the image of the spandex-covered yarn to be detected to obtain a preprocessed image;
[0007] S2: Based on the improved FRFCM, the preprocessed image is smoothed and clustered to obtain the evenness image of the spandex-coated yarn;
[0008] S3: The morphological opening operation is used to process the image of spandex-covered yarn evenness to obtain an accurate image of spandex-covered yarn evenness, and the average diameter and CV value of spandex-covered yarn evenness in the accurate image of spandex-covered yarn evenness are calculated.
[0009] The beneficial effects of the above solution are as follows: The above technical solution provides a method for detecting the evenness diameter and CV value of spandex-covered yarn. The image smoothing algorithm is introduced into the FRFCM algorithm to achieve efficient image segmentation, and the membership matrix is corrected by median filtering. This solves the problems of low efficiency, low accuracy, great harm to human health, and great waste of raw materials in the traditional detection of spandex-covered yarn.
[0010] Further, the preprocessing in S1 includes: scaling the image of the spandex-covered yarn to be detected to 256×256 pixels, and converting the scaled spandex-covered yarn image into a grayscale image.
[0011] The beneficial effects of the above-mentioned further solutions are: by performing scaling and grayscale processing on the image using the above technical solutions, the image to be tested can be preprocessed, which facilitates further processing of the image in the later stages.
[0012] Furthermore, the smoothing process in S2 includes the following formula:
[0013] Let the energy function E be:
[0014]
[0015] Φ f =(x 2 +ε) f / 2
[0016] Where, r s To output a smooth image, t s Given the input image, s represents the pixel position, and α represents the penalty function coefficient. To output the gradient of the image along the x-axis and y-axis, Φ f Let f be the penalty function, ε be a constant, and f be the power of the penalty function;
[0017] The energy function is solved iteratively to output a smooth image.
[0018] The beneficial effect of the above-mentioned further solution is that by smoothing the image using the above formula, the influence of isolated parts of spandex-covered yarn is effectively filtered out, thereby improving the accuracy of image segmentation.
[0019] Furthermore, the clustering process in S2 includes the following formula:
[0020] Define the objective function J of the FRFCM algorithm as:
[0021]
[0022] Where c is the preset number of clusters, i is the value of the number of clusters, n is the number of gray levels in the smoothed image, j is the gray level value, and x j The grayscale value is θ jThe number of pixels, The grayscale value is θ j The pixels relative to v i The membership degree, m is the fuzziness controlling the generation of partitions, v i For cluster centers, ||·|| denotes the norm measure;
[0023] Under membership constraints, minimizing the objective function of the FRFCM algorithm using the Lagrange multiplier method yields a newly constructed unconstrained function. for:
[0024]
[0025] Where λ is the Lagrange multiplier, u ij Membership function;
[0026] Solving unconstrained functions About u ij and v i The partial derivative of gives the following formula:
[0027]
[0028]
[0029] Let the membership matrix corresponding to the preprocessed image be U = [u ij ] c×n To obtain a stable membership matrix, the following convergence condition is set:
[0030] max|U (b) -U (b+1) |<η
[0031] Among them, U (b) Let U be the membership matrix obtained in the b-th iteration. (b+1) Let f be the membership matrix obtained in the (b+1)th iteration, η be the convergence condition of the iteration, and max|·| represent taking the maximum value;
[0032] The membership matrix is subjected to median filtering to obtain the clustering output.
[0033] The beneficial effect of the above-mentioned further solution is that the image is clustered through the above technical solution, and the membership matrix is corrected by median filtering to obtain the clustered image.
[0034] Furthermore, the calculation of the average diameter and CV value of the spandex-covered yarn in S3 includes the following sub-steps:
[0035] S3-1: Perform morphological opening operation on the spandex-covered yarn evenness image using a 5*5 square operator to obtain an accurate spandex-covered yarn evenness image;
[0036] S3-2: Traverse the precise spandex-covered yarn evenness image to obtain the number of non-zero pixels in each column of the image. Multiply the number of non-zero pixels in each column of the image by the actual length corresponding to a single pixel in the image to obtain the column diameter of the spandex-covered yarn evenness. Calculate the average diameter of the spandex-covered yarn evenness by averaging all column diameters, and then calculate the CV value of the spandex-covered yarn evenness, as shown in the following formula:
[0037]
[0038] Where N is the number of samples taken from the cross-section, x q Let be the diameter of the yarn in the q-th column. This represents the average value of the detections.
[0039] The beneficial effects of the above-mentioned further solutions are: by obtaining the average diameter and CV value of the spandex-covered yarn through the above technical solutions, the present invention has low computational complexity and can meet practical needs. Attached Figure Description
[0040] Figure 1 This is a flowchart of a method for detecting the CV value of spandex-covered yarn based on an improved FRFCM.
[0041] Figure 2 Image of the spandex-covered yarn to be tested.
[0042] Figure 3 Image of spandex-covered yarn evenness.
[0043] Figure 4 Image of the evenness of spandex-coated yarn. Detailed Implementation
[0044] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0045] like Figure 1 As shown, a method for detecting the CV value of spandex-covered yarn based on improved FRFCM is characterized by the following steps:
[0046] S1: Preprocess the image of the spandex-covered yarn to be detected to obtain a preprocessed image;
[0047] S2: Based on the improved FRFCM, the preprocessed image is smoothed and clustered to obtain the evenness image of the spandex-coated yarn;
[0048] S3: The morphological opening operation is used to process the image of spandex-covered yarn evenness to obtain an accurate image of spandex-covered yarn evenness, and the average diameter and CV value of spandex-covered yarn evenness in the accurate image of spandex-covered yarn evenness are calculated.
[0049] The preprocessing in S1 includes scaling the image of the spandex-covered yarn to be detected to 256×256 pixels and converting the scaled spandex-covered yarn image into a grayscale image.
[0050] Smoothing in S2 includes the following formulas:
[0051] Let the energy function E be:
[0052]
[0053] Φ f =(x 2 +ε) f / 2
[0054] Where, r s To output a smooth image, t s Given the input image, s represents the pixel position, and α represents the penalty function coefficient. To output the gradient of the image along the x-axis and y-axis, Φ f Let f be the penalty function, ε be a constant, and f be the power of the penalty function;
[0055] The energy function is solved iteratively to output a smooth image.
[0056] The clustering process in S2 includes the following formulas:
[0057] Define the objective function J of the FRFCM algorithm as:
[0058]
[0059] Where c is the preset number of clusters, i is the value of the number of clusters, n is the number of gray levels in the smoothed image, j is the gray level value, and x j The grayscale value is θ j The number of pixels, The grayscale value is θ j The pixels relative to v i The membership degree, m is the fuzziness controlling the generation of partitions, v i For cluster centers, ||·|| denotes the norm measure;
[0060] Under membership constraints, minimizing the objective function of the FRFCM algorithm using the Lagrange multiplier method yields a newly constructed unconstrained function. for:
[0061]
[0062] Where λ is the Lagrange multiplier, u ij Membership function;
[0063] Solving unconstrained functions About u ij and v i The partial derivative of gives the following formula:
[0064]
[0065]
[0066] Let the membership matrix corresponding to the preprocessed image be U = [u ij ] c×n To obtain a stable membership matrix, the following convergence condition is set:
[0067] max|U (b) -U (b+1) |<η
[0068] Among them, U (b) Let U be the membership matrix obtained in the b-th iteration. (b+1) Let f be the membership matrix obtained in the (b+1)th iteration, η be the convergence condition of the iteration, and max|·| represent taking the maximum value;
[0069] The membership matrix is subjected to median filtering to obtain the clustering output.
[0070] The calculation of the average diameter and CV value of spandex-covered yarn in S3 includes the following steps:
[0071] S3-1: Perform morphological opening operation on the spandex-covered yarn evenness image using a 5*5 square operator to obtain an accurate spandex-covered yarn evenness image;
[0072] S3-2: Traverse the precise spandex-covered yarn evenness image to obtain the number of non-zero pixels in each column of the image. Multiply the number of non-zero pixels in each column of the image by the actual length corresponding to a single pixel in the image to obtain the column diameter of the spandex-covered yarn evenness. Calculate the average diameter of the spandex-covered yarn evenness by averaging all column diameters, and then calculate the CV value of the spandex-covered yarn evenness, as shown in the following formula:
[0073]
[0074] Where N is the number of samples taken from the cross-section, x q Let be the diameter of the yarn in the q-th column. This represents the average value of the detections.
[0075] In one embodiment of the present invention, an image of the yarn to be detected is input, and the image is preprocessed to obtain a preprocessed image, such as... Figure 2 As shown; the preprocessed image is smoothed and clustered, where α is set to 1000, to obtain the yarn dryness image, as shown. Figure 3 As shown; morphological opening operations are applied to the yarn dryness image to obtain an accurate yarn dryness image, where c is set to 2, as... Figure 4 As shown.
[0076] This invention is based on an improved FRFCM algorithm. In the process of extracting the evenness of spandex-covered yarn using the FRFCM algorithm, an image smoothing algorithm is introduced to achieve efficient segmentation of the spandex-covered yarn image. Then, the image is initially clustered, and the membership matrix is corrected using median filtering. Finally, the image segmentation result is obtained, which effectively filters out the influence of isolated parts of the spandex-covered yarn and speeds up the processing, making the obtained evenness image more accurate. At the same time, it can effectively detect the diameter and CV value of the spandex-covered yarn and is not affected by environmental factors such as temperature and humidity.
[0077] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the invention.
Claims
1. A method for detecting the CV value of spandex-covered yarn based on improved FRFCM, characterized in that, The method includes the following steps: S1: Preprocess the image of the spandex-covered yarn to be detected to obtain a preprocessed image; S2: Based on the improved FRFCM, the preprocessed image is smoothed and clustered to obtain the evenness image of the spandex-coated yarn; The smoothing process in S2 includes the following formula: Setting the energy function for: in, To output a smooth image, For the input image, For pixel position, The coefficients of the penalty function are... To output the image along shaft and gradient of the axis, For the penalty function, It is a constant. Let be the power of the penalty function; Iteratively solve the energy function to output a smooth image; S3: The morphological opening operation is used to process the image of spandex-covered yarn evenness to obtain an accurate image of spandex-covered yarn evenness, and the average diameter and CV value of spandex-covered yarn evenness in the accurate image of spandex-covered yarn evenness are calculated.
2. The method for detecting the CV value of spandex-covered yarn based on improved FRFCM according to claim 1, characterized in that, The preprocessing in S1 includes: scaling the image of the spandex-covered yarn to be detected to 256×256 pixels, and converting the scaled spandex-covered yarn image into a grayscale image.
3. The method for detecting the CV value of spandex-covered yarn based on improved FRFCM according to claim 1, characterized in that, The clustering process in S2 includes the following formula: Define the objective function of the FRFCM algorithm for: in, The preset number of clusters, To determine the number of clusters, To smooth the number of gray levels in the image, For grayscale values, The grayscale value is The number of pixels, The grayscale value is pixels relative to membership degree To control the ambiguity of the generated partitions, As cluster center, Represents the norm measure; Under membership constraints, minimizing the objective function of the FRFCM algorithm using the Lagrange multiplier method yields a newly constructed unconstrained function. for: in, It is a Lagrange multiplier. Membership function; Solving unconstrained functions about and The partial derivative of gives the following formula: Let the membership matrix of the preprocessed image be... To obtain a stable membership matrix, the following convergence condition is set: in, For the first The membership matrix obtained in the second iteration For the first The membership matrix obtained in the second iteration For the iterative convergence condition, This indicates taking the maximum value; The membership matrix is subjected to median filtering to obtain the clustering output.
4. The method for detecting the CV value of spandex-covered yarn based on improved FRFCM according to claim 1, characterized in that, The calculation of the average diameter and CV value of the spandex-covered yarn in step S3 includes the following sub-steps: S3-1: Perform morphological opening operation on the spandex-covered yarn evenness image using a 5*5 square operator to obtain an accurate spandex-covered yarn evenness image; S3-2: Traverse the precise spandex-covered yarn evenness image to obtain the number of non-zero pixels in each column of the image. Multiply the number of non-zero pixels in each column of the image by the actual length corresponding to a single pixel in the image to obtain the column diameter of the spandex-covered yarn evenness. Calculate the average diameter of the spandex-covered yarn evenness by averaging all column diameters, and then calculate the CV value of the spandex-covered yarn evenness, as shown in the following formula: in, The number of samples taken from the cross-section. For the yarn in the first The diameter of the column, This represents the average value of the detected values.
Citation Information
Patent Citations
Yarn evenness detection method based on sub-pixel edge detection
CN110458809A
Yarn defect detection method based on machine vision
CN111862008A