Building Plane Segmentation Based on Point Clouds

: Planes are essential features to describe the shapes of buildings. The segmentation of a plane is signiﬁcant when reconstructing a building in three dimensions. However, there is a concern about the accuracy in segmenting plane from point cloud data. The objective of this paper was to develop an effective segmentation algorithm for building planes that combines the region growing algorithm with the distance algorithm based on boundary points. The method was tested on point cloud data from a cottage and pantry as scanned using a Faro Focus 3D laser range scanner and Matterport Camera, respectively. A coarse extraction of the building plane was obtained from the region growing algorithm. The coplanar points where two planes intersect were obtained from the distance algorithm. The building plane’s optimal segmentation was then obtained by combining the coarse extraction plane points and the corresponding coplanar points. The results show that the proposed method successfully segmented the plane points of the cottage and pantry. The optimal distance thresholds using the proposed method from the uncoarse extraction plane points to each plane boundary point of cottage and pantry were 0.025 m and 0.030 m, respectively. The highest correct rate and the highest error rate of the cottage’s (pantry’s) plane segmentations using the proposed method under the optimal distance threshold were 99.93% and 2.30% (98.55% and 2.44%), respectively. The F1 score value of the cottage’s and pantry’s plane segmentations using the proposed method under the optimal distance threshold reached 97.56% and 95.75%, respectively. This method can segment different objects on the same plane, while the random sample consensus (RANSAC) algorithm causes the plane to become over-segmented. The proposed method can also extract the coplanar points at the intersection of two planes, which cannot be separated using the region growing algorithm. Although the RANSAC-RG method combining the RANSAC algorithm and the region growing algorithm can optimize the segmentation results of the RANSAC (region growing) algorithm and has little difference in segmentation effect (especially for cottage data) with the proposed method, the method still loses coplanar points at some intersection of the two planes.


Introduction
Buildings play a vital role in urban planning and management, urban development [1][2][3][4], and so on. The extraction of building planar features has essential applications in urban construction [5][6][7][8][9]. The building planar includes both rooftops and facades. Building planar data are obtained primarily using three methods: aerial photogrammetry, depth cameras, and light detection and ranging (LiDAR) scanners. These methods can provide dense point clouds of the rooftops and facades of the building. Aerial photogrammetry the point and the best fitting plane is taken as the regional growth condition to segment the plane.
The region growing algorithm alone can segment building planes. However, it may not be effective to segment the coplanar points of several joint planes. Thus, most research combined the region growing algorithm with other approaches to detect building planes. Deschaud and Goulette [38] proposed a feature extraction algorithm based on the combination of region growing algorithm and Hough Transform, which used normal vector and voxel growth to detect planes in unorganized point clouds. This method is a robust normal estimation based on noisy data points, and the optimal local seed plane is determined by calculating the local plane fraction of each point. Dong et al. [39] segmented building rooftops from airborne LiDAR point clouds by introducing the region growing algorithm and an adaptive RANSAC algorithm. This method extracted relatively small rooftop patches in the presence of outliers. However, the algorithm's efficiency is relatively low when more buildings are segmented simultaneously with more outliers. Vo et al. [40] proposed the region growing algorithm based on octrees to realize building point clouds' plane segmentation. The voxel models simplified the initial data to calculate the local surface properties, avoiding expensive searches for adjacent points. In addition, the algorithm still needs to set the voxel size based on the dataset and the desired feature detection level.
Aiming at the problem that coplanar points where two planes intersect that cannot be separated by region growing algorithm, this paper proposes an effective segmentation method for building planes that combines the region growing algorithm with the distance algorithm based on boundary points to improve the segmentation precision of building planes. This method improves the region growing algorithm when extracting building coplanar points to obtain the optimal building plane segmentation.

Methods
This section introduces the proposed method for building plane segmentation in detail. Firstly, the building plane is segmented coarsely using the region growing algorithm. The uncoarse extraction plane points are obtained after removing the coarse extraction plane points from the original building points. The coarse extraction plane's boundary points are then extracted using the maximum value of the angle between the vectors formed between a point and its adjacent points on the tangent plane. Finally, the coplanar points where two planes intersect were obtained from the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points. The optimal plane segmentation is obtained by combining the coarse extraction plane points with the corresponding coplanar points. The workflow of the building plane point segmentation is shown in Figure 1.

Coarse Extraction of Plane Points
Region growing is a segmentation algorithm based on spatial proximity and homogeneity regarding a defined criterion. The building plane is extracted coarsely using the region growing algorithm in this paper. The algorithm's idea is that points with a minimum curvature are selected as an initial seed point. The seed point's adjacent points meet the angle value between the normal vector of the points and the normal vector of the current seed point. Furthermore, their curvature value is less than the set curvature value. These are regarded as new seed points to continue region growing until the seed point sequence is empty. The adjacent points are considered to belong to the same plane [41,42].

