Non-contact steel pipe end face size measuring method and system
Through the non-contact steel pipe end surface dimension measurement method, combined with image edge detection and graphic methods, the impact of burrs is identified and eliminated, and the problems of insufficient measurement accuracy and high maintenance costs in the prior art are solved, and high-precision steel pipe end surface dimension measurement is achieved.
Patent Information
- Application Number
- CN202510434491.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-08
AI Technical Summary
The prior art cannot effectively eliminate the impact of burrs while detecting the end dimensions of steel pipes without contact, and the manual measurement method is insufficient in accuracy and high maintenance costs.
The non-contact steel pipe end surface dimension measurement method is used to identify the pipe end profile through image edge detection and graphic methods, and the positional relationship between the contour points and the contour is calculated using a self-developed algorithm, accurately positioning the burrs and eliminating their impact on the measurement results.
It improves the accuracy of measuring the end face size of the steel pipe, reduces maintenance costs, enhances the sensitivity to burrs, and accurately obtains the effective end size.
Smart Images

Figure CN120351860A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of steel pipe production detection equipment, and specifically to a method and system for non-contact measurement of the end face size of a steel pipe based on high-precision contour recognition. Background Art
[0002] As an important industrial material, steel pipes are widely used in industries such as construction, petroleum, and natural gas. The production technology of seamless steel pipes has undergone a transformation from traditional hot rolling to cold drawing or cold rolling. Due to the rolling at high temperatures in the early hot rolling technology, although large deformation amounts can be achieved, the accuracy and surface quality are relatively low. With the increasing requirements for the accuracy of the end face size of steel pipes in industrial applications, traditional measurement methods, such as the right-angle ruler measurement method and the plumb line method, have many limitations. The right-angle ruler measurement method is limited by the pipe diameter and the size of the measuring tool, resulting in large errors; while the plumb line method requires rotating the steel pipe for measurement, which is not only difficult to operate, but also limited by the site and equipment, and the error is also large. Neither can meet the requirements of industrial applications.
[0003] Currently, in the steel pipe industry, tube mills still rely on manual tools for contact measurement when measuring the size of the pipe end of steel pipes for a long time. The measurement data is scarce, and it is impossible to give an intuitive judgment on the wall thickness unevenness and roundness, and frequent maintenance of manual tools is required. Therefore, some steel pipe enterprises have started to use non-contact steel pipe end face size detection methods in combination with cameras. For example, CN102141380A discloses a non-contact measurement method for the end face size of a steel pipe by image processing. This method uses a CCD camera to collect images of the end face of the steel pipe to be measured, transmits the collected image information to an industrial control computer, and calculates the actual wall thickness of the pipe end by fitting the inner and outer contours of the end face of the image and then calculating the distance between the intersection point of the perpendicular line from the tangent point of the outer contour to the outer contour tangent and the inner contour. Although this technology overcomes the damage to manual tools through a non-contact method and improves the measurement accuracy of the wall thickness, additional steps are required to eliminate the influence of burrs and wall thickness unevenness generated during the cutting operation of the steel pipe. In addition, this method cannot measure important parameters such as the specification size and roundness of the steel pipe end face, and other methods are required to measure such parameters during industrial production. Summary of the Invention
[0004] The technical problem to be solved by the present invention is how to synchronously eliminate the influence of burrs while detecting the size of the pipe end of a steel pipe without contact.
[0005] The present invention solves the above technical problems through the following technical means:
[0006] A non-contact method for measuring the end face size of a steel pipe, comprising the following steps:
[0007] Step 1: For the original image of the pipe end, convert it into a binary image, use morphological gradient operation to detect the contour, obtain the effective contour points of the pipe end, and determine whether the contour is approximately circular. Then sort the contour to distinguish the inner and outer contour point sets;
[0008] Step 2: Traverse the original contour points to calculate the average thickness, maximum and minimum thicknesses and their positions, and then filter the original contour points to obtain the contour point set with distances less than the distance threshold;
[0009] Step 3: According to the contour point set obtained after filtering in Step 2, calculate the convex hulls of the large and small contours, perform ellipse fitting on the convex hulls to obtain the fitted ellipse; calculate the average inner and outer diameters and the center point, and calculate the average thickness, maximum and minimum thicknesses and their positions of the filtered contour;
[0010] Step 4: According to the convex hull point set obtained in Step 3, draw the positions of each point in the contour point set, and determine whether the distance from the contour point to the contour exceeds the threshold. If it exceeds, it is judged as a burr;
[0011] Step 5: Calculate the maximum and minimum inner and outer diameters and the ellipticity according to the fitted ellipse obtained in Step 4, and draw the maximum and minimum thickness points.
[0012] Based on the original image of the pipe end, the present invention combines image edge detection and graphics methods to identify the pipe end contour, calculates the positional relationship between the contour points and the contour through a self-developed algorithm, accurately locates the pipe end burrs and eliminates the influence of the burrs on the measured pipe end dimensions. The present invention not only solves the problems of insufficient accuracy and high maintenance cost of the manual measurement method, but also improves the sensitivity to burrs and accurately obtains the effective pipe end dimensions.
[0013] As an optimized scheme of the above scheme, Step 1 includes the following processes:
[0014] Step 1.1: First, convert the image into a binary image by using the inverse binary method. Secondly, perform morphological gradient operation to highlight the image edge and retrieve all contours. Then, remove small noise contours by calculating the area of the contour, find the rectangle with the smallest area enclosing the contour, and screen out the rectangles with specific aspect ratios. Sort the contours enclosed by the rectangle and select the largest and the third largest contours as the outer diameter and inner diameter contours and add them to the effective contour, where the resolution of the contour points is the resolution of the original image;
[0015] Step 1.2: According to the two contour point sets obtained in Step 1.1, denote the zero-order moment of the contour as m 00, representing the area of the contour, and the first-order moments of the contour on the x-axis and y-axis are m 10 and m 01 , and the centroid coordinates of the contour are
[0016] Step 1.3: Calculate the Euclidean distance between the centroids of the two contours obtained in Step 1.2, and determine whether this distance exceeds the threshold. If it exceeds the threshold, return directly; otherwise, sort the two contours to distinguish the inner and outer contour point sets.
[0017] As an optimized solution to the above solution, Step 2 includes the following processes:
[0018] Step 2.1: Traverse the inner diameter original contour point set obtained in Step 1.1, calculate the distance from each inner diameter point to the outer diameter contour as the thickness and save it. The maximum distance is the maximum thickness, the minimum distance is the minimum thickness, and save the positions of the maximum and minimum thickness points. Calculate the average of the sum of all distances as the average thickness;
[0019] Step 2.2: According to the original contour point set obtained in Step 1.1, use the least squares algorithm to find the best-fit ellipse; to filter out contour points that are too far from the contour center, traverse the original contour point set, record the coordinates of each currently traversed point as p0(x0, y0), take two points at positions N1 (taking a larger value around 10 for N1 can provide stronger smoothing effect, improve the robustness of the algorithm, and is suitable for fitting ellipses with relatively simple contour shapes) points to the left and right of this point, and record them as p1(x1, y1) and p2(x2, y2) respectively. Calculate the distance dist from point p0 to the line L p1,p2 of, and the general equation of the line L p1,p2 is: Ax + Bz + C = 0, where A = y1 - y2, B = x2 - x1, C = x1 * y2 - y1 * x2. Calculate the distance from each point to the line L from p0(x0, y0) p1,p2 to Similarly, take two points at positions N2 (N2 takes half of N1, which provides additional conditions and can more accurately determine whether the current point should be retained and more accurately retain important contour features) points to the left and right and connect them to obtain the distance. Then calculate the average distance from all points between p1 and p2 to the line connecting the current point and the center point of the fitted ellipse; finally, compare the three obtained distances with the set threshold one by one. If it exceeds the threshold, filter the current traversed point; obtain the preliminary filtered contour point set;
[0020] Step 2.3: Traverse the set of original contour points obtained in Step 1.1, calculate the distance from each point in the point set to the preliminarily filtered contour point set, and mark the points whose distances do not exceed the set threshold as missing points and merge them with the filtered contour again; to ensure that the subsequent traversal order of the contour points is consistent with their position order on the contour, traverse the merged contour. For each traversed contour point, subtract the contour center from the contour point to obtain the direction vector from the contour center to this point, and normalize this direction vector using the Euclidean norm to obtain the unit vector; use the first unit vector as the initial vector and the positive x-direction as the standard direction. By calculating the angles between the initial vector and the unit vectors of the currently traversed contour points and the positive x-direction respectively, and then subtracting the two angles, the angle between the direction vector of each contour point and the initial point direction vector can be obtained. Sort these angles in ascending order to obtain the contour point set with the traversal order consistent with the position order.
[0021] Step 2.4: Similar to Step 2.2, filter the contour again to obtain the filtered contour point set, ensuring that there are no contour points that are too far from the contour center.
[0022] As an optimized solution of the above solution, Step 3 includes the following process:
[0023] Step 3.1: To simplify the contour shape and improve the algorithm robustness, and accurately calculate the subsequent pipe end dimensions, according to the finally filtered contour point set obtained in Step 2.4, convert the finally filtered contour point set into a convex hull and save it using the Graham scan method; use the least squares method to convert the point set saved by the convex hull into a fitted ellipse and obtain the center points of the two fitted ellipses, and calculate the values of the outer diameter and inner diameter by multiplying the average values of the major and minor axes of the fitted ellipses of the large and small contours by the pixel size respectively.
[0024] Step 3.2: Similar to Step 2.1, obtain the average thickness, maximum and minimum thicknesses of the filtered contour points and their positions.
[0025] As an optimized solution of the above solution, Step 4 includes the following process:
[0026] Step 4.1: According to the point set saved in the form of a convex hull obtained in Step 3, draw the contour points included in the point set for subsequent confirmation of the burr point positions.
[0027] Step 4.2: According to the point set saved in the form of a convex hull obtained in Step 3, traverse the large and small contours respectively, and use the ray projection method to judge whether the point is inside the contour and the distance from the point to the contour; for the large contour point set, judge whether the distance from the point outside the contour to the contour exceeds the threshold. If the distance exceeds, it is judged as a burr point and drawn on the image; for the small contour point set, judge whether the distance from the point inside the contour to the contour exceeds the threshold. If the distance exceeds, it is judged as a burr point and drawn on the image.
[0028] As an optimized solution of the above scheme, step 5 includes the following process:
[0029] According to the fitted ellipse obtained in step 3.1, the major axis and minor axis of the large-profile fitted ellipse are denoted as a1 and b1 respectively, the major axis and minor axis of the small-profile fitted ellipse are denoted as a2 and b2 respectively, and the pixel size is denoted as pix. The maximum outer diameter = a1 * pix, the minimum outer diameter = b1 * pix, the maximum inner diameter = a2 * pix, and the minimum inner diameter = b2 * pix. According to the maximum and minimum thickness positions obtained in step 3.2, draw the maximum and minimum thickness points.
[0030] The present invention also provides a non-contact steel pipe end face dimension measurement system, including:
[0031] A binarization module: For the original image of the pipe end, convert it into a binary image and use morphological gradient operation to detect the contour to obtain the effective contour points of the pipe end and judge whether the contour is approximately circular, and then sort the contour to distinguish the inner and outer contour point sets;
[0032] A filtering module: Traverse the original contour points to calculate the average thickness, maximum and minimum thicknesses and their positions, and then filter the original contour points to obtain a contour point set with a distance less than the distance threshold;
[0033] A convex hull calculation module: According to the contour point set obtained after filtering, calculate the convex hulls of the large and small contours, perform ellipse fitting on the convex hulls to obtain the fitted ellipse; calculate the average inner and outer diameters and the center point, and calculate the average thickness, maximum and minimum thicknesses and their positions of the filtered contour;
[0034] A burr judgment module: According to the obtained convex hull point set, draw the positions of each point in the contour point set, and judge whether the distance from the contour point to the contour exceeds the threshold. If it exceeds, it is judged as a burr;
[0035] A thickness calculation module: Calculate the maximum and minimum inner and outer diameters and the ellipticity according to the obtained fitted ellipse, and draw the maximum and minimum thickness points.
[0036] As an optimized solution of the above scheme, the binarization module includes the following process:
[0037] Step 1.1: First, convert the image into a binary image by using the inverse binarization method. Secondly, perform morphological gradient operation to highlight the image edges and retrieve all contours. Then, remove small noise contours by calculating the area of the contours and find the rectangle with the smallest area enclosing the contour, and screen out rectangles with a specific aspect ratio. Sort the contours enclosed by the rectangle and select the largest and the third largest contours as the outer diameter and inner diameter contours and add them to the effective contours, where the resolution of the contour points is the resolution of the original image;
[0038] Step 1.2: According to the two sets of contour points obtained in Step 1.1, denote the zeroth moment of the contour as m 00, which represents the area of the contour. The first moments of the contour on the x-axis and y-axis are m 10 and m 01 respectively. The centroid coordinates of the contour are
[0039] Step 1.3: According to the centroid coordinates of the two contours obtained in Step 1.2, calculate the Euclidean distance between the coordinates, and determine whether the distance exceeds the threshold. If it exceeds the threshold, return directly; otherwise, sort the two contours to distinguish the inner and outer contour point sets.
[0040] As an optimized solution of the above scheme, the filtering module includes the following process:
[0041] Step 2.1: Traverse the original inner diameter contour point set obtained in Step 1.1, calculate the distance from each point to the outer diameter contour, which is saved as the thickness. Obtain the maximum distance as the maximum thickness, the minimum distance as the minimum thickness, and save the positions of the maximum and minimum thickness points. Calculate the average of the sum of all distances as the average thickness;
[0042] Step 2.2: According to the original contour point set obtained in Step 1.1, use the least squares algorithm to find the best-fit ellipse. To filter the contour points that are too far from the center of the contour, traverse the original contour point set. Denote the coordinates of each currently traversed point as p0(x0, y0). Take two points at positions N1 (taking a relatively large value around 10 for N1 can provide stronger smoothing effect, improve the robustness of the algorithm, and is suitable for fitting ellipses with relatively simple contour shapes) on the left and right sides of this point, and denote them as p1(x1, y1) and p2(x2, y2) respectively. Calculate the distance dist from point p0 to the line L p1,p2 formed by p1 and p2. The general equation of the line L p1,p2 is: Ax + Bz + C = 0, where A = y1 - y2, B = x2 - x1, C = x1 * y2 - y1 * x2. Calculate the distance p1,p2 from each point to the line L Similarly, take two points at positions N2 (taking half of N1, which provides additional conditions and can more accurately judge whether the current point should be retained, and more accurately retain important contour features) on the left and right sides of the current point, connect them to obtain the distance, and then calculate the average distance from all points between p1 and p2 to the line connecting the current point and the center point of the fitted ellipse. Finally, compare the three obtained distances with the set threshold one by one. If it exceeds the threshold, filter the currently traversed point; obtain the preliminary filtered contour point set;
[0043] Step 2.3: Traverse the set of original contour points obtained in Step 1.1, calculate the distance from each point in the point set to the preliminarily filtered contour point set, and mark the points whose distances do not exceed the set threshold as missing points and merge them with the filtered contour again; To ensure that the subsequent traversal order of the contour points is consistent with their position order on the contour, traverse the merged contour. For each traversed contour point, subtract the contour center from the contour point to obtain the direction vector from the contour center to this point, and normalize this direction vector using the Euclidean norm to obtain the unit vector; Use the first unit vector as the initial vector and the positive x - direction as the standard direction. By calculating the angles between the initial vector and the unit vector of the current traversed contour point and the positive x - direction respectively, and then subtracting the two angles, the angle between the direction vector of each contour point and the initial point direction vector can be obtained. Sort these angles in ascending order to obtain the contour point set with the traversal order consistent with the position order.
[0044] Step 2.4: Similar to Step 2.2, filter the contour again to obtain the filtered contour point set, ensuring that there are no contour points that are too far from the contour center.
[0045] As an optimized solution for the above - mentioned scheme, the convex hull calculation module includes the following process:
[0046] Step 3.1: To simplify the contour shape and improve the algorithm robustness, and to accurately calculate the subsequent pipe end dimensions, according to the finally filtered contour point set obtained in Step 2.4, convert the finally filtered contour point set into a convex hull and save it through the Graham scan method; Use the least - squares method to convert the point set saved in the convex hull into a fitted ellipse and obtain the center points of the two fitted ellipses. Calculate the average values of the major and minor axes of the fitted ellipses of the large and small contours respectively, and multiply by the pixel size to obtain the values of the outer diameter and inner diameter.
[0047] Step 3.2: Similar to Step 2.1, obtain the average thickness, maximum and minimum thicknesses of the filtered contour points and their positions.
[0048] The burr judgment module includes the following process:
[0049] Step 4.1: According to the point set saved in the form of a convex hull obtained in Step 3, draw the contour points included in the point set for subsequent confirmation of the burr point positions.
[0050] Step 4.2: According to the point set saved in the form of a convex hull obtained in Step 3, traverse the large and small contours respectively, and use the ray projection method to judge whether the point is inside the contour and the distance from the point to the contour; For the large contour point set, judge whether the distance from the point outside the contour to the contour exceeds the threshold. If it exceeds the distance, judge it as a burr point and draw it on the image; For the small contour point set, judge whether the distance from the point inside the contour to the contour exceeds the threshold. If it exceeds the distance, judge it as a burr point and draw it on the image.
[0051] The thickness calculation module includes the following process:
[0052] For the fitted ellipse obtained in step 3.1, the major axis and minor axis of the large contour fitted ellipse are denoted as a1 and b1 respectively, the major axis and minor axis of the small contour fitted ellipse are denoted as a2 and b2 respectively, and the pixel size is denoted as pix. The maximum outer diameter = a1 * pix, the minimum outer diameter = b1 * pix, the maximum inner diameter = a2 * pix, and the minimum inner diameter = b2 * pix. According to the maximum and minimum thickness positions obtained in step 3.2, draw the maximum and minimum thickness points.
[0053] The advantages of the present invention are as follows:
[0054] Based on the original image of the pipe end, the present invention combines image edge detection and graphics methods to identify the pipe end contour, calculates the position relationship between the contour points and the contour through a self-developed algorithm, accurately locates the burrs at the pipe end, and eliminates the influence of the burrs on the measured pipe end dimensions. This method not only solves the problems of insufficient accuracy and high maintenance cost of the manual measurement method, but also improves the sensitivity to burrs and accurately obtains the effective pipe end dimensions. Description of the Drawings
[0055] Figure 1 It is a flow block diagram of the method in the embodiment of the present invention.
[0056] Figure 2 It is an enlarged view of the outer diameter contour in the embodiment of the present invention.
[0057] Figure 3 It is the detection original data and detection result diagram using the method in the embodiment of the present invention. Detailed Embodiment
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0059] The present invention provides a non-contact method for measuring the dimensions of the end face of a steel pipe, which eliminates the influence of burrs while detecting the dimensions of the pipe end and improves the detection accuracy of the pipe end dimensions. As Figure 1 shown, the specific steps are as follows:
[0060] Step 1: For the original image of the pipe end, convert it into a binary image and use morphological gradient operation to detect the contour to obtain the effective contour points of the pipe end and determine whether the contour is approximately circular, and then sort the contour to distinguish the inner and outer contour point sets.
[0061] Step 1.1: The high-precision acquisition of the pipe end profile is the basic step of dimensional measurement. First, the image is converted into a binary image using the inverse binarization method. Secondly, the morphological gradient operation is performed to highlight the image edges and retrieve all contours. Then, small noise contours are removed by calculating the areas of the contours, and the rectangle with the smallest area enclosing the contours is found. After that, rectangles with a specific aspect ratio are selected, and the contours enclosed by the rectangles are sorted. The largest and the third largest contours are selected as the outer diameter and inner diameter contours and added to the effective contours, where the resolution of the contour points is the resolution of the original image. It should be noted here that there are two layers of pixel contours for the outer diameter and inner diameter of the steel pipe end face. The outermost layer of the outer diameter and the outermost layer of the inner diameter contours are taken, so they are the largest and the third largest contours. As Figure 2 shown, it is an enlarged view of the outer diameter contour.
[0062] Step 1.2: According to the two sets of contour points obtained in Step 1.1, denote the zero-order moment of the contour as m 00, representing the area of the contour. The first-order moments of the contour on the x-axis and y-axis are m 10 and m 01 respectively, and the centroid coordinates of the contour are
[0063] Step 1.3: According to the centroid coordinates of the two contours obtained in Step 1.2, calculate the Euclidean distance between the coordinates and determine whether the distance exceeds the threshold. If it exceeds the threshold, directly return. Otherwise, sort the two contours to distinguish the inner and outer contour point sets.
[0064] Step 2: Traverse the original contour points to calculate the average thickness, the maximum and minimum thicknesses and their positions, and then filter the original contour points by the algorithm to obtain the set of contour points less than the distance threshold.
[0065] Step 2.1: Traverse the set of original inner diameter contour points obtained in Step 1.1, calculate the distance from each point to the outer diameter contour, which is saved as the thickness. The maximum distance is the maximum thickness, the minimum distance is the minimum thickness, and the positions of the maximum and minimum thickness points are saved. The average of the sum of all distances is taken as the average thickness.
[0066] Step 2.2: According to the set of original contour points obtained in Step 1.1, use the least squares algorithm to find the best fitting ellipse. To filter the contour points that are too far from the contour center, traverse the set of original contour points. Denote the coordinates of each currently traversed point as p0(x0, y0). Take two points at positions N1 (a relatively large value around 10 for N1 can provide stronger smoothing effect, improve the robustness of the algorithm, and is suitable for fitting ellipses with relatively simple contour shapes) on the left and right sides of this point, which are denoted as p1(x1, y1) and p2(x2, y2) respectively. Calculate the distance dist from point p0 to the line L p1,p2 connecting p1 and p2. L p1,p2The general form of the straight line equation is: Ax + Bz + C = 0, where A = y1 - y2, B = x2 - x1, C = x1*y2 - y1*x2. The distance from each point p0(x0, y0) to the straight line L p1,p2 distance Similarly, take two points at the positions of N2 points on both the left and right sides (N2 is half of N1, which provides additional conditions and can more accurately determine whether the current point should be retained, and more accurately retain important contour features) and connect them to obtain the distance. Then calculate the average distance from all points between p1 and p2 to the line connecting the current point and the center point of the fitted ellipse. Finally, compare the three obtained distances with the set threshold one by one. If it exceeds the threshold, the currently traversed point is filtered. A preliminary filtered contour point set is obtained. In this embodiment, N1 is generally about 10 points, and N2 is generally about 5 points. Calculating the distance in this way is more reasonable.
[0067] Step 2.3: Traverse the original contour point set obtained in Step 1.1, calculate the distance from each point on the point set to the preliminary filtered contour point set, and mark the points whose distances do not exceed the set threshold as missing points and merge them with the filtered contour again. To ensure that the subsequent traversal order of the contour points is consistent with their position order on the contour, traverse the merged contour. For each traversed contour point, subtract the contour center from the contour point to obtain the direction vector from the contour center to this point, and normalize this direction vector using the Euclidean norm to obtain the unit vector. Using the first unit vector as the initial vector and the positive x direction as the standard direction, by calculating the angles between the initial vector and the unit vector of the current traversed contour point and the positive x direction respectively, and then subtracting the two angles, the angle between the direction vector of each contour point and the direction vector of the initial point can be obtained. Sorting these angles in ascending order can obtain the contour point set with the traversal order consistent with the position order.
[0068] Step 2.4: Similar to Step 2.2, filter the contour again to ensure that there are no contour points that are too far from the contour center.
[0069] Step 3: According to the contour point set obtained after filtering in Step 2, calculate the convex hulls of the large and small contours, perform ellipse fitting on the convex hulls, calculate the average outer and inner diameters and the center point, and calculate the average thickness, maximum and minimum thicknesses and their positions of the filtered contour.
[0070] Step 3.1: To simplify the contour shape and improve the robustness of the algorithm, and accurately calculate the subsequent pipe end dimensions, according to the final filtered contour point set obtained in Step 2.4, convert the final filtered contour point set into a convex hull and save it through the Graham scan method. Use the least squares method to convert the point set saved in the convex hull into a fitted ellipse and obtain the center points of the two fitted ellipses. Calculate the average values of the major and minor axes of the fitted ellipses of the large and small contours and multiply them by the pixel size to obtain the outer diameter and inner diameter values.
[0071] Step 3.2: Similar to Step 2.1, obtain the average thickness, maximum and minimum thicknesses of the filtered contour points and their positions.
[0072] Step 4: Based on the convex hull point set obtained in Step 3, plot the positions of each point in the contour point set, and determine whether the distance from the contour point to the contour exceeds the threshold. If it exceeds, it is judged as a burr and plotted.
[0073] Step 4.1: Based on the point set saved in the form of a convex hull obtained in Step 3, plot the contour points included in the point set for subsequent confirmation of the burr point positions.
[0074] Step 4.2: Based on the point set saved in the form of a convex hull obtained in Step 3, traverse the large and small contours respectively, and judge whether the point is inside the contour and the distance from the point to the contour through the ray projection method. For the large contour point set, judge whether the distance from the point outside the contour to the contour exceeds the threshold. If it exceeds the distance, it is judged as a burr point and plotted on the image; for the small contour point set, judge whether the distance from the point inside the contour to the contour exceeds the threshold. If it exceeds the distance, it is judged as a burr point and plotted on the image.
[0075] Step 5: Calculate the maximum and minimum inner and outer diameters and ellipticity according to the fitted ellipse obtained in Step 3, and plot the maximum and minimum thickness points.
[0076] Step 5.1: According to the fitted ellipse obtained in Step 3.1, denote the major axis and minor axis of the fitted ellipse of the large contour as a1 and b1 respectively, and the major axis and minor axis of the fitted ellipse of the small contour as a2 and b2 respectively. Denote the pixel size as pix. Maximum outer diameter = a1 * pix, minimum outer diameter = b1 * pix, maximum inner diameter = a2 * pix, minimum inner diameter = b2 * pix. According to the positions of the maximum and minimum thicknesses obtained in Step 3.2, plot the maximum and minimum thickness points.
[0077] As Figure 3 shown, Figure 3 In each row of figures, the left figure is the original data, the aperture in the figure is the end face of the steel pipe, and the right figure is the test result report. The purple points in the report represent the minimum thickness positions, and the yellow points represent the maximum thickness positions. Since no comparison standard was set during the test, all the displayed results are unqualified. This does not affect the effectiveness of the method in this embodiment.
[0078] Based on the original image of the pipe end, this embodiment adopts a combination of image edge detection and graphics methods to identify the pipe end contour, calculates the positional relationship between the contour points and the contour through a self-developed algorithm, accurately locates the pipe end burrs and eliminates the influence of the burrs on the measured pipe end dimensions. This method not only solves the problems of insufficient accuracy and high maintenance cost of the manual measurement method, but also improves the sensitivity to burrs and accurately obtains the effective pipe end dimensions.
[0079] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A non-contact method for measuring the end face dimensions of a steel pipe, characterized in that, Including the following steps: Step 1: For the original image of the pipe end, convert it into a binary image, use morphological gradient operation to detect the contour, obtain the effective contour points of the pipe end, and judge whether the contour is approximately circular. Then sort the contour to distinguish the inner and outer contour point sets; Step 2: Traverse the original contour points to calculate the average thickness, maximum and minimum thicknesses and their positions, and then filter the original contour points to obtain the contour point set with a distance less than the distance threshold; Step 3: According to the contour point set obtained after filtering in Step 2, calculate the convex hulls of the large and small contours, perform ellipse fitting on the convex hulls to obtain the fitted ellipse; calculate the average inner and outer diameters and the center point, and calculate the average thickness, maximum and minimum thicknesses and their positions of the filtered contour; Step 4: According to the convex hull point set obtained in Step 3, draw the positions of each point in the contour point set, and judge whether the distance from the contour point to the contour exceeds the threshold. If it exceeds, it is judged as a burr; Step 5: Calculate the maximum and minimum inner and outer diameters and the ellipticity according to the fitted ellipse obtained in Step 4, and draw the maximum and minimum thickness points.
2. The non-contact steel pipe end face dimension measurement method according to claim 1, wherein The said Step 1 Including the following process: Step 1.1: First, use the inverse binary method to convert the image into a binary image. Secondly, perform morphological gradient operation to highlight the image edges and retrieve all contours. Then, remove small noise contours by calculating the area of the contours, find the rectangle with the smallest area enclosing the contour, and screen out the rectangles with a specific aspect ratio. Sort the contours enclosed by the rectangle and select the largest and the third largest contours as the outer diameter and inner diameter contours and add them to the effective contour. The resolution of the contour points is the resolution of the original image; Step 1.2: According to the two contour point sets obtained in Step 1.1, denote the zeroth moment of the contour as m 00 , representing the area of the contour. The first moments of the contour on the x-axis and y-axis are m 10 and m 01 respectively. The centroid coordinates of the contour are Step 1.3: According to the centroid coordinates of the two contours obtained in Step 1.2, calculate the Euclidean distance between the coordinates, and judge whether the distance exceeds the threshold. If it exceeds the threshold, directly return. Otherwise, sort the two contours to distinguish the inner and outer contour point sets.
3. The non-contact steel pipe end face dimension measurement method according to claim 2, wherein The said Step 2 includes the following process: Step 2.1: Traverse the inner diameter original contour point set obtained in Step 1.1, calculate the distance from each point to the outer diameter contour as the thickness and save it. The maximum distance is the maximum thickness, the minimum distance is the minimum thickness, and save the positions of the maximum and minimum thickness points. Take the average of the sum of all distances as the average thickness; Step 2.2: Based on the original contour point set obtained in Step 1.1, use the least squares algorithm to find the best-fitting ellipse; to filter out the contour points that are too far from the contour center, traverse the original contour point set, record the coordinates of each currently traversed point as p0(x0, y0), take two points at positions N1 (taking a relatively large value around 10 for N1 can provide a stronger smoothing effect, improve the robustness of the algorithm, and is suitable for fitting an ellipse with a relatively simple contour shape) points to the left and right of this point, and denote them as p1(x1, y1) and p2(x2, y2) respectively, and calculate the distance dist from point p0 to the line L p1,p2 The general equation of the line L p1,p2 is: Ax + Bz + C = 0, where A = y1 - y2, B = x2 - x1, C = x1 * y2 - y1 * x2, and the distance from each point p0(x0, y0) to the line L p1,p2 is Similarly, take the connection of two points at positions N2 (N2 is taken as half of N1, which provides additional conditions and can more accurately determine whether the current point should be retained and more accurately retain important contour features) points to the left and right, obtain the distance, and then calculate the average distance from all points between p1 and p2 to the line connecting the current point and the center point of the fitted ellipse; finally, compare the obtained distances with the set threshold one by one, and if it exceeds the threshold, filter the currently traversed point; obtain the preliminary filtered contour point set; Step 2.3: Traverse the original contour point set obtained in Step 1.1, calculate the distance from each point on the point set to the preliminary filtered contour point set, and mark the points with a distance not exceeding the set threshold as missing points and merge them with the filtered contour again; To ensure that the subsequent contour point traversal order is consistent with their position order on the contour, traverse the merged contour. For each traversed contour point, subtract the contour center from the contour point to obtain the direction vector from the contour center to this point, and normalize this direction vector using the Euclidean norm to obtain the unit vector; Take the first unit vector as the initial vector and the positive x direction as the standard direction. By calculating the angles between the initial vector and the unit vector of the current traversed contour point and the positive x direction respectively, and then subtracting the two angles, the angle between the direction vector of each contour point and the direction vector of the initial point can be obtained. Sort these angles in ascending order to obtain the contour point set with the traversal order consistent with the position order; Step 2.4: Similar to Step 2.2, filter the contour again to obtain a filtered contour point set, ensuring that there are no contour points that are too far from the contour center.
4. The non-contact steel pipe end face dimension measurement method according to claim 2, characterized in that, The said Step 3 includes the following processes: Step 3.1: To simplify the contour shape, improve the algorithm robustness, and accurately calculate the subsequent pipe end dimensions. According to the final filtered contour point set obtained in Step 2.4, convert the final filtered contour point set into a convex hull and save it through the Graham scan method; use the least squares method to convert the point set saved in the convex hull into a fitted ellipse and obtain the center points of the two fitted ellipses. Calculate the average values of the major and minor axes of the fitted ellipses of the large and small contours respectively, and multiply by the pixel size to obtain the outer diameter and inner diameter values. Step 3.2: Similar to Step 2.1, obtain the average thickness, maximum and minimum thicknesses, and their positions of the filtered contour points.
5. The non-contact steel pipe end face dimension measurement method according to claim 4, wherein, The said Step 4 includes the following processes: Step 4.1: According to the point set saved in the form of a convex hull obtained in Step 3, draw the contour points included in the point set for subsequent confirmation of the burr point positions. Step 4.2: According to the point set saved in the form of a convex hull obtained in Step 3, traverse the large and small contours respectively, and use the ray projection method to judge whether the point is inside the contour and the distance from the point to the contour; for the large contour point set, judge whether the distance from the point outside the contour to the contour exceeds the threshold. If the distance exceeds, judge it as a burr point and draw it on the image; for the small contour point set, judge whether the distance from the point inside the contour to the contour exceeds the threshold. If the distance exceeds, judge it as a burr point and draw it on the image.
6. The non-contact steel pipe end face dimension measurement method according to any one of claims 1 to 5, characterized in that, The said Step 5 includes the following processes: For the fitted ellipse obtained in step 3.1, the major axis and minor axis of the large contour fitted ellipse are denoted as a1 and b1 respectively, the major axis and minor axis of the small contour fitted ellipse are denoted as a2 and b2 respectively, and the pixel size is denoted as pix, and we get The maximum outer diameter = a1 * pix, the minimum outer diameter = b1 * pix, the maximum inner diameter = a2 * pix, and the minimum inner diameter = b2 * pix. According to the maximum and minimum thickness positions obtained in step 3.2, draw the maximum and minimum thickness points.
7. Non-contact steel pipe end face dimension measurement system, characterized in that, Including: Binaryization module: For the original pipe end image, convert it into a binary image, use morphological gradient operation to detect the contour, obtain the effective contour points of the pipe end, and judge whether the contour is approximately circular. Then sort the contours to distinguish the inner and outer contour point sets. Filtering module: Traverse the original contour points to calculate the average thickness, maximum and minimum thicknesses, and their positions, and then filter the original contour points to obtain a contour point set with a distance less than the threshold. Convex hull calculation module: According to the filtered contour point set, calculate the convex hulls of the large and small contours, perform ellipse fitting on the convex hulls to obtain the fitted ellipses; calculate the average outer and inner diameters and the center points, and calculate the average thickness, maximum and minimum thicknesses, and their positions of the filtered contour. Burr judgment module: According to the obtained convex hull point set, draw the positions of the points in the contour point set, judge whether the distance from the contour point to the contour exceeds the threshold. If it exceeds, judge it as a burr. Thickness calculation module: Calculate the maximum and minimum outer and inner diameters, ellipticity according to the obtained fitted ellipse, and draw the maximum and minimum thickness points.
8. The non-contact steel pipe end face dimension measurement system according to claim 7, wherein The said binaryization module includes the following processes: Step 1.1: First, convert the image into a binary image using the inverse binaryization method. Secondly, perform morphological gradient operation to highlight the image edges and retrieve all contours. Then, remove small noise contours by calculating the area of the contours, find the rectangle with the smallest area enclosing the contours, and screen out rectangles with a specific aspect ratio. Sort the contours enclosed by the rectangle and select the largest and the third largest contours as the outer diameter and inner diameter contours and add them to the effective contours, where the resolution of the contour points is the resolution of the original image. Step 1.2: According to the two contour point sets obtained in Step 1.1, denote the zero-order moment of the contour as m 00 , representing the area of the contour. The first-order moments of the contour on the x-axis and y-axis are m 10 and m 01 , respectively. The centroid coordinates of the contour are Step 1.3: Calculate the Euclidean distance between the centroid coordinates of the two contours obtained in Step 1.2, and determine whether the distance exceeds the threshold. If it exceeds the threshold, return directly; otherwise, sort the two contours to distinguish the inner and outer contour point sets.
9. The non-contact steel pipe end face dimension measurement system according to claim 8, characterized in that, The filtering module includes the following processes: Step 2.1: Traverse the original inner diameter contour point set obtained in Step 1.1, calculate the distance from each point to the outer diameter contour as the thickness and save it. Obtain the maximum distance as the maximum thickness, the minimum distance as the minimum thickness, and save the positions of the maximum and minimum thickness points. Calculate the average of the sum of all distances as the average thickness; Step 2.2: Based on the original contour point set obtained in Step 1.1, use the least squares algorithm to find the best-fitting ellipse; to filter out the contour points that are too far from the contour center, traverse the original contour point set, record the coordinates of each currently traversed point as p0(x0, y0), and take the two points at positions N1 points away from the left and right sides of this point, denoted as p1(x1, y1) and p2(x2, y2) respectively, and find the distance dist from point p0 to the line L p1,p2 of, and the general equation of the line L p1,p2 is: Ax + Bz + C = 0, where A = y1 - y2, B = x2 - x1, C = x1*y2 - y1*x2, and the distance from each point to p0(x0, y0) to the line L p1,p2 is Similarly, take the two points at positions N2 points away from the left and right sides and connect them to obtain the distance, and then calculate the average distance between all the points between p1 and p2 to the line connecting the current point and the center point of the fitted ellipse; finally, compare the obtained distances with the set threshold one by one. If it exceeds the threshold, filter the currently traversed point; obtain the preliminary filtered contour point set; Step 2.3: Traverse the original contour point set obtained in Step 1.1, calculate the distance from each point on the point set to the preliminarily filtered contour point set, and mark the points with distances not exceeding the set threshold as missing points and merge them with the filtered contour again; To ensure that the subsequent contour point traversal order is consistent with their position order on the contour, traverse the merged contour. For each traversed contour point, obtain the direction vector from the contour center to this point by subtracting the contour point from the contour center, and normalize this direction vector using the Euclidean norm to obtain a unit vector; Use the first unit vector as the initial vector and the positive x direction as the standard direction. By calculating the angles between the initial vector and the unit vector of the current traversed contour point and the positive x direction respectively, and then subtracting the two angles, the angle between the direction vector of each contour point and the initial point direction vector can be obtained. Sort these angles in ascending order to obtain a contour point set with traversal order consistent with the position order; Step 2.4: Similar to Step 2.2, filter the contour again to obtain a filtered contour point set to ensure that there are no contour points that are too far from the contour center.
10. The non-contact steel pipe end face dimension measurement system according to claim 9, characterized in that, The convex hull calculation module includes the following processes: Step 3.1: To simplify the contour shape and improve the algorithm robustness, and accurately calculate the subsequent pipe end dimensions, according to the final filtered contour point set obtained in Step 2.4, convert the final filtered contour point set into a convex hull and save it through the Graham scan method; Use the least squares method to convert the point set saved by the convex hull into a fitted ellipse and obtain the center points of the two fitted ellipses. Calculate the average values of the major and minor axes of the fitted ellipses of the large and small contours respectively, and multiply by the pixel size to obtain the outer diameter and inner diameter values; Step 3.2: Similar to Step 2.1, obtain the average thickness, maximum and minimum thicknesses of the filtered contour points and their positions; The burr judgment module includes the following processes: Step 4.1: According to the point set saved in the form of a convex hull obtained in Step 3, draw the contour points included in the point set for subsequent confirmation of the burr point positions; Step 4.2: According to the point set saved in the form of a convex hull obtained in Step 3, traverse the large and small contours respectively, and judge whether the point is inside the contour and the distance from the point to the contour through the ray projection method; For the large contour point set, judge whether the distance from the point outside the contour to the contour exceeds the threshold. If it exceeds the distance, judge it as a burr point and draw it on the image; For the small contour point set, judge whether the distance from the point inside the contour to the contour exceeds the threshold. If it exceeds the distance, judge it as a burr point and draw it on the image; The thickness calculation module includes the following processes: For the fitted ellipse obtained in step 3.1, the major axis and minor axis of the large contour fitted ellipse are denoted as a1 and b1 respectively, the major axis and minor axis of the small contour fitted ellipse are denoted as a2 and b2 respectively, and the pixel size is denoted as pix, obtaining Maximum outer diameter = a1 * pix, minimum outer diameter = b1 * pix, maximum inner diameter = a2 * pix, minimum inner diameter = b2 * pix. According to the maximum and minimum thickness positions obtained in step 3.2, draw the maximum and minimum thickness points.
Citation Information
Patent Citations
Method for processing size and image of pipe end of non-contact measuring steel pipe
CN102141380A
Thickness and dimension automatic measuring instrument for insulation layer and protective sleeve of image type cable
CN102141381A
Method for eliminating axis error during measurement of inner diameter and outer diameter of end of steel pipe
CN102589456A
Steel pipe wall thickness online detection method based on machine vision
CN113689415A
Device and method for measuring ovality of pipe end of large-diameter steel pipe
CN114577137A
Cited By
Non-contact steel pipe end face size measuring device
CN120351844A
Non-contact steel pipe end face size measuring device
CN120351844B
