A method and system for measuring yarn sub-pixel diameter

The yarn image is taken through the linear array CCD sensor and image processing is performed, including grayscale value adjustment and edge detection, to determine the sub-pixel-level second edge pixel point of the yarn, solving the problem of large error in yarn diameter measurement in the prior art , realizes high-precision online measurement.

CN113808121BActive Publication Date: 2025-02-18JINING POLYTECHNIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111124256.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-02-18
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

The prior art has large errors in yarn diameter measurement and it is difficult to achieve online measurement, especially in the production process of yarn.

Method used

The initial discrete image of the yarn is captured by a linear array CCD sensor. Through image processing technology, including grayscale value adjustment, edge detection and fitting function construction, the sub-pixel level second edge pixel point of the yarn is determined, and its coordinate position is calculated to Determine the diameter of the yarn.

Benefits of technology

Subpixel-level measurement of yarn diameter is realized, which improves measurement accuracy, simplifies the measurement process, and supports online measurement on the yarn production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113808121B_ABST
    Figure CN113808121B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for measuring the sub-pixel diameter of a yarn, comprising an initial discrete image of the yarn taken by a linear array CCD sensor, adjusting the initial discrete image of the yarn to obtain a grayscale discrete image, determining a first edge of the yarn in the image based on the grayscale discrete image, and then determining a sub-pixel second edge pixel point of the yarn based on the first edge of the yarn, and finally calculating the yarn diameter based on the second edge pixel point position. In the present invention, the linear array CCD sensor is arranged on both sides of the yarn production line, thereby realizing online measurement of the yarn diameter, and calculating the yarn diameter by the second edge pixel point position, thereby realizing sub-pixel level measurement of the yarn diameter. The method has a simple process and strong operability, and also greatly improves the accuracy of the yarn diameter measurement result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of yarn measurement, and in particular relates to a method and system for measuring a yarn sub-pixel diameter. Background Art

[0002] Yarn diameter is an important indicator of yarn uniformity. Since the cross section of the yarn is irregular and soft and easy to deform, the linear density (length per unit mass) is usually used to characterize its diameter in actual production. However, due to the influence of twist coefficient and hairiness, the same linear density may correspond to different diameter values.

[0003] In the prior art, the diameter is mostly calculated by obtaining the number of pixels, which has a large measurement error. In order to improve the measurement accuracy, technicians try to measure the yarn diameter through image processing technology, but the algorithm calculation cycle of image processing technology is long and the efficiency is low, so it is difficult to achieve online measurement of yarn diameter. Summary of the invention

[0004] In view of the problems existing in the above-mentioned prior art, the present invention provides a method and system for measuring the sub-pixel diameter of a yarn, thereby realizing online sub-pixel measurement of the yarn.

[0005] A first aspect of an embodiment of the present invention provides a method for measuring a yarn sub-pixel diameter, the method comprising:

[0006] Acquire an initial discrete image of the yarn using a linear array CCD sensor;

[0007] Collecting the grayscale value of each pixel of the initial discrete image, calculating the average grayscale value of the pixels of the initial discrete image as the adjustment value, and adjusting the grayscale value of each pixel of the initial discrete image based on the adjustment value, and outputting a grayscale discrete image;

[0008] Selecting the pixel point with the lowest grayscale value of the grayscale discrete image as the detection origin, and judging in sequence based on the detection origin whether the grayscale values ​​of each pixel point in the horizontal direction of the detection origin meet the threshold, so as to determine the first edge pixel point of the grayscale discrete image;

[0009] Based on the grayscale values ​​of the first edge pixel points of the grayscale discrete image, a fitting function is constructed to connect the edge pixel points of the grayscale discrete image into a continuous first edge of the grayscale discrete image;

[0010] Taking each first pixel point of the first edge of the grayscale discrete image as a starting point, selecting a number of target points equidistant to the left and right of the starting point, and determining the second edge pixel point based on the grayscale value of the target point;

[0011] Based on the coordinate position of the second edge pixel point, the diameter of the yarn can be calculated.