Coarse Extraction of Plane Points
Region growing is a segmentation algorithm based on spatial proximity and homogeneity regarding a defined criterion. The building plane is extracted coarsely using the region growing algorithm in this paper. The algorithm's idea is that points with a minimum curvature are selected as an initial seed point. The seed point's adjacent points meet the angle value between the normal vector of the points and the normal vector of the current seed point. Furthermore, their curvature value is less than the set curvature value. These are regarded as new seed points to continue region growing until the seed point sequence is empty. The adjacent points are considered to belong to the same plane [41,42].
The normal vector and curvature are the surface's basic characteristics and are an essential basis for surface feature recognition. The sampling point's normal vector and curvature need to be estimated to obtain plane segmentation using the region-growing algorithm.
The normal vector of the point is estimated based on neighborhood range, which is usually calculated by the neighborhood radius or adjacent points. In this paper, the normal vector and curvature of a point were estimated using a curved surface composed of adjacent points. The normal vector of a point was calculated using principal component analysis or the eigenvectors and eigenvalues of the covariance matrix created from the adjacent points. The corresponding covariance matrix C for point is [43,44]: The normal vector and curvature are the surface's basic characteristics and are an essential basis for surface feature recognition. The sampling point's normal vector and curvature need to be estimated to obtain plane segmentation using the region-growing algorithm.
The normal vector of the point is estimated based on neighborhood range, which is usually calculated by the neighborhood radius or adjacent points. In this paper, the normal vector and curvature of a point were estimated using a curved surface composed of adjacent points. The normal vector of a point was calculated using principal component analysis or the eigenvectors and eigenvalues of the covariance matrix created from the adjacent points. The corresponding covariance matrix C for point p i is [43,44]: where n is the number of adjacent points of p i , and p s represents the center of the adjacent points. In this paper, the parameter n of cottage and pantry is set to 50 and 60, respectively. The normal vector of the point p i is [45]: where λ j represents the j-th eigenvalue of the covariance matrix, and → v j represents the j-th eigenvector. The normal vector is the eigenvector corresponding to the minimum eigenvalue. Its direction can be determined using the normal vector of a point and the Remote Sens. 2022, 14, 95 5 of 20 vector formed by the point and the set viewpoint since the direction of the point's normal vector is ambiguous.
As the eigenvalue λ 0 < λ 1 < λ 2 represents the degree of change of a point along with the three main directions, the curvature σ of point p i can be approximated as [44,46]: where λ 0 , λ 1 , and λ 2 are the eigenvalues of the covariance matrix, and σ is the curvature of the point. The angle value of the cottage and pantry between the normal vector of the current seed point and the normal vector of its adjacent points is set to 2.0 • after obtaining the normal vectors and curvatures for all points. The reason for setting the angle value to 2.0 • is because the points obtained are not strictly in the same plane. When the angle value between the normal vector of the current seed point and the normal vector of its adjacent points is within the threshold, it can be regarded as coplanar, which can make the surface as smooth as possible. Additionally, suppose each point is smoothly bent (i.e., the threshold of the angle between the normal vector of the current seed point and its adjacent point normal vector is very small). In that case, however, the offset of the surface will increase with an increased number of points. The curvature value of cottage and pantry is set to 0.5 in this paper to control the angle between the current seed point and average normal vectors since curvature measures the rate of change of surface normals. In this paper, the number of points of the smallest point clusters of cottage and pantry is set to 850 and 1000, respectively.
The operational steps are as follows: 1. Calculate all points' curvatures and add the minimum curvature point to the seed point set.

2.
Calculate the normal vector of the current seed point and its adjacent points. If the current seed point's adjacent points not only meet the angle value between the normal vector of the points and the normal vector of the current seed point but also their curvature value is less than the set curvature value, the adjacent points to the seed point sequence.

3.
Delete the current seed point, and the adjacent points are regarded as new seed points to continue the region growing.

4.
This process will continue until the seed point sequence is empty.

Optimal Extraction of Plane Points
A coarse extraction of the building plane was obtained using the region growing algorithm. The uncoarse extraction plane points were obtained after removing the coarse extraction plane points from the original building points. However, the extracted plane lacked coplanar points from the two planes' intersections since the algorithm is less effective in segmenting the coplanar points. The coplanar points are obtained by calculating the distance threshold from the uncoarse extraction plane points to the coarse extraction planes. In this paper, the coplanar points where the two planes intersect were obtained using the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points.

