Pipe centering method and device, electronic equipment and storage medium
Through line laser sensor scanning and data processing, straight line fitting technology improves the recognition accuracy of chamfers or concave and convex parts of pipes, solves the problem of insufficient pipe centering accuracy in existing technologies, and realizes high-precision pipe processing.
Patent Information
- Application Number
- CN202411971915.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the existing technology, the accuracy of line laser recognition of chamfers or concave and convex parts of pipes is low, resulting in insufficient accuracy in detecting the left and right endpoints when centering the pipe, which cannot meet the requirements of high-precision processing.
Use a line laser sensor to scan the pipe to obtain the initial point cloud, obtain the target point cloud through data processing, and perform straight line fitting to determine the first side point and the second side point. Combined with the preset axis offset, the center coordinates of the mid-surface to be found are calculated to ensure that the scanning direction of the line laser sensor is perpendicular to the fitting straight line.
The recognition accuracy of the laser line at the chamfer or concave-convex part of the pipe is improved, the accuracy of the initial point cloud is enhanced, and the accuracy of the fitting line is ensured, thereby improving the accuracy of the left and right endpoint coordinates of the mid-surface to be found, meeting the needs of high-precision pipe processing.
Smart Images

Figure CN119635033B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of laser cutting, and in particular to a pipe centering method and device, an electronic device, and a storage medium. BACKGROUND
[0002] Before laser processing is performed on a single side of a pipe, pipe centering is a prerequisite for ensuring the processing accuracy of the pipe. Pipe centering can be understood as finding the center position of the center of the face to be centered of the pipe relative to the center of the reference center, with the center of the chuck of the laser pipe cutting machine or the center of the laser cutting head as the reference center.
[0003] Currently, the pipe centering method includes machine vision-based pipe centering. The main process is as follows: after the pipe is loaded in place, the camera of the line laser sensor triggers a single photograph of the face to be centered to detect the left and right end points to obtain two left and right end point coordinates, and then the center position of the center of the face to be centered of the pipe relative to the reference center is determined according to the two left and right end point coordinates.
[0004] However, for a square tube with a chamfer or a concave-convex tube surface, the recognition accuracy of the line laser at the chamfer or the concave-convex position is low, resulting in low accuracy of the two left and right end point coordinates obtained by the camera triggering a single photograph of the face to be centered to detect the left and right end points, which cannot meet the high-precision requirement of the pipe processing accuracy. SUMMARY
[0005] The present application provides a pipe centering method, device, electronic device, and storage medium, which can solve the problem that the recognition accuracy of the line laser at the chamfer or the concave-convex position is low, resulting in low accuracy of the two left and right end point coordinates obtained by the camera triggering a single photograph of the face to be centered to detect the left and right end points, which cannot meet the high-precision requirement of the pipe processing accuracy.
[0006] According to a first aspect of the present application, a pipe centering method is provided, the method comprising:
[0007] scanning the pipe using a line laser sensor to obtain an initial point cloud;
[0008] performing data processing on the initial point cloud to obtain a target point cloud;
[0009] performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines;
[0010] determining a first side point and a second side point according to the plurality of fitting straight lines, the first side point being a point cloud of a first side surface adjacent to the face to be centered of the pipe having the same pre-set axis coordinate value in a first pre-set axis direction, and the second side point being a point cloud of a second side surface adjacent to the face to be centered of the pipe having the same pre-set axis coordinate value in the first pre-set axis direction;
[0011] determine a center coordinate of the surface to be centered in a second preset axis direction according to the first side point, the second side point and a preset axis offset, a plane formed by the first preset axis and the second preset axis being perpendicular to a scanning direction of the linear laser sensor.
[0012] According to a second aspect of the present application, a pipe centering device is provided, the device comprising:
[0013] a pipe scanning module configured to scan a pipe using a linear laser sensor to obtain an initial point cloud;
[0014] a data processing module configured to perform data processing on the initial point cloud to obtain a target point cloud;
[0015] a straight line fitting module configured to perform straight line fitting on the target point cloud to obtain a plurality of fitting straight lines;
[0016] a side point determining module configured to determine a first side point and a second side point according to the plurality of fitting straight lines, the first side point being a point with a same preset axis coordinate value in a first preset axis direction of a point cloud of a first side surface adjacent to a surface to be centered of the pipe, and the second side point being a point with a same preset axis coordinate value in the first preset axis direction of a point cloud of a second side surface adjacent to the surface to be centered of the pipe;
[0017] a coordinate determining module configured to determine a center coordinate of the surface to be centered in a second preset axis direction according to the first side point, the second side point and a preset axis offset, a plane formed by the first preset axis and the second preset axis being perpendicular to a scanning direction of the linear laser sensor.
[0018] According to a third aspect of the present application, an electronic device is provided, comprising a processor and a memory,
[0019] the memory being configured to store codes and related data;
[0020] the processor being configured to execute the codes in the memory to implement the pipe centering method according to any of the embodiments of the present application.
[0021] According to a fourth aspect of the present application, a storage medium is provided, the storage medium storing a computer program, the program being executed by a processor to implement the pipe centering method according to any of the embodiments of the present application.
[0022] In the embodiment of the present application, the initial point cloud is obtained by scanning the pipe with a line laser sensor; the target point cloud is obtained by data processing on the initial point cloud; a plurality of fitting straight lines are obtained by straight line fitting on the target point cloud; the first side point and the second side point are determined according to the plurality of fitting straight lines, the first side point being a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the first side surface adjacent to the to-be-centered surface of the pipe, and the second side point being a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the second side surface adjacent to the to-be-centered surface of the pipe; the center coordinate of the to-be-centered surface in the second pre-set axis direction is determined according to the first side point, the second side point and the pre-set axis offset, and the plane formed by the first pre-set axis and the second pre-set axis is perpendicular to the scanning direction of the line laser sensor. That is, the line laser recognition accuracy of the chamfer or the concave-convex part of the pipe is higher by scanning the to-be-centered surface of the pipe and the two side surfaces adjacent to the to-be-centered surface with the line laser sensor, the accuracy of the initial point cloud is improved, and the situation that the line laser recognition accuracy of the chamfer or the concave-convex part of the pipe is low, resulting in low pipe centering accuracy, is avoided; then the target point cloud is obtained by data processing on the initial point cloud, and a plurality of fitting straight lines are obtained by straight line fitting on the target point cloud, and since the accuracy of the initial point cloud is improved, the accuracy of the fitting straight lines fitted according to the initial point cloud is higher, and then the accuracy of the first side point and the second side point determined according to the plurality of fitting straight lines is improved, that is, the accuracy of the left and right end point coordinates of the to-be-centered surface of the pipe is improved, so that the accuracy of the center coordinate of the to-be-centered surface in the second pre-set axis direction determined according to the first side point, the second side point and the pre-set axis offset is improved, the high-precision requirement of the pipe machining precision is met, and the error of the center coordinate of the pipe is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0024] Figure 1 is a flowchart of the pipe centering method provided by the embodiment of the present application;
[0025] Figure 2 is a schematic diagram of a pipe machining scene provided by the embodiment of the present application;
[0026] Figure 3 is another flowchart of the pipe centering method provided by the embodiment of the present application;
[0027] Figure 4 is a schematic diagram of the initial point cloud provided by the embodiment of the present application;
[0028] Figure 5 is a schematic diagram of a target point cloud provided by an embodiment of the present application;
[0029] Figure 6 is another flowchart of a pipe centering method provided by an embodiment of the present application;
[0030] Figure 7 is a schematic diagram of two side points provided by an embodiment of the present application;
[0031] Figure 8 is a schematic diagram of a first chamfer point cloud provided by an embodiment of the present application;
[0032] Figure 9 is a structural schematic diagram of a pipe centering device provided by an embodiment of the present application;
[0033] Figure 10 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0035] The terms "first", "second", "third", "fourth" and the like (if any) in the description, claims and above drawings of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0036] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and some embodiments may not be described again for the same or similar concepts or processes.
[0037] Figure 1is a flowchart of a pipe centering method provided by an embodiment of the present application. The method can be performed by a pipe centering device, which can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device, such as a computer, a server, etc. The following embodiments will be described by taking the device integrated in an electronic device as an example. Referring to Figure 1 , the method can specifically include the following steps:
[0038] Step 101: Scanning a pipe to obtain an initial point cloud by using a line laser sensor.
[0039] The initial point cloud can be understood as a contour point cloud of the pipe.
[0040] In an optional implementation, the laser cutting head is generally horizontally installed, and is used to control the movement of the cutting head in the horizontal direction to achieve transverse cutting of the pipe. As shown in Figure 2 , the rotation axis of the laser cutting head is defined as the A axis, the rotation axis of the chuck is defined as the B axis, the transverse movement axis of the laser cutting head is defined as the X axis, the transverse movement axis of the chuck is defined as the Y axis, and the vertical movement axis of the laser cutting head is defined as the Z axis. The line laser sensor is installed at a fixed position near the cutting head and moves with the cutting head; then, the target position of the cutting head is determined according to the configuration parameters of the machine tool, the size of the pipe, the center coordinates of the B axis, and the best field of view range of the line laser sensor, which is equivalent to determining the target scanning position of the line laser sensor; finally, the initial point cloud including the left and right chamfers of the pipe surface to be recognized is obtained by using the line laser sensor to scan the pipe at the target scanning position during the rotation of the pipe clamped by the chuck. The configuration parameters of the machine tool can include the distance Bx from the X axis origin to the Y axis, the distance Bz from the Z axis origin to the Y axis, and the movement ranges of the X axis, the Y axis, the Z axis, the A axis, and the B axis. The best field of view range can be determined according to the hardware model of the line laser sensor.
[0041] Step 102: Performing data processing on the initial point cloud to obtain a target point cloud.
[0042] The data processing can include, but is not limited to, center line extraction, coordinate conversion, filtering, and other processing operations. The target point cloud can be understood as a point cloud obtained after the data processing of the initial point cloud.
[0043] Since the first point cloud obtained by scanning the pipe with the line laser sensor is a bright-dark distinguished point cloud, and the straight line fitting needs to be performed on the point cloud in the brightest area, and the first point cloud is the coordinate in the camera coordinate system, and the pipe flattening needs to determine the flattening angle of the pipe in the machine tool coordinate system, in an optional implementation, the center line of the initial point cloud can be extracted to obtain a first intermediate point cloud, the first intermediate point cloud is subjected to coordinate conversion to obtain a second intermediate point cloud, and the second intermediate point cloud is subjected to filtering to obtain a target point cloud, so that the point cloud coordinates are unified into the coordinates in the machine tool coordinate system, and the target point cloud is subjected to straight line fitting in the machine tool coordinate system to obtain a plurality of fitting straight lines.
[0044] In addition, since the point cloud obtained by scanning the pipe with the line laser sensor may have some noise points affecting the accuracy of the straight line fitting, in an optional implementation, the second intermediate point cloud can be filtered to obtain a target point cloud, since the second intermediate point cloud is subjected to filtering, the influence of the noise points existing in the target point cloud on the accuracy of the straight line fitting is reduced, and the accuracy of the plurality of fitting straight lines obtained by performing the straight line fitting on the target point cloud is improved.
[0045] Step 103, performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines.
[0046] Step 104, determining a first side point and a second side point according to the plurality of fitting straight lines, the first side point being a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the first side surface adjacent to the to-be-centered surface of the pipe, and the second side point being a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the second side surface adjacent to the to-be-centered surface of the pipe.
[0047] The first side surface can be understood as the left side surface adjacent to the to-be-centered surface. The second side surface can be understood as the right side surface adjacent to the to-be-centered surface. The first side point can be understood as a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the first side surface adjacent to the to-be-centered surface of the pipe in the target point cloud. The second side point can be understood as a point with the same pre-set axis coordinate value in the first pre-set axis direction of the point cloud of the second side surface adjacent to the to-be-centered surface of the pipe in the target point cloud. The first pre-set axis direction can be understood as the Y-axis direction. The Y-axis coordinates of the points in the profile point cloud of the pipe are the same.
[0048] In an optional implementation, a first straight line of the to-be-centered surface, a second straight line of the first side surface, and a third straight line of the second side surface can be screened from the plurality of fitting straight lines, and the first side point and the second side point can be determined according to the first straight line, the second straight line, and the third straight line. The first straight line can be understood as a fitting straight line parallel to the to-be-centered surface. The second straight line can be understood as a fitting straight line parallel to the first side surface adjacent to the to-be-centered surface. The third straight line can be understood as a fitting straight line parallel to the second side surface adjacent to the to-be-centered surface.
[0049] Since the to-be-centered surface and the two adjacent side surfaces are in a perpendicular relationship, and in order to ensure the accuracy of the slope of the fitting straight line, it is necessary to ensure that the number of points included in the fitting straight line meets a certain preset number, therefore, the first straight line and the second straight line are perpendicular to each other, the first straight line and the third straight line are perpendicular to each other, and the number of points of each fitting straight line needs to reach the preset number, so the first straight line of the to-be-centered surface, the second straight line of the first side surface and the third straight line of the second side surface are selected from the plurality of fitting straight lines, including: determining the first straight line, the second straight line and the third straight line from the plurality of fitting straight lines according to the slope of each fitting straight line, the angle between each fitting straight line and other fitting straight lines, and the number of points of each fitting straight line.
[0050] Specifically, the straight line slope of each fitting straight line and the number of points included in each fitting straight line can be determined; the angle between each fitting straight line and other fitting straight lines is determined; the first straight line of the to-be-centered surface, the second straight line of the first side surface and the third straight line of the second side surface are determined according to the straight line slope of each fitting straight line, the number of points included in each fitting straight line and the angle between each fitting straight line and other fitting straight lines, so that the first straight line of the to-be-centered surface, the second straight line of the first side surface and the third straight line of the second side surface can be more accurately selected from the plurality of fitting straight lines according to the slope of the fitting straight line, the angle between the fitting straight line and other fitting straight lines, and the number of points of the points included in each fitting straight line, improve the accuracy of the first straight line, the second straight line and the third straight line, and further improve the accuracy of the first side point and the second side point determined according to the first straight line and the second straight line, thereby improving the centering accuracy of the pipe centering according to the first side point and the second side point.
[0051] After determining the first straight line, the second straight line and the third straight line, since the intersection of the two straight lines can be obtained by solving the straight line equation, the first side point and the second side point are determined according to the first straight line equation, the second straight line equation and the third straight line equation, including: obtaining the first straight line equation of the first straight line according to the coordinates of any point on the first straight line and the slope of the first straight line; obtaining the second straight line equation of the second straight line according to the coordinates of any point on the second straight line and the slope of the second straight line; obtaining the third straight line equation of the third straight line according to the coordinates of any point on the third straight line and the slope of the third straight line; determining the first side point and the second side point according to the first straight line equation, the second straight line equation and the third straight line equation, so that the first side point and the second side point can be more accurately determined, the accuracy of the first side point and the second side point is improved, and the centering accuracy of the pipe centering according to the first side point and the second side point is further improved.
[0052] In another alternative embodiment, a reference straight line parallel to the to-be-searched surface among the plurality of fitting straight lines can be identified; a first reference straight line and a second reference straight line perpendicular to the reference straight line can be obtained; and a first side point and a second side point can be determined according to the first reference straight line, the second reference straight line and the target point cloud. The reference straight line can be understood as a fitting straight line parallel to the to-be-searched surface. The first reference straight line can be understood as a straight line parallel to the first side surface and perpendicular to the reference straight line. The second reference straight line can be understood as a straight line parallel to the second side surface and perpendicular to the reference straight line. The length of the reference straight line is greater than the straight line distance between the first side surface and the second side surface, the first reference straight line is on the left side of the first side surface, the second reference straight line is on the right side of the second side surface, the point in the target point cloud with the smallest distance from the first reference straight line is the point on the first side surface, the point in the target point cloud with the smallest distance from the second reference straight line is the point on the second side surface, and the present application is to determine the center coordinate value of the to-be-searched surface in the second preset axis direction. When there are convex points or concave points on the pipe surface of the pipe, the points on the two side surfaces can be determined first, and then the center coordinate of the to-be-searched surface in the second preset axis direction can be more accurately determined according to the second preset axis coordinate of the points on the two side surfaces. That is, two reference straight lines with a certain distance from the first side surface or the second side surface can be obtained, the distances between the points in the target point cloud and the reference straight lines are determined, and the first side point and the second side point are more accurately determined according to the distances between the points in the target point cloud and the reference straight lines. Therefore, the first side point and the second side point are determined according to the first reference straight line, the second reference straight line and the target point cloud, which includes: determining the reference straight line parallel to the to-be-searched surface according to the slopes of the plurality of fitting straight lines; then determining a plurality of first distances between the points in the target point cloud and the first reference straight line; determining a plurality of second distances between the points in the target point cloud and the second reference straight line; and determining the first side point and the second side point according to the plurality of first distances and the plurality of second distances. The first distance can be understood as the distance between the points in the target point cloud and the first reference straight line. The second distance can be understood as the distance between the points in the target point cloud and the second reference straight line.
[0053] In step 105, the center coordinate of the to-be-searched surface in the second preset axis direction is determined according to the first side point, the second side point and the preset axis offset, and the plane formed by the first preset axis and the second preset axis is perpendicular to the scanning direction of the line laser sensor.
[0054] The preset axis offset can be understood as the distance from the X-axis origin to the Y-axis. The second preset axis can be the X-axis. The center coordinate can be understood as the coordinate value of the middle X-axis of the two side points of the to-be-searched surface of the pipe in the X-axis direction.
[0055] In an optional embodiment, the first coordinate of the first side point and the second coordinate of the second side point are obtained, the first coordinate comprises a first coordinate value in the direction of the second preset axis, and the second coordinate comprises a second coordinate value in the direction of the second preset axis; the first coordinate value, the second coordinate value, and the preset axis offset are substituted into the center coordinate calculation formula to calculate the center coordinate of the to-be-centered surface in the direction of the second preset axis, and the center coordinate formula is:
[0056] Q = (P1 + P2) / 2 - D
[0057] wherein Q represents the center coordinate of the to-be-centered surface in the direction of the second preset axis, P1 represents the first coordinate value, P2 represents the second coordinate value, and D represents the preset axis offset. The first coordinate value can be understood as the X-axis coordinate of the first side point. The second coordinate value can be understood as the X-axis coordinate of the second side surface.
[0058] In the embodiment of the application, the line laser sensor is used to scan the to-be-centered surface of the pipe and the two side surfaces adjacent to the to-be-centered surface, and the recognition accuracy of the line laser at the chamfer or the concave-convex part of the pipe is higher, the accuracy of the initial point cloud is improved, and the situation that the recognition accuracy of the line laser at the chamfer or the concave-convex part of the pipe is low, resulting in low pipe centering accuracy, is avoided; then the initial point cloud is subjected to data processing to obtain a target point cloud, and the target point cloud is subjected to straight line fitting to obtain a plurality of fitting straight lines, since the accuracy of the initial point cloud is improved, the accuracy of the fitting straight lines obtained according to the initial point cloud is higher, and then the accuracy of the first side point and the second side point determined according to the plurality of fitting straight lines is improved, that is, the accuracy of the left and right end point coordinates of the to-be-centered surface of the pipe is improved, so that the accuracy of the center coordinate of the to-be-centered surface in the direction of the second preset axis determined according to the first side point, the second side point, and the preset axis offset is improved, the high-precision requirement of the pipe machining precision is met, and the error of the center coordinate of the pipe is reduced.
[0059] The pipe centering method provided by the embodiment of the application will be further described below. As shown in Figure 3 , the pipe centering method provided by the embodiment of the application is another flowchart, and can specifically include the following steps: Figure 3
[0060] Step 201: obtaining an initial point cloud of the pipe by using a line laser sensor to scan the pipe.
[0061] For example, the initial point cloud obtained by using the line laser sensor to scan the pipe is as shown in Figure 4 .
[0062] Step 202: obtaining a first intermediate point cloud by extracting a center line of the initial point cloud.
[0063] For example, the center line of the initial point cloud in the brightest area of Figure 4 is extracted to obtain a first intermediate point cloud as shown inFigure 5 The first intermediate point cloud is shown.
[0064] In step 203, coordinate conversion is performed on the first intermediate point cloud to obtain a second intermediate point cloud.
[0065] In an optional embodiment, the pixel coordinates of the first intermediate point cloud, the calibration matrix of the camera, and the distortion matrix can be obtained, and the first intermediate point cloud is subjected to coordinate conversion according to the pixel coordinates of the first intermediate point cloud, the calibration matrix of the camera, and the distortion matrix to obtain the second intermediate point cloud in the machine tool coordinate system.
[0066] Specifically, the pixel coordinates of each point in the first intermediate point cloud, the calibration matrix of the camera, and the distortion matrix can be multiplied respectively to obtain the second intermediate point cloud.
[0067] In step 204, filtering is performed on the second intermediate point cloud to obtain a target point cloud.
[0068] The filtering operation can include, but is not limited to, any one of median filtering, smoothing filtering, and radius filtering. Median filtering is a nonlinear smoothing technique that sets the gray value of each pixel to the median value of the gray values of all pixels in a certain neighborhood window of the pixel. Smoothing filtering is a low-frequency enhancement spatial domain filtering technique. Spatial domain smoothing filtering generally uses a simple averaging method, that is, the average brightness value of adjacent image points is calculated. The size of the neighborhood is directly related to the smoothing effect. The larger the neighborhood, the better the smoothing effect. However, if the neighborhood is too large, the edge information will be lost, and thus the output image will become blurred. Therefore, the size of the neighborhood should be reasonably selected. Radius filtering is a radius outlier removal technique.
[0069] In an optional embodiment, if the second intermediate point cloud has many outliers and noise points, median filtering and / or smoothing filtering can be selected. In this way, the outliers and noise points in the second intermediate point cloud can be removed, the influence of the outliers and noise points on the straight line fitting can be reduced, and the accuracy of the straight line fitting can be improved. If the second intermediate point cloud is not smooth enough, radius filtering can be selected to increase the smoothness of the second intermediate point cloud, reduce the influence of the outliers and noise points on the straight line fitting, and improve the accuracy of the straight line fitting.
[0070] In step 205, straight line fitting is performed on the target point cloud to obtain a plurality of fitting straight lines.
[0071] In step 206, the straight line slopes of the fitting straight lines and the number of points included in each fitting straight line are determined.
[0072] In step 207, the included angles between the fitting straight lines and other fitting straight lines are determined.
[0073] In step 208, the first straight line of the middle surface to be searched, the second straight line of the first side surface, and the third straight line of the second side surface are determined according to the straight line slope of each fitting straight line, the number of points included in each fitting straight line, and the angle between each fitting straight line and other fitting straight lines.
[0074] The number of points included in the first straight line and the number of points included in the second straight line are generally one third of the total number of points of the point cloud, the slope of the second straight line is generally between 0° and 90°, the slope of the third straight line is generally between -90° and 0°, the angle between the first straight line and the second straight line is generally about 90°, and the angle between the first straight line and the third straight line is also generally about 90°. Therefore, in an optional embodiment, a straight line with a point number greater than a preset number and a straight line slope of zero is determined as the first straight line of the middle surface to be searched; a straight line with a point number greater than a preset number, a straight line slope belonging to a first interval, and an angle with the first straight line belonging to a preset angle interval is determined as the second straight line of the first side surface; and a straight line with a point number greater than a preset number, a straight line slope belonging to a second interval, and an angle with the first straight line belonging to a preset angle interval is determined as the third straight line of the second side surface. The first interval and the second interval are different. The preset angle interval can be understood as an angle interval between two preset straight lines, which can be 【85°, 95°】.
[0075] For example, the plurality of fitting straight lines include L1, L2, L3, L4, and L5; the preset number is N, the first interval is 【45°, 90°】, the second interval is
-90°, 45°
[0076] Step 209, obtaining the first straight line equation of the first straight line according to the coordinates of any point on the first straight line and the slope of the first straight line.
[0077] In an optional embodiment, since the Y-axis coordinates of the first straight line, the second straight line and the third straight line are the same, when determining the straight line equation, the straight line equation in which the point is located can be determined only according to the X-axis coordinate and the Z-axis coordinate of the point of each straight line. That is, the slope of the first straight line and the coordinates of any point on the first straight line are substituted into the first point slope straight line equation to obtain the first straight line equation of the first straight line. Wherein, the first point slope straight line equation is z-z1=m(x-x1), x1 represents the X-axis coordinate of any point on the first straight line, and z1 represents the Z-axis coordinate of any point on the first straight line.
[0078] Step 210, obtaining the second straight line equation of the second straight line according to the coordinates of any point on the second straight line and the slope of the second straight line.
[0079] In an optional embodiment, the slope of the second straight line and the coordinates of any point on the second straight line are substituted into the second point slope straight line equation to obtain the second straight line equation of the second straight line. Wherein, the second point slope straight line equation is z-z2=m(x-x2), x2 represents the X-axis coordinate of any point on the second straight line, and z2 represents the Z-axis coordinate of any point on the second straight line.
[0080] Step 211, obtaining the third straight line equation of the third straight line according to the coordinates of any point on the third straight line and the slope of the third straight line.
[0081] In an optional embodiment, the slope of the third straight line and the coordinates of any point on the third straight line are substituted into the third point slope straight line equation to obtain the third straight line equation of the third straight line. Wherein, the third point slope straight line equation is z-z3=m(x-x3), x3 represents the X-axis coordinate of any point on the third straight line, and z3 represents the Z-axis coordinate of any point on the third straight line.
[0082] Step 212, determining the first side point and the second side point according to the first straight line equation, the second straight line equation and the third straight line equation.
[0083] In an optional embodiment, the first straight line equation and the second straight line equation are solved to obtain the first straight line equation group; the first straight line equation group is solved to obtain the first side point; the first straight line equation and the third straight line equation are solved to obtain the second straight line equation group; and the second straight line equation group is solved to obtain the second side point.
[0084] Step 213, determining the center coordinates of the to-be-centered surface in the second preset axis direction according to the first side point, the second side point and the preset axis offset.
[0085] In the embodiment of the present application, the line laser sensor is used to scan the to-be-centered surface of the pipe and the two side surfaces adjacent to the to-be-centered surface, and the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is higher, the accuracy of the initial point cloud is improved, and the situation that the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is low and the centering accuracy of the pipe is low is avoided; then the initial point cloud is subjected to data processing to obtain a target point cloud, and the target point cloud is subjected to straight line fitting to obtain a plurality of fitting straight lines, since the accuracy of the initial point cloud is improved, the accuracy of the fitting straight lines obtained according to the initial point cloud is higher, and then the accuracy of the first side point and the second side point determined according to the plurality of fitting straight lines is improved, that is, the accuracy of the left and right end point coordinates of the to-be-centered surface of the pipe is improved, so that the accuracy of the center coordinates of the to-be-centered surface in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset is improved, the high-precision requirement of the pipe machining precision is met, and the error of the center coordinates of the pipe is reduced.
[0086] Figure 6 Another flowchart of the pipe centering method provided by the embodiment of the present application is shown in FIG. 3, which can specifically include the following steps: Figure 6
[0087] Step 301: obtaining an initial point cloud by using a line laser sensor to scan a pipe.
[0088] Step 302: obtaining a first intermediate point cloud by extracting a center line of the initial point cloud.
[0089] Step 303: obtaining a second intermediate point cloud by performing coordinate conversion on the first intermediate point cloud.
[0090] Step 304: obtaining a target point cloud by filtering the second intermediate point cloud.
[0091] Step 305: obtaining a plurality of fitting straight lines by performing straight line fitting on the target point cloud.
[0092] Step 306: identifying a reference straight line parallel to the to-be-centered surface from the plurality of fitting straight lines.
[0093] Step 307: obtaining a first reference straight line and a second reference straight line perpendicular to the reference straight line.
[0094] In an optional manner, the first reference straight line and the second reference straight line perpendicular to the reference straight line can be automatically obtained according to the preset setting.
[0095] Step 308: determining a plurality of first distances between each point in the target point cloud and the first reference straight line.
[0096] In an optional implementation, a first reference line equation of the first reference line can be determined according to the coordinates of any point on the first reference line and the slope of the first reference line, and then the first distances between the points and the first reference line can be determined according to the coordinates of the points and the first reference line equation.
[0097] Step 309, determining the second distances between the points in the target point cloud and the second reference line.
[0098] In an optional implementation, a second reference line equation of the second reference line can be determined according to the coordinates of any point on the second reference line and the slope of the second reference line, and then the second distances between the points and the second reference line can be determined according to the coordinates of the points and the second reference line equation.
[0099] Step 310, determining the first side point and the second side point according to the first distances and the second distances.
[0100] Since the first reference line is on the left side of the first side surface, the distances between the points on the first side surface and the first reference line are the smallest, and thus in an optional implementation, the point corresponding to the smallest first distance in the first distances is determined as the first side point. Since the second reference line is on the right side of the second side surface, the distances between the points on the second side surface and the second reference line are the smallest, and thus in an optional implementation, the point corresponding to the smallest second distance in the second distances is determined as the second side point. In this way, the points on the two side surfaces can be determined first, and then the center coordinates of the to-be-centered surface in the second preset axis direction can be determined more accurately according to the coordinates of the points on the two side surfaces.
[0101] For example, as shown in Figure 7 , the point T1 corresponding to the smallest first distance d1 in the first distances is determined as the first side point, and the point T2 corresponding to the smallest second distance d2 in the second distances is determined as the second side point.
[0102] Step 311, determining the center coordinates of the to-be-centered surface in the second preset axis direction according to the first side point, the second side point, and the preset axis offset.
[0103] In the embodiment of the present application, the line laser sensor scans the surface to be centered of the pipe and the two side surfaces adjacent to the surface to be centered, and the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is higher, the accuracy of the initial point cloud is improved, and the situation that the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is low, resulting in low centering accuracy of the pipe, is avoided; then the initial point cloud is processed to obtain a target point cloud, and a plurality of fitting straight lines are obtained by fitting the target point cloud, and since the accuracy of the initial point cloud is improved, the accuracy of the fitting straight lines obtained by fitting the initial point cloud is higher, and the accuracy of the first side point and the second side point determined according to the plurality of fitting straight lines is improved, that is, the accuracy of the left and right end point coordinates of the surface to be centered of the pipe is improved, so that the accuracy of the center coordinates of the surface to be centered in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset is improved, the high-precision requirement of the pipe machining precision is met, and the error of the center coordinates of the pipe is reduced.
[0104] Optionally, after the first straight line of the surface to be centered, the second straight line of the first side surface and the third straight line of the second side surface are selected from the plurality of fitting straight lines, a distance threshold can be obtained, and the target point cloud to be deleted is determined according to the distance threshold and the first straight line; the target point cloud to be deleted is deleted from the target point cloud to obtain a point cloud to be fitted, a plurality of straight lines are obtained by fitting the point cloud to be fitted for the second time, and the first straight line of the surface to be centered, the second straight line of the first side surface and the third straight line of the second side surface are selected from the plurality of fitting straight lines again; the first side point and the second side point are determined according to the first straight line, the second straight line and the third straight line, so that the chamfer point cloud at the chamfer of the pipe and some discrete point clouds of the discrete points not deleted in the filtering stage in the target point cloud can be deleted through the plurality of straight lines obtained by the first time fitting and the distance threshold, the influence of the chamfer point cloud and the discrete point cloud on the accuracy of the second time fitting is reduced, and the fitting accuracy of the plurality of straight lines obtained by the second time fitting is improved. The distance threshold can include a first threshold and a second threshold.
[0105] Specifically, the chamfer point cloud can be determined according to the target point cloud, the first threshold and the first straight line; the second threshold is set, the discrete point cloud is determined according to the second point cloud, the second threshold and the first straight line; and the chamfer point cloud and the discrete point cloud are determined as the point cloud to be deleted, so that the point cloud affecting the accuracy of the second time fitting in the second point cloud can be deleted according to different distance thresholds, and the fitting accuracy of the plurality of straight lines obtained by the second time fitting is improved.
[0106] Further, since the pipe has two chamfers on the left and right sides, the left and right points belonging to the points in the first straight line can be determined on the first straight line, and then the point cloud to the left of the left point is screened from the target point cloud according to the left point, and the point cloud to the right of the right point is screened from the target point cloud according to the right point, and finally the point cloud at the left chamfer is determined according to the first threshold, the left point and the point cloud to the left of the left point, and the point cloud at the right chamfer is determined according to the first threshold, the right point and the point cloud to the right of the right point. Therefore, in an optional implementation, the first coordinate and the second coordinate of the first straight line can be determined; the first candidate point cloud on the left of the first coordinate and the second candidate point cloud on the right of the second coordinate are screened from the target point cloud; the first chamfer point cloud is determined according to the first threshold, the first coordinate and the first candidate point cloud; the second chamfer point cloud is determined according to the first threshold, the second coordinate and the second candidate point cloud; and the first chamfer point cloud and the second chamfer point cloud are determined as the chamfer point cloud. Wherein, the first coordinate can be understood as the coordinate of the left point of the first straight line, and the second coordinate can be understood as the coordinate of the right point of the first straight line. The first candidate point cloud can be understood as the point cloud in the target point cloud located on the left of the first coordinate. The second candidate point cloud can be understood as the point cloud in the target point cloud located on the left of the second coordinate.
[0107] Since each point in the discrete point cloud has a certain distance from the initial straight line, the discrete point cloud can be determined according to the distance between each point in the target point cloud and the first straight line. That is, the third distance between each point in the target point cloud and the first straight line can be determined; the point cloud composed of the points in the target point cloud with a third distance greater than the second threshold is determined as the discrete point cloud, so that the point cloud of the points in the target point cloud not belonging to the inner point of the first straight line can be deleted, the influence of the discrete point cloud on the fitting accuracy of the second straight line can be reduced, and the fitting accuracy of the plurality of straight lines obtained by the second straight line fitting can be improved. Wherein, the third distance can be understood as a preset distance threshold between each point in the target point cloud and the first straight line.
[0108] Further, the first coordinate and the second coordinate of the first straight line can be determined by determining the coordinate of the point with the minimum coordinate value in the second preset axis direction among the plurality of points on the first straight line as the first coordinate, and determining the coordinate of the point with the maximum coordinate value in the second preset axis direction among the plurality of points on the first straight line as the second coordinate, or obtaining the detection box corresponding to the first straight line, determining the point on the left boundary line of the detection box on the first straight line as the first coordinate, and determining the point on the right boundary line of the detection box on the first straight line as the second coordinate, so that the first coordinate and the second coordinate on the first straight line can be determined more quickly and accurately, the accuracy of the first coordinate and the second coordinate can be improved, and the accuracy of the chamfer point cloud determined according to the first threshold, the first coordinate, the second coordinate and the target point cloud can be improved.
[0109] The first chamfer point cloud is determined according to the first threshold value, the first coordinate and the first candidate point cloud, which can include: determining a fourth distance between each point in the first candidate point cloud and the first coordinate; and determining a point cloud composed of points in the first candidate point cloud with a fourth distance less than the first threshold value as the first chamfer point cloud. The second chamfer point cloud is determined according to the first threshold value, the second coordinate and the second candidate point cloud, which includes: determining a fifth distance between each point in the second candidate point cloud and the second coordinate; and determining a point cloud composed of points in the second candidate point cloud with a fifth distance less than the first threshold value as the second chamfer point cloud. In this way, the chamfer point cloud and the discrete point cloud in the target point cloud can be more accurately determined, the influence of the chamfer point cloud and the discrete point cloud on the accuracy of the second straight line fitting is reduced, and the fitting accuracy of the plurality of straight lines obtained by the second straight line fitting is improved. The fourth distance can be understood as the distance between each point in the first candidate point cloud and the first coordinate. The fifth distance can be understood as the distance between each point in the second candidate point cloud and the second coordinate.
[0110] For example, the first chamfer point cloud determined according to the first threshold value, the first coordinate and the first candidate point cloud is a point cloud composed of red points in the following figure. Figure 8
[0111] Figure 9 is a structural schematic diagram of a pipe centering device provided by an embodiment of the present application. The device is suitable for performing the pipe centering method provided by the present application. As shown in the figure, the device can specifically include: Figure 9
[0112] The pipe scanning module 401 is configured to scan a pipe by using a line laser sensor to obtain an initial point cloud.
[0113] The data processing module 402 is configured to perform data processing on the initial point cloud to obtain a target point cloud.
[0114] The straight line fitting module 403 is configured to perform straight line fitting on the target point cloud to obtain a plurality of fitting straight lines.
[0115] The side point determination module 404 is configured to determine a first side point and a second side point according to the plurality of fitting straight lines. The first side point is a point cloud of a first side surface adjacent to a to-be-centered surface of the pipe and having a same preset axis coordinate value in a first preset axis direction. The second side point is a point cloud of a second side surface adjacent to the to-be-centered surface of the pipe and having a same preset axis coordinate value in the first preset axis direction.
[0116] The coordinate determination module 405 is configured to determine a center coordinate of the to-be-centered surface in a second preset axis direction according to the first side point, the second side point and a preset axis offset. A plane formed by the first preset axis and the second preset axis is perpendicular to a scanning direction of the line laser sensor.
[0117] Optionally, the side point determination module 404 is specifically configured to:
[0118] screening the first straight line of the middle surface to be searched, the second straight line of the first side surface and the third straight line of the second side surface from the plurality of fitting straight lines;
[0119] determining the first side point and the second side point according to the first straight line, the second straight line and the third straight line.
[0120] Optionally, the side point determination module 404 screens the first straight line of the middle surface to be searched, the second straight line of the first side surface and the third straight line of the second side surface from the plurality of fitting straight lines, and the method comprises the following steps.
[0121] determining the straight line slope of each fitting straight line and the number of points included in each fitting straight line;
[0122] determining the included angle between each fitting straight line and other fitting straight lines;
[0123] determining the first straight line of the middle surface to be searched, the second straight line of the first side surface and the third straight line of the second side surface according to the straight line slope of each fitting straight line, the number of points included in each fitting straight line and the included angle between each fitting straight line and other fitting straight lines.
[0124] Optionally, the side point determination module 404 determines the first straight line of the middle surface to be searched, the second straight line of the first side surface and the third straight line of the second side surface according to the straight line slope of each fitting straight line, the number of points included in each fitting straight line and the included angle between each fitting straight line and other fitting straight lines, and the method comprises the following steps.
[0125] determining the straight line with the number of points greater than a preset number and the straight line slope of zero as the first straight line of the middle surface to be searched;
[0126] determining the straight line with the number of points greater than a preset number, the straight line slope belonging to a first interval and the included angle with the first straight line belonging to a preset included angle interval as the second straight line of the first side surface;
[0127] determining the straight line with the number of points greater than a preset number, the straight line slope belonging to a second interval and the included angle with the first straight line belonging to the preset included angle interval as the third straight line of the second side surface.
[0128] Optionally, the side point determination module 404 determines the first side point and the second side point according to the first straight line, the second straight line and the third straight line, and the method comprises the following steps.
[0129] obtaining a first straight line equation of the first straight line according to the coordinates of any point on the first straight line and the slope of the first straight line;
[0130] a second line equation of the second line is obtained according to the coordinates of an arbitrary point on the second line and a slope of the second line;
[0131] a third line equation of the third line is obtained according to the coordinates of an arbitrary point on the third line and a slope of the third line;
[0132] the first side point and the second side point are determined according to the first line equation, the second line equation and the third line equation.
[0133] Optionally, the side point determination module 404, in determining the first side point and the second side point according to the first line equation, the second line equation and the third line equation, comprises:
[0134] a first line equation set is obtained by combining the first line equation and the second line equation;
[0135] the first side point is obtained by solving the first line equation set;
[0136] a second line equation set is obtained by combining the first line equation and the third line equation;
[0137] the second side point is obtained by solving the second line equation set.
[0138] Optionally, the side point determination module 404 is further specific for:
[0139] a reference line parallel to the plane to be searched is identified from the plurality of fitting lines;
[0140] a first reference line and a second reference line perpendicular to the reference line are obtained;
[0141] the first side point and the second side point are determined according to the first reference line, the second reference line and the target point cloud.
[0142] Optionally, the side point determination module 404, in determining the first side point and the second side point according to the first reference line, the second reference line and the target point cloud, comprises:
[0143] a plurality of first distances between each point in the target point cloud and the first reference line are determined;
[0144] a plurality of second distances between each point in the target point cloud and the second reference line are determined;
[0145] the first side point and the second side point are determined according to the plurality of first distances and the plurality of second distances.
[0146] Optionally, the side point determination module 404 determines the first side point and the second side point according to the plurality of first distances and the plurality of second distances, including:
[0147] determining a point corresponding to a smallest first distance in the plurality of first distances as the first side point;
[0148] determining a point corresponding to a smallest second distance in the plurality of second distances as the second side point.
[0149] Optionally, the coordinate determination module 405 is specifically configured to:
[0150] obtain a first coordinate of the first side point and a second coordinate of the second side point, the first coordinate including a first coordinate value in the second preset axis direction, and the second coordinate including a second coordinate value in the second preset axis direction;
[0151] substitute the first coordinate value, the second coordinate value and the preset axis offset into a center coordinate calculation formula to calculate a center coordinate of the surface to be centered in the second preset axis direction, the center coordinate formula being:
[0152] Q = (P1 + P2) / 2 - D
[0153] wherein Q represents the center coordinate of the surface to be centered in the second preset axis direction, P1 represents the first coordinate value, P2 represents the second coordinate value, and D represents the preset axis offset.
[0154] Optionally, the data processing module 402 is specifically configured to:
[0155] extract a center line of the initial point cloud to obtain a first intermediate point cloud;
[0156] perform coordinate conversion on the first intermediate point cloud to obtain a second intermediate point cloud;
[0157] perform filtering on the second intermediate point cloud to obtain the target point cloud.
[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the above described functional modules can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0159] The pipe centering device provided by the embodiment of the present application can utilize the line laser sensor to scan the surface to be centered of the pipe and the two side surfaces adjacent to the surface to be centered, and the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is higher, the accuracy of the initial point cloud is improved, and the situation that the identification accuracy of the line laser at the chamfer or the concave-convex portion of the pipe is low and the centering accuracy of the pipe is low is avoided; then the initial point cloud is subjected to data processing to obtain a target point cloud, and the target point cloud is subjected to straight line fitting to obtain a plurality of fitting straight lines, since the accuracy of the initial point cloud is improved, the accuracy of the fitting straight lines obtained according to the initial point cloud is higher, and then the accuracy of the first side point and the second side point determined according to the plurality of fitting straight lines is improved, that is, the accuracy of the left and right end point coordinates of the surface to be centered of the pipe is improved, so that the accuracy of the center coordinates of the surface to be centered in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset is improved, the high-precision requirement of the pipe machining precision is met, and the error of the center coordinates of the pipe is reduced.
[0160] Figure 10 is a structural schematic diagram of an electronic device provided by the embodiment of the present application.
[0161] Please refer to Figure 10 , provides an electronic device 50, comprising:
[0162] a processor 51; and,
[0163] a memory 52 configured to store executable instructions of the processor;
[0164] wherein the processor 51 is configured to execute the above-mentioned method via execution of the executable instructions.
[0165] The processor 51 can communicate with the memory 52 through the bus 53.
[0166] The embodiment of the present application further provides a computer readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the above-mentioned method.
[0167] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes ROM, RAM, magnetic disc or optical disc and various storage medium capable of storing program codes.
[0168] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A pipe centering method, characterized by, The method comprises: scanning a to-be-centered surface of a pipe and first and second side surfaces adjacent to the to-be-centered surface by using a line laser sensor to obtain an initial point cloud, the Y-axis coordinates of points in the initial point cloud being the same; performing data processing on the initial point cloud to obtain a target point cloud; performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines; selecting a first straight line of the to-be-centered surface, a second straight line of the first side surface and a third straight line of the second side surface from the plurality of fitting straight lines; obtaining a first straight line equation of the first straight line according to the coordinates of an arbitrary point on the first straight line and the slope of the first straight line, obtaining a second straight line equation of the second straight line according to the coordinates of an arbitrary point on the second straight line and the slope of the second straight line, and obtaining a third straight line equation of the third straight line according to the coordinates of an arbitrary point on the third straight line and the slope of the third straight line; obtaining a first straight line equation set by combining the first straight line equation and the second straight line equation, and obtaining a first side point by solving the first straight line equation set; obtaining a second straight line equation set by combining the first straight line equation and the third straight line equation, and obtaining a second side point by solving the second straight line equation set; determining the center coordinates of the to-be-centered surface in the X-axis direction according to the first side point, the second side point and a preset axis offset; wherein the preset axis offset is the distance from the origin of the X-axis to the Y-axis, the transverse movement axis of a laser cutting head is the X-axis, the transverse movement axis of a chuck is the Y-axis, and the plane formed by the X-axis and the Y-axis is perpendicular to the scanning direction of the line laser sensor.
2. The method of claim 1, wherein, The method comprises: determining the straight line slopes of the fitting straight lines and the number of points included in each fitting straight line; determining the included angles between each fitting straight line and other fitting straight lines; determining the first straight line of the to-be-centered surface, the second straight line of the first side surface and the third straight line of the second side surface according to the straight line slopes of the fitting straight lines, the number of points included in each fitting straight line and the included angles between each fitting straight line and other fitting straight lines.
3. The method of claim 2, wherein, The method comprises: determining the first straight line of the to-be-centered surface as a straight line whose point number is greater than a preset number and whose straight line slope is zero; determining the second straight line of the first side surface as a straight line whose point number is greater than a preset number, whose straight line slope belongs to a first interval and whose included angle with the first straight line belongs to a preset included angle interval; determining the third straight line of the second side surface as a straight line whose point number is greater than a preset number, whose straight line slope belongs to a second interval and whose included angle with the first straight line belongs to the preset included angle interval.
4. The method of claim 1, wherein, The method comprises: obtaining a first coordinate of the first side point and a second coordinate of the second side point, the first coordinate comprising a first coordinate value in the X-axis direction, and the second coordinate comprising a second coordinate value in the X-axis direction; substituting the first coordinate value, the second coordinate value and the preset axis offset into a center coordinate calculation formula to calculate a center coordinate of the face to be centered in the X-axis direction, the center coordinate formula being: Q = (P1 + P2) / 2 - D wherein Q represents the center coordinate of the face to be centered in the X-axis direction, P1 represents the first coordinate value, P2 represents the second coordinate value, and D represents the preset axis offset.
5. The method according to any one of claims 1 to 4, characterized in that, data processing of the initial point cloud to obtain a target point cloud, comprising: extracting a center line of the initial point cloud to obtain a first intermediate point cloud; coordinate conversion of the first intermediate point cloud to obtain a second intermediate point cloud; filtering of the second intermediate point cloud to obtain the target point cloud.
6. A pipe centering method characterized by, The method comprises: scanning a face to be centered of a pipe and first and second side faces adjacent to and perpendicular to the face to be centered by using a line laser sensor to obtain an initial point cloud, the Y-axis coordinates of points in the initial point cloud being the same; data processing of the initial point cloud to obtain a target point cloud; straight line fitting of the target point cloud to obtain a plurality of fitting straight lines; identifying a reference straight line parallel to the face to be centered from the plurality of fitting straight lines; obtaining a first reference straight line and a second reference straight line perpendicular to the reference straight line, determining a plurality of first distances between points in the target point cloud and the first reference straight line, determining a plurality of second distances between points in the target point cloud and the second reference straight line, and determining a point corresponding to a smallest first distance in the plurality of first distances as a first side point and a point corresponding to a smallest second distance in the plurality of second distances as a second side point according to the plurality of first distances and the plurality of second distances; determining a center coordinate of the face to be centered in the X-axis direction according to the first side point, the second side point and a preset axis offset; wherein the preset axis offset is a distance from an X-axis origin to a Y-axis, a transverse movement axis of a laser cutting head is the X-axis, a transverse movement axis of a chuck is the Y-axis, and a plane formed by the X-axis and the Y-axis is perpendicular to a scanning direction of the line laser sensor.
7. The method of claim 6, wherein, The data processing of the initial point cloud to obtain a target point cloud comprises: extracting a center line of the initial point cloud to obtain a first intermediate point cloud; coordinate conversion of the first intermediate point cloud to obtain a second intermediate point cloud; filtering of the second intermediate point cloud to obtain the target point cloud.
8. An electronic device, comprising: comprising a processor and a memory, the memory being configured to store codes and related data; the processor being configured to execute the codes in the memory to implement the pipe centering method according to any one of claims 1 to 7.
9. A storage medium having a computer program stored thereon, the program being executed by a processor to implement the pipe centering method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Elliptical tube centering method and system, electronic equipment and storage medium
CN117123922A
Shaft center line offset and cage guide spacing measurement method based on point cloud technology
CN118999413A