[0012] A second aspect of an embodiment of the present invention provides a yarn sub-pixel diameter measurement system, the system comprising:

[0013] An image acquisition unit, used to acquire an initial discrete image of the yarn taken by a linear array CCD sensor;

[0014] An image filtering unit is used to collect the grayscale value of each pixel of the initial discrete image, calculate the average grayscale value of the pixels of the initial discrete image, and adjust the grayscale value of each pixel of the initial discrete image based on the average grayscale value to output a grayscale discrete image;

[0015] An edge detection unit is used to select a pixel point with the lowest grayscale value of the grayscale discrete image as a detection origin, and determine whether the grayscale values ​​of each pixel point in the horizontal direction of the detection origin meet the threshold value based on the detection origin, so as to determine a first edge pixel point of the grayscale discrete image;

[0016] A data processing unit, configured to construct a fitting function based on the grayscale values ​​of the first edge pixels of the grayscale discrete image to connect the edge pixels of the grayscale discrete image into a continuous first edge of the grayscale discrete image;

[0017] An edge detection unit is used to take each first pixel point of the first edge of the grayscale discrete image as a starting point, select a number of target points equidistant to the left and right of the starting point, and determine a second edge pixel point based on the grayscale value of the target point;

[0018] The output unit can calculate the diameter of the yarn based on the coordinate position of the second edge pixel point.

[0019] A third aspect of an embodiment of the present invention provides a terminal, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the above-mentioned method for measuring the sub-pixel diameter of a yarn.

[0020] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the above-mentioned method for measuring the sub-pixel diameter of a yarn based on voiceprint analysis.

[0021] The yarn sub-pixel diameter measurement method and system of the present invention have the following beneficial effects:

[0022] 1. The present invention discloses a method and system for measuring the sub-pixel diameter of a yarn, including an initial discrete image of the yarn taken by a linear array CCD sensor. The linear array CCD sensor is arranged on both sides of the yarn production line. The initial image is analyzed and processed to measure the diameter of the yarn, thereby realizing online measurement of the yarn diameter, simplifying the process of yarn diameter measurement, and improving the practicability of the yarn measurement method.

[0023] 2. The present invention discloses a method and system for measuring the sub-pixel diameter of a yarn, which includes adjusting an initial discrete image of the yarn to obtain a grayscale discrete image, determining the first edge of the yarn in the image based on the grayscale discrete image, and then determining the sub-pixel second edge pixel point of the yarn based on the first edge of the yarn, and finally calculating the yarn diameter based on the position of the second edge pixel point, thereby realizing sub-pixel measurement of the yarn diameter and greatly improving the accuracy of the yarn diameter measurement results. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 It is an overall flow chart of a method for measuring the sub-pixel diameter of a yarn according to the present invention;

[0026] Figure 2 It is a flow chart of grayscale discrete image adjustment process;

[0027] Figure 3 This is a flow chart of a method for determining a first edge pixel. DETAILED DESCRIPTION

[0028] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0029] An embodiment of the present invention provides a method for measuring a yarn sub-pixel diameter, the method comprising:

[0030] Acquire an initial discrete image of the yarn using a linear array CCD sensor;

[0031] Collecting the grayscale value of each pixel of the initial discrete image, calculating the average grayscale value of the pixels of the initial discrete image as the adjustment value, and adjusting the grayscale value of each pixel of the initial discrete image based on the adjustment value, and outputting a grayscale discrete image;

[0032] Selecting the pixel point with the lowest grayscale value of the grayscale discrete image as the detection origin, and judging in sequence based on the detection origin whether the grayscale values ​​of each pixel point in the horizontal direction of the detection origin meet the threshold, so as to determine the first edge pixel point of the grayscale discrete image;

[0033] Based on the grayscale values ​​of the first edge pixel points of the grayscale discrete image, a fitting function is constructed to connect the edge pixel points of the grayscale discrete image into a continuous first edge of the grayscale discrete image;