Boundary Points
Boundary points are essential geometric features. They play a vital role in reconstructing surface models. The coarse extraction plane's boundary points were extracted based on the maximum value of the angle between the vectors formed between a point and its adjacent points on the micro-tangent plane.
After obtaining the normal vectors for all points, the angle criterion based on the maximum angle between vectors formed between a point and its adjacent points on the micro-tangent plane was used to determine whether it is located on a plane's boundary.
The idea of boundary feature extraction based on the maximum value of the angle is to project the local point set onto the micro-tangent plane. Then, the angle is calculated between the vectors formed between a point and its adjacent points on the micro-tangent plane, and the maximum value of the angle is taken as the measurement criterion. For uniformly distributed internal point clouds, the angle value between the vectors formed between a point and its adjacent points is small. If the distribution of adjacent points is biased to one side, the angle value will be larger. According to this principle, if the maximum angle value between the vectors formed between a point and its adjacent points on the micro-tangent plane greater than the set threshold value, the point is regarded as a boundary point, otherwise it is an internal point.
In addition, an appropriate number of boundary points need to be extracted to calculate the distance from the uncoarse extraction plane points to the coarse extraction plane's boundary points. If the angle threshold is too small, many inside points will be regarded as boundary points. If the angle threshold is too large, some boundary points may be missing. Thus, the angle threshold of the cottage and pantry was set to π 2 in this paper. The boundary point extraction process for the coarse extraction plane is as follows: 1.
Calculate the normal vector of the surface formed by a point and its neighboring points. The micro-tangent plane is calculated from the normal vector.

2.
Project these points to the micro-tangent plane.

3.
Calculate the angle between the vectors formed between a point and its adjacent points on the micro-tangent plane.

4.
If the maximum angle between adjacent vectors is greater than the set threshold value, it is regarded as a boundary point; otherwise, it is considered an interior point ( Figure 2).  The boundary points extraction results are shown in Figure 3.

Coplanar points Extraction
After the boundary points were obtained, the coplanar points at which two planes intersect were then extracted using the distance threshold from the uncoarse extraction plane points to the boundary points of the coarse extraction plane. The uncoarse extraction plane points were obtained after removing the coarse extraction plane points from the

Coplanar points Extraction
After the boundary points were obtained, the coplanar points at which two planes intersect were then extracted using the distance threshold from the uncoarse extraction plane points to the boundary points of the coarse extraction plane. The uncoarse extraction plane points were obtained after removing the coarse extraction plane points from the original points of the building. Points among the uncoarse extraction plane points are represented as P(x, y, z). A boundary point of the coarse extraction plane is represented as Q(l, m, n). The distance d(P, Q) from the uncoarse extraction plane point to the boundary point is [47]: The coarse extraction of the cottage plane and pantry plane was obtained using the region growing algorithm with 22 planes and 30 planes, respectively. The distances were calculated from the uncoarse extraction plane points to the coarse extraction plane's boundary points. If the distance from a point of the uncoarse extraction plane to the plane boundary point is within the threshold, the point is assigned to the plane. The cottage's data density obtained from the instrument is roughly uniform, and the distance between points is about 0.010 m. The pantry's data density obtained by the depth camera is not uniform, with the distance between some points being 0.010 m, while the distance between some points is 0.040 m. The plane segmentation result will be different because of the various distance threshold from the uncoarse extraction plane points to the boundary points of the coarse extraction plane. The plane segmentation results of 0.020 m and 0.025 m from a distance between the uncoarse extraction plane points and each plane boundary point of the cottage were calculated, respectively. When the distance between the uncoarse extraction plane points and each plane boundary point of the cottage is 0.025 m, the plane segmentation result is optimal (Figure 4). point of the cottage were calculated, respectively. When the distance between the uncoarse extraction plane points and each plane boundary point of the cottage is 0.025 m, the plane segmentation result is optimal ( Figure 4).
Finally, the coplanar points where two planes intersect were obtained using the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points. The optimal plane segmentation can be obtained by combining the coarse extraction plane points using region growing algorithm with the corresponding coplanar points based on the distance algorithm.

Results
The density of the cottage's data obtained is roughly uniform, with a distance of about 0.010 m from point to point. The pantry's data density obtained by the depth camera is uneven, and the distance is between 0.010 m and 0.040 m from some points. We evaluated the plane segmentation results using the proposed method when the distance thresholds from the uncoarse extraction plane points to each plane boundary point is set to 0.015 m, 0.020 m, 0.025 m, 0.030 m, and 0.035 m, respectively. The proposed method under different distance thresholds was tested on two datasets of indoor scenes that are cottage and Finally, the coplanar points where two planes intersect were obtained using the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points. The optimal plane segmentation can be obtained by combining the coarse extraction plane points using region growing algorithm with the corresponding coplanar points based on the distance algorithm.

