一种三维点云提取方法及提取系统
By combining the CSF algorithm and support vector machine, the efficiency and accuracy issues of 3D point cloud detection in tunnel construction were solved, achieving fast and accurate tunnel point cloud extraction, which is suitable for complex tunnel environments and railway equipment detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STANDARDS & METROLOGY RES INST CHINA ACADEMY OF RAILWAY SCI
- Filing Date
- 2023-05-16
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for 3D point cloud detection in tunnel construction suffer from low efficiency, complex methods, and incomplete detection. Traditional filtering methods cannot effectively eliminate non-tunnel point clouds, resulting in inaccurate detection results.
The CSF algorithm is used to perform ground filtering on the initial point cloud data, and the tunnel point cloud is extracted by combining it with support vector machine (SVM). By constructing three-dimensional spatial features and two-dimensional planar features, a support vector machine model is created using the training set for binary classification.
It enables rapid and accurate extraction of tunnel point clouds, improving the accuracy and robustness of detection, effectively removing noisy point clouds, and is suitable for complex tunnel environments, with fast processing speed.
Smart Images

Figure CN116681653B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of tunnel engineering surveying and railway equipment testing, specifically involving a three-dimensional point cloud extraction method and system based on multiple features. Background Technology
[0002] During tunnel construction, it is necessary to frequently inspect the cross-sectional quality of the tunnel at different stages. Traditional inspection methods using total stations or laser profilers suffer from low efficiency, complexity, and incomplete inspection. With the development of 3D scanning technology, using scanners to obtain massive amounts of 3D point cloud data from within the tunnel, and leveraging efficient point cloud processing algorithms, tunnel cross-sectional quality inspection tasks can be completed quickly, accurately, and easily.
[0003] like Figure 1 As shown, the initial point cloud data acquired by the 3D laser scanner includes tunnel point clouds and non-tunnel point clouds. Among them, non-tunnel point clouds include ground, vehicles and people. Therefore, adopting an efficient point cloud filtering algorithm to remove non-tunnel point clouds is the key to extracting clean and high-quality tunnel point clouds. Commonly used point cloud filtering methods include: (1) filtering methods based on manual selection. This method removes non-target point clouds through human-computer interaction, which is not suitable for situations where noise points are scattered; (2) filtering methods based on distance thresholds. This method divides target point clouds and non-target point clouds by setting specific thresholds. Therefore, this method has poor universality and is prone to misjudgment; (3) filtering methods based on statistics. This method removes outliers by statistically analyzing the distance between each point and each point within the K nearest neighbor range. However, this method cannot remove noise points that are close to the target point cloud; (4) filtering methods based on the Random Sample Consensus (RANSAC) algorithm achieve point cloud segmentation by fitting different planes. This method is highly dependent on parameters and is specific to the plane of a particular object. Summary of the Invention
[0004] To at least partially overcome the problems existing in related technologies, this application provides a three-dimensional point cloud extraction method and extraction system.
[0005] According to a first aspect of the embodiments of this application, this application provides a three-dimensional point cloud extraction method, which includes the following steps:
[0006] Obtain initial point cloud data;
[0007] Based on the mileage range, a portion of the initial point cloud data to be calculated is segmented from the initial point cloud data, and this portion of the initial point cloud data is downsampled.
[0008] Ground filtering is performed on a portion of the downsampled initial point cloud data based on the CSF algorithm;
[0009] Three-dimensional spatial features and two-dimensional planar features are constructed from the filtered point cloud data. The three-dimensional spatial features and two-dimensional planar features are divided into training set and test set. Support vector machine is created using the training set and used to extract tunnel point cloud.
[0010] In the above-described 3D point cloud extraction method, the method for obtaining the initial point cloud data is as follows:
[0011] The tunnel was scanned using a total station scanner to directly obtain absolute coordinate point cloud data;
[0012] Alternatively, a ground-based 3D laser scanner can be used in conjunction with a target to scan the tunnel. This first indirectly acquires relative coordinate point cloud data, which is then converted into absolute coordinate point cloud data through coordinate registration.
[0013] In the above-mentioned 3D point cloud extraction method, the process of performing ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm is as follows:
[0014] Filter out outliers from a portion of the initial point cloud data after downsampling, and invert the point cloud.
[0015] Initially, the grid is rasterized, and the grid size is determined based on the actual point cloud density. The initial position is located at the maximum value of the point cloud's vertical coordinate.
[0016] Project the point cloud and grid particles onto the same horizontal plane and calculate the lowest position that the current particle can reach.
[0017] Calculate the distance each particle travels under the influence of external forces, considering only gravity;
[0018] Calculate the distance each particle moves under the influence of internal forces;
[0019] The calculation continues to calculate the distance each particle moves under the influence of external forces when only gravity is considered, as well as the distance it moves under the influence of internal forces, until the maximum height change of all particles is less than a preset threshold or the number of iterations reaches a specified number, at which point the calculation stops.
[0020] Calculate the distance between the rasterized particles and the original point cloud;
[0021] Determine whether the distance between the rasterized particles and the original point cloud is less than a preset distance threshold. If it is, determine that the current point cloud is a ground point cloud; otherwise, determine that the current point cloud is a non-ground point cloud.
[0022] Determine if all point clouds have been traversed. If so, end the process; otherwise, return and recalculate the distance between the rasterized particles and the original point cloud.
[0023] Furthermore, the distance the particle travels under the influence of external forces, considering only gravity, is:
[0024]
[0025] In the formula, X(t+Δt) represents the distance the particle moves under the influence of external force, X(t) represents the position of the particle at time t, X(t-Δt) represents the position of the particle at time t-Δt, Δt represents the time interval, G represents the gravitational constant, and m represents the particle mass, which is usually 1.
[0026] Furthermore, the distance the particle moves under the influence of internal force is:
[0027]
[0028] In the formula, This represents the displacement vector of the particle. When the particle is movable, b = 1; otherwise, b = 0. Indicates the current particle, express neighboring particles, Represents the normalized vector in the vertical direction.
[0029]
[0030] Furthermore, the process of extracting tunnel point clouds using support vector machines is as follows:
[0031] Construct the feature vector of the tunnel point cloud;
[0032] Based on the constructed tunnel point cloud feature vector, the three-dimensional spatial features and two-dimensional planar features of the filtered point cloud data are divided into training set and test set;
[0033] Use the training set to create a support vector machine and obtain the support vector machine model with optimal parameters;
[0034] Using a trained support vector machine model, the test set is used as input to perform binary classification on the tunnel point cloud. If the output result is 1, the current input is determined to be a tunnel point cloud, and the point cloud data in the test set of the current input is retained. If the output result is -1, it indicates that the current input is a non-tunnel point cloud, and the point cloud data in the test set of the current input is discarded.
[0035] Furthermore, the process of constructing the tunnel point cloud feature vector is as follows:
[0036] Construct a 3D KD-tree on point cloud data to transform discrete 3D point clouds into an associated topological structure;
[0037] Find the neighboring point cloud clusters for each point in the KD-tree. The number of point cloud clusters is determined based on the actual point cloud density.
[0038] Calculate the covariance eigenvalues of all point clouds within a neighboring point cloud cluster, and construct 3D spatial features and 2D planar features.
[0039] Furthermore, the three-dimensional spatial features include a divergence index S. λ Planarity index P λ Linear exponent L λ Isotropic O λ Anisotropy A λ Feature entropy E λ Features and ∑λ, curvature change C λ Verticality V, z-axis range R of point cloud cluster z z-axis variance of point cloud clusters and point cloud cluster density D;
[0040] Divergence index S λ for:
[0041] Planarity index P λ for:
[0042] Linear exponent L λ for:
[0043] Isotropic O λ for:
[0044] Anisotropy A λ for:
[0045] Feature entropy E λ for:
[0046] The characteristic and ∑λ are: ∑λ=λ1+λ2+λ3;
[0047] Curvature change C λ for:
[0048] The verticality V is: V = 1 - n z ;
[0049] z-axis range R of point cloud cluster z For: R z =Max(z) - Min(z);
[0050] z-axis variance of point cloud clusters for:
[0051] The point cloud cluster density D is:
[0052] In the above formulas, λ1, λ2, λ3 represent the covariance eigenvalues, and n z The z-axis component of the normal vector of each point is represented, k represents the k value of the point cloud cluster when using the KD-tree nearest neighbor search, and r represents the search radius;
[0053] Two-dimensional planar features include the distance dis between each point within the vertical cross-section of the tunnel and the top of the rail. (i′,j) ;
[0054]
[0055] In the formula, Indicates the actual position of the rail top The coordinates, (x (i′,j) ,z (i′,j) ) represents the j-th point under the i′-th cross section.
[0056] Furthermore, the process of creating a support vector machine using the training set and obtaining the support vector machine model with optimal parameters is as follows:
[0057] Define a separating hyperplane H(x). When H(x) = 0, it indicates that the sample point lies on the separating hyperplane; when H(x) > 0, it indicates that the sample class is y = 1; when H(x) < 0, it indicates that the sample class is y = -1.
[0058] The expression for H(x) is:
[0059] H(x) = w T x+b;
[0060] In the formula, w represents the parameter vector and b represents the translation vector;
[0061] The expression for constructing the optimal separating hyperplane is:
[0062]
[0063] In the formula, i5 = 1, 2, ..., m;
[0064] The expression for the optimal separating hyperplane is transformed and Lagrange multipliers are introduced. After resolution, the final optimization objective function is:
[0065]
[0066] In the formula, α represents a vector, and i5 and j both represent indices;
[0067] Define kernel function With a penalty coefficient C > 0, the final optimization objective function is:
[0068]
[0069] In the formula, j = 1, 2, ..., m;
[0070] The SMO algorithm is used to solve for the vector α and obtain the corresponding parameter vector w:
[0071]
[0072] Find all S support vectors based on the KKT conditions, and calculate the average value b for each support vector:
[0073]
[0074] The optimal hyperplane is determined, and the classification decision function is:
[0075] f(x) = sign(w T x+b).
[0076] According to a second aspect of the embodiments of this application, based on the three-dimensional point cloud extraction method according to any one of claims 1 to 9, this application also provides a three-dimensional point cloud extraction system, which includes a scanning module, a downsampling module, a filtering module and an extraction module;
[0077] The scanning module is used to acquire initial point cloud data;
[0078] The downsampling module is used to segment the initial point cloud data to be calculated from the initial point cloud data according to the mileage range and perform downsampling processing on the initial point cloud data.
[0079] The filtering module performs ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm in order to identify and remove ground features within the tunnel.
[0080] The extraction module is used to obtain a training set and a test set based on the filtered point cloud data, and to create a support vector machine using the training set, and then use the support vector machine to extract the tunnel point cloud.
[0081] As can be seen from the above specific embodiments of this application, it has at least the following beneficial effects: The three-dimensional point cloud extraction method provided by this application uses the CSF algorithm to perform ground filtering on the initial point cloud obtained in the tunnel, and then converts the retained discrete three-dimensional point cloud into an associated topological structure, constructs a variety of three-dimensional spatial features and two-dimensional planar features to expand the point cloud data, and finally extracts the tunnel point cloud quickly and accurately by training the optimal support vector machine model. It has the advantages of high accuracy, good robustness and fast processing speed. This application can also be applied to the field of railway equipment inspection, which can accurately remove the point clouds of accessories such as ladders, level gauges and targets in the point cloud of railway tank cars, retain the tank wall data, improve the accuracy of subsequent volume calculation, and lay the foundation for intelligent inspection and testing of railway tank cars.
[0082] It should be understood that the above general description and the following specific embodiments are merely exemplary and illustrative, and do not limit the scope of the claims made in this application. Attached Figure Description
[0083] The accompanying drawings, which are part of the specification of this application, illustrate embodiments of the present application and are used together with the description in the specification to illustrate the principles of the present application.
[0084] Figure 1 This is a schematic diagram of the initial point cloud data of a tunnel in the existing technology.
[0085] Figure 2 A flowchart illustrating a three-dimensional point cloud extraction method provided for a specific implementation of this application.
[0086] Figure 3 This is a schematic diagram of the initial point cloud data obtained in a three-dimensional point cloud extraction method provided in a specific embodiment of this application.
[0087] Figure 4 This is a flowchart illustrating the ground filtering of a portion of the downsampled initial point cloud data based on the CSF algorithm in a three-dimensional point cloud extraction method provided in a specific embodiment of this application.
[0088] Figure 5 The flowchart illustrates a method for extracting tunnel point clouds using a support vector machine in a specific embodiment of this application.
[0089] Figure 6 This application provides a graphical representation of a linearly separable support vector machine in a three-dimensional point cloud extraction method.
[0090] Figure 7 The diagram illustrates the result of filtering the ground in point cloud data based on the CSF algorithm in a three-dimensional point cloud extraction method provided in this application. Figure (a) represents the initial point cloud, Figure (b) represents the point cloud after being segmented by mileage, Figure (c) represents the point cloud after downsampling, and Figure (d) represents the point cloud after removing the ground using the CSF algorithm.
[0091] Figure 8 This is a schematic diagram of tunnel point cloud extraction results for different test sets in a three-dimensional point cloud extraction method provided in a specific embodiment of this application.
[0092] Figure 9 This is a schematic diagram illustrating the application of a three-dimensional point cloud extraction method in railway equipment inspection, which is a specific embodiment of this application. Detailed Implementation
[0093] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the spirit of the content disclosed in this application will be clearly explained below with reference to the accompanying drawings and detailed description. After understanding the embodiments of this application, any person skilled in the art can make changes and modifications based on the technology taught in this application without departing from the spirit and scope of this application.
[0094] The illustrative embodiments and descriptions provided in this application are for explaining the application, but are not intended to limit the application. Furthermore, elements / components using the same or similar reference numerals in the drawings and embodiments are used to represent the same or similar parts.
[0095] The terms “first,” “second,” etc., used in this document are not intended to specifically refer to order or sequence, nor are they used to limit this application; they are merely used to distinguish elements or operations described using the same technical terms.
[0096] The terms “include,” “including,” “have,” “contain,” etc., used in this article are all open-ended terms, meaning that they include but are not limited to.
[0097] The term "and / or" as used herein includes any or all of the things mentioned.
[0098] The term "multiple" in this article includes "two" and "more than two"; the term "multiple groups" in this article includes "two groups" and "more than two groups".
[0099] Certain terms used to describe this application will be discussed below or elsewhere in this specification to provide additional guidance to those skilled in the art in describing the application.
[0100] Due to the complex construction environment at the tunnel site, in addition to the scanned tunnel point cloud data, the following point cloud data are also included: (1) the ground; (2) the trolleys, slag removal vehicles and shotcrete vehicles under construction; (3) the construction personnel on site; (4) the ventilation pipes and drainage pipes connecting the tunnel; (5) the water vapor and dust remaining after the tunnel blasting. Therefore, it is necessary to use a fast and accurate filtering method to remove the above noise point clouds and retain the tunnel point cloud.
[0101] The initial point cloud acquired by the 3D scanner inside the tunnel contains a large amount of data, of which only the tunnel point cloud is the correct data used for subsequent tunnel quality inspection. Therefore, it is necessary to extract the tunnel 3D point cloud data.
[0102] like Figure 2 As shown, the 3D point cloud extraction method provided in this application includes the following steps:
[0103] S1. Obtain initial point cloud data;
[0104] To ensure that the acquired point cloud data represents real-world geodetic coordinates, the following two methods can be used to acquire point cloud data:
[0105] One approach is to use a total station scanner to scan the tunnel and directly obtain absolute coordinate point cloud data. This method is relatively simple for personnel to operate, but the scanning time is relatively long.
[0106] Another approach is to use a ground-based 3D laser scanner combined with a target to scan the tunnel. This first indirectly acquires relative coordinate point cloud data, which is then converted into absolute coordinate point cloud data through coordinate registration. While this method is more complex to operate manually, it offers a shorter scanning time.
[0107] In practice, an appropriate method can be selected to obtain initial point cloud data based on the existing equipment and workflow on site. The obtained initial point cloud data is as follows: Figure 3 As shown.
[0108] It should be noted that the real-world geodetic coordinates refer to the three-dimensional coordinates under the CGCS2000 national geodetic coordinate system. In actual engineering calculations, calculations should be performed according to geodetic coordinates.
[0109] S2. Based on the mileage range, segment the initial point cloud data to be calculated into a portion of the initial point cloud data and perform downsampling processing on this portion of the initial point cloud data.
[0110] It should be noted that the mileage range is determined based on the site requirements; for example, the mileage range can be 100m to 200m.
[0111] Downsampling the initial point cloud data to be calculated, filtering out redundant point clouds, and retaining representative point cloud data within a local area can reduce the amount of point cloud data, reduce the amount of computation, improve the processing speed of subsequent point cloud data, and further ensure the accuracy of subsequent tunnel 3D point cloud quality detection.
[0112] S3. Based on the CSF (Cloth Simulation Filter) algorithm, ground filtering is performed on a portion of the downsampled initial point cloud data to identify and remove relatively continuous ground features within the tunnel.
[0113] The CSF algorithm assumes a cloth is laid on top of an original inverted point cloud. By analyzing the relationship between each node on the cloth and the corresponding point cloud, iteratively derives the shape of the cloth, which represents the ground shape. Based on this shape, ground and non-ground areas can be distinguished.
[0114] By analyzing the forces acting on each particle in three-dimensional space (e.g., external forces composed of gravity and collision forces, and internal forces of traction), the following basic formula is defined:
[0115]
[0116] In equation (1), F ext (X,t) represents the external force F acting on the particle at time t and position X. int (X,t) represents the internal force experienced by the particle at position X at time t, and m represents the particle mass (usually 1).
[0117] Assume the particles move only vertically relative to the ground, initially laid out on top of an inverted point cloud. As they are affected by external forces, the cloth particles will sink, sometimes intersecting with the point cloud. To determine which cloth particles intersect with the point cloud, we check if the vertical height of a particle at a given point and the height of the current point cloud are both lower than the height of the ground point cloud. If so, the particle at that point is considered immovable; otherwise, it is considered movable.
[0118] By considering the internal forces of movable particles, the shape of the cloth can be finally fitted.
[0119] Specifically, such as Figure 4 As shown, the process of performing ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm is as follows:
[0120] S31. Filter the initial point cloud data after downsampling, remove outliers, and invert the point cloud.
[0121] S32. Initially rasterize the grid, determine the grid size (Grid Resolution, GR) based on the actual point cloud density, and initially position it at the maximum value of the point cloud's vertical coordinate.
[0122] S33. Project the point cloud and grid particles onto the same horizontal plane, find the nearest point (Corresponding Point, CP) of each particle, and define the height value of the point before projection as the Intersection Height Value (IHV). IHV represents the lowest position that the current particle can reach.
[0123] S34. Calculate the distance each particle moves under the influence of external forces (considering only gravity), compare the height after the position change with IHV, and if the height after the position change is less than or equal to IHV, set the height of the particle to be equal to the height of IHV and mark the particle as an immovable particle.
[0124] The distance a particle travels under the influence of an external force is calculated using the following formula:
[0125]
[0126] In equation (2), X(t+Δt) represents the distance the particle moves under the influence of external force, X(t) represents the position of the particle at time t, X(t-Δt) represents the position of the particle at time t-Δt, Δt represents the time interval, and G represents the gravitational constant.
[0127] S35. Calculate the distance each particle moves under the influence of internal forces. There are three cases between two adjacent particles: 1) Both are subject to forces and are movable particles, then they move the same distance in opposite directions; 2) The forces on them are different, one moves and the other does not; 3) Neither is subject to any force and is an immovable particle, so it remains stationary. The distance a particle moves under the influence of internal forces is calculated using the following formula:
[0128]
[0129] In equation (3), b represents the displacement vector of the particle. When the particle is movable, b = 1; otherwise, b = 0. Indicates the current particle, express neighboring particles, This represents the normalized vector in the vertical direction, i.e.
[0130] The number of times a particle moves is represented by a rigidity factor (RI). Common rigidity factors are 1, 2, and 3. The larger the rigidity factor, the harder the surface of the cloth and the flatter the surface tends to be.
[0131] S36. Continue iterating according to steps S34 and S35 until the maximum height change of all particles is less than the preset threshold or the number of iterations reaches the specified number, at which point the calculation stops.
[0132] S37. Calculate the distance between the rasterized particles and the original point cloud.
[0133] S38. Determine whether the distance between the rasterized particles and the original point cloud is less than a preset distance threshold. If so, determine that the current point cloud is a ground point cloud; otherwise, determine that the current point cloud is a non-ground point cloud.
[0134] S39. Determine whether all point clouds have been traversed. If yes, end the process; otherwise, return to step S37 and recalculate the distance between the rasterized particles and the original point cloud.
[0135] Point cloud data acquired inside tunnels typically occurs on relatively flat ground surfaces, exhibiting greater connectivity and similarity compared to other non-ground point clouds. Therefore, using CSF (Content Filtering) can effectively separate ground point clouds from non-ground point clouds, preserving the non-ground point clouds and laying the foundation for subsequent extraction of tunnel point clouds.
[0136] S4. Construct three-dimensional spatial features and two-dimensional planar features for the filtered point cloud data, and divide the three-dimensional spatial features and two-dimensional planar features into training set and test set. Use the training set to create a support vector machine, and use the support vector machine to extract tunnel point cloud.
[0137] Three-dimensional point clouds generally include spatial (x,y,z) coordinates, RGB colors, reflectivity, and other information. Feature data can be generated using point cloud data, and machine learning algorithms can learn and train on the feature data to generate a stable model, ultimately enabling rapid and accurate identification of target point clouds.
[0138] SVM (Support Vector Machine) is a classic machine learning algorithm used for classification. It takes the point cloud data of the tunnel to be extracted as input, constructs feature vectors, generates the optimal parameters of the model, and realizes the binary discrimination of whether the input point cloud is the tunnel point cloud, thereby achieving the purpose of extracting the tunnel point cloud and providing high-quality data for subsequent tunnel 3D point cloud cross-section quality inspection tasks.
[0139] like Figure 5 As shown, the process of extracting tunnel point clouds using support vector machines is as follows:
[0140] S41. Construct the feature vector of the tunnel point cloud. The specific process is as follows:
[0141] First, a 3D KD-tree is constructed on the point cloud data to transform the discrete 3D point cloud into an associated topological structure.
[0142] Secondly, the neighboring point cloud clusters of each point are found in the KD-tree, and the number of point cloud clusters is determined according to the actual point cloud density.
[0143] Finally, the covariance eigenvalues of all point clouds within the neighboring point cloud clusters are calculated to construct three-dimensional spatial features and two-dimensional planar features for subsequent support vector machine input.
[0144] Assume p (x,y,z) ∈U 3 N is a point cloud in a three-dimensional point cloud space. U (p) represents the point cloud p (x,y,z) In a KD-tree nearest neighbor search, the nearest point cloud cluster is searched, where n represents the number of point cloud clusters. The matrix formed by this point cloud cluster is:
[0145]
[0146] In equation (4), Let i represent the coordinates of the i2th point cloud cluster, and n represent the number of point cloud clusters, i2 = 1, 2, ..., n.
[0147] To find the center point of the point cloud cluster, construct a matrix B with the same number of rows and columns as matrix A:
[0148]
[0149] The covariance matrix of the point cloud cluster is:
[0150]
[0151] The covariance eigenvalues calculated from the covariance matrix of the point cloud clusters are λ1, λ2, and λ3. Using these eigenvalues, the following three-dimensional spatial features are constructed:
[0152] Divergence index S λ :
[0153]
[0154] Planarity index P λ :
[0155]
[0156] Linear exponent L λ :
[0157]
[0158] Isotropic O λ :
[0159]
[0160] Anisotropy A λ :
[0161]
[0162] Feature entropy E λ :
[0163]
[0164] Features and ∑λ:
[0165] ∑λ=λ1+λ2+λ3 (13)
[0166] Curvature change C λ :
[0167]
[0168] Verticality V:
[0169] V = 1 - n z (15)
[0170] In equation (15), n z This represents the z-axis component of the normal vector at each point.
[0171] z-axis range R of point cloud cluster z :
[0172] R z =Max(z)-Min(z) (16)
[0173] z-axis variance of point cloud clusters
[0174]
[0175] Point cloud cluster density D:
[0176]
[0177] In equation (18), k represents the k value of the point cloud clusters searched using the KD-tree nearest neighbor search, and r represents the search radius.
[0178] In addition, the point cloud is sliced along the parallel z-axis, and each slice represents the actual cross-section of the tunnel. To ensure the integrity of each cross-section shape, the slice thickness can be set to 10cm. Based on the designed cross-section and the designed track top position, the S of each actual cross-section is determined. i′ ={p1,p2,…,p n′ Actual rail top position Where p1, p2, ..., p n′ Represents the actual cross-section S i′ Let n′ represent the number of points on the xoz plane. Project the actual cross-section onto the xoz plane and calculate the distance dis between the j-th point on the i′-th cross-section and the top of the track on the i′-th cross-section. (i′,j) This distance is the two-dimensional planar feature, and the calculation formula is as follows:
[0179]
[0180] In equation (19), Indicates the actual position of the rail top The coordinates, (x (i′,j) ,z (i′,j) ) represents the j-th point under the i′-th cross section.
[0181] S42. Based on the constructed tunnel point cloud feature vector, divide the three-dimensional spatial features and two-dimensional planar features of the filtered point cloud data into training set and test set.
[0182] The training set is used to train the SVM model and determine the optimal parameters, so each sample in the sample set needs to be labeled.
[0183] Determine m train Input Samples
[0184] in, Let i4 represent the n-dimensional feature vector of the i4th sample, where i4 = 1, 2, ..., m train .
[0185] Based on the point cloud feature vector constructed in step S41, where n = 13, Indicates the category of the i-th sample. -1 indicates a non-tunnel point cloud, and 1 indicates a tunnel point cloud.
[0186] The test set is used as input to the optimal parameter model of SVM, and m test test samples The sample is input into the trained SVM model for tunnel point cloud discrimination. If it is determined to be a tunnel point cloud, the test sample is kept; otherwise, the test sample is discarded.
[0187] S43. Use the training set to create a support vector machine and obtain the support vector machine model with the optimal parameters;
[0188] Support Vector Machines (SVMs) solve convex optimization problems to find the most suitable support vectors and construct the optimal separating hyperplane for binary classification. When encountering linearly separable samples, soft margins can be introduced to reduce the impact of outliers and improve the robustness and generalization of the optimal separating hyperplane. When encountering linearly inseparable samples, the dimensionality of the sample feature space can be increased to construct the optimal separating hyperplane, and a suitable kernel function can be introduced to address the curse of computation in high-dimensional environments.
[0189] The specific process of creating a support vector machine using the training set obtained in step S42 as input samples and obtaining the support vector machine model with optimal parameters is as follows:
[0190] S431, such as Figure 6 As shown, a separating hyperplane H(x) is defined. When H(x) = 0, it indicates that the sample point is located on the separating hyperplane; when H(x) > 0, it indicates that the sample class is y = 1; when H(x) < 0, it indicates that the sample class is y = -1.
[0191] The expression for H(x) is:
[0192] H(x) = w T x+b (20)
[0193] In equation (20), w represents the parameter vector and b represents the translation vector.
[0194] S432. Construct the optimal separating hyperplane, i.e., find... Figure 4The hyperplane shown in the figure is the one with the largest interval, i.e.:
[0195]
[0196] In equation (21), i5 = 1, 2, ..., m.
[0197] S433. Transform equation (21) and introduce Lagrange multipliers. After resolution, the final optimized objective function is:
[0198]
[0199] In equation (22), α represents a vector, and i5 and j both represent serial numbers.
[0200] S434. To solve the problem of linearly inseparable samples, define a kernel function. With a penalty coefficient C > 0, the final optimization objective function is:
[0201]
[0202] In equation (23), j = 1, 2, ..., m.
[0203] S435. By using the SMO (Sequential Minimal Optimization) algorithm to solve for vector α, the corresponding parameter vector w can be obtained:
[0204]
[0205] S436. Based on the KKT conditions, find all S support vectors and calculate the average value b for each support vector:
[0206]
[0207] S437. Determine the optimal hyperplane; the classification decision function is:
[0208] f(x) = sign(w T x+b) (26)
[0209] S44. Using the trained support vector machine model, take the test set as input and perform binary classification on the tunnel point cloud; if the output result is 1, then the current input is determined to be a tunnel point cloud, and the point cloud data in the test set of the current input is retained; if the output result is -1, then the current input is a non-tunnel point cloud, and the point cloud data in the test set of the current input is discarded.
[0210] The following specific embodiment illustrates the tunnel 3D point cloud extraction method provided in this application.
[0211] Point cloud data were collected using a Leica RTC360 terrestrial 3D laser scanner at the intersection tunnel of the Xuanji Railway, the Shangxu Tunnel of the Jinjian Railway, and the Xiling Tunnel of the Xishi Railway.
[0212] Ground filtering in point cloud data based on the CSF algorithm:
[0213] like Figure 7 As shown in (a), the initial point cloud length is 153.9 m. During the scanning process, the closer the point cloud is to the scanner, the higher the density of the scanned point cloud and the better the obtained point cloud data. Therefore, it is necessary to segment the point cloud near the scanner according to mileage before calculation.
[0214] like Figure 7 As shown in (b), this embodiment segments a 21m long portion of the point cloud for calculation, resulting in a point cloud count of 23,215,278. To accelerate subsequent calculations, the current point cloud is downsampled. Figure 7 As shown in (c), the number of point clouds becomes 196132 after downsampling. Finally, the CSF algorithm is used to remove ground data, retaining the remaining point clouds. Figure 7 As shown in (d), it can be seen that the connectivity between the tunnel point cloud and the non-tunnel point cloud is poor and the dispersion is strong.
[0215] Extraction of tunnel point clouds based on SVM:
[0216] Construct three-dimensional spatial features and two-dimensional planar features, and normalize each set of features to prevent the influence of excessively large or small feature values.
[0217] 70% of the feature data was allocated to the training set, and 30% to the test set. Tunneled and non-tunneled point clouds in the training set were labeled. A Gaussian kernel function was used, and other optimal parameters were determined. The average value of the five-fold cross-validation was used as the score of the current trained model, and the accuracy was defined as [missing value]. Where N represents the number of correctly predicted point clouds, and M represents the total number of point clouds. The final prediction accuracy on different test sets is shown in Table 1.
[0218] Table 1. Support Vector Machine Prediction Results
[0219]
[0220] As shown in Table 1, the prediction accuracy of this support vector machine model on different test sets is approximately 99%, which is relatively high. This is because after the CSF algorithm accurately removes the ground, the non-tunnel point cloud and the tunnel point cloud are in a discrete state and have obvious feature inconsistencies, thus allowing for accurate extraction of features such as... Figure 8 The tunnel point cloud extraction results are shown.
[0221] A small number of pipelines, lines, and low sidewalls that are very close to the tunnel may be mistakenly identified as tunnel point clouds. However, these account for a very small proportion of the total number of point clouds and their impact on the subsequent quality inspection of the tunnel's three-dimensional point cloud cross-section is negligible.
[0222] The three sets of test data in Table 1 are all different tunnels with similar shapes, but the same training model can be used to extract tunnel point clouds. Therefore, this application has good versatility.
[0223] The 3D point cloud extraction method provided in this application first uses the CSF algorithm to perform ground filtering on the initial point cloud obtained in the tunnel. Then, the retained discrete 3D point cloud is converted into a related topological structure, and various 3D spatial features and 2D planar features are constructed to expand the point cloud data. Finally, the tunnel point cloud is extracted quickly and accurately by training an optimal support vector machine model. This application has the following advantages:
[0224] (1) High accuracy;
[0225] Since tunnel point clouds and non-tunnel point clouds have obvious feature inconsistencies, CSF filtering is first used to remove the ground, then a point cloud feature space is constructed, and support vector machine is used to extract tunnel point clouds. This can accurately extract tunnel point clouds and reduce the misjudgment that may occur when detecting tunnel point clouds in the future.
[0226] (2) Good robustness;
[0227] Because the construction conditions inside tunnels are quite complex, point cloud data of construction trolleys, slag removal vehicles, shotcrete vehicles, personnel, ventilation pipes, drainage pipes, etc. are often acquired together. However, the features of tunnel point clouds are relatively stable compared to these types of noise point clouds, and the features of tunnels with similar shapes are basically consistent. Therefore, the model can be transferred to similar tunnels and has good robustness.
[0228] (3) It is relatively fast;
[0229] Compared with existing technologies, the three-dimensional point cloud extraction method provided in this application has a significantly improved processing speed, can meet on-site construction specifications, and has good market prospects.
[0230] (4) It has strong migratory ability;
[0231] The three-dimensional point cloud extraction method provided in this application can be successfully transferred to the field of railway equipment inspection. In particular, it has good recognition ability in extracting tank bodies from three-dimensional laser scanning point cloud data of railway tank cars. It can remove the point clouds of accessories such as ladders, level gauges, and targets inside the tank, and accurately extract the tank wall, laying a good foundation for subsequent calculation of tank volume and intelligent inspection and verification of railway tank cars.
[0232] Based on the three-dimensional point cloud extraction method provided in the embodiments of this application, the embodiments of this application also provide a three-dimensional point cloud extraction system, which includes a scanning module, a downsampling module, a filtering module and an extraction module.
[0233] The scanning module is used to acquire initial point cloud data.
[0234] The downsampling module is used to segment the initial point cloud data to be calculated from the initial point cloud data according to the mileage range and to perform downsampling processing on the initial point cloud data.
[0235] The filtering module performs ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm to identify and remove relatively coherent ground features within the tunnel.
[0236] The extraction module is used to obtain training and test sets based on the filtered point cloud data, and to create a support vector machine using the training set, and then use the support vector machine to extract the tunnel point cloud.
[0237] It should be noted that the 3D point cloud extraction system provided in the above embodiments is only an example of the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the 3D point cloud extraction system can be divided into different program modules to complete all or part of the processing described above. In addition, the 3D point cloud extraction system and the 3D point cloud extraction method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0238] In an exemplary embodiment, this application also provides a storage medium, which is a computer-readable storage medium, such as a memory including a computer program, which can be executed by a processor to complete the steps in the aforementioned three-dimensional point cloud extraction method.
[0239] The embodiments of this application described above can be implemented in various hardware, software codes, or combinations thereof. For example, embodiments of this application can also be program code executing the methods described above in a data signal processor. This application can also relate to various functions executed by a computer processor, digital signal processor, microprocessor, or field-programmable gate array. The processor described above can be configured to perform specific tasks according to this application, which is accomplished by executing machine-readable software code or firmware code defining the specific methods disclosed in this application. The software code or firmware code can be developed into different programming languages and different formats or forms. The software code can also be compiled for different target platforms. However, the different code styles, types, and languages of the software code performing tasks according to this application and other types of configuration code do not depart from the spirit and scope of this application.
[0240] The above description is merely an illustrative embodiment of this application. Any equivalent changes and modifications made by those skilled in the art without departing from the concept and principles of this application shall fall within the scope of protection of this application.
Claims
1. A method for extracting three-dimensional point clouds, characterized in that, Includes the following steps: Obtain initial point cloud data; Based on the mileage range, a portion of the initial point cloud data to be calculated is segmented from the initial point cloud data, and this portion of the initial point cloud data is downsampled. Ground filtering is performed on a portion of the downsampled initial point cloud data based on the CSF algorithm; Three-dimensional spatial features and two-dimensional planar features are constructed from the filtered point cloud data. The three-dimensional spatial features and two-dimensional planar features are divided into training set and test set. Support vector machine is created using the training set and the tunnel point cloud is extracted using the support vector machine. The process of extracting tunnel point clouds using support vector machines is as follows: Construct the feature vector of the tunnel point cloud; Based on the constructed tunnel point cloud feature vector, the three-dimensional spatial features and two-dimensional planar features of the filtered point cloud data are divided into training set and test set; Use the training set to create a support vector machine and obtain the support vector machine model with optimal parameters; Using a trained support vector machine model, the test set is used as input to perform binary classification on the tunnel point cloud; if the output result is 1, the current input is determined to be a tunnel point cloud, and the point cloud data in the test set of the current input is retained; If the output is -1, it means that the current input is a non-tunnel point cloud, and the point cloud data in the current input test set is discarded; The process of creating a support vector machine using the training set and obtaining the support vector machine model with optimal parameters is as follows: Define the separating hyperplane ,when When, it indicates that the sample point is located on the separating hyperplane; when When, it indicates that the sample category is ;when When, it indicates that the sample category is ; The expression is: ; In the formula, Represents a parameter vector. Represents the translation vector; The expression for constructing the optimal separating hyperplane is: ; In the formula, ; The expression for the optimal separating hyperplane is transformed and Lagrange multipliers are introduced. After resolution, the final optimization objective function is: ; In the formula, Represents a vector. and All represent serial numbers; Define kernel function and penalty coefficient The final optimization objective function is: ; In the formula, j ; The vector is solved using the SMO algorithm. And obtain the corresponding parameter vector. : ; Find all S support vectors based on the KKT conditions, and calculate the average value of each support vector. : ; The optimal hyperplane is determined, and the classification decision function is: 。 2. The three-dimensional point cloud extraction method according to claim 1, characterized in that, The method for obtaining the initial point cloud data is as follows: The tunnel was scanned using a total station scanner to directly obtain absolute coordinate point cloud data; Alternatively, a ground-based 3D laser scanner can be used in conjunction with a target to scan the tunnel. This first indirectly acquires relative coordinate point cloud data, which is then converted into absolute coordinate point cloud data through coordinate registration.
3. The three-dimensional point cloud extraction method according to claim 1, characterized in that, The process of performing ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm is as follows: Filter out outliers from a portion of the initial point cloud data after downsampling, and invert the point cloud. Initially, the grid is rasterized, and the grid size is determined based on the actual point cloud density. The initial position is located at the maximum value of the point cloud's vertical coordinate. Project the point cloud and grid particles onto the same horizontal plane and calculate the lowest position that the current particle can reach. Calculate the distance each particle travels under the influence of external forces, considering only gravity; Calculate the distance each particle moves under the influence of internal forces; The calculation continues to calculate the distance each particle moves under the influence of external forces when only gravity is considered, as well as the distance it moves under the influence of internal forces, until the maximum height change of all particles is less than a preset threshold or the number of iterations reaches a specified number, at which point the calculation stops. Calculate the distance between the rasterized particles and the original point cloud; Determine whether the distance between the rasterized particles and the original point cloud is less than a preset distance threshold. If it is, determine that the current point cloud is a ground point cloud; otherwise, determine that the current point cloud is a non-ground point cloud. Determine if all point clouds have been traversed. If so, end the process; otherwise, return and recalculate the distance between the rasterized particles and the original point cloud.
4. The three-dimensional point cloud extraction method according to claim 3, characterized in that, The distance the particle travels under the influence of external forces, considering only gravity, is: ; In the formula, This represents the distance a particle travels under the influence of an external force. Indicates that the particle is in Location at any given moment Indicates that the particle is in Location at any given moment Indicates time interval, denoted by , where m represents the gravitational constant and m represents the particle mass.
5. The three-dimensional point cloud extraction method according to claim 3, characterized in that, The distance the particle moves under the influence of internal force is: ; In the formula, This represents the displacement vector of the particle; when the particle is a movable particle, ;otherwise, ; Indicates the current particle, express neighboring particles, Represents the normalized vector in the vertical direction. .
6. The three-dimensional point cloud extraction method according to claim 1, characterized in that, The process of constructing the tunnel point cloud feature vector is as follows: Construct a 3D KD-tree on point cloud data to transform discrete 3D point clouds into an associated topological structure; Find the neighboring point cloud clusters for each point in the KD-tree. The number of point cloud clusters is determined based on the actual point cloud density. Calculate the covariance eigenvalues of all point clouds within a neighboring point cloud cluster, and construct 3D spatial features and 2D planar features.
7. The three-dimensional point cloud extraction method according to claim 6, characterized in that, The three-dimensional spatial features include the divergence index. Planarity Index Linear exponent Isotropic Anisotropy Feature entropy Features and Curvature changes Verticality Clusters of clouds Axial range Clusters of clouds Axial variance and point cloud cluster density ; Divergence Index for: ; Planarity Index for: ; Linear exponential for: ; isotropic for: ; Anisotropy for: ; Feature Entropy for: ; Features and for: ; Curvature variation for: ; Verticality for: ; dotted cloud clusters Axial range for: ; dotted cloud clusters Axial variance for: ; Point cloud cluster density for: ; In the above formulas, Represents the eigenvalues of the covariance. Represents the normal vector of each point Axial components, This indicates that a KD-tree nearest neighbor search is used to search point cloud clusters. value, Indicates the search radius; Two-dimensional planar features include the distance between each point within the vertical cross-section of the tunnel and the top of the rail. ; ; In the formula, Indicates the actual position of the rail top coordinates Indicates the first The j-th point under a cross-section.
8. An extraction system based on the three-dimensional point cloud extraction method according to any one of claims 1 to 7, characterized in that, It includes a scanning module, a downsampling module, a filtering module, and an extraction module; The scanning module is used to acquire initial point cloud data; The downsampling module is used to segment the initial point cloud data to be calculated from the initial point cloud data according to the mileage range and perform downsampling processing on the initial point cloud data. The filtering module performs ground filtering on a portion of the downsampled initial point cloud data based on the CSF algorithm in order to identify and remove ground features within the tunnel. The extraction module is used to obtain a training set and a test set based on the filtered point cloud data, and to create a support vector machine using the training set, and then use the support vector machine to extract the tunnel point cloud.
Citation Information
Patent Citations
Pavement scene target identification method based on laser radar point cloud
CN114612795A
Building three-dimensional extraction method based on multispectral laser radar point cloud data
CN114972628A