Pipe centering method and device, electronic equipment and storage medium
By performing data processing and linear fitting of the initial point cloud of the pipe, the side points and central coordinates of the pipe are determined, and the problem of low accuracy of line laser recognition at chamfers or concave convexities in the prior art is solved, and high-precision pipe neutralization processing is achieved.
Patent Information
- Application Number
- CN202411971915.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-30
AI Technical Summary
When using linear laser recognition at chamfers or concave convexities of pipes, the recognition accuracy is low, resulting in low accuracy of pipe search and inability to meet high-precision processing requirements.
The initial point cloud is obtained by scanning the pipe with a linear laser sensor, and the target point cloud is obtained by performing data processing. Then, the target point cloud is linearly fitted, the first side point and the second side point are determined, and the center coordinates of the middle face to be searched in the second preset axis direction based on these points and the preset axis offset amount are calculated.
The accuracy of laser recognition of line at chamfers or concave convex points of pipes is improved, the accuracy of the initial point cloud is enhanced, and the accuracy of the left and right end points coordinates of the middle surface of the pipe is improved, meeting the requirements of high-precision processing.
Smart Images

Figure CN119635033A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser cutting technology, and in particular to a pipe centering method, device, electronic equipment and storage medium. Background Art
[0002] Before laser processing one side of the tube, centering is the prerequisite for ensuring the processing accuracy of the tube. Centering can be understood as taking the rotation center of the chuck of the laser tube cutting machine or the rotation center of the laser cutting head as the reference center, and finding the center position of the center surface of the tube to be found relative to the reference center.
[0003] At present, the method of pipe centering includes pipe centering based on machine vision; the main process is: after the pipe is loaded into place, the camera of the line laser sensor is used to trigger a photo of the center surface to be found, and the left and right endpoints are detected to obtain the coordinates of the left and right endpoints, and then the center position of the center surface of the pipe to be found relative to the reference center is determined based on the coordinates of the left and right endpoints.
[0004] However, for square tubes with chamfers or uneven surfaces, the recognition accuracy of the line laser at the chamfers or uneven surfaces is low, resulting in low accuracy of the left and right endpoint coordinates obtained by using the camera to trigger a photo of the mid-surface to be found for left and right endpoint detection, which cannot meet the high-precision requirements of tube processing accuracy. Summary of the invention
[0005] The present invention provides a pipe centering method, device, electronic device and storage medium, which can solve the problem that due to the low recognition accuracy of the line laser at the chamfer or concave and convex parts, the accuracy of the left and right endpoint coordinates obtained by using a camera to trigger one photo of the center surface to be found to perform left and right endpoint detection is low, and the high precision requirements of pipe processing accuracy cannot be met.
[0006] According to a first aspect of the present invention, a method for centering a pipe is provided, the method comprising:
[0007] Scan 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] Determine a first side point and a second side point according to the plurality of fitting straight lines, wherein the first side point is a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point is a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction;
[0011] The center coordinates of the mid-surface to be found in the direction of the second preset axis are 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.
[0012] According to a second aspect of the present invention, a pipe centering device is provided, the device comprising:
[0013] The pipe scanning module is used to scan the pipe using a line laser sensor to obtain an initial point cloud;
[0014] A data processing module, used for performing data processing on the initial point cloud to obtain a target point cloud;
[0015] A straight line fitting module, used for performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines;
[0016] A side point determination module, configured to determine a first side point and a second side point according to the plurality of fitted straight lines, wherein the first side point is a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point is a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction;
[0017] A coordinate determination module is used to determine the center coordinates of the mid-surface to be found in the direction of the second preset axis based on 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.
[0018] According to a third aspect of the present invention, there is provided an electronic device, comprising a processor and a memory.
[0019] The memory is used to store codes and related data;
[0020] The processor is used to execute the code in the memory to implement the pipe centering method as described in any one of the embodiments of the present invention.
[0021] According to a fourth aspect of the present invention, there is provided a storage medium having a computer program stored thereon, which, when executed by a processor, implements a pipe centering method as described in any one of the embodiments of the present invention.
[0022] In an embodiment of the present invention, a line laser sensor is used to scan a pipe to obtain an initial point cloud; data processing is performed on the initial point cloud to obtain a target point cloud; a plurality of fitted straight lines are performed on the target point cloud to obtain a first side point and a second side point are determined based on the plurality of fitted straight lines, the first side point being a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction, and the second side point being a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction; based on the first side point, the second side point and the preset axis offset, the center coordinates of the middle surface to be found in the second preset axis direction are determined, 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. That is, a line laser sensor is used to scan the middle surface to be found of the pipe and the two side surfaces adjacent to the middle surface to be found. The recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is higher, thereby improving the accuracy of the initial point cloud and avoiding the low recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe, which leads to low accuracy of pipe centering. Then, data processing is performed on the initial point cloud to obtain the target point cloud, and the target point cloud is linearly fitted to obtain multiple fitting lines. Since the accuracy of the initial point cloud is improved, the accuracy of the fitting lines obtained by fitting the initial point cloud is higher, thereby improving the accuracy of the first side point and the second side point determined according to the multiple fitting lines, that is, improving the accuracy of the left and right end point coordinates of the middle surface to be found of the pipe, thereby improving the accuracy of the center coordinates of the middle surface to be found in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset, thereby meeting the high-precision requirements of the pipe processing accuracy and reducing the error of the center coordinates of the pipe. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 It is a schematic flow chart of a pipe centering method provided by an embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of a pipe processing scenario provided by an embodiment of the present invention;
[0026] Figure 3 is another schematic flow chart of the pipe centering method provided by an embodiment of the present invention;
[0027] Figure 4 is a schematic diagram of an initial point cloud provided by an embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of a target point cloud provided by an embodiment of the present invention;
[0029] Figure 6 It is another schematic flow chart of the pipe centering method provided by an embodiment of the present invention;
[0030] Figure 7 is a schematic diagram of two side points provided by an embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of a first chamfer point cloud provided by an embodiment of the present invention;
[0032] Fig. 9 It is a structural schematic diagram of a pipe centering device provided by an embodiment of the present invention;
[0033] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0037] Figure 1The present invention provides a flow chart of a method for finding the center of a pipe provided by an embodiment of the present invention. The method can be executed by a pipe finding device, which can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, such as a computer, a server, etc. The following embodiments will be described by taking the device integrated into an electronic device as an example. Figure 1 , the method may specifically include the following steps:
[0038] Step 101: Scan the pipe using a line laser sensor to obtain an initial point cloud.
[0039] Among them, the initial point cloud can be understood as the contour point cloud of the pipe.
[0040] In an optional embodiment, the laser cutting head is generally installed horizontally, which is used to control the movement of the cutting head in the horizontal direction to achieve transverse cutting of the pipe. Figure 2 As shown, 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 lateral movement axis of the laser cutting head is defined as the X axis, the lateral 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, according to the configuration parameters of the machine tool, the size of the pipe, the center coordinates of the B axis and the optimal field of view of the line laser sensor, the target position of the cutting head is determined, which is equivalent to determining the target scanning position of the line laser sensor. Finally, in the process of the chuck clamping the pipe to rotate, the line laser sensor is used to scan the pipe at the target scanning position to obtain the initial point cloud including the chamfers of the left and right sides of the surface to be identified of the pipe. Among them, the configuration parameters of the machine tool may include the distance Bx from the origin of the X axis to the Y axis, the distance Bz from the origin of the Z axis to the Y axis, and the movement range of the X axis, Y axis, Z axis, A axis, and B axis. The optimal field of view can be determined according to the hardware model of the line laser sensor.
[0041] Step 102: Process the initial point cloud to obtain a target point cloud.
[0042] The data processing may include but is not limited to centerline extraction, coordinate conversion, filtering and other processing operations. The target point cloud may be understood as a point cloud obtained after the initial point cloud is processed.
[0043] Since the first point cloud obtained by scanning the pipe with a line laser sensor is a point cloud distinguished by light and dark, and straight line fitting requires straight line fitting of the point cloud in the brightest area; and the first point cloud is the coordinate in the camera coordinate system, and the leveling of the pipe requires determining the leveling angle of the pipe in the machine tool coordinate system, therefore, in an optional implementation, the center line of the initial point cloud can be extracted to obtain the first intermediate point cloud, the first intermediate point cloud can be transformed into the second intermediate point cloud, and the second intermediate point cloud can be filtered to obtain the target point cloud, so that the point cloud coordinates can be unified into the coordinates in the machine tool coordinate system, and the target point cloud can be fitted in the machine tool coordinate system to obtain multiple fitting lines.
[0044] In addition, since the point cloud obtained by scanning the pipe using a line laser sensor may contain some noise points that affect the accuracy of straight-line fitting, in an optional implementation, the second intermediate point cloud can be filtered to obtain the target point cloud. Since the second intermediate point cloud is filtered, the influence of the noise points in the target point cloud on the accuracy of straight-line fitting is reduced, thereby improving the accuracy of multiple fitting straight lines obtained by straight-line fitting of the target point cloud.
[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 based on multiple fitting straight lines, the first side point being a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point being a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction.
[0047] Among them, the first side surface can be understood as the left side surface adjacent to the middle surface to be found. The second side surface can be understood as the right side surface adjacent to the middle surface to be found. The first side point can be understood as the point in the target point cloud of the first side surface adjacent to the middle surface to be found of the pipe with the same preset axis coordinate value in the first preset axis direction. The second side point can be understood as the point in the target point cloud of the second side surface adjacent to the middle surface to be found of the pipe with the same preset axis coordinate value in the first preset axis direction. The first preset axis direction can be understood as the Y-axis direction. The Y-axis coordinates of each point in the contour point cloud of the pipe are the same.
[0048] In an optional implementation, a first straight line of the mid-surface to be found, a second straight line of the first side surface, and a third straight line of the second side surface can be screened out from a plurality of fitting straight lines; and a first side point and a second side point can be determined based on 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 mid-surface to be found. The second straight line can be understood as a fitting straight line parallel to the first side surface adjacent to the mid-surface to be found. The third straight line can be understood as a fitting straight line parallel to the second side surface adjacent to the mid-surface to be found.
[0049] Since the middle surface to be found 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 a preset number. Then, the first straight line of the middle surface to be found, the second straight line of the first side surface, and the third straight line of the second side surface are selected from multiple fitting straight lines, including: determining the first straight line, the second straight line, and the third straight line from multiple 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 linear 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 can be determined; according to the linear 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, the first straight line of the middle surface to be found, the second straight line of the first side surface and the third straight line of the second side surface can be determined. In this way, 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 included in each fitting straight line, the first straight line of the middle surface to be found, the second straight line of the first side surface and the third straight line of the second side surface can be more accurately screened out from multiple fitting straight lines, thereby improving the accuracy of the first straight line, the second straight line and the third straight line, and then improving 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 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 determined more accurately, the accuracy of the first side point and the second side point is improved, and then the accuracy of centering the pipe according to the first side point and the second side point is improved.
[0052] In another optional implementation, a reference straight line parallel to the mid-surface to be found among multiple fitted straight lines can be identified; a first reference straight line and a second reference straight line perpendicular to the reference straight line are obtained; and a first side point and a second side point are 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 fitted straight line parallel to the mid-surface to be found. 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 and the second side, the first reference straight line is on the left side of the first side, the second reference straight line is on the right side of the second side, the point with the smallest distance from the first reference straight line in the target point cloud is the point on the first side, and the point with the smallest distance from the second reference straight line in the target point cloud is the point on the second side. The present invention is to determine the intermediate axis coordinate value of the middle surface to be found in the second preset axis direction. When there are convex points or concave points on the tube surface of the pipe, the points on the two sides can be determined first, and then the center coordinates of the middle surface to be found in the second preset axis direction can be more accurately determined based on the second preset axis coordinates of the points on the two sides. That is, two reference straight lines with a certain distance from the first side or the second side can be obtained, the distance between each point in the target point cloud and the reference straight line can be determined, and the first side point and the second side point can be more accurately determined based on the distance between each point in the target point cloud and the reference straight line. Therefore, according to the first reference straight line, the second reference straight line and the target point cloud, the first side point and the second side point are determined, including: determining a reference straight line parallel to the mid-surface to be found according to the slopes of multiple fitting straight lines; then determining multiple first distances between each point in the target point cloud and the first reference straight line; determining multiple second distances between each point 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 multiple first distances and the multiple second distances. Among them, the first distance can be understood as the distance between each point in the target point cloud and the first reference straight line. The second distance can be understood as the distance between each point in the target point cloud and the second reference straight line.
[0053] Step 105, determining the center coordinates of the mid-surface to be found in the direction of the second preset axis according to the first side point, the second side point and the preset axis offset, wherein 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 X-axis coordinate value of the middle of the two side points of the mid-surface to be found of the pipe in the X-axis direction.
[0055] In an optional implementation, the first coordinate of the first side point and the second coordinate of the second side point are obtained, the first coordinate includes a first coordinate value in the direction of the second preset axis, and the second coordinate includes 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 mid-surface to be found 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 mid-surface to be found 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 present invention, a line laser sensor is used to scan the middle surface to be found of the pipe and the two side surfaces adjacent to the middle surface to be found. The recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is higher, thereby improving the accuracy of the initial point cloud and avoiding the situation that the recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is low, resulting in low accuracy of pipe centering. Then, data processing is performed on the initial point cloud to obtain a target point cloud, and a plurality of fitting lines are obtained by linear fitting of the target point cloud. Since the accuracy of the initial point cloud is improved, the accuracy of the fitting lines obtained by fitting the initial point cloud is higher, thereby improving the accuracy of the first side point and the second side point determined according to the plurality of fitting lines, that is, improving the accuracy of the left and right end point coordinates of the middle surface to be found of the pipe, thereby improving the accuracy of the center coordinates of the middle surface to be found in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset, thereby meeting the high-precision requirements of the pipe processing accuracy and reducing the error of the center coordinates of the pipe.
[0059] The pipe centering method provided by the embodiment of the present invention is further described below. Figure 3 As shown, Figure 3 1 is another flow chart of the pipe centering method provided by an embodiment of the present invention, which may specifically include the following steps:
[0060] Step 201: Scan the pipe using a line laser sensor to obtain an initial point cloud.
[0061] For example, a line laser sensor is used to scan the pipe to obtain Figure 4 The initial point cloud shown.
[0062] Step 202: extract the center line of the initial point cloud to obtain a first intermediate point cloud.
[0063] For example, extract Figure 4 The center line of the initial point cloud in the brightest area is obtained as Figure 5 The first intermediate point cloud is shown.
[0064] Step 203: performing coordinate transformation 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 and the distortion matrix of the camera can be obtained, and the first intermediate point cloud can be transformed according to the pixel coordinates of the first intermediate point cloud, the calibration matrix and the distortion matrix of the camera 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 may be multiplied respectively to obtain the second intermediate point cloud.
[0067] Step 204: Filter the second intermediate point cloud to obtain a target point cloud.
[0068] Among them, the filtering operation may 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 grayscale value of each pixel to the median of the grayscale values of all pixels within a certain neighborhood window of the point. Smoothing filtering is a low-frequency enhanced spatial domain filtering technique; smoothing filtering in the spatial domain is generally performed using a simple averaging method, which is to calculate the average brightness value of neighboring pixel points. 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, smoothing will cause greater loss of edge information, thereby blurring the output image. Therefore, the size of the neighborhood needs to be reasonably selected. Radius filtering is a radius outlier removal technique.
[0069] In an optional implementation, if the second intermediate point cloud has many outliers and noise points, median filtering and / or smoothing filtering can be selected to remove the outliers and noise points in 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. 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] Step 205: performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines.
[0071] Step 206: determine the slope of each fitted straight line and the number of points included in each fitted straight line.
[0072] Step 207: determine the angle between each fitting straight line and other fitting straight lines.
[0073] Step 208, determining the first straight line of the mid-surface to be found, the second straight line of the first side surface and the third straight line of the second side surface according to the 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 generally account for one third of the total number of points in the point cloud, and 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°, and the angle between the first straight line and the second straight line is generally around 90°, and the angle between the first straight line and the third straight line is also generally around 90°. Therefore, in an optional embodiment, a straight line with a greater number of points than a preset number and a straight line slope of zero is determined as the first straight line of the mid-surface to be found; a straight line with a greater number of points than a preset number, a straight line slope belonging to the first interval, and an angle with the first straight line belonging to the preset angle interval is determined as the second straight line of the first side; a straight line with a greater number of points than a preset number, a straight line slope belonging to the second interval, and an angle with the first straight line belonging to the preset angle interval is determined as the third straight line of the second side. Among them, the first interval and the second interval are different. The preset angle interval can be understood as the preset angle interval between two 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°], and the preset angle interval is [85°, 95°]. Among them, the number of points of L1 is N1, the number of points of L2 is N2, the number of points of L3 is N3, the number of points of L4 is N4, the number of points of L5 is N5, N4<N5<N<N1<N2<N3; the straight line slope K1 of L1 is 0°, the straight line slope K2 of L2 is 85°, the straight line slope K3 of L3 is -85°, the straight line slope K4 of L4 is 25°, and the straight line slope K5 of L5 is 35°; the angle between L1 and L2 is 89°, the angle between L1 and L3 is 88°, the angle between L1 and L4 is 38°, and the angle between L1 and L5 is 45°. It can be determined that the number of points N1 of L1 is greater than N and the straight line slope K1 of L1 is zero, then L1 is determined to be the first straight line; it can be determined that the number of points N2 of L2 is greater than N, the straight line slope K2 (85°) of L2 belongs to the first interval, and the angle (89°) between L2 and the first straight line L1 belongs to the preset angle interval, then L2 is determined to be the second straight line; it can be determined that the number of points N3 of L3 is greater than N, the straight line slope K2 (-85°) of L3 belongs to the second interval, and the angle (88°) between L3 and the first straight line L1 belongs to the preset angle interval, then L3 is determined to be the third straight line.
[0076] Step 209 , 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.
[0077] In an optional implementation, 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 where the point is located can be determined only based on the X-axis coordinates and Z-axis coordinates of the points on each straight line. That is, the slope of the first straight line and the coordinates of any point on the first straight line can be substituted into the first point-slope straight line equation to obtain the first straight line equation. Among them, 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 a 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 implementation, the slope of the second straight line and the coordinates of any point on the second straight line can be substituted into the second point-slope straight line equation to obtain the second straight line equation. 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 a 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 implementation, the slope of the third straight line and the coordinates of any point on the third straight line can be substituted into the third point slope straight line equation to obtain the third straight line equation of the third straight line. 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 a first side point and a 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 can be combined to obtain a first straight line equation group; the first straight line equation group is solved to obtain a first side point; the first straight line equation and the third straight line equation are combined to obtain a second straight line equation group; and the second straight line equation group is solved to obtain a second side point.
[0084] Step 213: Determine the center coordinates of the mid-surface to be found in the direction of the second preset axis according to the first side point, the second side point and the preset axis offset.
[0085] In the embodiment of the present invention, a line laser sensor is used to scan the middle surface to be found of the pipe and the two side surfaces adjacent to the middle surface to be found. The recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is higher, thereby improving the accuracy of the initial point cloud and avoiding the situation that the recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is low, resulting in low accuracy of pipe centering. Then, data processing is performed on the initial point cloud to obtain a target point cloud, and a plurality of fitting lines are obtained by linear fitting of the target point cloud. Since the accuracy of the initial point cloud is improved, the accuracy of the fitting lines obtained by fitting the initial point cloud is higher, thereby improving the accuracy of the first side point and the second side point determined according to the plurality of fitting lines, that is, improving the accuracy of the left and right end point coordinates of the middle surface to be found of the pipe, thereby improving the accuracy of the center coordinates of the middle surface to be found in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset, thereby meeting the high-precision requirements of the pipe processing accuracy and reducing the error of the center coordinates of the pipe.
[0086] Figure 6 FIG. 1 is another flow chart of the pipe centering method provided by an embodiment of the present invention. Figure 6 As shown, the following steps may be specifically included:
[0087] Step 301: Scan the pipe using a line laser sensor to obtain an initial point cloud.
[0088] Step 302: extract the center line of the initial point cloud to obtain a first intermediate point cloud.
[0089] Step 303: performing coordinate transformation on the first intermediate point cloud to obtain a second intermediate point cloud.
[0090] Step 304: Filter the second intermediate point cloud to obtain a target point cloud.
[0091] Step 305: Perform straight line fitting on the target point cloud to obtain a plurality of fitting straight lines.
[0092] Step 306: Identify a reference straight line parallel to the mid-surface to be found among the multiple fitted 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, a preset first reference straight line and a second reference straight line perpendicular to the reference straight line may be automatically acquired according to the reference straight line.
[0095] Step 308: determine a plurality of first distances between each point in the target point cloud and the first reference line.
[0096] In an optional embodiment, the first reference line equation of the first reference line can be determined based on the coordinates of any point on the first reference line and the slope of the first reference line, and then multiple first distances between each point and the first reference line can be determined based on the coordinates of each point and the first reference line equation.
[0097] Step 309: determine a plurality of second distances between each point in the target point cloud and the second reference straight line.
[0098] In an optional embodiment, the second reference line equation of the second reference line can be determined based on the coordinates of any point on the second reference line and the slope of the second reference line, and then multiple second distances between each point and the second reference line can be determined based on the coordinates of each point and the second reference line equation.
[0099] Step 310: Determine a first side point and a second side point according to the plurality of first distances and the plurality of second distances.
[0100] Since the first reference straight line is on the left side of the first side surface, the distance between each point on the first side surface and the first reference straight line is the smallest. In an optional embodiment, the point corresponding to the smallest first distance among multiple first distances is determined as the first side point; since the second reference straight line is on the right side of the second side surface, the distance between each point on the second side surface and the second reference straight line is the smallest. In an optional embodiment, the point corresponding to the smallest second distance among multiple 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 mid-surface to be found in the direction of the second preset axis can be more accurately determined based on the coordinates of the points on the two side surfaces.
[0101] For example, Figure 7 As shown, a point T1 corresponding to the smallest first distance d1 among the plurality of first distances is determined as a first side point, and a point T2 corresponding to the smallest second distance d2 among the plurality of second distances is determined as a second side point.
[0102] Step 311: Determine the center coordinates of the mid-surface to be found in the direction of the second preset axis according to the first side point, the second side point and the preset axis offset.
[0103] In the embodiment of the present invention, a line laser sensor is used to scan the middle surface to be found of the pipe and the two side surfaces adjacent to the middle surface to be found. The recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is higher, thereby improving the accuracy of the initial point cloud and avoiding the situation that the recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is low, resulting in low accuracy of pipe centering. Then, data processing is performed on the initial point cloud to obtain a target point cloud, and a plurality of fitting lines are obtained by linear fitting of the target point cloud. Since the accuracy of the initial point cloud is improved, the accuracy of the fitting lines obtained by fitting the initial point cloud is higher, thereby improving the accuracy of the first side point and the second side point determined according to the plurality of fitting lines, that is, improving the accuracy of the left and right end point coordinates of the middle surface to be found of the pipe, thereby improving the accuracy of the center coordinates of the middle surface to be found in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset, thereby meeting the high-precision requirements of the pipe processing accuracy and reducing the error of the center coordinates of the pipe.
[0104] Optionally, after selecting the first straight line of the middle surface to be found, the second straight line of the first side surface, and the third straight line of the second side surface from the multiple fitted straight lines, a distance threshold can be obtained, and the point cloud to be deleted can be determined based on the distance threshold and the first straight line; the point cloud to be deleted can be deleted from the target point cloud to obtain the point cloud to be fitted, and the second straight line fitting can be performed on the point cloud to be fitted to obtain multiple straight lines, and the first straight line of the middle surface to be found, the second straight line of the first side surface, and the third straight line can be selected from the multiple fitted straight lines again; the first side point and the second side point can be determined based on the first straight line fitting and the distance threshold, so that the chamfer point cloud at the chamfer of the pipe in the target point cloud and the discrete point cloud of some discrete points that are not deleted in the filtering stage can be deleted, thereby reducing the influence of the chamfer point cloud and the discrete point cloud on the accuracy of the second straight line fitting, and improving the fitting accuracy of the multiple straight lines obtained by the second straight line fitting. Among them, the distance threshold can include the first threshold and the second threshold.
[0105] Specifically, the chamfered point cloud can be determined according to the target point cloud, the first threshold and the first straight line; the second threshold is set, and the discrete point cloud is determined according to the second point cloud, the second threshold and the first straight line; the chamfered point cloud and the discrete point cloud are determined as point clouds to be deleted, so that the point clouds in the second point cloud that affect the accuracy of the second straight line fitting can be deleted according to different distance thresholds, thereby improving the fitting accuracy of multiple straight lines obtained by the second straight line fitting.
[0106] Furthermore, since the pipe has two chamfers on the left and right sides, the left point and the right point belonging to the points in the first straight line can be determined on the first straight line, and then the point cloud on the left side of the left point is screened out from the target point cloud according to the left point, and the point cloud on the right side of the right point is screened out from the target point cloud according to the right point. Finally, the point cloud at the left chamfer is determined according to the first threshold, the left point and the point cloud on the left side 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 on the right side of the right point. Therefore, in an optional embodiment, the first coordinate and the second coordinate of the first straight line can be determined; the first candidate point cloud on the left side of the first coordinate and the second candidate point cloud on the right side of the second coordinate are screened out 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; the first chamfer point cloud and the second chamfer point cloud are determined as chamfer point clouds. Among them, 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 located to the left of the first coordinate in the target point cloud. The second candidate point cloud can be understood as the point cloud predicted to be located at the second coordinate in the target point cloud.
[0107] Since each point in the discrete point cloud is at a certain distance from the initial straight line, the discrete point cloud can be determined based on 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 whose third distance is greater than the second threshold is determined as a discrete point cloud, so that the point cloud of the inner points in the target point cloud that do not belong to the first straight line can be deleted, reducing the impact of the discrete point cloud on the accuracy of the second straight line fitting, and improving the fitting accuracy of multiple straight lines obtained by the second straight line fitting. Among them, the third distance can be understood as the preset distance threshold between each point in the target point cloud and the first straight line.
[0108] Further, to determine the first coordinate and the second coordinate of the first straight line, the coordinate of the point corresponding to the minimum coordinate value in the second preset axis direction among the multiple points on the first straight line can be determined as the first coordinate; the coordinate of the point corresponding to the maximum coordinate value in the second preset axis direction among the multiple points on the first straight line can be determined as the second coordinate; or, obtain the detection frame corresponding to the first straight line; determine the point on the first straight line that is on the left boundary line of the detection frame as the first coordinate; and determine the point on the first straight line that is on the right boundary line of the detection frame as the second coordinate. In this way, the first coordinate and the second coordinate on the first straight line can be determined more quickly and accurately, thereby improving the accuracy of the first coordinate and the second coordinate, and thereby improving the accuracy of the chamfer point cloud determined according to the first threshold, the first coordinate, the second coordinate and the target point cloud.
[0109] Determining the first chamfer point cloud according to the first threshold, the first coordinate and the first candidate point cloud may include: determining the fourth distance between each point in the first candidate point cloud and the first coordinate; determining the point cloud composed of the points in the first candidate point cloud whose fourth distance is less than the first threshold as the first chamfer point cloud. Determining the second chamfer point cloud according to the first threshold, the second coordinate and the second candidate point cloud may include: determining the fifth distance between each point in the second candidate point cloud and the second coordinate; determining the point cloud composed of the points in the second candidate point cloud whose fifth distance is less than the first threshold as the second chamfer point cloud, so that the chamfer point cloud and the discrete point cloud in the target point cloud can be determined more accurately, reducing the influence of the chamfer point cloud and the discrete point cloud on the accuracy of the second straight line fitting, and improving the fitting accuracy of the multiple straight lines obtained by the second straight line fitting. Among them, 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, the first coordinates and the first candidate point cloud is: Figure 8 The point cloud composed of the red points in .
[0111] Fig. 9 Schematic diagram of a pipe centering device provided in an embodiment of the present invention, which is suitable for executing the pipe centering method provided in an embodiment of the present invention. Fig. 9 As shown, the device may specifically include:
[0112] The pipe scanning module 401 is used to scan the pipe using a line laser sensor to obtain an initial point cloud;
[0113] A data processing module 402 is used to process the initial point cloud to obtain a target point cloud;
[0114] A straight line fitting module 403 is used to perform straight line fitting on the target point cloud to obtain a plurality of fitting straight lines;
[0115] A side point determination module 404 is used to determine a first side point and a second side point according to the plurality of fitting straight lines, wherein the first side point is a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point is a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction;
[0116] The coordinate determination module 405 is used to determine the center coordinates of the mid-surface to be found in the direction of the second preset axis based on 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.
[0117] Optionally, the side point determination module 404 is specifically configured to:
[0118] Filtering out a first straight line of the mid-surface to be found, a second straight line of the first side surface, and a third straight line of the second side surface from the plurality of fitted straight lines;
[0119] 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.
[0120] Optionally, the side point determination module 404 selects the first straight line of the mid-surface to be found, 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, including:
[0121] Determine the slope of each fitted straight line and the number of points included in each fitted straight line;
[0122] Determine the angle between each fitted straight line and other fitted straight lines;
[0123] According to the linear slopes of the fitted straight lines, the number of points included in the fitted straight lines and the angles between the fitted straight lines and other fitted straight lines, the first straight line of the mid-surface to be found, the second straight line of the first side surface and the third straight line of the second side surface are determined.
[0124] Optionally, the side point determination module 404 determines the first straight line of the mid-surface to be found, the second straight line of the first side surface, and the third straight line of the second side surface according to the linear slopes of the respective fitted straight lines, the number of points included in the respective fitted straight lines, and the angles between the respective fitted straight lines and other fitted straight lines, including:
[0125] Determine a straight line whose number of points is greater than a preset number and whose slope is zero as the first straight line of the mid-surface to be found;
[0126] Determine a straight line whose number of points is greater than a preset number, whose slope belongs to a first interval, and whose angle with the first straight line belongs to a preset angle interval as a second straight line of the first side surface;
[0127] A straight line whose number of points is greater than a preset number, whose slope belongs to the second interval and whose angle with the first straight line belongs to the preset angle interval is determined as a third straight line of the second side surface.
[0128] Optionally, the side point determining 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, including:
[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] Obtaining a 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;
[0131] Obtaining a 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;
[0132] 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.
[0133] Optionally, the side point determination module 404 determines 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, including:
[0134] Combining the first straight line equation and the second straight line equation to obtain a first straight line equation system;
[0135] Solving the first straight line equation group to obtain the first side point;
[0136] Combining the first straight line equation and the third straight line equation to obtain a second straight line equation group;
[0137] The second side point is obtained by solving the second straight line equation group.
[0138] Optionally, the side point determination module 404 is further specifically configured to:
[0139] Identifying a reference straight line parallel to the mid-surface to be found among the plurality of fitting straight lines;
[0140] Acquire a first reference straight line and a second reference straight line perpendicular to the reference straight line;
[0141] 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.
[0142] Optionally, the side point determination module 404 determines the first side point and the second side point according to the first reference straight line, the second reference straight line and the target point cloud, including:
[0143] Determine a plurality of first distances between each point in the target point cloud and the first reference straight line;
[0144] Determine a plurality of second distances between each point in the target point cloud and the second reference straight line;
[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 determining 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] Determine a point corresponding to the smallest first distance among the multiple first distances as the first side point;
[0148] A point corresponding to the smallest second distance among the multiple second distances is determined as the second side point.
[0149] Optionally, the coordinate determination module 405 is specifically configured to:
[0150] Acquire a first coordinate of the first side point and a second coordinate of the second side point, wherein the first coordinate includes a first coordinate value in the direction of the second preset axis, and the second coordinate includes a second coordinate value in the direction of the second preset axis;
[0151] Substitute the first coordinate value, the second coordinate value and the preset axis offset into the center coordinate calculation formula to calculate the center coordinate of the mid-surface to be found in the direction of the second preset axis. The center coordinate formula is:
[0152] Q=(P1+P2) / 2-D
[0153] Among them, Q represents the center coordinate of the mid-surface to be found 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.
[0154] Optionally, the data processing module 402 is specifically configured to:
[0155] Extracting the center line of the initial point cloud to obtain a first intermediate point cloud;
[0156] Performing coordinate transformation on the first intermediate point cloud to obtain a second intermediate point cloud;
[0157] The second intermediate point cloud is filtered to obtain the target point cloud.
[0158] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, 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 functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0159] The pipe centering device provided by the embodiment of the present invention can use a line laser sensor to scan the pipe's middle surface to be found and the two side surfaces adjacent to the middle surface to be found. The recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is higher, thereby improving the accuracy of the initial point cloud and avoiding the situation where the recognition accuracy of the line laser at the chamfer or concave-convex part of the pipe is low, resulting in a low pipe centering accuracy; then the initial point cloud is processed to obtain a target point cloud, and the target point cloud is linearly fitted to obtain a plurality of fitting lines. Since the accuracy of the initial point cloud is improved, the accuracy of the fitting lines obtained by fitting the initial point cloud is higher, thereby improving the accuracy of the first side point and the second side point determined according to the plurality of fitting lines, that is, improving the accuracy of the left and right end point coordinates of the pipe's middle surface to be found, thereby improving the accuracy of the center coordinates of the middle surface to be found in the second preset axis direction determined according to the first side point, the second side point and the preset axis offset, thereby meeting the high-precision requirements of the pipe processing accuracy and reducing the error of the center coordinates of the pipe.
[0160] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0161] Please refer to Fig.10 , an electronic device 50 is provided, comprising:
[0162] a processor 51; and
[0163] A memory 52, used to store executable instructions of the processor;
[0164] The processor 51 is configured to execute the above-mentioned method by executing the executable instructions.
[0165] The processor 51 can communicate with the memory 52 via a bus 53 .
[0166] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method is implemented.
[0167] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned 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 aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0168] Finally, it should be noted that 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for centering a pipe, characterized in that: The method comprises: Scan the pipe using a line laser sensor to obtain an initial point cloud; 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; Determine a first side point and a second side point according to the plurality of fitting straight lines, wherein the first side point is a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point is a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction; The center coordinates of the mid-surface to be found in the direction of the second preset axis are 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.
2. The method according to claim 1, characterized in that The determining the first side point and the second side point according to the plurality of fitting straight lines comprises: Filtering out a first straight line of the mid-surface to be found, a second straight line of the first side surface, and a third straight line of the second side surface from the plurality of fitted straight lines; 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.
3. The method according to claim 2, characterized in that The step of selecting the first straight line of the mid-surface to be found, 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 comprises: Determine the slope of each fitted straight line and the number of points included in each fitted straight line; Determine the angle between each fitted straight line and other fitted straight lines; According to the linear slopes of the fitted straight lines, the number of points included in the fitted straight lines and the angles between the fitted straight lines and other fitted straight lines, the first straight line of the mid-surface to be found, the second straight line of the first side surface and the third straight line of the second side surface are determined.
4. The method according to claim 3, characterized in that The determining, according to the linear slopes of the respective fitted straight lines, the number of points included in the respective fitted straight lines, and the angles between the respective fitted straight lines and other fitted straight lines, the first straight line of the mid-surface to be found, the second straight line of the first side surface, and the third straight line of the second side surface comprises: Determine a straight line whose number of points is greater than a preset number and whose slope is zero as the first straight line of the mid-surface to be found; Determine a straight line whose number of points is greater than a preset number, whose slope belongs to a first interval, and whose angle with the first straight line belongs to a preset angle interval as a second straight line of the first side surface; A straight line whose number of points is greater than a preset number, whose slope belongs to the second interval and whose angle with the first straight line belongs to the preset angle interval is determined as a third straight line of the second side surface.
5. The method according to claim 2, characterized in that: The 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 comprises: 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; Obtaining a 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 a 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; 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.
6. The method according to claim 5, characterized in that The 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 comprises: Combining the first straight line equation and the second straight line equation to obtain a first straight line equation system; Solving the first straight line equation group to obtain the first side point; Combining the first straight line equation and the third straight line equation to obtain a second straight line equation group; The second side point is obtained by solving the second straight line equation group.
7. The method according to claim 1, characterized in that The determining the first side point and the second side point according to the plurality of fitting straight lines comprises: Identifying a reference straight line parallel to the mid-surface to be found among the plurality of fitting straight lines; Acquire a first reference straight line and a second reference straight line perpendicular to the reference straight line; 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.
8. The method according to claim 7, characterized in that The determining the first side point and the second side point according to the first reference straight line, the second reference straight line and the target point cloud comprises: Determine a plurality of first distances between each point in the target point cloud and the first reference straight line; Determine a plurality of second distances between each point in the target point cloud and the second reference straight line; The first side point and the second side point are determined according to the plurality of first distances and the plurality of second distances.
9. The method according to claim 8, characterized in that The determining the first side point and the second side point according to the plurality of first distances and the plurality of second distances comprises: Determine a point corresponding to the smallest first distance among the multiple first distances as the first side point; A point corresponding to the smallest second distance among the multiple second distances is determined as the second side point.
10. The method according to claim 1, characterized in that The step of determining the center coordinates of the mid-surface to be found in the direction of the second preset axis according to the first side point, the second side point and the preset axis offset comprises: Acquire a first coordinate of the first side point and a second coordinate of the second side point, wherein the first coordinate includes a first coordinate value in the direction of the second preset axis, and the second coordinate includes a second coordinate value in the direction of the second preset axis; Substitute the first coordinate value, the second coordinate value and the preset axis offset into the center coordinate calculation formula to calculate the center coordinate of the mid-surface to be found in the direction of the second preset axis. The center coordinate formula is: Q=(P1+P2) / 2-D Among them, Q represents the center coordinate of the mid-surface to be found 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.
11. The method according to any one of claims 1 to 10, characterized in that: The step of performing data processing on the initial point cloud to obtain a target point cloud includes: Extracting the center line of the initial point cloud to obtain a first intermediate point cloud; Performing coordinate transformation on the first intermediate point cloud to obtain a second intermediate point cloud; The second intermediate point cloud is filtered to obtain the target point cloud.
12. A pipe centering device, characterized in that: The device comprises: The pipe scanning module is used to scan the pipe using a line laser sensor to obtain an initial point cloud; A data processing module, used for performing data processing on the initial point cloud to obtain a target point cloud; A straight line fitting module, used for performing straight line fitting on the target point cloud to obtain a plurality of fitting straight lines; A side point determination module, configured to determine a first side point and a second side point according to the plurality of fitted straight lines, wherein the first side point is a point on a point cloud of a first side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in a first preset axis direction, and the second side point is a point on a point cloud of a second side surface adjacent to the middle surface to be found of the pipe having the same preset axis coordinate value in the first preset axis direction; A coordinate determination module is used to determine the center coordinates of the mid-surface to be found in the direction of the second preset axis based on 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.
13. An electronic device, characterized in that: Including processor and memory, The memory is used to store codes and related data; The processor is used to execute the code in the memory to implement the pipe centering method according to any one of claims 1 to 11.
14. A storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the pipe centering method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Elliptical tube centering method and system, electronic equipment and storage medium
CN117123922A
Pipe centering method based on machine vision and laser cutting method
CN117123931A
Pipeline center line identification method and system, computer equipment and storage medium
CN118397246A
Shaft center line offset and cage guide spacing measurement method based on point cloud technology
CN118999413A
Industrial pipeline center point auxiliary marking device
CN221291282U
Cited By
Pipe online multi-dimensional detection and adaptive correction integrated system and method
CN122644904A