Results
The density of the cottage's data obtained is roughly uniform, with a distance of about 0.010 m from point to point. The pantry's data density obtained by the depth camera is uneven, and the distance is between 0.010 m and 0.040 m from some points. We evaluated the plane segmentation results using the proposed method when the distance thresholds from the uncoarse extraction plane points to each plane boundary point is set to 0.015 m, 0.020 m, 0.025 m, 0.030 m, and 0.035 m, respectively. The proposed method under different distance thresholds was tested on two datasets of indoor scenes that are cottage and pantry ( Figures 5 and 6). Furthermore, the RANSAC algorithm, the region growing algorithm, and the RANSAC-RG method were used to test point cloud data from cottage and pantry to verify the effectiveness of the proposed method.
Remote Sens. 2022, 14, x FOR PEER REVIEW 9 of 21 pantry ( Figures 5 and 6). Furthermore, the RANSAC algorithm, the region growing algorithm, and the RANSAC-RG method were used to test point cloud data from cottage and pantry to verify the effectiveness of the proposed method. The cottage and pantry were obtained based on the room detection datasets (Full-3D) [48] and the Stanford Large-Scale 3D Indoor Spaces Dataset by Matterport Camera [49], respectively. The cottage data were scanned by using the Faro Focus 3D laser range scanner. The scanner has a full 360°×305° field of view and a high density of 91,352 points/m 2 . We removed its roof points and delete some discrete points because of missing some of the roof points of the cottage.
The RANSAC algorithm randomly selects some points from a dataset to fit the plane and calculates the distance from other points to the fitting plane by continuous iterative method. If the distance from the point to the fitting plane is within the set distance threshold, the point is regarded as the interior. Otherwise, it is regarded as the exterior, and the model with the most interior points is the optimal plane model [50,51]. The RANSAC algorithm fitting plane points is shown in Figure 7. The region growing algorithm can also detect plane points. However, it will not determine the intersection points of two planes ( Figure 8b). The proposed method can segment the building plane by combining the region growing algorithm with the distance algorithm based on the boundary points ( Figure  8c).
In addition, the RANSAC-RG method combining the RANSAC algorithm with region growing algorithm was to evaluate the plane segmentation results since the RAN-SAC algorithm can cause the plane to become over-segmented. This is especially true when two objects on the same plane cannot be separated from each other in the algorithm. The region growing algorithm can separated different objects from the same plane. The RANSAC-RG method first uses the RANSAC algorithm to segment the building plane. Then, the subplane obtained by the RANSAC algorithm is optimally segmented by the region growing algorithm. However, the angle value between the normal vector of the current seed point and the normal vector of its adjacent points is too small to identify different objects when segmenting different objects from the same plane by region growing algorithm. The edge points of the plane will be lost when identifying successfully different objects from the same plane. Therefore, the distance algorithm based on boundary points is used to optimize the segmentation results. Finally, different planes are merged if they have the same normal vector, and their shortest distance is within 0.010 m (0.025 m) for the cottage (pantry) data.   The cottage and pantry were obtained based on the room detection datasets (Full-3D) [48] and the Stanford Large-Scale 3D Indoor Spaces Dataset by Matterport Camera [49], respectively. The cottage data were scanned by using the Faro Focus 3D laser range scanner. The scanner has a full 360 • × 305 • field of view and a high density of 91,352 points/m 2 . We removed its roof points and delete some discrete points because of missing some of the roof points of the cottage.
The RANSAC algorithm randomly selects some points from a dataset to fit the plane and calculates the distance from other points to the fitting plane by continuous iterative method. If the distance from the point to the fitting plane is within the set distance threshold, the point is regarded as the interior. Otherwise, it is regarded as the exterior, and the model with the most interior points is the optimal plane model [50,51]. The RANSAC algorithm fitting plane points is shown in Figure 7. The region growing algorithm can also detect plane points. However, it will not determine the intersection points of two planes ( Figure 8b). The proposed method can segment the building plane by combining the region growing algorithm with the distance algorithm based on the boundary points ( Figure 8c).   x y x y In addition, the RANSAC-RG method combining the RANSAC algorithm with region growing algorithm was to evaluate the plane segmentation results since the RANSAC algorithm can cause the plane to become over-segmented. This is especially true when two objects on the same plane cannot be separated from each other in the algorithm. The region growing algorithm can separated different objects from the same plane. The RANSAC-RG method first uses the RANSAC algorithm to segment the building plane. Then, the subplane obtained by the RANSAC algorithm is optimally segmented by the region growing algorithm. However, the angle value between the normal vector of the current seed point and the normal vector of its adjacent points is too small to identify different objects when segmenting different objects from the same plane by region growing algorithm. The edge points of the plane will be lost when identifying successfully different objects from the same plane. Therefore, the distance algorithm based on boundary points is used to optimize the segmentation results. Finally, different planes are merged if they have the same normal vector, and their shortest distance is within 0.010 m (0.025 m) for the cottage (pantry) data.
The RANSAC (region growing, RANSAC-RG) algorithm was used to perform plane segmentation of a cottage and pantry, as shown in . Finally, the proposed method under the optimal distance threshold combing the region growing algorithm with the distance algorithm based on boundary points was used to perform the cottage's and pantry's plane segmentation (Figures 15 and 16). The planes were labeled with different colors.
The segmentation accuracy was evaluated by comparing the number of points manually identified as a plane with the proposed method. The performance of these algorithms can be evaluated based on the classification precision. This paper evaluates the segmentation accuracy of several large planes of cottage and pantry using the proposed method under different distance thresholds from the uncoarse extraction plane points to each plane boundary point. In addition, the plane segmentation accuracy of the RANSAC (region growing and RANSAC-RG) algorithm was evaluated to verify the effectiveness of the proposed method under the optimal distance threshold. Correct refers to the ratio of the number of correct classification points assigned to a plane by an algorithm to the number of ground truth data of a plane (manually identified). Error refers to the ratio of the number of error classification points assigned to a plane by an algorithm to the number of the ground truth data of a plane (manually identified).