[0034] Taking each first pixel point of the first edge of the grayscale discrete image as a starting point, selecting a number of target points equidistant to the left and right of the starting point, and determining the second edge pixel point based on the grayscale value of the target point;

[0035] Based on the coordinate position of the second edge pixel point, the diameter of the yarn can be calculated.

[0036] refer to Figure 1 In this embodiment, the initial discrete image of the yarn is obtained by a linear array CCD sensor. The initial discrete image is a projection image of the yarn on the CCD pixel. The yarn diameter can be calculated according to the number of CCD pixels occupied by the initial discrete image of the yarn. However, the yarn has hairiness. The projection of the hairiness will affect the diameter measurement result of the yarn during the calculation. Therefore, it is necessary to filter the hairiness noise. In this embodiment, the grayscale value of each pixel point of the initial discrete image is compared with the average grayscale value, the grayscale value of the pixel point is adjusted, and the hairiness noise in the initial discrete image is filtered to obtain a grayscale discrete image. Since the linear array CCD pixels are arranged discretely, the error in calculating the yarn diameter directly by the number of CCD pixels occupied by the yarn grayscale discrete image is relatively large. Therefore, in this embodiment, the first edge pixel point of the yarn is determined by taking the pixel point with the lowest grayscale value in the grayscale discrete image as the origin and comparing the grayscale values ​​of this point with the points in the horizontal direction. Then, based on the first edge pixel point, several pixels are selected from 1 / 4 of it, and the second edge pixel point of the grayscale image is determined by Gaussian fitting. According to the coordinate position of the second edge pixel point, the diameter of the yarn can be calculated more accurately.

[0037] Based on the above method, the above initial discrete image acquisition method includes:

[0038] Measuring the speed and direction of yarn movement on a yarn production line;

[0039] The position of the yarn imaging light source and the frequency of the linear array CCD sensor acquiring images are adjusted based on the movement speed and movement direction of the yarn to obtain a projection image of the yarn;

[0040] A magnifying lens is arranged behind the yarn projection image to magnify the acquired projection image to obtain a magnified image of the yarn;

[0041] The enlarged image of the yarn is collected by an image collection unit, and the position is adjusted and output as an initial discrete image of the yarn. The collection unit adopts CCD pixels arranged in a linear array.

[0042] In this embodiment, the yarn diameter measurement is mostly used in the yarn production process, so the initial discrete image of the yarn is also collected on the yarn production line. In the yarn production process, since the yarn is constantly moving, the movement speed and movement angle of the yarn must be measured before the yarn is collected. Based on the movement angle of the yarn, the yarn imaging light source and the linear array CCD sensor are arranged on both sides of the yarn and the yarn is in a parallel position. The yarn imaging light source adopts a parallel light source, and then the frequency of the CCD sensor acquiring the image is adjusted based on the movement speed of the yarn. The frequency of the CCD sensor acquiring the image should be kept consistent with the movement speed of the yarn. The projection image of the yarn can be obtained by irradiating the yarn with the yarn imaging light source. In order to facilitate measurement, in this embodiment, the projection image of the yarn is enlarged by a magnifying lens, and then the enlarged image of the yarn is collected by a collection unit. The magnification of the magnifying lens is preferably 20 times, and the collection unit is a CCD pixel arranged in a linear array. After the enlarged image is obtained, since there may be vibration during the movement of the yarn, there may be a certain deviation in the position of the collected image, so the enlarged image needs to be adjusted in position, and the final output is the initial discrete image of the yarn.

[0043] Based on the above method, the adjustment steps of the above grayscale discrete image are as follows:

[0044] (1) Divide the grayscale discrete image into several horizontal strip image blocks;

[0045] (2) calculating the grayscale value of each pixel in the strip image block, and selecting a square adjustment frame with the pixel with the lowest grayscale value as the center, wherein the side length of the adjustment frame is the same as the width of the strip image;

[0046] (3) Calculate the average grayscale value of each pixel in the adjustment frame as the adjustment value, compare the grayscale value of the pixel in the adjustment frame with the adjustment value, calculate the proportion of pixels with grayscale values ​​less than the adjustment value in the adjustment frame, and if the proportion is less than the set threshold, reselect the adjustment frame;

