Methods, devices, electronic equipment, and storage media for extracting the centerline of a pipeline.
By reconstructing the target point cloud information and performing planar projection, combined with multinomial fitting and cluster analysis, the problem of poor accuracy of pipeline centerline data was solved, and accurate quantification of pipeline deformation and orientation was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (BEIJING)
- Filing Date
- 2023-06-27
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, when the outer surface of a pipeline is partially or mostly in contact with or buried in the soil, the size and shape of the exposed outer surface of the pipeline are variable, resulting in incomplete point cloud data and affecting the accuracy of the pipeline's central axis data.
By acquiring the original point cloud information and pipeline geometry information, the target point cloud information is reconstructed, a planar projection is performed, the pipeline boundary points are fitted using a polynomial relation, and the three-dimensional central axis of the pipeline is extracted by combining cluster analysis and the least squares method.
It improves the accuracy of pipeline centerline data, enabling accurate determination of pipeline deformation and orientation, and providing a reliable basis for stress calculation.
Smart Images

Figure CN116740169B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of pipeline centerline, and more particularly to a method, apparatus, electronic device and storage medium for extracting pipeline centerline. Background Technology
[0002] Oil and gas pipelines undertake long-distance transportation of oil and gas resources. These pipelines often traverse complex geological environments. Under the influence of soil displacement caused by geological disasters such as landslides, floods, and ground subsidence, pipelines are frequently exposed, partially exposed, or suspended. Such situations accelerate pipeline wear and can even lead to pipeline rupture, necessitating emergency pipeline repair measures. Before maintenance and repair, it is necessary to calculate and analyze the safety status of the exposed, high-risk sections of the pipeline. Before conducting stress calculations, the deformation of the pipeline needs to be determined based on the state of its central axis.
[0003] Existing technologies acquire complete and accurate point cloud data of the pipe surface through 3D scanning technology, process the point cloud data based on boundary feature points to obtain point cloud boundary data, and obtain the centerline data based on the point cloud boundary data.
[0004] However, in actual working conditions, since the outer surface of the pipeline is in contact with the soil or even mostly buried in the soil, the size and shape of the exposed outer surface of the pipeline are uncertain, and the point cloud data of its surface is incomplete. The accuracy of the supplemented point cloud data is poor compared with the actual pipeline surface data. Therefore, the analysis and processing of the supplemented point cloud data by existing technology will result in poor accuracy of the extracted pipeline centerline data. Summary of the Invention
[0005] This application provides a method, apparatus, electronic device, and storage medium for extracting the centerline of a pipeline, in order to solve the problem of poor accuracy of the extracted pipeline centerline data.
[0006] In a first aspect, this application provides a method for extracting the central axis of a pipeline, comprising: obtaining target point cloud information based on original point cloud information and pipeline geometric information, wherein the original point cloud information represents the original spatial position data of collectable data points on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial position data of uncollectable data points on the pipeline surface; obtaining reconstructed point cloud information based on the original point cloud information and the target point cloud information, wherein the reconstructed point cloud information represents the discrete spatial position data of the pipeline surface supplemented by the target point cloud information; obtaining planar projection information based on the reconstructed point cloud information, wherein the planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space; and obtaining the extraction result of the three-dimensional central axis of the pipeline based on the two planar projection information.
[0007] In one possible implementation, obtaining the extraction result of the three-dimensional central axis of the pipe based on the two planar projection information includes: obtaining a target dataset based on the two planar projection information, wherein the projection planes corresponding to the two planar projection information are perpendicular to each other, and the target dataset represents a data set representing the three-dimensional central axis of the pipe; and obtaining the extraction result of the three-dimensional central axis of the pipe based on the target dataset.
[0008] In one possible implementation, obtaining planar projection information based on the reconstructed point cloud information includes: performing position coordinate transformation on the reconstructed point cloud information to obtain first point cloud information, wherein the position coordinate transformation is used to transform the position coordinates of the pipe model corresponding to the reconstructed point cloud information in a Cartesian coordinate system, so as to ensure that any end face of the pipe model is parallel to any coordinate plane of the Cartesian coordinate system, and / or to ensure that the overall orientation of the pipe model is the same as the orientation of any coordinate axis of the Cartesian coordinate system; and projecting the first point cloud information onto a plane in the three-dimensional space to obtain the planar projection information.
[0009] In one possible implementation, obtaining the target dataset based on the two planar projection information includes: obtaining two-dimensional point cloud boundary points based on the planar projection information and a boundary extraction algorithm; obtaining first point cloud boundary points based on the two-dimensional point cloud boundary points and a clustering analysis algorithm, wherein the clustering analysis algorithm is an analysis algorithm that classifies the two-dimensional point cloud boundary points by solving the Euclidean distance between them and using the shortest distance principle; obtaining a polynomial relation based on the first point cloud boundary points, wherein the polynomial relation is used to fit the discontinuous data of the first point cloud boundary points into continuous data based on the least squares principle; obtaining a two-dimensional axis relation based on the polynomial relation; sampling data from the common independent variable of the two two-dimensional axis relations to obtain a first independent variable value, wherein the two two-dimensional axis relations correspond to the two planar projection information respectively; and substituting the first independent variable value into the two two-dimensional axis relations to obtain the target dataset.
[0010] In one possible implementation, obtaining the polynomial relation based on the first point cloud boundary points includes: obtaining a sample dataset based on the first point cloud boundary points; obtaining a first mapping relationship based on the sample dataset, the first mapping relationship representing the data relationship between two mutually perpendicular decomposition directions of data points in the sample dataset; obtaining first polynomial coefficients based on the first mapping relationship, the first polynomial coefficients representing the values that minimize the sum of squared errors of all data points in the sample dataset; and obtaining the polynomial relation based on the first polynomial coefficients.
[0011] In one possible implementation, the polynomial relation includes a first relation and a second relation. Obtaining the two-dimensional axis relation based on the polynomial relation includes: obtaining the relative distance between the first relation and the second relation; if the relative distance is equal to the pipe diameter, obtaining the two-dimensional axis relation; if the relative distance is not equal to the pipe diameter, redetermining the projection plane of the reconstructed point cloud information in the three-dimensional space, and calculating the updated planar projection information to obtain the updated two-dimensional axis relation.
[0012] Secondly, this application provides a device for extracting the centerline of a pipeline, comprising:
[0013] The first processing module is used to obtain target point cloud information based on the original point cloud information and the pipeline geometry information, wherein the original point cloud information represents the original spatial position data of the data that can be collected on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial position data of the data that cannot be collected on the pipeline surface.
[0014] The second processing module is used to obtain reconstructed point cloud information based on the original point cloud information and the target point cloud information. The reconstructed point cloud information represents the discrete spatial position data of the pipe surface supplemented by the target point cloud information.
[0015] The third processing module is used to obtain planar projection information based on the reconstructed point cloud information, wherein the planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space;
[0016] The fourth processing module is used to obtain the extraction result of the three-dimensional central axis of the pipeline based on the two plane projection information.
[0017] In one possible implementation, when the fourth processing module obtains the extraction result of the three-dimensional central axis of the pipeline based on the two planar projection information, it is specifically used to: obtain a target dataset based on the two planar projection information, wherein the projection planes corresponding to the two planar projection information are perpendicular to each other, and the target dataset represents the data set of the three-dimensional central axis of the pipeline; and obtain the extraction result of the three-dimensional central axis of the pipeline based on the target dataset.
[0018] In one possible implementation, when the third processing module obtains the planar projection information based on the reconstructed point cloud information, it is specifically used to: perform position coordinate transformation on the reconstructed point cloud information to obtain first point cloud information. The position coordinate transformation is used to transform the position coordinates of the pipe model corresponding to the reconstructed point cloud information in the Cartesian coordinate system, so as to make any end face of the pipe model parallel to any coordinate plane of the Cartesian coordinate system, and / or to make the overall orientation of the pipe model point in the same direction as any coordinate axis of the Cartesian coordinate system; and project the first point cloud information onto a plane in the three-dimensional space to obtain the planar projection information.
[0019] In one possible implementation, when the fourth processing module obtains the target dataset based on the two plane projection information, it specifically performs the following steps: obtaining two-dimensional point cloud boundary points based on the plane projection information and a boundary extraction algorithm; obtaining first point cloud boundary points based on the two-dimensional point cloud boundary points and a clustering analysis algorithm, wherein the clustering analysis algorithm is an analysis algorithm that classifies the two-dimensional point cloud boundary points by solving the Euclidean distance between them and using the shortest distance principle; obtaining a polynomial relation based on the first point cloud boundary points, wherein the polynomial relation is used to fit the discontinuous data of the first point cloud boundary points into continuous data based on the least squares principle; obtaining a two-dimensional axis relation based on the polynomial relation; sampling data from the common independent variable of the two two-dimensional axis relations to obtain a first independent variable value, wherein the two two-dimensional axis relations correspond to the two plane projection information respectively; and substituting the first independent variable value into the two two-dimensional axis relations to obtain the target dataset.
[0020] In one possible implementation, when the fourth processing module obtains the polynomial relation based on the first point cloud boundary points, it is specifically used to: obtain a sample dataset based on the first point cloud boundary points; obtain a first mapping relationship based on the sample dataset, the first mapping relationship representing the data relationship between two mutually perpendicular decomposition directions of data points in the sample dataset; obtain first polynomial coefficients based on the first mapping relationship, the first polynomial coefficients representing the values that minimize the sum of squared errors of each data point in the sample dataset; and obtain the polynomial relation based on the first polynomial coefficients.
[0021] In one possible implementation, the polynomial relation includes a first relation and a second relation. When the fourth processing module obtains the two-dimensional axis relation based on the polynomial relation, it is specifically used to: obtain the relative distance between the first relation and the second relation; if the relative distance is equal to the pipe diameter, obtain the two-dimensional axis relation; if the relative distance is not equal to the pipe diameter, redetermine the projection plane of the reconstructed point cloud information in the three-dimensional space, and calculate the updated plane projection information to obtain the updated two-dimensional axis relation.
[0022] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0023] The memory stores computer-executed instructions;
[0024] The processor executes computer execution instructions stored in the memory to implement the method for extracting the centerline of a pipeline as described in any of the first aspects of the embodiments of this application.
[0025] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method for extracting the centerline of a pipeline as described in any of the first aspects of the embodiments of this application.
[0026] According to a fifth aspect of the embodiments of this application, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method for extracting the centerline of a pipeline as described in any of the first aspects above.
[0027] This application provides a method, apparatus, electronic device, and storage medium for extracting the centerline of a pipeline. It obtains target point cloud information based on original point cloud information and pipeline geometric information. The original point cloud information represents the original spatial position data of collectable data points on the pipeline surface, while the target point cloud information represents the reconstructed spatial position data of the curved surface at uncollectable data points on the pipeline surface. Based on the original and target point cloud information, reconstructed point cloud information is obtained, representing discrete spatial position data of the pipeline surface supplemented by the target point cloud information. Plane projection information is obtained from the reconstructed point cloud information, representing the projection point data of the reconstructed point cloud information on a plane in three-dimensional space. The extraction result of the three-dimensional centerline of the pipeline is obtained based on the two plane projection information. Since the target point cloud information is obtained from the original and pipeline geometric information, and then the discrete reconstructed point cloud information is obtained based on the supplementary target point cloud information, and then the plane projection information is obtained from the reconstructed point cloud information, the extraction result of the three-dimensional centerline of the pipeline can be obtained based on the two plane projection information, thus solving the problem of poor accuracy in the extracted pipeline centerline data. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0029] Figure 1 This is an application scenario diagram of the pipeline centerline extraction method provided in the embodiments of this application;
[0030] Figure 2 A flowchart of a method for extracting the centerline of a pipeline provided in one embodiment of this application;
[0031] Figure 3 for Figure 2 The diagram shows the data processing effect of obtaining the original point cloud information in step S101 of the embodiment shown.
[0032] Figure 4 for Figure 2 A schematic diagram of the reconstructed point cloud information projected onto the plane in step S103 of the embodiment shown;
[0033] Figure 5 for Figure 2 A schematic diagram illustrating the specific implementation steps of step S103 in the illustrated embodiment;
[0034] Figure 6 for Figure 5 A schematic diagram illustrating the effect of the position coordinate transformation in step S1031 of the embodiment shown;
[0035] Figure 7 for Figure 2 A schematic diagram illustrating the specific implementation steps of step S104 in the illustrated embodiment;
[0036] Figure 8 for Figure 2 The reverse projection in step S104 of the illustrated embodiment yields a three-dimensional schematic diagram of the pipe's central axis.
[0037] Figure 9 for Figure 7 A schematic diagram illustrating the specific implementation steps of step S1041 in the illustrated embodiment;
[0038] Figure 10 for Figure 9 The diagram shows the effect of the specific implementation of step S10413 in the embodiment shown.
[0039] Figure 11 for Figure 7 The diagram shows the effect of the specific implementation of step S1042 in the embodiment shown.
[0040] Figure 12 A flowchart of a method for extracting the centerline of a pipeline is provided for another embodiment of this application;
[0041] Figure 13 for Figure 12 A schematic diagram of the pipe cross-section in the illustrated embodiment;
[0042] Figure 14 This is a schematic diagram of a device for extracting the centerline of a pipeline provided in one embodiment of this application;
[0043] Figure 15 A schematic diagram of an electronic device provided according to one embodiment of this application;
[0044] Figure 16 This is a block diagram illustrating a terminal device in an exemplary embodiment of this application.
[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0047] The technical solution of this application involves the collection, storage, use, processing, transmission, provision and disclosure of user personal information and data, which comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0048] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0049] The application scenarios of the embodiments of this application are explained below:
[0050] Figure 1 This diagram illustrates an application scenario of the pipe centerline extraction method provided in this application embodiment. The pipe centerline extraction method provided in this application embodiment can be applied to stress analysis scenarios involving exposed or incomplete pipes. For example, as shown... Figure 1 As shown, data can be collected for the exposed portion of a pipe (the area without filled oblique lines), but not for the non-exposed portion (the area with filled oblique lines). Therefore, only the raw point cloud data of the pipe surface can be obtained. Based on the raw point cloud data and the pipe geometry, the pipe surface can be reconstructed to obtain reconstructed point cloud information. By performing planar projection on the discrete reconstructed point cloud information, planar projection information can be obtained. By combining the two planar projection information, accurate pipe centerline data can be extracted. Based on the extracted pipe centerline data, the pipe deformation and orientation can be determined, and further, the pipe stress calculation and analysis can be carried out.
[0051] Existing technologies acquire complete and accurate point cloud data of the pipeline surface using 3D scanning. This point cloud data is then processed based on boundary feature points to obtain point cloud boundary data, and finally, the central axis data is derived from this boundary data. Current methods for extracting the pipeline central axis from point cloud data require complete and highly accurate original data. However, in actual operating conditions, because parts or even most of the pipeline's outer surface are in contact with soil or buried within it, the size and shape of the exposed outer surface are variable, resulting in incomplete point cloud data. Although this can be supplemented by reconstructing the pipeline surface, the accuracy of the supplemented discrete point cloud data is inferior to the actual data from the pipeline surface. Therefore, the existing methods for analyzing and processing the supplemented point cloud data result in inaccurate discrete point cloud boundary data, leading to poor accuracy in the extracted pipeline central axis data.
[0052] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0053] Figure 2 A flowchart of a method for extracting the centerline of a pipeline provided in one embodiment of this application is shown below. Figure 2 As shown, the method for extracting the centerline of a pipeline provided in this embodiment includes the following steps:
[0054] Step S101: Based on the original point cloud information and the pipeline geometry information, the target point cloud information is obtained. The original point cloud information represents the original spatial location data of the collectable data points on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial location data of the uncollectable data points on the pipeline surface.
[0055] For example, the raw point cloud information represents the original spatial location data at the collectable data points on the pipe surface. The raw point cloud information can reflect the pipe's geometric information and degree of deformation on the exposed outer surface of the pipe. The raw point cloud information can be obtained by acquiring and processing the exposed pipe portion using optical measurement devices (e.g., handheld 3D scanners, global scanning devices, and LiDAR) or vision devices (e.g., vertical cameras and time-lapse cameras). In one possible implementation, Figure 3 for Figure 2 The illustrated embodiment shows a schematic diagram of the data processing effect of obtaining the original point cloud information in step S101. Figure 3As shown, data is collected from the exposed part of the pipeline using optical measurement or vision equipment. The resulting point cloud information is massive and may contain noise. Therefore, by preprocessing the collected point cloud information, such as thinning and noise reduction, the original point cloud information can be obtained. This further reduces the amount of data processing, eliminates unnecessary sharp features and removes outliers, reduces the impact of noise on pipeline surface reconstruction and pipeline axis fitting, and improves the calculation speed.
[0056] For example, pipeline geometric information represents the geometric data of the pipeline. More specifically, given basic information such as the pipeline's laying location and laying records, the basic geometric data such as the pipeline's diameter can be determined. Based on the original point cloud information, the area ratio of the pipeline surface at the data acquisition location and the degree of pipeline deformation can be further calculated.
[0057] For example, the target point cloud information represents the spatial location data of the surface reconstruction at locations on the pipe surface where data cannot be collected. The target point cloud information reflects the pipe's geometric information and degree of deformation on the unexposed outer surface. In one possible implementation, based on the original point cloud information and the pipe's geometric information, a reconstructed surface of the unexposed outer surface of the pipe is obtained through surface reconstruction. This reconstructed surface is then converted into a point cloud, thus obtaining the target point cloud information. More specifically, based on the original point cloud information and the pipe's geometric information, the unexposed outer surface of the pipe can be reconstructed using reverse engineering software to obtain the target point cloud information.
[0058] Step S102: Based on the original point cloud information and the target point cloud information, the reconstructed point cloud information is obtained. The reconstructed point cloud information represents the discrete spatial location data of the pipe surface supplemented by the target point cloud information.
[0059] For example, the reconstructed point cloud information represents the discrete spatial location data of the pipe surface supplemented by the target point cloud information. The original point cloud information corresponds to the original spatial location data at the collectable data points on the pipe surface, and the target point cloud information corresponds to the surface reconstruction spatial location data at the uncollectable data points on the pipe surface. Based on the supplementation by the target point cloud information, the original point cloud information and the target point cloud information are processed into a regularized and ordered state to obtain the reconstructed point cloud information. Through the solution of this embodiment, the point cloud information at the uncollectable data points on the pipe surface is supplemented. Based on the target point cloud information supplemented by the surface reconstruction method, the data accuracy of the extracted pipe centerline can be further improved on the basis of the original point cloud information.
[0060] Step S103: Based on the reconstructed point cloud information, obtain planar projection information. The planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space.
[0061] For example, the reconstructed point cloud information is discrete position data of the pipe surface in three-dimensional space. To improve data processing speed and accuracy, it is projected onto a plane in three-dimensional space for analysis, thus obtaining planar projection information. In one possible implementation, Figure 4 for Figure 2 The illustrated embodiment shows a schematic diagram of the reconstructed point cloud information projected onto a plane in step S103, as shown below. Figure 4 As shown, for a certain data point P d (x d ,y d ,z d ), d=1,2,…,n, P d Projected onto a plane in space ax + by + cz + 1 = 0, P e (x e ,y e ,z e P is on the plane d The projection point, vector Normal vector parallel to the plane The data points, projection points, and normal vectors have the following mathematical relationship, as shown in equation (1):
[0062]
[0063] Therefore, the coordinates of the projection point in each direction are as shown in equation (2):
[0064]
[0065] In one possible implementation, Figure 5 for Figure 2 The schematic diagram of the specific implementation steps of step S103 in the embodiment shown is as follows: Figure 5 As shown, the specific implementation steps of step S103 include:
[0066] Step S1031: Perform position coordinate transformation on the reconstructed point cloud information to obtain the first point cloud information. The position coordinate transformation is used to transform the position coordinates of the pipe model corresponding to the reconstructed point cloud information in the Cartesian coordinate system, so as to make any end face of the pipe model parallel to any coordinate plane of the Cartesian coordinate system, and / or to make the overall direction of the pipe model point in the same direction as any coordinate axis of the Cartesian coordinate system.
[0067] For example, position coordinate transformation only changes the overall direction of the pipeline, without changing the physical characteristics of the pipeline itself, such as its diameter, length, and deformation. Figure 6 for Figure 5 The diagram illustrates the effect of the position coordinate transformation in step S1031 of the illustrated embodiment, as shown below. Figure 6As shown, reconstructed point cloud information is obtained through optical measurement or vision equipment and subsequent analysis. The direction of the pipeline corresponding to the reconstructed point cloud information can be any direction within the three-dimensional space O-xyz. When performing axis extraction analysis on a section of pipeline, to simplify calculations, the reconstructed point cloud information corresponding to the pipeline can be transformed by position coordinates. This allows any end face of the pipeline model to be parallel to any coordinate plane of the Cartesian coordinate system, and / or to ensure that the overall orientation of the pipeline model points in the same direction as any coordinate axis of the Cartesian coordinate system. For example, the overall orientation of the pipeline model can be transformed along any direction to be parallel to the x-axis. Based on the pipeline model after the overall orientation transformation achieved through position coordinate transformation, the first point cloud information is further obtained.
[0068] The solution in this embodiment simplifies the calculation process and improves the calculation speed. Specifically, by converting the general arbitrary direction of the pipeline into a pipeline with positional characteristics through positional coordinates, the spatial positional coordinate data of the pipeline surface is converted from general data into standardized data. That is, the data of a certain coordinate direction moves along a certain coordinate axis of the coordinate system. In this way, the step of determining the projection surface can be simplified when performing planar projection in subsequent steps.
[0069] Step S1032: Project the first point cloud information onto a plane in three-dimensional space to obtain planar projection information.
[0070] For example, the planar projection information is the projection point data on the corresponding plane obtained by projecting the first point cloud information onto a plane in three-dimensional space. More specifically, such as... Figure 6 As shown, in three-dimensional space, if any plane is parallel to the coordinate axis x, then the projection plane can be used as the projection plane of the first point cloud information. More specifically, to simplify the calculation, the coordinate plane xOy and / or the coordinate plane xOz are generally used as the projection plane of the first point cloud information of the pipe surface.
[0071] Step S104: Based on the two planar projection information, the three-dimensional centerline of the pipe is extracted.
[0072] For example, based on planar projection information, the spatial position data on the pipe surface can be obtained as projection point data corresponding to the projection plane. Based on the projection point data of the two projection planes and the angle between them, the three-dimensional central axis of the pipe can be obtained through back projection. Further, in one possible implementation... Figure 7 for Figure 2 The schematic diagram of the specific implementation steps of step S104 in the embodiment shown is as follows: Figure 7 As shown, the specific implementation steps of step S104 include:
[0073] Step S1041: Based on the two planar projection information, obtain the target dataset, wherein the projection planes corresponding to the two planar projection information are perpendicular to each other, and the target dataset represents the data set of the three-dimensional central axis of the pipeline.
[0074] For example, Figure 8 for Figure 2 In the illustrated embodiment, the back projection in step S104 yields a three-dimensional schematic diagram of the pipe's central axis, as shown below. Figure 8 As shown, given that the angle between the two projection planes is α = 90°, the two-dimensional axes l1 and l2 of the pipes on the corresponding projection planes can be obtained based on the planar projection information of the two projection planes. Based on the back projection of the two-dimensional axes l1 and l2, combined with the plane angle α = 90°, the target dataset based on the two-dimensional axes l1 and l2 can be derived through spatial geometric relationships.
[0075] More specifically, in one possible implementation, Figure 9 for Figure 7 The schematic diagram of the specific implementation steps of step S1041 in the embodiment shown is as follows: Figure 9 As shown, the specific implementation steps of step S1041 include:
[0076] Step S10411: Obtain the boundary points of the two-dimensional point cloud based on the planar projection information and the boundary extraction algorithm.
[0077] For example, such as Figure 6 As shown, coordinate planes xOy and xOz are used as two projection planes of the pipe surface. According to the Cartesian coordinate system, coordinate planes xOy and xOz are perpendicular to each other. The reconstructed point cloud information corresponding to the pipe surface is projected onto the two coordinate planes to obtain the corresponding planar projection information. Boundary extraction algorithms, such as the 2D AlphaShapes algorithm and the Deloitte triangulation edge point search algorithm, are used to obtain the two-dimensional point cloud boundary points.
[0078] Step S10412: Based on the boundary points of the two-dimensional point cloud and the clustering analysis algorithm, the first boundary points of the point cloud are obtained. The clustering analysis algorithm is an analysis algorithm that solves the Euclidean distance between the boundary points of the two-dimensional point cloud and classifies them using the shortest distance principle.
[0079] For example, based on geometric relationships and clustering analysis algorithms, the projected boundaries at both ends of the pipe are removed. More specifically, for example, the Pdist function is used to solve the Euclidean distance between two-dimensional boundary points, and the linkage function is used to classify them using the shortest distance principle, thereby achieving clustering of the two boundary point sets along the axial direction of the pipe.
[0080] Step S10413: Based on the first point cloud boundary points, obtain the polynomial relation. The polynomial relation is used to fit the discontinuous data of the first point cloud boundary points into continuous data based on the least squares method.
[0081] For example, based on the least squares principle, polynomial fitting is performed on the two boundary points along the pipe axis. More specifically, for example, a sample dataset is obtained based on the first point cloud boundary point of the pipe boundary in the coordinate plane xOy. A first mapping relationship is obtained based on each data point in the sample dataset. This first mapping relationship characterizes the data relationship between two mutually perpendicular decomposition directions of the data points in the sample dataset. For example, if the data point in the sample dataset is P... i (x i ,y i ), i = 1, 2, ..., m, the first mapping relationship is shown in equation (3):
[0082]
[0083] Where m is the dimension of the sample; n is the order of the polynomial; θ j (j=0,1,2,...,n) are the coefficients of the first polynomial.
[0084] For example, the coefficients of the first polynomial represent the values that minimize the sum of squared errors S of each data point in the sample dataset, as shown in the calculation relationship of equation (4), where S is the minimum value.
[0085]
[0086] More specifically, the sum of squared errors S with respect to the coefficients θ of the first polynomial j The partial derivatives of (j=0,1,2,...,n) should satisfy the condition shown in equation (5):
[0087]
[0088] When j takes the values 0, 1, 2, ..., n, the relationship is as shown in equation (6):
[0089]
[0090] Transformed into matrix form, as shown in equation (7):
[0091]
[0092] Then the matrix relationship is as shown in equation (8):
[0093] Xθ=Y (8)
[0094] Further derivation of equation (8) yields the relationship shown in equation (9):
[0095] θ=X -1 Y (9)
[0096] Then, the first polynomial coefficients corresponding to the coefficient vector matrix θ are obtained. Further, based on the first polynomial coefficients, the polynomial relation is obtained, that is, the polynomial relation of the two boundaries of the pipeline is fitted, as shown in equation (10):
[0097]
[0098] The scheme in this embodiment obtains the coefficients of the first polynomial by using the least squares method based on the discrete data in the sample dataset, and finally obtains the fitted continuous polynomial relation. Figure 10 for Figure 9 The illustrated diagram shows the effect of step S10413 in the embodiment shown. Figure 10 As shown, a continuous polynomial relation can be obtained from the discrete reconstructed point cloud information. That is, due to the influence of actual working conditions, the area of the pipe surface where data can be collected is limited in some pipe sections. Therefore, the accuracy of the reconstructed point cloud data of the corresponding pipe sections obtained by surface reconstruction is poor. As a result, the reconstructed point cloud information obtained in the end will have some pipe section data missing. The solution based on this embodiment can effectively solve this problem and fit and supplement the missing data.
[0099] Step S10414: Based on the polynomial relationship, the two-dimensional axis relationship is obtained.
[0100] For example, for the same independent variable x, y I y II Taking the average value, a two-dimensional axis relationship of the pipeline projection plane (coordinate plane xOy) is obtained, as shown in equation (11):
[0101]
[0102] Similarly, we can obtain the two-dimensional axis relationship of the pipeline's projection onto the coordinate plane xOz.
[0103] Step S10415: Data sampling is performed on the common independent variable of the two two-dimensional axis relationships to obtain the value of the first independent variable, wherein the two two-dimensional axis relationships correspond to two planar projection information respectively.
[0104] Step S10416: Substitute the value of the first independent variable into the two two-dimensional axis relationships to obtain the target dataset.
[0105] For example, the independent variable x is sampled at equal intervals along the central axis of the pipe to obtain the first independent variable value: x iSubstituting i = 1, 2, ..., m into the two two-dimensional axis relationships, we obtain the target dataset (x) of the pipeline's central axis. i ,y i ,z i ), i = 1, 2, ..., m.
[0106] Step S1042: Based on the target dataset, obtain the extraction result of the three-dimensional centerline of the pipeline.
[0107] For example, Figure 11 for Figure 7 The schematic diagram of the specific implementation effect of step S1042 in the embodiment shown is as follows: the fitting effect of the pipeline centerline is as follows. Figure 11 As shown, within the coordinate plane xOy, according to the target dataset (x i ,y i ,z i The three-dimensional centerline of the pipeline can be extracted by simulation using relevant software (such as MATLAB or Python), where i = 1, 2, ..., m.
[0108] In this embodiment, target point cloud information is obtained based on the original point cloud information and the pipeline geometry information. The original point cloud information represents the original spatial position data of the collectable data points on the pipeline surface, while the target point cloud information represents the surface reconstruction spatial position data of the uncollectable data points on the pipeline surface. Reconstructed point cloud information is obtained based on the original and target point cloud information, representing the discrete spatial position data of the pipeline surface supplemented by the target point cloud information. Plane projection information is obtained based on the reconstructed point cloud information, representing the projection point data of the reconstructed point cloud information on a plane in three-dimensional space. The extraction result of the three-dimensional central axis of the pipeline is obtained based on the two plane projection information. Since the target point cloud information is obtained from the original and pipeline geometry information, and then the discrete state of the reconstructed point cloud information is obtained based on the supplementary target point cloud information, and then the plane projection information is obtained from the reconstructed point cloud information, the extraction result of the three-dimensional central axis of the pipeline can be obtained based on the two plane projection information, thus solving the problem of poor accuracy of the extracted pipeline central axis data.
[0109] Figure 12 A flowchart of a method for extracting the centerline of a pipeline provided in another embodiment of this application is shown below. Figure 12 As shown, the method for extracting the centerline of a pipeline provided in this embodiment... Figure 2 Based on the pipeline centerline extraction method provided in the illustrated embodiment, further refinement of step S14014 results in the following steps in the pipeline centerline extraction method provided in this embodiment:
[0110] Step S201: Based on the original point cloud information and the pipeline geometry information, the target point cloud information is obtained. The original point cloud information represents the original spatial location data of the collectable data points on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial location data of the uncollectable data points on the pipeline surface.
[0111] Step S202: Based on the original point cloud information and the target point cloud information, the reconstructed point cloud information is obtained. The reconstructed point cloud information represents the discrete spatial location data of the pipe surface supplemented by the target point cloud information.
[0112] Step S203: Based on the reconstructed point cloud information, obtain planar projection information. The planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space.
[0113] Step S204: Obtain the boundary points of the two-dimensional point cloud based on the planar projection information and the boundary extraction algorithm.
[0114] Step S205: Based on the boundary points of the two-dimensional point cloud and the clustering analysis algorithm, the first boundary points of the point cloud are obtained. The clustering analysis algorithm is an analysis algorithm that solves the Euclidean distance between the boundary points of the two-dimensional point cloud and classifies them using the shortest distance principle.
[0115] Step S206: Based on the first point cloud boundary points, obtain the polynomial relation. The polynomial relation is used to fit the discontinuous data of the first point cloud boundary points into continuous data based on the least squares method.
[0116] Step S207: The polynomial relation includes a first relation and a second relation. Obtain the relative distance between the first relation and the second relation.
[0117] Step S208: If the relative distance is equal to the pipe diameter, the two-dimensional axis relationship is obtained.
[0118] Step S209: If the relative distance is not equal to the pipe diameter, the projection plane of the reconstructed point cloud information in the three-dimensional space is redefined, and the updated planar projection information is calculated to obtain the updated two-dimensional axis relationship.
[0119] For example, Figure 13 for Figure 12 A schematic diagram of the pipe cross-section in the illustrated embodiment is shown below. Figure 13As shown, the pipe is projected onto three different projection planes. The relative distance between the pipe boundaries corresponding to the first and second relationships obtained on projection plane A is D1. Since D1 equals the pipe diameter D, the two-dimensional axial relationship based on the first and second relationships can be determined. The relative distance between the pipe boundaries corresponding to the first and second relationships obtained on projection plane B is D2. Due to missing data in the reconstructed point cloud information along this projection direction, D2 is less than the pipe diameter D. Therefore, it is necessary to redetermine the projection plane of the reconstructed point cloud information in three-dimensional space and calculate the updated planar projection information to obtain the updated two-dimensional axial relationship. The relative distance between the pipe boundaries corresponding to the first and second relationships obtained on projection plane C is D3. Due to the poor accuracy of the target point cloud information and the presence of abnormal noise, D3 is greater than the pipe diameter D. Therefore, it is necessary to redetermine the projection plane of the reconstructed point cloud information in three-dimensional space and calculate the updated planar projection information to obtain the updated two-dimensional axial relationship.
[0120] In another possible implementation, such as Figure 13 As shown, although there are missing data in the reconstructed point cloud information in the projection direction corresponding to projection plane B, or although there are abnormal noise points in the reconstructed point cloud information in the projection direction corresponding to projection plane C, according to the method of this embodiment, subsequent steps can be performed using the two two-dimensional axial relationships obtained from projection plane A and a projection plane perpendicular to projection plane A. More generally, after obtaining the reconstructed point cloud information, the first relationship y corresponding to the projection plane can be determined based on any two projection planes and the angle between the two projection planes. I Second relation y II If the first relation y I Second relation y II If the relative distance between them conforms to the pipeline geometry information (e.g., pipeline diameter), then the corresponding two-dimensional axis relationship y can be determined. Subsequently, the subsequent steps can be carried out based on the two two-dimensional axis relationships. The specific geometric derivation will not be elaborated here.
[0121] In another possible implementation, for locations where there are auxiliary parts or installation structures on the outer surface of the pipe, the relative distance between the first and second relational expressions is compared with the pipe diameter to select the first and second relational expressions corresponding to the relative distance that is consistent with the pipe diameter (or within the allowable error range), thereby determining the two-dimensional axial relational expression for the corresponding location.
[0122] The solution in this embodiment can improve the accuracy of the two-dimensional axis relationship by comparing the relative distance between the first and second relationships with the pipe diameter. More specifically, since the amount of basic data provided by the original point cloud information for determining the two-dimensional axis relationship is small, the reconstructed point cloud information is obtained by supplementing the original point cloud information to increase the amount of basic data for determining the two-dimensional axis relationship. However, the reconstructed point cloud information has data fluctuations. Therefore, after obtaining the reconstructed point cloud information, the relative distance between the first and second relationships is compared with the pipe diameter to select the relative distance that is consistent with the pipe diameter (or within the allowable error range). Then, the accurate two-dimensional axis relationship can be determined according to the corresponding first and second relationships.
[0123] Step S210: Data sampling is performed on the common independent variable of the two two-dimensional axis relationships to obtain the value of the first independent variable, wherein the two two-dimensional axis relationships correspond to two planar projection information respectively.
[0124] Step S211: Substitute the value of the first independent variable into the two two-dimensional axis relationships to obtain the target dataset.
[0125] Step S212: Based on the target dataset, obtain the extraction result of the three-dimensional centerline of the pipeline.
[0126] In this embodiment, the implementation of steps S201-S203 is the same as that in this application. Figure 2 The implementation of steps S101-S103 in the illustrated embodiment is the same, and the implementation of steps S204-S206 is the same as that in this application. Figure 2 The implementation methods of steps S10411-S10413 in the illustrated embodiment are the same, and the implementation methods of steps S210-S211 are the same as those in this application. Figure 2 The implementation of steps S10415-S10416 in the illustrated embodiment is the same, and the implementation of step S212 is the same as in this application. Figure 2 The implementation of step S1042 in the illustrated embodiment is the same, and will not be described in detail here.
[0127] Figure 14 This is a schematic diagram of the structure of a device for extracting the centerline of a pipeline according to an embodiment of this application, as shown below. Figure 14 As shown, the pipeline centerline extraction device 3 provided in this embodiment includes:
[0128] The first processing module 31 is used to obtain target point cloud information based on the original point cloud information and the pipeline geometry information. The original point cloud information represents the original spatial position data of the collectable data points on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial position data of the uncollectable data points on the pipeline surface.
[0129] The second processing module 32 is used to obtain reconstructed point cloud information based on the original point cloud information and the target point cloud information. The reconstructed point cloud information represents the discrete spatial position data of the pipe surface supplemented by the target point cloud information.
[0130] The third processing module 33 is used to obtain planar projection information based on the reconstructed point cloud information. The planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space.
[0131] The fourth processing module 34 is used to obtain the extraction result of the three-dimensional centerline of the pipeline based on the projection information of the two planes.
[0132] In one possible implementation, when the fourth processing module 34 obtains the extraction result of the three-dimensional central axis of the pipeline based on the two planar projection information, it is specifically used to: obtain a target dataset based on the two planar projection information, wherein the projection planes corresponding to the two planar projection information are perpendicular to each other, and the target dataset represents the data set of the three-dimensional central axis of the pipeline; and obtain the extraction result of the three-dimensional central axis of the pipeline based on the target dataset.
[0133] In one possible implementation, when the third processing module 33 obtains planar projection information based on the reconstructed point cloud information, it is specifically used to: perform position coordinate transformation on the reconstructed point cloud information to obtain first point cloud information. The position coordinate transformation is used to transform the position coordinates of the pipe model corresponding to the reconstructed point cloud information in the Cartesian coordinate system, so as to make any end face of the pipe model parallel to any coordinate plane of the Cartesian coordinate system, and / or to make the overall direction of the pipe model point in the same direction as any coordinate axis of the Cartesian coordinate system; and project the first point cloud information onto a plane in three-dimensional space to obtain planar projection information.
[0134] In one possible implementation, when the fourth processing module 34 obtains the target dataset based on the two planar projection information, it specifically performs the following steps: It obtains two-dimensional point cloud boundary points based on the planar projection information and a boundary extraction algorithm; it obtains first point cloud boundary points based on the two-dimensional point cloud boundary points and a clustering analysis algorithm, wherein the clustering analysis algorithm is an analysis algorithm that classifies two-dimensional point cloud boundary points by solving the Euclidean distance between them and using the shortest distance principle; it obtains a polynomial relation based on the first point cloud boundary points, which is used to fit the discontinuous data of the first point cloud boundary points into continuous data based on the least squares principle; it obtains a two-dimensional axis relation based on the polynomial relation; it samples the common independent variable of the two two-dimensional axis relations to obtain the value of the first independent variable, wherein the two two-dimensional axis relations correspond to the two planar projection information respectively; and it substitutes the value of the first independent variable into the two two-dimensional axis relations to obtain the target dataset.
[0135] In one possible implementation, when the fourth processing module 34 obtains the polynomial relation based on the first point cloud boundary points, it specifically performs the following steps: obtaining a sample dataset based on the first point cloud boundary points; obtaining a first mapping relation based on the sample dataset, the first mapping relation representing the data relationship between two mutually perpendicular decomposition directions of the data points in the sample dataset; obtaining first polynomial coefficients based on the first mapping relation, the first polynomial coefficients representing the values that minimize the sum of squared errors of each data point in the sample dataset; and obtaining the polynomial relation based on the first polynomial coefficients.
[0136] In one possible implementation, the polynomial relation includes a first relation and a second relation. When the fourth processing module 34 obtains the two-dimensional axis relation based on the polynomial relation, it is specifically used to: obtain the relative distance between the first relation and the second relation; if the relative distance is equal to the pipe diameter, obtain the two-dimensional axis relation; if the relative distance is not equal to the pipe diameter, redetermine the projection plane of the reconstructed point cloud information in three-dimensional space, and calculate the updated plane projection information to obtain the updated two-dimensional axis relation.
[0137] The first processing module 31, the second processing module 32, the third processing module 33, and the fourth processing module 34 are connected sequentially. The pipeline centerline extraction device 3 provided in this embodiment can perform the following... Figures 2-13 The technical solutions of any of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.
[0138] Figure 15 A schematic diagram of an electronic device provided in one embodiment of this application, as shown below. Figure 15 As shown, the electronic device 4 provided in this embodiment includes: a processor 41, and a memory 42 communicatively connected to the processor 41.
[0139] Among them, memory 42 stores computer-executed instructions;
[0140] The processor 41 executes computer execution instructions stored in the memory 42 to implement this application. Figures 2-13 The corresponding embodiments provide a method for extracting the centerline of a pipeline.
[0141] The memory 42 and the processor 41 are connected via a bus 43.
[0142] For relevant instructions, please refer to the corresponding text. Figures 2-13 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0143] One embodiment of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this application. Figures 2-13 The corresponding embodiments provide a method for extracting the centerline of a pipeline.
[0144] The computer-readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0145] One embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements this application. Figures 2-13 The corresponding embodiments provide a method for extracting the centerline of a pipeline.
[0146] Figure 16 This is a block diagram illustrating an exemplary embodiment of the present application of a terminal device 800, which may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0147] The terminal device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0148] Processing component 802 typically controls the overall operation of terminal device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0149] Memory 804 is configured to store various types of data to support operation on terminal device 800. Examples of this data include instructions for any application or method operating on terminal device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0150] Power supply component 806 provides power to various components of terminal device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal device 800.
[0151] Multimedia component 808 includes a screen that provides an output interface between terminal device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When terminal device 800 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0152] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when terminal device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0153] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0154] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of terminal device 800. For example, sensor assembly 814 can detect the on / off state of terminal device 800, the relative positioning of components such as the display and keypad of terminal device 800, changes in the position of terminal device 800 or a component of terminal device 800, the presence or absence of user contact with terminal device 800, the orientation or acceleration / deceleration of terminal device 800, and temperature changes of terminal device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0155] Communication component 816 is configured to facilitate wired or wireless communication between terminal device 800 and other devices. Terminal device 800 can access wireless networks based on communication standards, such as WiFi, 3G, 4G, 5G, or other standard communication networks, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0156] In an exemplary embodiment, the terminal device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the functions described in this application. Figures 2-13 The method provided in any of the corresponding embodiments.
[0157] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of a terminal device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0158] This application also provides a non-transitory computer-readable storage medium, which, when the instructions in the storage medium are executed by the processor of a terminal device, enables the terminal device 800 to perform the above-described embodiments of this application. Figures 2-13 The method provided in any of the corresponding embodiments.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0160] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0161] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for extracting the centerline of a pipeline, characterized in that, The method includes: Based on the original point cloud information and the pipeline geometry information, the target point cloud information is obtained, wherein the original point cloud information represents the original spatial position data of the data that can be collected on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial position data of the data that cannot be collected on the pipeline surface. Based on the original point cloud information and the target point cloud information, reconstructed point cloud information is obtained, and the reconstructed point cloud information represents the discrete spatial position data of the pipe surface supplemented by the target point cloud information. Based on the reconstructed point cloud information, planar projection information is obtained, wherein the planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space; Based on the two plane projection information, a target dataset is obtained, wherein the projection planes corresponding to the two plane projection information are perpendicular to each other, and the target dataset is a data set representing the three-dimensional central axis of the pipeline; Based on the target dataset, the three-dimensional centerline of the pipeline is extracted. The step of obtaining the target dataset based on the two plane projection information includes: Based on the planar projection information and boundary extraction algorithm, the boundary points of the two-dimensional point cloud are obtained; Based on the two-dimensional point cloud boundary points and the clustering analysis algorithm, the first point cloud boundary points are obtained, wherein the clustering analysis algorithm is an analysis algorithm that solves the Euclidean distance between the two-dimensional point cloud boundary points and classifies them using the shortest distance principle; Based on the first point cloud boundary point, a polynomial relation is obtained. The polynomial relation is used to fit the discontinuous data of the first point cloud boundary point into continuous data based on the least squares method. Based on the polynomial relationship, the two-dimensional axis relationship is obtained; Data sampling is performed on the common independent variable of the two two-dimensional axis relationships to obtain the value of the first independent variable, wherein the two two-dimensional axis relationships correspond to the two plane projection information respectively; Substituting the value of the first independent variable into the two two-dimensional axis relationships yields the target dataset.
2. The method according to claim 1, characterized in that, The step of obtaining planar projection information based on the reconstructed point cloud information includes: The reconstructed point cloud information is transformed by position coordinates to obtain first point cloud information. The position coordinate transformation is used to transform the position coordinates of the pipe model corresponding to the reconstructed point cloud information in the Cartesian coordinate system, so as to make any end face of the pipe model parallel to any coordinate plane of the Cartesian coordinate system, and / or to make the overall direction of the pipe model the same as the direction of any coordinate axis of the Cartesian coordinate system. The first point cloud information is projected onto a plane in the three-dimensional space to obtain the plane projection information.
3. The method according to claim 1, characterized in that, The process of obtaining the polynomial relation based on the first point cloud boundary point includes: Based on the first cloud boundary point, the sample dataset is obtained; Based on the sample dataset, a first mapping relationship is obtained, which characterizes the data relationship between two mutually perpendicular decomposition directions of data points in the sample dataset; Based on the first mapping relationship, the coefficients of the first polynomial are obtained. The coefficients of the first polynomial represent the values that minimize the sum of squared errors of each data point in the sample dataset. The polynomial relation is obtained based on the coefficients of the first polynomial.
4. The method according to claim 1, characterized in that, The polynomial relation includes a first relation and a second relation. The step of obtaining the two-dimensional axis relation based on the polynomial relation includes: Obtain the relative distance between the first relation and the second relation; If the relative distance is equal to the pipe diameter, the two-dimensional axial relationship is obtained; If the relative distance is not equal to the pipe diameter, the projection plane of the reconstructed point cloud information in the three-dimensional space is redefined, and the updated planar projection information is calculated to obtain the updated two-dimensional axis relationship.
5. A device for extracting the centerline of a pipeline, characterized in that, include: The first processing module is used to obtain target point cloud information based on the original point cloud information and the pipeline geometry information, wherein the original point cloud information represents the original spatial position data of the data that can be collected on the pipeline surface, and the target point cloud information represents the surface reconstruction spatial position data of the data that cannot be collected on the pipeline surface. The second processing module is used to obtain reconstructed point cloud information based on the original point cloud information and the target point cloud information. The reconstructed point cloud information represents the discrete spatial position data of the pipe surface supplemented by the target point cloud information. The third processing module is used to obtain planar projection information based on the reconstructed point cloud information, wherein the planar projection information represents the projection point data corresponding to the reconstructed point cloud information on a plane in three-dimensional space; The fourth processing module is used to obtain a target dataset based on the two plane projection information, wherein the projection planes corresponding to the two plane projection information are perpendicular to each other, and the target dataset is a data set representing the three-dimensional central axis of the pipeline; Based on the target dataset, the three-dimensional centerline of the pipeline is extracted. The fourth processing module is specifically used to obtain the boundary points of the two-dimensional point cloud based on the planar projection information and the boundary extraction algorithm; Based on the two-dimensional point cloud boundary points and the clustering analysis algorithm, the first point cloud boundary points are obtained, wherein the clustering analysis algorithm is an analysis algorithm that solves the Euclidean distance between the two-dimensional point cloud boundary points and classifies them using the shortest distance principle; Based on the first point cloud boundary point, a polynomial relation is obtained. The polynomial relation is used to fit the discontinuous data of the first point cloud boundary point into continuous data based on the least squares method. Based on the polynomial relationship, the two-dimensional axis relationship is obtained; Data sampling is performed on the common independent variable of the two two-dimensional axis relationships to obtain the value of the first independent variable, wherein the two two-dimensional axis relationships correspond to the two plane projection information respectively; Substituting the value of the first independent variable into the two two-dimensional axis relationships yields the target dataset.
6. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for extracting the centerline of a pipe as described in any one of claims 1 to 4.
8. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method for extracting the centerline of a pipe as described in any one of claims 1 to 4.