F1
2 • precision • recall precision recall (7) where TP denotes the number of points correctly assigned to a plane that is a part of that plane in the reference, and FP denotes the number of points incorrectly unassigned to a plane that is a part of that plane in the reference. FN denotes the number of points wrongly assigned to a plane that is not a part of that plane in the reference.

Discussion
The segmentation accuracy of several large planes of cottage and pantry were ated using the proposed method under different distance thresholds from the un extraction plane points to each plane boundary point. With the increase in the di threshold, the correct rate of the plane segmentation was improved on the whole, the error rate increased (Tables 1 and 2). However, the correct rate of the plane segm tion does not always increase with the increase in the distance threshold. The corre of the cottage and pantry were the highest when the distance thresholds were set to m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plane 09) ( Table 2 possible reason for this is that some points that do not belong to the plane are assig the plane because the distance threshold is set too large from the uncoarse extraction point to the boundary point. As the distance threshold increased, the precision of th tage and pantry increased, while the recall rate decreased ( Table 3). The maximum of the F1 score was achieved using the proposed method for the cottage and pantr distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Since the F1 score weighted average of the precision and recall, the distance threshold corresponding maximum of the F1 score value was optimal in this paper. Therefore, the optimal di thresholds from the uncoarse extraction plane points to each plane boundary point cottage and pantry were 0.025 m and 0.030 m, respectively. Table 1. Accuracy assessment of cottage's plane segmentation using the proposed method different distance thresholds. In addition, the measures of precision, recall, and F1 score are effective means for evaluating object classification. The average values of precision, recall, and F1 scores of several large planes are used to evaluate the segmentation results of cottage and pantry. Precision represents the ratio of the number of correctly predicted positive samples to the total number of predicted positive samples. Recall represents the ratio of the number of correctly predicted positive samples to the number of all samples in the actual class. The F1 score is the weighted average of the precision and recall. The three measurements are calculated using the equations as follows [33]: where TP denotes the number of points correctly assigned to a plane that is a part of that plane in the reference, and FP denotes the number of points incorrectly unassigned to a plane that is a part of that plane in the reference. FN denotes the number of points wrongly assigned to a plane that is not a part of that plane in the reference.

Discussion
The segmentation accuracy of several large planes of cottage and pantry were evaluated using the proposed method under different distance thresholds from the uncoarse extraction plane points to each plane boundary point. With the increase in the distance threshold, the correct rate of the plane segmentation was improved on the whole, while the error rate increased (Tables 1 and 2). However, the correct rate of the plane segmentation does not always increase with the increase in the distance threshold. The correct rate of the cottage and pantry were the highest when the distance thresholds were set to 0.025 m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plane 09) ( Table 2). The possible reason for this is that some points that do not belong to the plane are assigned to the plane because the distance threshold is set too large from the uncoarse extraction plane point to the boundary point. As the distance threshold increased, the precision of the cottage and pantry increased, while the recall rate decreased ( Table 3). The maximum value of the F1 score was achieved using the proposed method for the cottage and pantry at a distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Since the F1 score is the weighted average of the precision and recall, the distance threshold corresponding to the maximum of the F1 score value was optimal in this paper. Therefore, the optimal distance thresholds from the uncoarse extraction plane points to each plane boundary point of the cottage and pantry were 0.025 m and 0.030 m, respectively. Table 1. Accuracy assessment of cottage's plane segmentation using the proposed method under different distance thresholds.

Discussion
The segmentation accuracy of several large planes of cottage and ated using the proposed method under different distance threshold extraction plane points to each plane boundary point. With the incr threshold, the correct rate of the plane segmentation was improved the error rate increased (Tables 1 and 2). However, the correct rate of tion does not always increase with the increase in the distance thresh of the cottage and pantry were the highest when the distance thresho m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plan possible reason for this is that some points that do not belong to the p the plane because the distance threshold is set too large from the uncoa point to the boundary point. As the distance threshold increased, the tage and pantry increased, while the recall rate decreased ( Table 3). T of the F1 score was achieved using the proposed method for the cott distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Sinc weighted average of the precision and recall, the distance threshold c maximum of the F1 score value was optimal in this paper. Therefore, t thresholds from the uncoarse extraction plane points to each plane bo cottage and pantry were 0.025 m and 0.030 m, respectively.