[0047] (4) If the proportion is greater than the set threshold, the adjustment frame is moved one pixel in the horizontal direction, and the proportion of pixels with grayscale values ​​less than the adjustment value in the adjustment frame is calculated. If the proportion is greater than the set threshold, the grayscale values ​​of the pixels in the opposite column of the adjustment frame to the moving direction are adjusted to the lowest grayscale value;

[0048] (5) Repeat the above step (4) until the proportion of pixels with grayscale values ​​less than the adjustment value in the adjustment frame is less than the set threshold, the adjustment frame stops moving, and the adjustment of the initial discrete image is completed.

[0049] refer to Figure 2 In this embodiment, the grayscale discrete image is first divided into a number of horizontal strip image blocks, wherein the width of the strip image block is preferably 20 pixels, and then the grayscale value of each pixel in a single strip image block is obtained, and a 20*20 adjustment frame is selected with the pixel with the lowest grayscale value as the center, and the average value of all pixels in the adjustment frame is calculated, and the calculated average value is used as the adjustment value, and then the grayscale values ​​of all pixels in the adjustment frame are compared with the adjustment value, and the ratio of pixels with grayscale values ​​less than the adjustment value in the adjustment frame is counted. If the ratio is less than the set threshold, it means that the selected center point is an interference point, and the point is discarded and the center point is re-determined, and the adjustment frame is selected. If the ratio is greater than the set threshold, the adjustment frame is moved one pixel in the horizontal direction, wherein the threshold is preferably 0.1.

[0050] The adjustment box moves in the horizontal direction. In this embodiment, two identical adjustment boxes are copied, one moves to the left and the other moves to the right. After moving one pixel, the ratio of pixels whose grayscale values ​​are less than the adjustment value in the adjustment box is calculated. If the ratio is greater than the set threshold, the grayscale of the pixels in the rightmost (left) column of the adjustment box moving to the left (right) is adjusted to the lowest grayscale value. The adjustment box continues to be moved until the proportion of pixels whose grayscale values ​​are less than the adjustment value in the adjustment box is less than the set threshold. The adjustment box is stopped and the adjustment of the initial discrete image is completed.

[0051] Based on the above method, the method for determining the first edge pixel point is as follows:

[0052] Based on the grayscale discrete image of the yarn, the grayscale values ​​of the pixels in each horizontal position of the grayscale discrete image are calculated respectively, and the pixel with the lowest grayscale value is selected as the detection origin;

[0053] Select the detection threshold of the pixel point, and calculate the difference between the gray value of the pixel points on both sides of the detection origin at each horizontal position of the gray discrete image and the detection threshold;

[0054] Determine whether the difference is positive or negative. If the difference is negative, select the previous pixel of the pixel as the first edge pixel at each horizontal position of the grayscale discrete image. There are two first edge pixels at each horizontal position of the grayscale discrete image.

[0055] The first edge pixel point of the grayscale discrete image can be obtained by sequentially determining the first edge pixel point of each horizontal position of the grayscale discrete image.

[0056] refer to Figure 3 In this embodiment, by calculating the first edge pixel points at each horizontal position of the grayscale discrete image, all the first edge pixel points of the entire grayscale discrete image are obtained. Specifically, the grayscale values ​​of each pixel point at each horizontal position of the grayscale discrete image are calculated respectively, and the pixel point with the lowest grayscale value at the horizontal position is selected as the detection origin. The detection threshold of the pixel point is selected. In this embodiment, the detection threshold can be set to half of the highest grayscale value at the horizontal position. Then, the difference between the grayscale value of the pixel points on both sides of the detection origin at each horizontal position of the grayscale discrete image and the detection threshold is calculated in turn, and the positive and negative values ​​of the calculated difference are judged. The difference between the grayscale value of the pixel points on both sides of the detection origin and the detection threshold is detected. The calculation formula of the above judgment process is as follows:

