Point cloud plane segmentation method
By performing density clustering of point clouds on Gaussian spheres and using global energy functions to determine the optimal density threshold, the problem of automatically determining the density threshold in the prior art is solved, and precise plane segmentation and clustering of point clouds is realized, meeting the high-precision application needs.
Patent Information
- Application Number
- CN202411843584.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-14
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is difficult to automatically determine the effective density threshold, making it difficult to cluster point clouds into different clusters, thereby affecting the effect of point cloud segmentation.
Accurate plane segmentation of point clouds is achieved by density clustering on Gaussian spheres and determining the optimal density threshold using global energy functions.
Automatic density threshold is realized, the effect of point cloud clustering is improved, and the point cloud can be accurately segmented to meet the accuracy requirements of indoor three-dimensional reconstruction and other applications.
Smart Images

Figure CN119723085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional point cloud reconstruction, and in particular to a point cloud plane segmentation method. Background Art
[0002] With the continuous development of LiDAR technology, 3D point cloud segmentation has attracted great interest among computer vision researchers. Man-made structures such as buildings are usually composed of planes, which makes plane segmentation a critical task in 3D point cloud applications. Recently, supervised plane segmentation methods have become increasingly popular, and many methods have been proposed to address this problem. Although these methods can provide a comprehensive description of the points, they require a large number of training samples, making the labeling process time-consuming and labor-intensive. In addition, the limited availability of public datasets restricts the progress of these methods. In contrast, traditional methods remain popular due to their simplicity and high reliability.
[0003] Clustering-based methods segment point sets by calculating local feature attributes of three-dimensional point cloud data. Among them, density-based clustering is particularly common, and DBSCAN is a popular choice that can detect clusters within a fixed radius and density threshold. Czerniawski et al. (2018) (Czerniawski, T., Sankaran, B., Nahangi, M., Haas, C., Leite, F., 2018. 6D DBSCAN-based segmentation of building point clouds for planar object classification.) applied DBSCAN to the six-dimensional clustering space and combined it with supervised methods to detect and extract planes in point clouds. However, for different types of point clouds, the radius and density threshold of DBSCAN usually need to be manually iteratively adjusted. Chen et al. (2023) (Chen, H., Xie, T., Liang, M., Liu, W., Liu, PX, 2023. A local tangentplane distance-based approach to 3D point cloud segmentation via clustering.) performed multidimensional scaling analysis on the point cloud to reconstruct the correlation information between data points in three-dimensional Euclidean space. The resulting reconstructed point cloud exhibits separation between different planes. They then proposed a density-based adaptive DBSCAN clustering method to cluster and segment the reconstructed point cloud. However, this method is limited to segmenting points with significant density features and has difficulty processing sparser points after reconstruction using density clustering. Therefore, there is still a significant challenge in automatically determining an effective density threshold to cluster the entire point cloud into different clusters. Summary of the invention
[0004] In order to solve the problem that the existing traditional point cloud segmentation technology cannot automatically determine the effective density threshold, thus making it difficult to effectively cluster the point cloud into different clusters, the present invention provides a point cloud plane segmentation method, which can achieve accurate plane segmentation from the point cloud by density clustering the point cloud on a Gaussian sphere and using a global energy function to determine the optimal density threshold.
[0005] The present invention provides a point cloud plane segmentation method, comprising:
[0006] Step 1: Obtain point cloud data;
[0007] Step 2: Calculate the normal vector of each point in the point cloud data based on PCA;
[0008] Step 3: Performing Gaussian mapping on the points in the point cloud data based on the normal vector to generate a Gaussian sphere;
[0009] Step 4: Calculate the density of the points in the point cloud data based on the Gaussian sphere, generate a density threshold based on the density of the points, generate a number of clustering results according to the density threshold, and extract the plane intersection points corresponding to the number of clustering results;
[0010] Step 5: determining an optimal clustering result from the plurality of clustering results by using an energy function, and preliminarily segmenting the point cloud data according to the optimal clustering result;
[0011] Step 6: Allocate the plane intersection points of the optimal clustering result to the plane one by one;
[0012] Step 7: Perform fusion processing on the over-segmented planes to obtain the final segmentation result of the point cloud data.
[0013] Furthermore, the step 2 specifically includes:
[0014] Step 2.1: Calculate the resolution of the point cloud data. The resolution is calculated by the following formula:
[0015]
[0016] Where R represents the resolution, n p Represents the number of points in the point cloud data, d ij Indicates point P i The closest point P j The Euclidean distance of
[0017] Step 2.2: Select points within the range of δ times the resolution of each point in the point cloud data to construct a covariance matrix to calculate the normal vector of the point.
[0018] Further, the Gaussian sphere is as follows:
[0019]
[0020] Among them, Z represents the set of points on the Gaussian sphere, R 3 represents a three-dimensional vector space, Indicates point P i According to the normal vector (n xi ,n yi ,n zi ) direction after being projected onto the Gaussian sphere.
[0021] Furthermore, the step 4 calculates the density of the points in the point cloud data according to the Gaussian sphere, generates a density threshold based on the density of the points, and generates a number of clustering results according to the density threshold, specifically including:
[0022] Step 4.1: Calculate the density of each point on the Gaussian sphere;
[0023] Step 4.2: Calculate the density threshold δ of the point cloud data based on the density of the points
[0024]
[0025] Among them, d i Indicates point P i The density, n p represents the number of points in the point cloud data, and δ represents the density threshold of the point cloud data;
[0026] Step 4.3: Traverse the points on the Gaussian sphere, find the points whose density is greater than the density threshold, and generate a density threshold set Den = {d1, d2, d3, ..., d n |d i <d j ,i <j};
[0027] Step 4.4: Calculate the threshold set D of plane intersection points using all adjacent densities in the density threshold set thr
[0028] D thr ={th1,th2,th3,…,th k |th i <th j ,i <j}
[0029]
[0030] Among them, i Indicates the threshold for extracting plane intersection points;
[0031] Step 4.5: Based on the threshold set D of the plane intersection thr For each threshold in the point cloud data, the points with a density greater than the threshold of the current plane intersection are plane intersection points, and the points with a density less than the threshold of the current plane intersection are plane points. The plane points are clustered Euclideanly to generate different planes. The threshold set D of the plane intersection is thr Generate k density clustering results Re = {r1, r2, r3,, ..., r i ,...,r k}, where r i Represents the i-th clustering result.
[0032] Furthermore, in step 5, determining the optimal clustering result from the plurality of clustering results by using an energy function specifically includes:
[0033] Step 5.1: For any clustering result among several clustering results, calculate the clustering plane error term in the clustering result:
[0034]
[0035] Where errd represents the error term, ζ represents the set of all planes of clustering, ||p|| represents the number of points in ζ, and ψ i A single plane representing clustering, one of the ζ planes, dis(p ij ,ψ i ) represents point p ij To plane ψ i The vertical distance;
[0036] Step 5.2: Calculate the penalty term of the energy function,
[0037]
[0038] Among them, P en represents the penalty term, p b represents the number of plane intersections, ||ψ|| represents the number of planes;
[0039] Step 5.3: Calculate the energy function of the clustering result based on the error term and the penalty term
[0040] E=errd+P en
[0041] Where E represents the energy function;
[0042] Step 5.4: Repeat steps 5.1 to 5.3 until the energy functions of all density clustering results are calculated, and select the clustering result with the smallest energy function as the optimal clustering result.
[0043] Furthermore, step 6 allocates the plane intersection points of the optimal clustering result to the plane one by one, specifically including:
[0044] Step 6.1: Find the two plane clusters closest to the plane intersection point. The distance from the plane intersection point to the plane cluster is calculated by the following formula:
[0045] d c =argmin(d(x i ,y i ,z i )),(x i ,y i ,z i )∈ψ
[0046] Among them, d c Represents the distance from the point to the plane cluster, d(x i ,y i ,z i ) represents a point (x i ,y i ,z i ) and the distance between the current point;
[0047] Step 6.2: Calculate the orthogonal distance from the plane intersection point to the fitting plane of the two nearest plane clusters
[0048]
[0049] Among them, d o It represents the orthogonal distance from the point to the fitting plane, A, B, C and D are the plane equation coefficients, and x, y and z are the coordinate values of the point;
[0050] Step 6.3: Assign the plane intersection points to the planes with the smallest orthogonal distance.
[0051] Furthermore, in step 7, the fusion processing of the over-segmented planes specifically includes: determining the normal vector angle of each plane relative to the adjacent plane, and if the angle is less than θ, merging the two planes into one plane.
[0052] Beneficial effects of the present invention:
[0053] The proposed method first maps the point cloud onto a Gaussian sphere, which enhances the density characteristics of the point cloud. Then an energy function is introduced into the density clustering process to determine the optimal density threshold of the intersection points of the segmentation planes. Finally, a parameter-free intersection point assignment method is used to assign these points to the best fitting plane.
[0054] The robustness of the method is demonstrated by evaluating three different data sets. Comprehensive experiments show that the method can obtain satisfactory results for high-quality synthetic point clouds, low-quality roof point clouds, and more complex room point clouds. The recall rate and precision of the segmentation results of the present invention can reach 95%, which can meet the accuracy requirements of subsequent indoor 3D reconstruction work and provide more powerful data support for applications such as building information management, indoor navigation positioning, and intelligent planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 One of the flow charts of a point cloud plane segmentation method provided by an embodiment of the present invention;
[0056] Figure 2 A second flow chart of a point cloud plane segmentation method provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of Gaussian mapping results provided by an embodiment of the present invention;
[0058] Figure 4 A schematic diagram of plane intersection extraction results provided by an embodiment of the present invention;
[0059] Figure 5 A schematic diagram of the intersection allocation result provided by an embodiment of the present invention;
[0060] Figure 6 A schematic diagram of an initial point cloud provided by an embodiment of the present invention;
[0061] Figure 7 A schematic diagram of a point cloud plane segmentation result provided by an embodiment of the present invention;. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] like Figure 1 and Figure 2 As shown, an embodiment of the present invention provides a point cloud plane segmentation method, comprising:
[0064] Step 1: Obtain point cloud data;
[0065] Specifically, point cloud data is synthesized using the point cloud processing software CloudCompare or the data sets Matterport3D and Stanford large-scale 3D Indoor Spaces Dataset are downloaded to obtain point cloud data. It is understood that obtaining point cloud data includes but is not limited to the method proposed in the embodiment of the present invention, and point cloud data extracted by other data sets or means can also use the method provided by the present invention, which will not be elaborated in detail here.
[0066] Step 2: Calculate the point cloud normal vector.
[0067] Specifically, the normal vector of each point in the point cloud data is calculated based on principal component analysis (PCA), including:
[0068] Step 2.1: Calculate the resolution of the point cloud data. The resolution R is calculated by the following formula:
[0069]
[0070] Among them, R represents the resolution of the point cloud data, n p Represents the number of points in the point cloud data, d ij Indicates point P i The closest point P j The Euclidean distance of
[0071] Step 2.2: Select points within the range of δ times the resolution of each point in the point cloud data to construct a covariance matrix to calculate the normal vector of the point. Specifically, in order to fully capture the normal vector of each point, δ=3 is set in the embodiment of the present invention. After the calculation is completed, the point cloud data is represented as follows:
[0072] PC={p1,p2,p3,...,p i ,…,p n}
[0073] p i =(x i ,y i ,z i ,n xi ,n yi ,n zi )
[0074] Among them, PC represents the point cloud data set, p i represents the i-th point in the point cloud data, (x i ,y i ,z i ) represents point P i The original coordinates, (n xi ,n yi ,n zi ) represents point Pi The normal vector of .
[0075] Step 3: Gaussian mapping.
[0076] Specifically, based on the normal vector, the points in the point cloud data are Gaussian mapped to generate a Gaussian sphere, which enhances the density feature of the point cloud. The Gaussian sphere is defined as follows:
[0077]
[0078] Among them, Z represents the set of points on the unit sphere (Gaussian sphere), R 3 represents a three-dimensional vector space, Indicates point P i According to the normal vector (n xi ,n yi ,n zi ) direction is projected onto the Gaussian sphere, such as Figure 3 As shown, the point cloud after Gaussian mapping and the original point cloud data.
[0079] Step 4: Generate several Euclidean clustering results based on the density threshold.
[0080] Specifically, the density of points in the point cloud data is calculated based on the Gaussian sphere, a density threshold is generated based on the density of the points, and several clustering results are generated according to the density threshold, and the plane intersection points corresponding to the several clustering results are extracted, which specifically includes:
[0081] Step 4.1: Calculate the density of each point on the Gaussian sphere;
[0082] Specifically, the number of points within a certain range of a selected point is set as the density of the point. In the embodiment of the present invention, the number of points within a range of 0.1 of each point in the Gaussian sphere is selected as the density of the point.
[0083] Step 4.2: Calculate the density threshold δ of the point cloud data based on the density of the points
[0084]
[0085] Among them, d i Indicates point P i The density, n p represents the number of points in the point cloud data, and δ represents the density threshold of the point cloud data;
[0086] Step 4.3: Traverse the points on the Gaussian sphere, find the points whose density is greater than the density threshold, and generate the density threshold set Den = {d1, d2, d3, ..., d n |d i <d j ,i <j};
[0087] Step 4.4: Use all adjacent densities in the density threshold set to calculate the threshold set D for extracting plane intersection points thr
[0088] D thr ={th1,th2,th3,…,th k |th i <th j ,i <j}
[0089]
[0090] Among them, i Indicates the threshold for extracting plane intersection points;
[0091] Step 4.5: Threshold set D based on plane intersection thr For each threshold in the point cloud data, the points with a density greater than the threshold of the current plane intersection point are plane intersection points, and the points with a density less than the threshold of the current plane intersection point are plane points. The plane points are clustered in an Euclidean way to generate the threshold set D of the plane intersection points in different planes. thr Generate k density clustering results Re = {r1, r2, r3,, ..., r i ,...,r k}, where r i Represents the i-th clustering result.
[0092] Step 5: Determine the optimal clustering result through the energy function.
[0093] Specifically, the optimal clustering result is determined from a number of clustering results through an energy function, and the point cloud data is preliminarily segmented according to the optimal clustering result, including:
[0094] Step 5.1: For any clustering result among several clustering results, calculate the clustering plane error term in the clustering result.
[0095] Specifically, step 4.5 performs Euclidean clustering based on the plane points, clusters the plane points into different planes, and calculates the clustering plane error term in the clustering result. The specific calculation is as follows:
[0096] Each clustering result can perform plane segmentation on the point cloud data, that is, any clustering result can represent the plane segmentation result of the point cloud data. The error term of the clustering result is the error term of the plane segmentation result. The specific calculation is as follows:
[0097]
[0098] Where errd represents the error term, ζ represents the set of all planes of clustering, ||p|| represents the number of points in ζ, and ψ iA single plane representing clustering, one of the ζ planes, dis(p ij ,ψ i ) represents point p ij To plane ψ i The vertical distance;
[0099] Step 5.2: Calculate the penalty term of the energy function,
[0100]
[0101] Among them, P en represents the penalty term, p b represents the number of plane intersections, |ψ‖ represents the number of planes;
[0102] Step 5.3: Calculate the energy function of the clustering result based on the error term and penalty term
[0103] E=errd+P en
[0104] Where E represents the energy function;
[0105] Step 5.4: Repeat steps 5.1 to 5.3 until the energy functions of all density clustering results are calculated, and select the clustering result with the smallest energy function as the optimal clustering result.
[0106] Specifically, by calculating the clustering result r i The error term and clustering result r based on the planar Euclidean clustering result i The penalty term based on the number of plane intersections and the number of planes under the condition of r i The E value is set, and the clustering result with the smallest E value is selected as the optimal density clustering result. Figure 4 As shown, the optimal plane intersection point and Euclidean clustering results of the polygonal point cloud determined by the energy function in the embodiment of the present invention.
[0107] It can be understood that the commonly used DBSCAN algorithm has two parameters, which need to be adjusted repeatedly when processing different point clouds. The embodiment of the present invention uses the global energy function to determine the optimal density threshold, which can effectively avoid the problem of repeatedly adjusting parameters.
[0108] Step 6: Plane intersection assignment.
[0109] Specifically, the plane intersection points of the optimal clustering results are assigned to the best fitting plane one by one based on the least squares method, which specifically includes:
[0110] Step 6.1: Find the two plane clusters closest to the plane intersection. The distance from the plane intersection to the plane cluster is calculated by the following formula:
[0111] d c=argmin(d(x i ,y i ,z i )),(x i ,y i ,z i )∈ψ
[0112] Among them, d c Represents the distance from the point to the plane cluster, d(x i ,y i ,z i ) represents a point (x i ,y i ,z i ) and the distance between the current point;
[0113] Step 6.2: Calculate the orthogonal distance from the plane intersection point to the fitted planes of the two closest plane clusters
[0114]
[0115] Among them, d o It represents the orthogonal distance from a point to the fitting plane, A, B, C and D are the coefficients of the plane equation, and x, y and z are the coordinate values of the point;
[0116] Step 6.3: Assign plane intersection points to planes with small orthogonal distance.
[0117] Step 7: Merge over-segmented planes.
[0118] Specifically, the over-segmented planes are fused to obtain the final segmentation result of the point cloud data. Figure 5 As shown in the red box, the plane is over-segmented. To solve this problem, the over-segmented planes are fused to determine the normal vector angle of each plane relative to the adjacent plane. If the angle is less than θ, the two planes are merged into one plane. In the embodiment of the invention, θ is set to 10°. The merged result is shown in Figure 5 (c) It should be noted that if the point cloud data contains special adjacent planes, that is, the angle between the adjacent planes is 10° or less, θ can be flexibly adjusted.
[0119] The point cloud plane segmentation method provided by the present invention enhances the density characteristics of the point cloud by mapping the point cloud into a Gaussian sphere, and introduces the energy function into the density clustering process to determine the optimal density threshold of the intersection of the segmentation planes, and finally uses the least squares method to assign the plane intersections to the best fitting plane to complete the point cloud segmentation. The present invention can automatically determine the effective density threshold, thereby effectively clustering the point cloud into different clusters to achieve point cloud segmentation.
[0120] In order to verify the effectiveness of the present invention, different types of point clouds are segmented using the method provided in the above embodiment, such as Figure 6 As shown, it is the input initial point cloud data. Figure 7 is the result image after point cloud segmentation, where Figure 7 (a), (b) and (c) are the segmentation results of the synthesized polygonal point clouds, (d), (e) and (f) are the segmentation results of the roof point clouds, and (h), (i) and (g) are the segmentation results of the room point clouds.
[0121] Comprehensive experiments show that the proposed method can achieve satisfactory results for both high-quality synthetic point clouds and low-quality roof point clouds as well as more complex room point clouds.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A point cloud plane segmentation method, characterized in that: include: Step 1: Obtain point cloud data; Step 2: Calculate the normal vector of each point in the point cloud data based on PCA; Step 3: Performing Gaussian mapping on the points in the point cloud data based on the normal vector to generate a Gaussian sphere; Step 4: Calculate the density of the points in the point cloud data based on the Gaussian sphere, generate a density threshold based on the density of the points, generate a number of clustering results according to the density threshold, and extract the plane intersection points corresponding to the number of clustering results; Step 5: determining an optimal clustering result from the plurality of clustering results by using an energy function, and preliminarily segmenting the point cloud data according to the optimal clustering result; Step 6: Allocate the plane intersection points of the optimal clustering result to the plane one by one; Step 7: Perform fusion processing on the over-segmented planes to obtain the final segmentation result of the point cloud data.
2. A point cloud plane segmentation method according to claim 1, characterized in that: The step 2 specifically includes: Step 2.1: Calculate the resolution of the point cloud data. The resolution is calculated by the following formula: Among them, R represents the resolution, n p Represents the number of points in the point cloud data, d ij Indicates point P i The closest point P j The Euclidean distance of Step 2.2: Select points within the range of δ times the resolution of each point in the point cloud data to construct a covariance matrix to calculate the normal vector of the point.
3. A point cloud plane segmentation method according to claim 1, characterized in that: The Gaussian sphere is as follows: Among them, Z represents the set of points on the Gaussian sphere, R 3 represents a three-dimensional vector space, Indicates point P i According to the normal vector (n xi ,n yi ,n zi ) direction is projected onto the Gaussian sphere.
4. A point cloud plane segmentation method according to claim 1, characterized in that: The step 4 calculates the density of the points in the point cloud data according to the Gaussian sphere, generates a density threshold based on the density of the points, and generates several clustering results according to the density threshold, specifically including: Step 4.1: Calculate the density of each point on the Gaussian sphere; Step 4.2: Calculate the density threshold δ of the point cloud data based on the density of the points Among them, d i Indicates point P i The density, n p represents the number of points in the point cloud data, and δ represents the density threshold of the point cloud data; Step 4.3: Traverse the points on the Gaussian sphere, find the points whose density is greater than the density threshold, and generate a density threshold set Den = {d1, d2, d3, ..., d n |d i <d j ,i <j}; Step 4.4: Calculate the threshold set D of plane intersection points using all adjacent densities in the density threshold set thr D thr ={th1,th2,th3,…,th k |th i <th j ,i <j} Among them, i Indicates the threshold for extracting plane intersection points; Step 4.5: Based on the threshold set D of the plane intersection thr For each threshold in the point cloud data, the points with a density greater than the threshold of the current plane intersection are plane intersection points, and the points with a density less than the threshold of the current plane intersection are plane points. The plane points are clustered Euclideanly to generate different planes. The threshold set D of the plane intersection is thr Generate k density clustering results Re = {r1, r2, r3,, ..., r i ,...,r k }, where r i Represents the i-th clustering result.
5. A point cloud plane segmentation method according to claim 4, characterized in that: In step 5, determining the optimal clustering result from the plurality of clustering results by using an energy function specifically includes: Step 5.1: For any clustering result among several clustering results, calculate the clustering plane error term in the clustering result: Where errd represents the error term, ζ represents the set of all planes of clustering, ||p|| represents the number of points in ζ, and ψ i A single plane representing clustering, one of the ζ planes, dis(p ij ,ψ i ) represents point p ij To plane ψ i The vertical distance; Step 5.2: Calculate the penalty term of the energy function, Among them, P en represents the penalty term, p b represents the number of plane intersections, ||ψ|| represents the number of planes; Step 5.3: Calculate the energy function of the clustering result based on the error term and the penalty term E=errd+P en Where E represents the energy function; Step 5.4: Repeat steps 5.1 to 5.3 until the energy functions of all density clustering results are calculated, and select the clustering result with the smallest energy function as the optimal clustering result.
6. A point cloud plane segmentation method according to claim 1, characterized in that: Step 6 allocates the plane intersection points of the optimal clustering result to the plane one by one, specifically including: Step 6.1: Find the two plane clusters closest to the plane intersection point. The distance from the plane intersection point to the plane cluster is calculated by the following formula: d c =argmin(d(x i ,y i ,z i )),(x i ,y i ,z i )∈ψ Among them, d c represents the distance from the plane intersection to the plane cluster, d(x i ,y i ,z i ) represents a point (x i ,y i ,z i ) and the distance between the current point; Step 6.2: Calculate the orthogonal distance from the plane intersection point to the fitting plane of the two nearest plane clusters Among them, d o It represents the orthogonal distance from the point to the fitting plane, A, B, C and D are the plane equation coefficients, and x, y and z are the coordinate values of the point; Step 6.3: Assign the plane intersection points to the planes with the smallest orthogonal distance.
7. A point cloud plane segmentation method according to claim 1, characterized in that: In step 7, the over-segmented planes are fused, specifically including: determining the normal vector angle of each plane relative to the adjacent plane, and if the angle is less than θ, merging the two planes into one plane.