Discussion
The segmentation accuracy of several large planes of cottage and ated using the proposed method under different distance thresholds extraction plane points to each plane boundary point. With the incr threshold, the correct rate of the plane segmentation was improved the error rate increased (Tables 1 and 2). However, the correct rate of tion does not always increase with the increase in the distance thresh of the cottage and pantry were the highest when the distance thresho m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plan possible reason for this is that some points that do not belong to the p the plane because the distance threshold is set too large from the uncoa point to the boundary point. As the distance threshold increased, the tage and pantry increased, while the recall rate decreased ( Table 3). T of the F1 score was achieved using the proposed method for the cott distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Sinc weighted average of the precision and recall, the distance threshold c maximum of the F1 score value was optimal in this paper. Therefore, t thresholds from the uncoarse extraction plane points to each plane bo cottage and pantry were 0.025 m and 0.030 m, respectively.

Discussion
The segmentation accuracy of several large planes of cottage and ated using the proposed method under different distance thresholds extraction plane points to each plane boundary point. With the incr threshold, the correct rate of the plane segmentation was improved the error rate increased (Tables 1 and 2). However, the correct rate of tion does not always increase with the increase in the distance thresh of the cottage and pantry were the highest when the distance thresho m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plan possible reason for this is that some points that do not belong to the p the plane because the distance threshold is set too large from the uncoa point to the boundary point. As the distance threshold increased, the tage and pantry increased, while the recall rate decreased ( Table 3). T of the F1 score was achieved using the proposed method for the cott distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Sinc weighted average of the precision and recall, the distance threshold c maximum of the F1 score value was optimal in this paper. Therefore, t thresholds from the uncoarse extraction plane points to each plane bo cottage and pantry were 0.025 m and 0.030 m, respectively.