[0057] S L =(HL i )(HL i+1 ) (1)

[0058] S R =(HR i )(HR i+1 ) (2)

[0059] Among them, S represents the difference, H represents the detection threshold, and L i Represents the gray value of the i-th pixel on the left side of the detection origin, R i Represents the gray value of the i-th pixel on the right side of the detection origin. L ≤0, the i-th pixel on the left side of the detection origin is the first edge pixel on the left side of each horizontal position of the grayscale discrete image. If S R ≤0, the i-th pixel on the right side of the detection origin is the first edge pixel on the right side at each horizontal position of the grayscale discrete image.

[0060] Based on the above method, the above first edge pixel points are discretely arranged, and a continuous first edge of a grayscale discrete image can be obtained by fitting them with a function. The fitting process is as follows:

[0061] Based on the number of first edge pixels, construct an n-order fitting function, where n is the number of first edge pixels;

[0062] Substituting the grayscale value of the first edge pixel into the n-order fitting function, and solving each fitting coefficient of the n-order fitting function;

[0063] The obtained fitting coefficient is input into the fitting function to obtain the fitting function of the first edge pixel.

[0064] In this embodiment, the continuous edge of the gray discrete image is obtained by fitting the gray value of the first edge pixel point. Specifically, the first edge pixel point can be curve fitted by the least square method. In this embodiment, the image is collected by a linear CCD sensor, so each point of the image is a discrete point. First, based on the number of the first edge pixel points, an n-order fitting function is constructed, and then the gray value of the first edge pixel point is substituted into the n-order fitting function to construct a fitting equation, and the fitting coefficient of the function is solved. Then, the obtained fitting coefficient is brought into the fitting function, and the coefficient of each term of the fitting function can be obtained, thereby obtaining the fitting function of the first edge pixel point.

[0065] Based on the above method, the method for determining the second edge pixel point is as follows:

[0066] Select the first pixel point on the first edge of the grayscale discrete image as the starting point, and select several target points at equal distances from 1 / 4 of the starting point on both sides;

[0067] Calculate the grayscale value difference between the selected target points, where the grayscale value difference between the target points is a discrete value;

[0068] Based on the gray value difference of the target point, a fitting function is constructed to fit the gray value of the target point, and the function value corresponding to the target point with the largest fitting coefficient is solved;

[0069] The coordinate position obtained by increasing the coordinate of the starting point by the function value is the coordinate position of the second pixel point.

[0070] In this embodiment, in order to further accurately locate the edge point of the image, it is necessary to further subdivide the first edge pixel point to obtain the second pixel point of the grayscale discrete image, and realize the sub-pixel edge recognition of the grayscale discrete image. First, the first edge pixel point is taken as the starting point, and several target points are selected at equal distances from 1 / 4 of the starting point on both sides. Then, the size of the target in one pixel point is 1 / 4 of the pixel point, and the sub-pixel recognition of the image is realized. Then, the difference of the grayscale values ​​of each target point can be obtained by calculation. Since the target points are selected at equal distances, the difference is a discrete value. Therefore, it is necessary to fit the grayscale value difference through a function, and solve the function value corresponding to the target point with the largest fitting coefficient of the fitting function. Finally, the coordinates of the first edge pixel point are increased by the function value to obtain the coordinates of the second pixel point.

[0071] Based on the above method, the fitting function construction process of the gray value of the above target point is as follows:

[0072] Get the coordinates of the target point, determine the position of the pixel where the target point is located, and calculate the gray value weight of each pixel where the target point is located;

[0073] Get the gray value of the pixel where the target point is located, and calculate the gray value of each target point according to the gray value weight of the target point in each pixel;

[0074] The grayscale value difference between two adjacent target points is calculated in sequence, and a grayscale value variation function of the target point can be obtained based on the grayscale value difference between the two adjacent target points;

[0075] Based on the change function of the gray value of the target point, a function graph of the change function of the gray value of the target point is constructed. Based on the function graph of the change function of the gray value of the target point, a fitting function of the target point is constructed with the gray value of the target point as a parameter.

