A geometric feature extraction method and system suitable for pipeline 3D reconstruction
By performing feature extraction and preprocessing of pipeline three-dimensional laser point cloud data, combined with iterative least squares circle fitting and elevation interpolation technology, the problems of low efficiency and large error of pipeline three-dimensional reconstruction in the existing technology are solved, and high-precision and high-efficiency three-dimensional reconstruction of pipelines are achieved.
Patent Information
- Application Number
- CN202411691640.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-01
AI Technical Summary
The prior art is inefficient and has large errors in three-dimensional reconstruction of pipelines, especially when there are many pipes, complex structures and mutual occlusion.
A geometric feature extraction method suitable for three-dimensional reconstruction of pipelines is proposed. By collecting three-dimensional laser point cloud data, pre-processing the point cloud using straight through filtering and rotation matrix, the central axis and radius information of straight and bent pipes is extracted, and the iterative least squares circle fitting and elevation interpolation technology is combined to achieve high-precision three-dimensional reconstruction of pipelines.
It improves the accuracy and accuracy of pipeline three-dimensional reconstruction, enhances reconstruction efficiency, and is suitable for pipeline three-dimensional reconstruction of complex structures.
Smart Images

Figure CN119741421A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser point cloud data feature extraction, and in particular to a geometric feature extraction method and system suitable for three-dimensional reconstruction of pipelines. Background Art
[0002] Pipelines are basic components of many industrial sites such as power, oil, and chemical plants, and are used for short- and long-distance transportation of liquids or gases. With economic development and optimization of industrial structure, a large number of industrial plants are facing industrial upgrading, and pipeline 3D reconstruction and digitization have become an important means to understand the current status of the factory. Due to the large number of factory pipelines, complex structures, and the mutual obstruction of many pipelines, the efficiency of 3D reconstruction of pipelines using traditional industrial measurement methods is low. In addition, there will be an error of about 10%-20% in the design drawings, and the 3D reconstruction of pipelines using design drawings will result in large errors.
[0003] As a real-scene reproduction technology, 3D laser scanning technology can obtain 3D point cloud data that truly describes the pipeline shape by performing 3D laser scanning on the pipeline, and its relative position accuracy can reach the millimeter and sub-millimeter level. Using 3D laser point cloud data to perform 3D reconstruction of pipelines has become a more accurate and efficient means.
[0004] Therefore, it is necessary to propose a geometric feature extraction method and system suitable for pipeline 3D reconstruction, so as to realize high-precision pipeline 3D reconstruction using laser point cloud data. Summary of the invention
[0005] In view of this, the present invention proposes a method and system for extracting geometric features suitable for three-dimensional reconstruction of pipelines, so as to at least partially solve the problems of the prior art or propose an alternative method and system for extracting geometric features suitable for three-dimensional reconstruction of pipelines.
[0006] To achieve the above object, a first aspect of the present invention provides a geometric feature extraction method suitable for three-dimensional reconstruction of a pipeline, the extraction method comprising:
[0007] A geometric feature extraction method suitable for pipeline 3D reconstruction, comprising:
[0008] Step 1: Collect the original three-dimensional laser point cloud data with the pipeline as the main target, and perform straight-through filtering on the original point cloud to obtain a straight pipeline point cloud; the collected original pipeline point cloud must cover more than 1 / 3 of the circumference of the outer wall of the pipeline; the method of performing straight-through filtering on the original point cloud to obtain the straight pipeline point cloud is: select two points s1 and s2 on the same side of the pipeline to construct the pipeline constraint direction h, and use the set distance threshold d and the straight-through filtering algorithm to perform straight-through filtering on the original point cloud, remove the point cloud of the surrounding environment, and obtain the straight pipeline point cloud;
[0009] Step 2: Rotate the straight pipeline point cloud to obtain the rotated straight pipeline point cloud and remove the noise data; the specific method is:
[0010] Rotate the straight pipeline point cloud, calculate the rotation matrix of the constraint direction h to rotate to the X-axis, and use the rotation matrix to rotate the straight pipeline point cloud to obtain the rotated straight pipeline point cloud;
[0011] The outer diameter L of the pipeline is initially obtained, and the point cloud within the threshold d range at two points s1 and s2 on the same side of the pipeline is used to perform iterative least squares circle fitting to preliminarily determine the outer diameter L of the pipeline;
[0012] The rotated straight pipeline point cloud is filtered twice, and the pipeline constraint direction h is constructed by selecting two points s1 and s2 on the same side of the pipeline. The original point cloud is filtered by the straight-through filtering algorithm through the set distance threshold d. The rotated straight pipe point cloud is filtered twice for the threshold value to remove noise data;
[0013] Step 3: Extract the central axis and radius of the rotated straight pipeline point cloud after removing the noise data; the specific method is: slice the point cloud within the threshold d range at two points s1 and s2 on the same side of the pipeline along the coordinate axis with an interval i and a thickness t, perform iterative least squares circle fitting on each point cloud slice, and extract the center and diameter of the circle;
[0014] According to the center and diameter of the slice fitting, the central axis and outer diameter of the pipeline are fitted. The center of all slice fitting circles is used as the central axis point set of the straight pipe. The central axis point set is fitted to the central axis P1P2 of the pipeline through the random consistency sampling RANSAC algorithm. The median of all slice fitting diameters is used as the outer diameter of the straight pipe.
[0015] Reversely rotate the central axis, calculate the rotation matrix R2 from the X axis to h, rotate the central axis P1P2, and obtain the central axis Q1Q2 of the unrotated point cloud in the constraint direction h;
[0016] Step 4: Extract the central axis and radius of the rotated elbow point cloud after removing the noise data; the specific method is: first extract the straight pipes A and B on both sides of the elbow point cloud;
[0017] The coordinates of the bent pipe point cloud are rotated, and the plane Z is constructed using the straight pipes A and B on both sides of the bent pipe. The rotation matrix R3 of the plane Z rotation parallel to the XOY plane is calculated, and the bent pipe point cloud is rotated using R3 to obtain the rotated bent pipe point cloud;
[0018] The bending center O of the elbow is obtained according to the bending radius c of the elbow, the central axis angle point J of the straight pipes A and B is calculated, and the intersection point J is translated along the negative direction of the X-axis and the Y-axis by a distance c to obtain the center O of the elbow;
[0019] The curved pipe axis point set P3 is obtained by arc interpolation. The curved pipe center axis point set P3 is obtained by arc interpolation using the center O, the bending radius c, and the set angle increment;
[0020] Use the elbow point cloud for elevation interpolation, form a kd-tree for spatial division of the elbow point cloud, and find the starting point P of the elbow centerline point set P3 os With P oe The closest neighbor points are P s With P e , using P s With P e Perform inverse distance elevation interpolation on the points in P3 in the elevation interval [h1, h2] to obtain the three-dimensional central axis point set of the curved pipe. The diameter of the curved pipe is the same as the radius of the straight pipe extracted in the above step;
[0021] Step 5: Save the extracted pipeline centerline and radius information in Extensible Markup Language (XML), import the results into the design software, and create the geometric features of the three-dimensional pipeline; finally, edit and complete the reconstruction of the three-dimensional pipeline;
[0022] The geometric feature information of the center axis and radius of the straight pipe and the curved pipe extracted by the above method is used to realize the three-dimensional reconstruction of the pipe.
[0023] In the above method, in step 1, the original point cloud is subjected to straight-through filtering to obtain the original point cloud in the straight pipe point cloud by the following steps:
[0024] Step 101: Find the maximum coordinate point m(X max ,Y max ,Z max ) and the minimum point n(X min ,Y min ,Z min );
[0025] Step 102: Use m and n to construct an AABB bounding box [(X min ,Y min ,Z min ),(X max ,Y max ,Z max )], expand the bounding box according to the threshold d, and get the new bounding box [(X min -d,Y min -d,Z min -d),(X max +d,Y max +d,Z max +d)];
[0026] Step 103: Traverse the point cloud coordinates (X, Y, Z) in the original point cloud and use the following conditional expression to determine whether the point is within the bounding box:
[0027] X min -d≤X≤X max +d
[0028] Y min -d≤Y≤Y max +d
[0029] Z min -d≤Z≤Z max +d
[0030] If the condition is met, the coordinates of the point cloud point are retained; if the condition is not met, the point cloud point is deleted, and finally the point cloud point within the bounding box is obtained;
[0031] In the above method, in step 2, rotating the straight pipeline point cloud to obtain the rotated straight pipeline point cloud includes the following sub-steps:
[0032] Step 201: Construct a line segment S based on the two points s1 and s2 on the same side of the selected pipeline. 1-1 S 2-2 , use the rotation model to calculate the rotation matrix R between the two points s1s2 on the same side of the pipeline and the X axis
[0033]
[0034] Among them, α is the construction line segment S 1-1 S 2-2 The rotation angle around the x-axis, β is the construction line segment S 1-1 S 2-2 The rotation angle around the y axis, γ is the angle to construct the line segment S 1-1 S 2-2 The rotation angle around the z axis;
[0035] Step 202: According to the rotation matrix R, traverse the point cloud points to be rotated, and use matrix multiplication to rotate the original point cloud point coordinates T1[x1, y1, z1] to T2[x2, y2, z2] to obtain the rotated straight line pipeline point cloud;
[0036] T2=RT1
[0037] Among them, R is a 3*3 rotation matrix, T1 is the original point cloud coordinate, and T2 is the rotated point cloud coordinate;
[0038] In the above method, in step 2, obtaining the pipeline outer diameter L includes the following steps:
[0039] Step 210: Based on the constraint point S1 (x1, y1, z1) on the same side of the pipeline, a bounding box [(X1-d, Y1-d, Z1-d), (X1+d, Y1+d, Z1+d)] is constructed using the threshold d, and the point cloud is filtered using the bounding box to obtain a bounding box point cloud;
[0040] Step 211: fitting the bounding box point cloud using the least squares circle fitting algorithm to obtain the circle center O1 and the diameter L1;
[0041] Step 212: for another pipeline constraint point S2 (x2, y2, z2), obtain the center O2 and the diameter L2 using steps 210 and 211;
[0042] Step 213: Preliminarily determine the outer diameter of the pipeline L = (L1 + L2) / 2 based on the radius D1 and D2
[0043] In the above method, in step 3, extracting the center and diameter of the circle includes the following steps:
[0044] Step 301: Take the initial direction point S1 as the starting point P and the initial direction point S2 as the end point E to construct a vector
[0045] Step 302: Calculate the The point T with a progressive length i from the end point E in the direction is calculated as follows:
[0046]
[0047] in for The unit vector of
[0048] Step 303: Use the point cloud of the threshold t range at two points s1 and s2 on the same side of the pipeline to perform iterative least squares circle fitting to preliminarily determine the outer diameter L of the pipeline; T ,y T ,z T ) point as the center to build an AABB bounding box [(x T -t,y T -t,z T -t),(x T +t,y T +t,z T +t)], traverse the straight tube point cloud and obtain the point cloud within the bounding box;
[0049] Step 304: Fit the bounding box point cloud using the least squares circle fitting algorithm to obtain the circle center O1 and the diameter L1;
[0050] Step 305: Assign the end point E to the starting point P, and assign point T to the end point E, forming a new vector Repeat steps 302 to 304 to obtain the center O n With diameter D n , n is the number of iterations;
[0051] In the above method, in step 4, obtaining the rotated elbow point cloud comprises the following steps:
[0052] Step 401: Calculate the normal N of the plane Z formed by the straight pipes A and B on both sides of the curved pipe point cloud. The calculation formula is as follows:
[0053]
[0054] in, is the vector formed by the starting point and end point of the straight pipe A, is the vector formed by the starting point and end point of the straight pipe B,
[0055] Step 402: Calculation Normal to XOY plane The rotation matrix R is calculated as follows:
[0056]
[0057] Among them, α is The rotation angle around the x-axis, β is The rotation angle around the y-axis, γ is The rotation angle around the z axis,
[0058] Traverse each curve point cloud point P, use matrix multiplication to calculate, and get the rotated point coordinates T. The calculation formula is as follows:
[0059] T(x,y,z)=RP(x,y,z)
[0060] In the above method, in step 4, the bend pipe center O includes the following steps:
[0061] Step 410: Using the rotation matrix R, the starting point and the end point of the straight tube center axis A and the straight tube center axis B are rotated to obtain the rotated straight tube center axis A. t With B t ;
[0062] Step 411: Calculate the central axis A t B t The intersection point J is calculated as follows:
[0063]
[0064] b1=y sa -k1x sa
[0065]
[0066] b2=y sb -k2x sb
[0067]
[0068] Among them, X is the horizontal coordinate of the intersection point J, and Y is the vertical coordinate of the intersection point J: sa ,y sa A t The starting point abscissa and ordinate: x ea ,y ea A t The end point abscissa and ordinate: x sb ,y sb For B t The horizontal and vertical coordinates of the starting point. eb ,y eb For B t The horizontal and vertical coordinates of the end point;
[0069] Step 412: Calculate the center O of the bend of the bend according to the given bend radius c. The calculation formula is as follows:
[0070] X o =Xc
[0071] Y o =Yc
[0072] Among them, X o , Y o To calculate the abscissa and ordinate of the center O of the bend of the elbow: X is the abscissa of the intersection point J, and Y is the ordinate of the intersection point J;
[0073] In the above method, in step 4, the elbow centerline point set P3 includes the following steps:
[0074] Step 420: Calculate the central axis point set P3 of the bent pipe by setting the initial rotation angle θ and the incremental rotation angle Δθ;
[0075] X n =X o +cos -1 (θ+Δθ*n)
[0076] Y n =Y o +sin -1 (θ+Δθ*n)
[0077] Among them, X n , Y n is the horizontal and vertical coordinates of the nth elbow axis point, Xo , Y o is the horizontal and vertical coordinates of the bending center O of the elbow, and n is the number of recursive iterations;
[0078] In the above method, in step 4, the diameter of the elbow comprises the following steps:
[0079] Step 430: Use the curved pipe point cloud to perform elevation interpolation, form a kd-tree from the curved pipe point cloud to perform spatial division, and find the starting point P of the curved pipe centerline point set P3 os With the end point P oe The closest neighbor points are P s (x s ,y s ,z s ) and P e (x e ,y e ,z e )
[0080] Step 431: traverse point p in the central axis point set P3, and perform elevation interpolation on point p. The calculation formula is as follows:
[0081]
[0082]
[0083] Among them, x s ,y s ,z s P s The three-dimensional coordinates of the point, x e ,y e ,z e P e The three-dimensional coordinates of point P, z is the elevation value of point P;
[0084] Step 432: assign values to the radii of the curved pipes according to the radii of the straight pipes AB;
[0085] In the above method, in step 1, the acquisition method of the three-dimensional laser original point cloud data with the pipeline as the main target includes but is not limited to: a handheld laser scanner, a fixed-station laser scanner, a vehicle-mounted laser scanner, and an airborne laser scanner;
[0086] A geometric feature extraction system suitable for pipeline 3D reconstruction, comprising:
[0087] An acquisition module is used to acquire three-dimensional laser point cloud data with the pipeline as the main object;
[0088] A storage module, which is used to store laser point cloud data, wherein the laser point cloud data includes pipeline point cloud data of a certain range including the pipeline object and a storage computer program;
[0089] A processing module is used to implement any one of the steps of the above method applicable to the geometric feature extraction method for three-dimensional reconstruction of the pipeline when executing the computer program; an output module is used to reconstruct the pipeline in three dimensions using the extracted center line and radius data.
[0090] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements any one of the steps of the above-mentioned method applicable to the step of the geometric feature extraction method for three-dimensional reconstruction of a pipeline.
[0091] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements any one of the steps of the above-mentioned method for extracting geometric features for three-dimensional reconstruction of a pipeline.
[0092] The present invention provides a method and system for extracting geometric features suitable for three-dimensional reconstruction of pipelines. The three-dimensional laser point cloud data of the pipeline is collected, two points on the same side of the straight pipe are interactively selected to determine the initial constraint direction, and the point cloud is filtered according to the constraint direction using a straight-through filtering method to remove non-pipeline noise points. The pipeline point cloud is sliced using the constraint direction, and the straight pipe center axis point and the outer diameter of the pipeline are extracted using an iterative least squares circle fitting method; the two-dimensional center axis point of the curve is extracted using projection transformation, and the three-dimensional spatial position of the center axis point of the curve is restored through elevation matching; the center axis point of the straight pipe and the center axis point of the elbow are merged to obtain a complete three-dimensional center axis and radius information of the pipeline, and finally, the extracted three-dimensional center axis and radius information of the pipeline are used to perform three-dimensional reconstruction of the pipeline. The method and system of the present invention can achieve higher precision and accuracy in three-dimensional reconstruction of pipelines, higher efficiency, and is suitable for a variety of scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0094] Figure 1 The present invention provides a geometric feature extraction method and system flow chart suitable for pipeline three-dimensional reconstruction.
[0095] Figure 2 This is a schematic diagram of the straight tube extraction provided in the method of the present invention.
[0096] Figure 3 It is a schematic diagram of elbow axis extraction provided in the method of the present invention.
[0097] Figure 4 Schematic diagram of a geometric feature extraction system suitable for three-dimensional reconstruction of pipelines provided by the present invention.
[0098] Figure 5 This is a schematic diagram of the structure of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0099] Combine the following Figure 1 The present invention describes a method and system for extracting geometric features suitable for three-dimensional reconstruction of pipelines:
[0100] Embodiment 1
[0101] A geometric feature extraction method suitable for pipeline 3D reconstruction includes the following steps:
[0102] 1. Collect the original three-dimensional laser point cloud data with the pipeline as the main target, and perform straight-through filtering on the original point cloud to obtain the straight pipeline point cloud; the acquisition method of the original three-dimensional laser point cloud data with the pipeline as the main target includes but is not limited to: handheld laser scanner, fixed-station laser scanner, vehicle-mounted laser scanner, airborne laser scanner; the collected original pipeline point cloud must cover more than 1 / 3 of the circumference of the outer wall of the pipeline; the method of performing straight-through filtering on the original point cloud to obtain the straight pipeline point cloud is: select two points s1 and s2 on the same side of the pipeline to construct the pipeline constraint direction h, and use the set distance threshold d to perform straight-through filtering on the original point cloud using the straight-through filtering algorithm to remove the point cloud of the surrounding environment to obtain the straight pipeline point cloud. The calculation method is as follows:
[0103] According to the three-dimensional coordinates of the two points S1 and S2 on the same side of the pipeline, find the maximum coordinate point m(X max ,Y max ,Z max ) and the minimum point n(X min ,Y min ,Z min );
[0104] Use m, n to construct the AABB bounding box [(X min ,Y min ,Z min ),(X max ,Y max ,Z max )], expand the bounding box according to the threshold d, and get the new bounding box [(X min -d,Y min -d,Z min -d),(Xmax +d,Y max +d,Z max +d)];
[0105] Traverse the point cloud coordinates (X, Y, Z) in the original point cloud and use the following conditional expression to determine whether the point is within the bounding box:
[0106] X min -d≤X≤X max +d
[0107] Y min -d≤Y≤Y max +d
[0108] Z min -d≤Z≤Z max +d
[0109] If the condition is met, the coordinates of the point cloud point are retained. If the condition is not met, the point cloud point is deleted, and finally the point cloud point within the bounding box is obtained.
[0110] Step 2: Rotate the straight pipeline point cloud to obtain the rotated straight pipeline point cloud and remove the noise data; the specific method is:
[0111] Rotate the straight pipeline point cloud, calculate the rotation matrix of the constraint direction h to the X-axis, and use the rotation matrix to rotate the pipeline point cloud to obtain the rotated straight pipeline point cloud. The calculation method is as follows:
[0112] (1) Construct line segment S based on the two points s1 and s2 on the same side of the selected pipeline 1-1 S 2-2 , use the rotation model to calculate the rotation matrix R between the two points s1s2 on the same side of the pipeline and the X axis
[0113]
[0114] Among them, α is the construction line segment S 1-1 S 2-2 The rotation angle around the x-axis, β is the construction line segment S 1-1 S 2-2 The rotation angle around the y axis, γ is the angle to construct the line segment S 1-1 S 2-2 The rotation angle around the z-axis.
[0115] (2) According to the rotation matrix R, traverse the point cloud points to be rotated, and use matrix multiplication to rotate the original point cloud point coordinates T1[x1,y1,z1] to T2[x2,y2,z2]. The point cloud of the linear pipeline after rotation is obtained.
[0116] T2=RT1
[0117] Among them, R is a 3*3 rotation matrix, T1 is the original point cloud coordinate, and T2 is the rotated point cloud coordinate;
[0118] The outer diameter L of the pipeline is initially obtained, and the point cloud within the threshold d range at two points s1 and s2 on the same side of the pipeline is used to perform iterative least squares circle fitting, and the outer diameter L of the pipeline is initially determined. The determination method is as follows:
[0119] (1) Based on the constraint point S1 (x1, y1, z1) on the same side of the pipeline, a bounding box [(X1-d, Y1-d, Z1-d), (X1+d, Y1+d, Z1+d)] is constructed using the threshold d. The point cloud is filtered using the bounding box to obtain the bounding box point cloud;
[0120] (2) Use the least squares circle fitting algorithm to fit the bounding box point cloud to obtain the center O1 and diameter L1;
[0121] (3) For another pipeline constraint point S2 (x2, y2, z2), use steps (1) and (2) to obtain the center O2 and diameter L2;
[0122] (4) Based on the radii D1 and D2, preliminarily determine the outer diameter of the pipeline L = (L1 + L2) / 2.
[0123] The rotated straight pipeline point cloud is filtered twice, and the pipeline constraint direction h is constructed by selecting two points s1 and s2 on the same side of the pipeline. The original point cloud is filtered by the straight-through filtering algorithm through the set distance threshold d. The rotated straight pipe point cloud is filtered twice for the threshold value to remove noise data;
[0124] 3. Extract the central axis and radius of the rotated straight pipeline point cloud after removing the noise data; the specific method is: use the point cloud within the threshold d range of two points s1 and s2 on the same side of the pipeline to slice the point cloud along the coordinate axis with an interval i and a thickness t, perform iterative least squares circle fitting on each point cloud slice, and extract the center and diameter of the circle. The calculation method is as follows:
[0125] (1) Take the initial direction point S1 as the starting point P and the initial direction point S2 as the end point E to construct the vector
[0126] (2) Calculate the edge The point T with a progressive length i from the end point E in the direction is calculated as follows:
[0127]
[0128] in for The unit vector of
[0129] (3) The point cloud of the thickness range t at two points s1 and s2 on the same side of the pipeline is used to perform iterative least squares circle fitting to preliminarily determine the outer diameter L of the pipeline; T ,y T ,z T ) point as the center to build an AABB bounding box [(x T -t,y T -t,z T -t),(x T +t,y T +t,z T +t)], traverse the straight tube point cloud and obtain the point cloud within the bounding box;
[0130] (4) Use the least squares circle fitting algorithm to fit the bounding box point cloud to obtain the center O1 and diameter L1;
[0131] (5) Assign the end point E to the starting point P, and assign point T to the end point E to form a new vector Repeat steps (2) to (4) to obtain the center of the circle O. n With diameter D n , n is the number of iterations;
[0132] According to the center and diameter of the slice fitting, the central axis and outer diameter of the pipeline are fitted. The center of all slice fitting circles is used as the central axis point set of the straight pipe. The central axis point set is fitted to the central axis P1P2 of the pipeline through the random consistency sampling RANSAC algorithm. The median of all slice fitting diameters is used as the outer diameter of the straight pipe.
[0133] Reversely rotate the central axis, calculate the rotation matrix R2 from the X axis to h, rotate the central axis P1P2, and obtain the central axis Q1Q2 of the unrotated point cloud in the constraint direction h;
[0134] 4. Extract the central axis and radius of the rotated elbow point cloud after removing the noise data; the specific method is: first extract the straight pipes A and B on both sides of the elbow point cloud;
[0135] The coordinates of the bent pipe point cloud are rotated, and plane Z is constructed using straight pipes A and B. The rotation matrix R3 of plane Z parallel to the XOY plane is calculated. The bent pipe point cloud is rotated using R3 to obtain the rotated bent pipe point cloud. The calculation method is as follows:
[0136] (1) Calculation: For the point cloud of the elbow, first extract the normal N of the plane Z formed by the straight pipes A and B on both sides of the elbow. The calculation formula is as follows:
[0137]
[0138] in, is the vector formed by the starting point and end point of the straight pipe A, The vector formed by the start and end points of straight pipe B.
[0139] (2) Calculation Normal to XOY plane The rotation matrix R is calculated as follows:
[0140]
[0141] Among them, α is The rotation angle around the x-axis, β is The rotation angle around the y-axis, γ is The rotation angle around the z-axis.
[0142] Traverse each curve point cloud point P, use matrix multiplication to calculate, and get the rotated point coordinates T. The calculation formula is as follows:
[0143] T(x,y,z)=RP(x,y,z)
[0144] According to the bending radius c of the elbow, the bending center O of the elbow is obtained, and the central axis corner point J of the straight pipes A and B is calculated. The intersection point J is translated along the negative direction of the X-axis and the Y-axis by a distance c to obtain the center O of the elbow. The calculation method is as follows:
[0145] (1) Using the rotation matrix R, the starting point and end point of the straight tube center axis A and the straight tube center axis B are rotated to obtain the rotated straight tube center axis A t With B t .
[0146] (2) Calculate the center axis A t B t The intersection point J is calculated as follows:
[0147]
[0148] b1=y sa -k1x sa
[0149]
[0150] b2=y sb -k2x sb
[0151]
[0152] Where, X is the horizontal coordinate of the intersection point J, and Y is the vertical coordinate of the intersection point J. sa ,y sa A t The horizontal and vertical coordinates of the starting point. ea ,y ea At The horizontal and vertical coordinates of the end point. sb ,y sb For B t The horizontal and vertical coordinates of the starting point. eb ,y eb For B t The horizontal and vertical coordinates of the end point;
[0153] (3) According to the given elbow radius c, calculate the center O of the elbow. The calculation formula is as follows:
[0154] X o =Xc
[0155] Y o =Yc
[0156] Among them, X o , Y o To calculate the horizontal and vertical coordinates of the center O of the bend of the elbow. X is the horizontal coordinate of the intersection point J, and Y is the vertical coordinate of the intersection point J.
[0157] The curved pipe axis point set P3 is obtained by arc interpolation. The curved pipe center axis point set P3 is obtained by arc interpolation using the center O, the bending radius c, and the set angle increment. The calculation method is as follows:
[0158] (1) By setting the initial rotation angle θ and the incremental rotation angle Δθ, the center axis point set P3 of the bent pipe is calculated;
[0159] X n =X o +cos -1 (θ+Δθ*n)
[0160] Y n =Y o +sin -1 (θ+Δθ*n)
[0161] Among them, X n , Y n is the horizontal and vertical coordinates of the nth elbow axis point, X o , Y o is the horizontal and vertical coordinates of the bending center O of the elbow, and n is the number of recursive iterations;
[0162] Use the elbow point cloud for elevation interpolation, form a kd-tree for spatial division of the elbow point cloud, and find the starting point P of the elbow centerline point set P3 os With P oe The closest neighbor points are P s With P e , using P s With P eThe inverse distance elevation interpolation is performed on the points in P3 in the elevation interval [h1,h2] to obtain the three-dimensional centerline point set of the elbow. The calculation method is as follows:
[0163] (1) Use the elbow point cloud for elevation interpolation, form a kd-tree for spatial division of the elbow point cloud, and find the starting point P of the elbow centerline point set P3 os With the end point P oe The closest neighbor points are P s (x s ,y s ,z s ) and P e (x e ,y e ,z e ).
[0164] (2) Traverse point p in the central axis point set P3 and perform elevation interpolation on point p. The calculation formula is as follows:
[0165]
[0166] Among them, x s ,y s ,z s P s The three-dimensional coordinates of the point, x e ,y e ,z e P e The three-dimensional coordinates of point P, z is the elevation value of point P.
[0167] (3) According to the radius of the straight pipe AB, assign values to the radius of the curved pipe respectively.
[0168] 5. Save the extracted pipeline centerline and radius information in Extensible Markup Language (XML). Import the results into the industrial design software SmartPlant3D to create the geometric features of the 3D pipeline. Finally, edit the pipeline properties and related business properties such as fluid to complete the reconstruction of the 3D pipeline.
[0169] Embodiment 2
[0170] On the basis of the above method embodiment, a geometric feature extraction system suitable for pipeline three-dimensional reconstruction provided by the present invention is further described. The geometric feature extraction system suitable for pipeline three-dimensional reconstruction described below and the geometric feature extraction method suitable for pipeline three-dimensional reconstruction described above can refer to each other.
[0171] like Figure 4 As shown, the system includes a collection module 201, a storage module 202, a processing module 203, and an output module 204, wherein:
[0172] The acquisition module 201 is used to acquire laser point cloud data, and uses a three-dimensional laser scanner to acquire pipeline laser point cloud data.
[0173] The storage module 202 is used to store laser point cloud data, wherein the laser point cloud data includes pipeline point cloud data within a certain range including the pipeline object.
[0174] The processing module 203 is used to extract the centerline and radius of the pipeline from the point cloud data of the storage module. Two points on the same side of the straight pipe are interactively selected to determine the angle between the constraint direction and the coordinate axis direction. If the angle is greater than the threshold, the pipeline point cloud is rotated to a position where the constraint direction is parallel to the coordinate axis, and the region of interest is extracted through straight-through filtering and point-to-line distance constraints; the region of interest is sliced, and iterative least squares circle fitting is used to extract the centerline point of the straight pipe and the outer diameter of the pipe; the projection idea is used to extract the centerline point of the bend in the coordinate plane, and the three-dimensional spatial position of the centerline point of the bend is restored through elevation matching; finally, the centerline point of the straight pipe is merged with the centerline point of the elbow to obtain the centerline characteristics and radius of the pipeline.
[0175] The output module 204 uses the extracted centerline and radius data to perform three-dimensional reconstruction of the pipeline.
[0176] Embodiment 3
[0177] On the basis of the first and second embodiments, Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor (processor0) 310, a communication interface (Communications Interface) 320, a memory (memory) 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions of the memory 330 to execute a geometric feature extraction method suitable for three-dimensional reconstruction of a pipeline, the method comprising: collecting three-dimensional laser point cloud data of the pipeline, interactively selecting two points on the same side of the straight pipe to determine the initial constraint direction, filtering the above point cloud using a straight-through filtering method according to the constraint direction, and removing non-pipeline noise points. The pipeline point cloud is sliced using the constraint direction, and the straight pipe center axis point and the outer diameter of the pipeline are extracted by iterative least squares circle fitting; the two-dimensional center axis point of the bend is extracted by projection conversion, and the three-dimensional spatial position of the center axis point of the bend is restored by elevation matching; the center axis point of the straight pipe and the center axis point of the elbow are merged to obtain the complete three-dimensional center axis and radius information of the pipeline, and finally the extracted pipeline geometric feature information is used to perform three-dimensional reconstruction of the pipeline. In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical form of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution can be expressed in the form of a software product, and the computer software product is stored in a storage medium, which contains several instructions for a computer device (which can be a personal computer, a server) to execute all or part of the steps of the method described in the example of the format of the present invention. The aforementioned storage medium includes, but is not limited to: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store programs.
[0178] Embodiment 4
[0179] On the basis of embodiments one to three, on the other hand, the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by the computer, the computer can execute the geometric feature extraction method suitable for three-dimensional reconstruction of the pipeline provided by the above methods, the method includes: collecting three-dimensional laser point cloud data of the pipeline, interactively selecting two points on the same side of the straight pipe to determine the initial constraint direction, filtering the above point cloud according to the constraint direction using a straight-through filtering method to remove non-pipeline noise. Slice the pipeline point cloud using the constraint direction, extract the straight pipe center axis point and the outer diameter of the pipeline using an iterative least squares circle fitting method; extract the two-dimensional center axis point of the curve using projection transformation, and restore the three-dimensional spatial position of the center axis point of the curve through elevation matching; merge the center axis point of the straight pipe with the center axis point of the elbow to obtain the complete three-dimensional center axis and radius information of the pipeline, and finally use the extracted pipeline geometric feature information to perform three-dimensional reconstruction of the pipeline.
[0180] The above described method, system and device embodiments are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement them without creative effort.
[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0183] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A geometric feature extraction method suitable for pipeline 3D reconstruction, characterized in that: include: Step 1: Collect the original 3D laser point cloud data with the pipeline as the main target, perform straight-through filtering on the original point cloud, and obtain the straight pipeline point cloud; The collected original point cloud of the pipeline needs to cover more than 1 / 3 of the circumference of the outer wall of the pipeline; the method of performing straight-through filtering on the original point cloud to obtain the straight pipeline point cloud is: selecting two points s1 and s2 on the same side of the pipeline to construct the pipeline constraint direction h, and using the set distance threshold d and the straight-through filtering algorithm to perform straight-through filtering on the original point cloud, remove the point cloud of the surrounding environment, and obtain the straight pipeline point cloud; Step 2: Rotate the straight pipeline point cloud to obtain the rotated straight pipeline point cloud and remove noise data; the specific method is: Rotate the straight pipeline point cloud, calculate the rotation matrix of the constraint direction h to rotate to the X-axis, and use the rotation matrix to rotate the straight pipeline point cloud to obtain the rotated straight pipeline point cloud; The outer diameter L of the pipeline is initially obtained, and the point cloud within the threshold d range at two points s1 and s2 on the same side of the pipeline is used to perform iterative least squares circle fitting to preliminarily determine the outer diameter L of the pipeline; The rotated straight pipeline point cloud is filtered twice, and the pipeline constraint direction h is constructed by selecting two points s1 and s2 on the same side of the pipeline. The original point cloud is filtered by the straight-through filtering algorithm through the set distance threshold d. The rotated straight pipe point cloud is filtered twice for the threshold value to remove noise data; Step 3: Extract the central axis and radius of the rotated straight pipeline point cloud after removing the noise data; the specific method is: slice the point cloud within the threshold d range at two points s1 and s2 on the same side of the pipeline along the coordinate axis with an interval i and a thickness t, perform iterative least squares circle fitting on each point cloud slice, and extract the center and diameter of the circle; According to the center and diameter of the slice fitting, the central axis and outer diameter of the pipeline are fitted. The center of all slice fitting circles is used as the central axis point set of the straight pipe. The central axis point set is fitted to the central axis P1P2 of the pipeline through the random consistency sampling RANSAC algorithm. The median of all slice fitting diameters is used as the outer diameter of the straight pipe. Reversely rotate the central axis, calculate the rotation matrix R2 from the X axis to h, rotate the central axis P1p2, and obtain the central axis Q1Q2 of the unrotated point cloud in the constraint direction h; Step 4: Extract the central axis and radius of the rotated elbow point cloud after removing the noise data; the specific method is: first extract the straight pipes A and B on both sides of the elbow point cloud; The coordinates of the bent pipe point cloud are rotated, and the plane Z is constructed using the straight pipes A and B on both sides of the bent pipe. The rotation matrix R3 of the plane Z rotation parallel to the XOY plane is calculated, and the bent pipe point cloud is rotated using R3 to obtain the rotated bent pipe point cloud; The bending center O of the elbow is obtained according to the bending radius c of the elbow, the central axis angle point J of the straight pipes A and B is calculated, and the intersection point J is translated along the negative direction of the X-axis and the Y-axis by a distance c to obtain the center O of the elbow; The curved pipe axis point set P3 is obtained by arc interpolation. The curved pipe center axis point set P3 is obtained by arc interpolation using the center O, the bending radius c, and the set angle increment; Use the elbow point cloud for elevation interpolation, form a kd-tree for spatial division of the elbow point cloud, and find the starting point P of the elbow centerline point set P3 os With P oe The closest neighbor points are P s With P e , using P s With P e Perform inverse distance elevation interpolation on the points in P3 in the elevation interval [h1, h2] to obtain the three-dimensional central axis point set of the curved pipe. The diameter of the curved pipe is the same as the radius of the straight pipe extracted in the above step; Step 5: Save the extracted pipeline centerline and radius information in Extensible Markup Language (XML), import the results into the design software, and create the geometric features of the three-dimensional pipeline; finally, edit and complete the reconstruction of the three-dimensional pipeline; The geometric feature information of the center axis and radius of the straight pipe and the curved pipe extracted by the above method is used to realize the three-dimensional reconstruction of the pipe.
2. A geometric feature extraction method suitable for pipeline 3D reconstruction according to claim 1, characterized in that: In step 1, the original point cloud is subjected to straight-through filtering to obtain the original point cloud in the straight pipe point cloud. The steps for determining the original point cloud are as follows: Step 101: Find the maximum coordinate point m(X max ,Y max ,Z max ) and the minimum point n(X min ,Y min ,Z min ); Step 102: Use m and n to construct an AABB bounding box [(X min ,Y min ,Z min ),(X max ,Y max ,Z max )], expand the bounding box according to the threshold d, and get the new bounding box [(X min -d,Y min -d,Z min -d),(X max +d,Y max +d,Z max +d)]; Step 103: Traverse the point cloud coordinates (X, Y, Z) in the original point cloud and use the following conditional expression to determine whether the point is within the bounding box: X min -d≤X≤X max +d Y min -d≤Y≤Y max +d Z min -d≤Z≤Z max +d If the condition is met, the coordinates of the point cloud point are retained. If the condition is not met, the point cloud point is deleted, and finally the point cloud point within the bounding box is obtained.
3. A geometric feature extraction method suitable for pipeline 3D reconstruction according to claim 1, characterized in that: In step 2, rotating the straight pipeline point cloud to obtain the rotated straight pipeline point cloud includes the following sub-steps: Step 201: Construct a line segment S based on the two points s1 and s2 on the same side of the selected pipeline. 1-1 S 2-2 , use the rotation model to calculate the rotation matrix R between the two points s1s2 on the same side of the pipeline and the X axis; Among them, α is the construction line segment S 1-1 S 2-2 The rotation angle around the x-axis, β is the angle to construct the line segment S 1-1 S 2-2 The rotation angle around the y axis, γ is the angle to construct the line segment S 1-1 S 2-2 The rotation angle around the z axis; Step 202: According to the rotation matrix R, traverse the point cloud points to be rotated, and use matrix multiplication to rotate the original point cloud point coordinates T1[x1, y1, z1] to T2[x2, y2, z2] to obtain the rotated straight line pipeline point cloud: T2=RT1 Among them, R is a 3*3 rotation matrix, T1 is the original point cloud coordinate, and T2 is the rotated point cloud coordinate.
4. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 2, obtaining the pipeline outer diameter L includes the following steps: Step 210: Based on the constraint point S1 (x1, y1, z1) on the same side of the pipeline, a bounding box [(X1-d, Y1-d, Z1-d), (X1+d, Y1+d, Z1+d)] is constructed using the threshold d, and the point cloud is filtered using the bounding box to obtain a bounding box point cloud; Step 211: fitting the bounding box point cloud using the least squares circle fitting algorithm to obtain the circle center O1 and the diameter L1; Step 212: for another pipeline constraint point S2 (x2, y2, z2), obtain the center O2 and the diameter L2 using steps 210 and 211; Step 213: Preliminarily determine the pipeline outer diameter L=(L1+L2) / 2 based on the radii D1 and D2.
5. The geometric feature extraction method suitable for pipeline 3D reconstruction according to claim 1, characterized in that: In step 3, extracting the center and diameter of the circle includes the following steps: Step 301: Take the initial direction point S1 as the starting point P and the initial direction point S2 as the end point E to construct a vector Step 302: Calculate the The point T with a progressive length i from the end point E in the direction is calculated as follows: in for The unit vector of Step 303: Use the point cloud of the threshold t range at two points s1 and s2 on the same side of the pipeline to perform iterative least squares circle fitting to preliminarily determine the outer diameter L of the pipeline; T ,y T ,z T ) point as the center to build an AABB bounding box [(x T -t,y T -t,z T -t),(x T +t,y T +t,z T +t)], traverse the straight tube point cloud and obtain the point cloud within the bounding box; Step 304: Fit the bounding box point cloud using the least squares circle fitting algorithm to obtain the circle center O1 and the diameter L1; Step 305: Assign the end point E to the starting point P, and assign point T to the end point E, forming a new vector Repeat steps 302 to 304 to obtain the center O n With diameter D n , n is the number of iterations.
6. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 4, obtaining the rotated elbow point cloud includes the following steps: Step 401: Calculate the normal N of the plane Z formed by the straight pipes A and B on both sides of the curved pipe point cloud. The calculation formula is as follows: in, is the vector formed by the starting point and end point of the straight pipe A, The vector formed by the starting point and end point of the straight pipe B: Step 402: Calculation Normal to XOY plane The rotation matrix R is calculated as follows: Among them, α is The rotation angle around the x-axis, β is The rotation angle around the y-axis, γ is The rotation angle around the z axis, Traverse each curve point cloud point P, use matrix multiplication to calculate, and get the rotated point coordinates T. The calculation formula is as follows: T(x,y,z)=RP(x,y,z).
7. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 4, the bend pipe center O includes the following steps: Step 410: Using the rotation matrix R, the starting point and the end point of the straight tube center axis A and the straight tube center axis B are rotated to obtain the rotated straight tube center axis A. t With B t ; Step 411: Calculate the central axis A t B t The intersection point J is calculated as follows: b1=y sa -k1x sa <h2 style=";text-align:left;direction:ltr">b2=y<h2 style=";text-align:left;direction:ltr"> sb <h2 style=";text-align:left;direction:ltr"> -k2x<h2 style=";text-align:left;direction:ltr"> sb Among them, X is the horizontal coordinate of the intersection point J, and Y is the vertical coordinate of the intersection point J: sa ,y sa A t The starting point abscissa and ordinate: x ea ,y ea A t The end point abscissa and ordinate: x sb ,y sb For B t The starting point abscissa and ordinate: x eb ,y eb For B t The horizontal and vertical coordinates of the end point; Step 412: Calculate the center O of the bend of the bend according to the given bend radius c. The calculation formula is as follows: X o =X-c AND o =Yc Among them, X o , Y o To calculate the abscissa and ordinate of the center O of the curved pipe: X is the abscissa of the intersection point J, and Y is the ordinate of the intersection point J.
8. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 4, the elbow centerline point set P3 includes the following steps: Step 420: Calculate the central axis point set P3 of the bent pipe by setting the initial rotation angle θ and the incremental rotation angle Δθ; X n =X o +cos -1 (θ+Δθ*n) Y n =Y o +sin -1 (θ+Δθ*n) Among them, X n , Y n is the horizontal and vertical coordinates of the nth elbow axis point, X o , Y o is the horizontal and vertical coordinates of the bending center O of the elbow, and n is the number of recursive iterations.
9. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 4, the diameter of the elbow comprises the following steps: Step 430: Use the curved pipe point cloud to perform elevation interpolation, form a kd-tree from the curved pipe point cloud to perform spatial division, and find the starting point P of the curved pipe centerline point set P3 os With the end point P oe The closest neighbor points are P s (x s ,y s ,z s ) and P e (x e ,y e ,z e ) Step 431: traverse point p in the central axis point set P3, and perform elevation interpolation on point p. The calculation formula is as follows: Among them, x s ,y s ,z s P s The three-dimensional coordinates of the point, x e ,y e ,z e P e The three-dimensional coordinates of point P, z is the elevation value of point P; Step 432: Assign values to the radii of the curved pipes according to the radii of the straight pipes AB.
10. The method for extracting geometric features suitable for three-dimensional reconstruction of pipelines according to claim 1, characterized in that: In step 1, the acquisition method of the three-dimensional laser original point cloud data with the pipeline as the main target includes but is not limited to: a handheld laser scanner, a fixed-station laser scanner, a vehicle-mounted laser scanner, and an airborne laser scanner.
11. A geometric feature extraction system suitable for three-dimensional reconstruction of pipelines, characterized in that: include: An acquisition module is used to acquire three-dimensional laser point cloud data with the pipeline as the main object; A storage module, which is used to store laser point cloud data, wherein the laser point cloud data includes pipeline point cloud data of a certain range including pipeline objects and a storage computer program; A processing module, used for implementing the steps of the geometric feature extraction method applicable to pipeline three-dimensional reconstruction as claimed in any one of claims 1 to 10 when executing the computer program; an output module, using the extracted centerline and radius data to perform three-dimensional reconstruction of the pipeline.
12. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of claims 1 to 10 for geometric feature extraction method applicable to three-dimensional reconstruction of pipelines when executing the program.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for extracting geometric features applicable to three-dimensional reconstruction of a pipeline as claimed in any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Pipeline detection method, device and equipment and storage medium
CN121504835A