Discussion
The segmentation accuracy of several large planes of cottage and ated using the proposed method under different distance threshold extraction plane points to each plane boundary point. With the incr threshold, the correct rate of the plane segmentation was improved the error rate increased (Tables 1 and 2). However, the correct rate of tion does not always increase with the increase in the distance thresh of the cottage and pantry were the highest when the distance thresho m (planes 4 and 8) ( Table 1) and 0.030 m (plane 04, plane 06, and plan possible reason for this is that some points that do not belong to the p the plane because the distance threshold is set too large from the uncoa point to the boundary point. As the distance threshold increased, the tage and pantry increased, while the recall rate decreased ( Table 3). T of the F1 score was achieved using the proposed method for the cott distance threshold of 0.025 m and 0.030 m, respectively (Table 3). Sinc weighted average of the precision and recall, the distance threshold c maximum of the F1 score value was optimal in this paper. Therefore, thresholds from the uncoarse extraction plane points to each plane bo cottage and pantry were 0.025 m and 0.030 m, respectively.          In addition, we compared the RANSAC (region growing and RANSAC-RG) algorithm with the proposed method under the optimal distance threshold based on the segmentation accuracy of several large planes of the cottage and pantry. Although the RANSAC algorithm can segment the building plane, it may over-segment and mistakenly divide the plane. This is especially true when two objects on the same plane cannot be separated from each other in the algorithm, such as the cottage's door (plane 5) and cottage's wall (plane 8) ( Table 4) (Figure 9b). The RANSAC algorithm divides several planes into the same on (plane 03 and plane 07 should be two different planes) ( Table 5) (Figure 13b). Although the correct rate of the cottage's plane segmentation was 100.00% (plane 1 and plane 2) (Table 4) using the RANSAC algorithm, the error rate of the plane segmentation reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error rate of the pantry's plane segmentation using the RANSAC algorithm reached 252.84% (plane 03) and 93.32% (plane 06) ( Table 5), respectively. the same on (plane 03 and plane 07 should be two different planes) (Ta Although the correct rate of the cottage's plane segmentation was 10 plane 2) ( Table 4) using the RANSAC algorithm, the error rate of the reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (   Although the correct rate of the cottage's plane segmentation was 10 plane 2) ( Table 4) using the RANSAC algorithm, the error rate of the reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (   plane 2) ( Table 4) using the RANSAC algorithm, the error rate of the reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (   reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (   reached 64.17% (plane 5) and 164.97% (plane 8) ( Table 4). The error plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (   plane segmentation using the RANSAC algorithm reached 252.84% (p (plane 06) (                The region growing algorithm uses the normal vector and curva segment plane points, and the highest correct rate of the cottage's and mentation was 97.73% (plane 4) ( Table 4) and 96.47% (plane 08) (Ta However, this algorithm cannot effectively segment the building plan pecially the intersection point of two planes (Figures 10 and 14). Wh plane segmentation is 0.00%, the correct rate of the cottage's and pant tation is 95.16% (plane 6) ( Table 4) and 90.61% (plane 06) ( Table 5), res the result of lacking the intersection point of the two planes.
The RANSAC-RG method combining the RANSAC algorithm a algorithm can separate different objects on the same plane, such as (plane 5) and cottage's wall (plane 8) (Table 4) (Figure 11b). In additio cottage's plane segmentation by the method was only 1.70% (plane 8) result of the RANSAC algorithm reached 164.97% (plane 8) (Table 4). T rithm segmented several planes that belong to different planes into t then some smaller clusters connecting the two planes segmented usi rithm was lost, making one plane incomplete (plane 03) ( Table 5). Th plane segmentation of the method is generally higher than that of the The region growing algorithm uses the normal vector and curva segment plane points, and the highest correct rate of the cottage's and mentation was 97.73% (plane 4) ( Table 4) and 96.47% (plane 08) (Ta However, this algorithm cannot effectively segment the building plan pecially the intersection point of two planes (Figures 10 and 14). Wh plane segmentation is 0.00%, the correct rate of the cottage's and pant tation is 95.16% (plane 6) ( Table 4) and 90.61% (plane 06) ( Table 5), res the result of lacking the intersection point of the two planes.
The RANSAC-RG method combining the RANSAC algorithm a algorithm can separate different objects on the same plane, such as (plane 5) and cottage's wall (plane 8) (Table 4) (Figure 11b). In additio cottage's plane segmentation by the method was only 1.70% (plane 8) result of the RANSAC algorithm reached 164.97% (plane 8) (Table 4). T rithm segmented several planes that belong to different planes into t then some smaller clusters connecting the two planes segmented usi rithm was lost, making one plane incomplete (plane 03) ( Table 5). Th plane segmentation of the method is generally higher than that of the gorithm. The region growing algorithm uses the normal vector and curva segment plane points, and the highest correct rate of the cottage's and mentation was 97.73% (plane 4) ( Table 4) and 96.47% (plane 08) (Tab However, this algorithm cannot effectively segment the building plan pecially the intersection point of two planes (Figures 10 and 14). Wh plane segmentation is 0.00%, the correct rate of the cottage's and pant tation is 95.16% (plane 6) ( Table 4) and 90.61% (plane 06) ( Table 5), res the result of lacking the intersection point of the two planes.
The RANSAC-RG method combining the RANSAC algorithm a algorithm can separate different objects on the same plane, such as (plane 5) and cottage's wall (plane 8) (Table 4) (Figure 11b). In additio cottage's plane segmentation by the method was only 1.70% (plane 8) result of the RANSAC algorithm reached 164.97% (plane 8) (Table 4). T rithm segmented several planes that belong to different planes into t then some smaller clusters connecting the two planes segmented usi rithm was lost, making one plane incomplete (plane 03) ( Table 5). Th plane segmentation of the method is generally higher than that of the gorithm.
Compared with the RANSAC (region growing, and RANSAC- The region growing algorithm uses the normal vector and curvature information to segment plane points, and the highest correct rate of the cottage's and pantry's plane segmentation was 97.73% (plane 4) ( Table 4) and 96.47% (plane 08) ( Table 5), respectively. However, this algorithm cannot effectively segment the building plane's point cloud, especially the intersection point of two planes (Figures 10 and 14). When the error rate of plane segmentation is 0.00%, the correct rate of the cottage's and pantry's plane segmentation is 95.16% (plane 6) ( Table 4) and 90.61% (plane 06) (Table 5), respectively, which is the result of lacking the intersection point of the two planes.
The RANSAC-RG method combining the RANSAC algorithm and region growing algorithm can separate different objects on the same plane, such as the cottage's door (plane 5) and cottage's wall (plane 8) (Table 4) (Figure 11b). In addition, the error rate of cottage's plane segmentation by the method was only 1.70% (plane 8) (Table 4), while the result of the RANSAC algorithm reached 164.97% (plane 8) ( Table 4). The RANSAC algorithm segmented several planes that belong to different planes into the same plane, and then some smaller clusters connecting the two planes segmented using the region algorithm was lost, making one plane incomplete (plane 03) ( Table 5). The correct rate of the plane segmentation of the method is generally higher than that of the region growing algorithm.
Compared with the RANSAC (region growing, and RANSAC-RG) algorithm, the cottage's and pantry's plane segmentation's highest correct rate reached 99.93% (plane 4) ( Table 4) and 98.55% (plane 08) (Table 5), respectively, using the proposed method. The proposed method can segment the plane points of buildings and significantly improve the segmentation effect, especially for coplanar points at the intersection of two planes (Figures 12 and 16).
In the coarse extraction process, some non-smooth points in the plane will be removed. The segmentation accuracy of some planes is not high if there are too many non-smooth points inside a plane when using the region growing algorithm (the RANSAC-RG method and the proposed method) (plane 1) (Table 4). However, the RANSAC algorithm's segmentation accuracy may not be affected (Figure 9). In addition, if there is no point connection in the middle part of a plane, the plane will be judged as two planes based on the region growing criterion by the region growing algorithm (the RANSAC-RG method and the proposed method) (plane 09) ( Table 5) (Figures 14, 15 and 16b). Some points in the point cloud data of the pantry obtained from the depth camera cannot be roughly assigned on the same plane due to the limitations of the matching image accuracy. Thus, the segmentation of some planes is not ideal when using the region growing algorithm (RANSAC-RG method and the proposed method); however, the RANSAC algorithm can still segment certain planes (plane 05) ( Table 5) (Figure 12b).
Although the RANSAC-RG method can optimize the segmentation results of the RANSAC (region growing) algorithm and has little difference in segmentation effect (especially for cottage data) with the proposed method, the algorithm still loses coplanar points at some intersection of the two planes (especially for pantry data) (Figure 15b). This is because more edge points of the subplane segmented optimally by the region growing algorithm can be lost due to the uneven distribution of the edge points, and there will also be some edge points lost even if a distance algorithm is used to optimize plane segmentation.
The proposed method, like the RANSAC algorithm, the region growing algorithm, and the RANSAC-RG method, still has misjudgments in recognizing coplanar points. The highest error rate of the cottage's and pantry's plane segmentation was 2.30% and 2.44%, respectively, using the proposed method.
From the overall analysis of several large planes, compared with the region growing algorithms, the RANSAC-RG method, and the proposed method, the precision value of cottage's plane segmentation using the RANSAC algorithm reached 97.38% (Table 6). This may be because the RANSAC algorithm can cause excessive segmentation, and it can contain more correctly classified numbers of plane points at the same time. The recall values of cottage's (pantry's) plane segmentation using the proposed method, the RANSAC-RG method and the region growing algorithms have a higher segmentation accuracy than the RANSAC algorithm. It can be seen that the proposed method, the RANSAC-RG method, and the region growing algorithm can segment planes more effectively compared with the RANSAC algorithm. The F1 score values of the cottage's and pantry's plane segmentation using the proposed method reached 97.56% and 95.75%, respectively (Table 6). From the above analysis, the region growing algorithm cannot separate the coplanar points of two planes, and the RANSAC algorithm causes the plane to become oversegmented. Most research combined the region growing algorithm with other approaches to detect building planes. Our idea is how to accurately extract the coplanar points of two planes that cannot be separated by region growing algorithm. The traditional way to get the coplanar points of two planes is to calculate the distance from the uncoarse extraction plane points to the coarse extraction planes. Because the boundary information can express the object's shape feature, our idea is that the coplanar points where two planes intersect were obtained from the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points. Our method is to optimize the region growing algorithm in extracting the coplanar points at the intersection of two planes. The algorithm can accurately segment the intersection planes formed from different angles because the region growing algorithm uses normal vector and curvature to segment the coarse extracted plane points, and the distance algorithm can obtain the coplanar points of the intersection of two planes.

Conclusions
We proposed an effective building plane segmentation algorithm, where the region growing algorithm coarsely segments the building plane. The coplanar points where two planes intersect were determined from the distance threshold from the uncoarse extraction plane points to the coarse extraction plane's boundary points. The building plane's optimal segmentation could be obtained by combining the coarse extraction plane points with the corresponding coplanar points. The results show that the proposed method can segment the plane points of a cottage and pantry. The optimal distance thresholds using the proposed method from the uncoarse extraction plane points to each plane boundary point of the cottage and pantry were 0.025 m and 0.030 m, respectively. The highest correct rate and the highest error rates of the cottage's and pantry's plane segmentations using the proposed method under the optimal distance threshold were 99.93% and 2.30% (98.55% and 2.44%), respectively. The F1 score values of the cottage's and pantry's plane segmentations using the proposed method under the optimal distance threshold reached 97.56% and 95.75%, respectively. Compared with the RANSAC algorithm, the proposed method can segment different objects on the same plane without causing excessive segmentation. The method can also extract coplanar points where two planes intersect that cannot be separated using the region growing algorithm. Although the RANSAC-RG method combining the RANSAC algorithm and region growing algorithm can optimize the segmentation results of the RANSAC (region growing) algorithm and has little difference in segmentation effect (especially for cottage data) with the proposed method, the method still loses coplanar points at some intersection of the two planes. Future tests of this approach will be conducted on buildings with large and complex scenes.