[0076] Specifically, since the target point is located in multiple pixels, the grayscale value of the target point can be calculated by the weight it occupies in each pixel. For example, the target point is located in 4 pixels, and its weights in the four pixels are w1, w2, w3, and w4 respectively. The grayscale values ​​of the four pixels are c1, c2, c3, and c4 respectively. The grayscale value of the target point is C = w1c1+w2c2+w3c3+w4c4, and then the grayscale value difference between two adjacent target points is calculated in turn. The grayscale value change function of the target point can be obtained from the grayscale value difference between the target points.

[0077] The type of fitting function can be determined based on the gray value change function image of the target point. In this embodiment, the fitting function is preferably a Gaussian fitting function, and the center of the Gaussian distribution, that is, the mean of the Gaussian distribution, is the edge position where the gray value changes the most. Therefore, only the mean of the Gaussian distribution is required to accurately locate the sub-pixel edge coordinates, where the calculation formula of the Gaussian curve function is: Logarithmically transform (3) to obtain Then, by solving (4) using the least squares method, we can obtain the value of μ, which is the value of the sub-pixel. The position of the sub-pixel point can be represented by μ, where μ represents the mean of the Gaussian distribution, that is, the coordinate of the sub-pixel point, and σ represents the standard deviation of the Gaussian function.

[0078] An embodiment of the present invention provides a yarn sub-pixel diameter measurement system, the system comprising:

[0079] An image acquisition unit, used to acquire an initial discrete image of the yarn taken by a linear array CCD sensor;

[0080] An image filtering unit is used to collect the grayscale value of each pixel of the initial discrete image, calculate the average grayscale value of the pixels of the initial discrete image, and adjust the grayscale value of each pixel of the initial discrete image based on the average grayscale value to output a grayscale discrete image;

[0081] An edge detection unit is used to select a pixel point with the lowest grayscale value of the grayscale discrete image as a detection origin, and determine whether the grayscale values ​​of each pixel point in the horizontal direction of the detection origin meet the threshold value based on the detection origin, so as to determine a first edge pixel point of the grayscale discrete image;

[0082] A data processing unit, configured to construct a fitting function based on the grayscale values ​​of the first edge pixels of the grayscale discrete image to connect the edge pixels of the grayscale discrete image into a continuous first edge of the grayscale discrete image;

[0083] An edge detection unit is used to take each first pixel point of the first edge of the grayscale discrete image as a starting point, select a number of target points equidistant to the left and right of the starting point, and determine a second edge pixel point based on the grayscale value of the target point;

[0084] The output unit can calculate the diameter of the yarn based on the coordinate position of the second edge pixel point.

[0085] The yarn sub-pixel diameter measurement system provided in this embodiment and the yarn sub-pixel diameter measurement method embodiment provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0086] An embodiment of the present invention provides a terminal, including a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the above-mentioned method for measuring the sub-pixel diameter of a yarn.

[0087] The terminal includes: at least one processor, a memory, a user interface and at least one network interface. The various components in the terminal are coupled together through a bus system. It can be understood that the bus system is used to achieve connection and communication between these components.

[0088] An embodiment of the present invention provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the above-mentioned method for measuring the sub-pixel diameter of a yarn.

[0089] It is understood that the memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The memory in the embodiment of the present invention is capable of storing data to support the operation of the terminal. Examples of such data include: any computer program for operating on the terminal, such as an operating system and an application program. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application program may include various applications.

[0090] The present invention is not limited to the above-mentioned specific implementation modes. Various changes made by ordinary technicians in this field based on the above-mentioned concepts without creative work are all within the protection scope of the present invention.

Claims

1. A method for measuring the sub-pixel diameter of a yarn, characterized in that: The method comprises: Acquire an initial discrete image of the yarn using a linear array CCD sensor; Collecting the grayscale value of each pixel of the initial discrete image, calculating the average grayscale value of the pixels of the initial discrete image as the adjustment value, and adjusting the grayscale value of each pixel of the initial discrete image based on the adjustment value, and outputting a grayscale discrete image; The pixel point with the lowest grayscale value of the grayscale discrete image is selected as the detection origin, and based on the detection origin, it is judged in turn whether the grayscale value of each pixel point in the horizontal direction of the detection origin meets the threshold value, so as to determine the first edge pixel point of the grayscale discrete image; Based on the grayscale values ​​of the first edge pixel points of the grayscale discrete image, a fitting function is constructed to connect the edge pixel points of the grayscale discrete image into a continuous first edge of the grayscale discrete image; Taking each first pixel point of the first edge of the grayscale discrete image as a starting point, selecting a number of target points equidistant to the left and right of the starting point, and determining the second edge pixel point based on the grayscale value of the target point; Calculating the diameter of the yarn based on the coordinate position of the second edge pixel point; The adjustment steps of the grayscale discrete image are as follows: (1) the grayscale discrete image is equally divided into a number of horizontal strip image blocks; (2) the grayscale value of each pixel in the strip image block is calculated, and a square adjustment frame is selected with the pixel with the lowest grayscale value as the center, and the side length of the adjustment frame is the same as the width of the strip image; (3) the average grayscale value of each pixel in the adjustment frame is calculated as the adjustment value, the grayscale value of the pixel in the adjustment frame is compared with the adjustment value, and the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is calculated. If the proportion is less than the set threshold, the adjustment frame is reselected; (4) if the proportion is greater than the set threshold, the adjustment frame is moved one pixel in the horizontal direction, and the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is calculated. If the proportion is greater than the set threshold, the grayscale value of the pixel in the opposite column of the adjustment frame and the moving direction is adjusted to the lowest grayscale value; (5) the above step (4) is repeated until the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is less than the set threshold, and the adjustment frame stops moving, and the adjustment of the initial discrete image is completed.

2. A method for measuring the sub-pixel diameter of a yarn according to claim 1, characterized in that ,The initial discrete image acquisition method includes: Measuring the speed and direction of yarn movement on a yarn production line; The position of the yarn imaging light source and the frequency of the linear array CCD sensor acquiring images are adjusted based on the moving speed and moving direction of the yarn to obtain a projection image of the yarn; A magnifying lens is arranged behind the yarn projection image to magnify the acquired projection image to obtain a magnified image of the yarn; The enlarged image of the yarn is collected by an image collection unit, and the position is adjusted and output as an initial discrete image of the yarn. The collection unit adopts CCD pixels arranged in a linear array.

3. A method for measuring the sub-pixel diameter of a yarn according to claim 1, characterized in that ,The method for determining the first edge pixel point is as follows: Based on the grayscale discrete image of the yarn, the grayscale values ​​of the pixels in each horizontal position of the grayscale discrete image are calculated respectively, and the pixel with the lowest grayscale value is selected as the detection origin; Select the detection threshold of the pixel point, and calculate the difference between the gray value of the pixel points on both sides of the detection origin at each horizontal position of the gray discrete image and the detection threshold; Determine whether the difference is positive or negative. If the difference is negative, select the previous pixel of the pixel as the first edge pixel at each horizontal position of the grayscale discrete image. There are two first edge pixels at each horizontal position of the grayscale discrete image. The first edge pixel point of the grayscale discrete image can be obtained by sequentially determining the first edge pixel point of each horizontal position of the grayscale discrete image.

4. A method for measuring the sub-pixel diameter of a yarn according to claim 3, characterized in that The first edge pixel points are arranged discretely, and a function is used to fit them to obtain a continuous first edge of a grayscale discrete image. The fitting process is as follows: Based on the number of first edge pixels, construct an n-order fitting function, where n is the number of first edge pixels; Substituting the grayscale value of the first edge pixel into the n-order fitting function, and solving each fitting coefficient of the n-order fitting function; The obtained fitting coefficient is input into the fitting function to obtain the fitting function of the first edge pixel.

5. A method for measuring the sub-pixel diameter of a yarn according to claim 4, characterized in that ,The method for determining the second edge pixel point is as follows: Select the first pixel point on the first edge of the grayscale discrete image as the starting point, and select several target points at equal distances from 1 / 4 of the starting point on both sides; Calculate the grayscale value difference between the selected target points, where the grayscale value difference between the target points is a discrete value; A fitting function is constructed based on the gray value difference of the target point to fit the gray value of the target point, and the function value corresponding to the target point with the largest fitting coefficient is solved; The coordinate position obtained by increasing the coordinate of the starting point by the function value is the coordinate position of the second pixel point.

6. A method for measuring yarn sub-pixel diameter according to claim 5, characterized in that: The fitting function construction process of the target point gray value is as follows: Get the coordinates of the target point, determine the position of the pixel where the target point is located, and calculate the gray value weight of each pixel where the target point is located; Get the gray value of the pixel where the target point is located, and calculate the gray value of each target point according to the gray value weight of the target point in each pixel; The grayscale value difference between two adjacent target points is calculated in sequence, and a grayscale value variation function of the target point can be obtained based on the grayscale value difference between the two adjacent target points; Based on the change function of the gray value of the target point, a function graph of the change function of the gray value of the target point is constructed. Based on the function graph of the change function of the gray value of the target point, a fitting function of the target point is constructed with the gray value of the target point as a parameter.

7. A yarn sub-pixel diameter measurement system, characterized in that: The system comprises: An image acquisition unit, used for acquiring an initial discrete image of the yarn taken by a linear array CCD sensor; An image filtering unit is used to collect the grayscale value of each pixel of the initial discrete image, calculate the average grayscale value of the pixels of the initial discrete image, and adjust the grayscale value of each pixel of the initial discrete image based on the average grayscale value to output a grayscale discrete image; An edge detection unit is used to select a pixel point with the lowest grayscale value of the grayscale discrete image as a detection origin, and determine whether the grayscale values ​​of each pixel point in the horizontal direction of the detection origin meet a threshold value based on the detection origin, so as to determine a first edge pixel point of the grayscale discrete image; A data processing unit, configured to construct a fitting function based on the grayscale values ​​of the first edge pixels of the grayscale discrete image to connect the edge pixels of the grayscale discrete image into a continuous first edge of the grayscale discrete image; An edge detection unit is used to take each first pixel point of the first edge of the grayscale discrete image as a starting point, select a number of target points equidistant to the left and right of the starting point, and determine a second edge pixel point based on the grayscale value of the target point; An output unit, which calculates the diameter of the yarn based on the coordinate position of the second edge pixel point; In the image filtering unit, the adjustment steps of the grayscale discrete image are as follows: (1) the grayscale discrete image is equally divided into a number of horizontal strip image blocks; (2) the grayscale value of each pixel in the strip image block is calculated, and a square adjustment frame is selected with the pixel with the lowest grayscale value as the center, and the side length of the adjustment frame is the same as the width of the strip image; (3) the average grayscale value of each pixel in the adjustment frame is calculated as the adjustment value, the grayscale value of the pixel in the adjustment frame is compared with the adjustment value, and the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is calculated. If the proportion is less than the set threshold, the adjustment frame is reselected; (4) if the proportion is greater than the set threshold, the adjustment frame is moved one pixel in the horizontal direction, and the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is calculated. If the proportion is greater than the set threshold, the grayscale value of the pixel in the opposite column of the adjustment frame and the moving direction is adjusted to the lowest grayscale value; (5) the above step (4) is repeated until the proportion of the pixel with a grayscale value less than the adjustment value in the adjustment frame is less than the set threshold, and the adjustment frame stops moving, and the adjustment of the initial discrete image is completed.

8. A terminal, characterized in that: The terminal includes a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement a yarn sub-pixel diameter measurement method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement a yarn sub-pixel diameter measurement method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image-based yarn defect detection method

    CN110298840A

  • Yarn hairiness test airflow control sealing mechanism

    CN209624358U