PRIMITIVE SEGMENTATION OF DOUGONG COMPONENTS BASED ON REGIONAL CLUSTERING

: As one of the most characteristic components of ancient Chinese architecture, Dougong has an important significance in the history of ancient Chinese architecture, but with the passage of time, wooden building components are prone to decay and missing, so it is particularly important to digitally retain the Dougong. In order to realize the Dougong component segmentation, this paper proposes a super voxel-based Dougong component primitive segmentation method, which is divided into two parts: firstly, super voxelizing the Dougong point cloud data, and secondly, realizing the Dougong component primitive segmentation by using multi-geometric constrained region growth algorithm. In order to verify the effectiveness of the method, this paper selects three main Dougong types of the Qing Dynasty, including pingshenke, jiaoke, zhutouke, for experimental validation, and the results show that the combination of super voxel and regional growth algorithm can effectively extract the geometric primitive surface of the Dougong components with high extraction efficiency and good adaptability, which can be prepared for the subsequent knowledge of Dougong construction method to achieve component segmentation.


INTRODUCTION
Ancient Chinese architecture is famous for its wood frame, and the Dougong is the finishing touch to the wood frame. As a transitional structure connecting columns and beams, the Dougong is the most characteristic part of ancient Chinese architecture and an essential part. However, with the passage of time, the Dougong elements will inevitably show various diseases, so it is important for the conservation research of the Dougong to get the data of each element and establish the solid model from the overall Dougong point cloud without the semantics of the element and part of the structure missing.
Ancient building point cloud segmentation is the basis for realizing component-level 3D modeling of ancient building parts. The purpose of segmentation is to cluster ancient building point clouds into point cloud clusters with the same geometric properties, so as to facilitate the subsequent fitting and identification processes. However, compared with other regular buildings, its building combination is complex, so it faces many difficulties in the segmentation process, mainly in the following points: First, the Dougong structure is complex, how to identify and detect each component from the point cloud is difficult. Secondly, there are many different types of Dougong components and various shapes, and there are overlaps and insertions between the components, and the cross-combination between the components causes the whole component to be interrupted in 3D space, which makes it extremely difficult to extract the component entities completely. Therefore, in order to realize the fine segmentation of the Dougong components, this paper uses the point cloud segmentation technique to cluster the primitive surfaces of the components, and then combines the knowledge of the Dougong construction pattern to realize the fine segmentation of the Dougong components.
For the special splicing rules of the Dougong components and the geometric characteristics of individual components, this paper * Corresponding author proposes a Dougong primitive segmentation method based on the super voxel data and the region growth algorithm. The method first uses the super voxel algorithm to segment the original point cloud into super voxel data, and uses the central voxel of the super voxel to represent the super voxel as the processing unit. Secondly, the super voxel data are merged using the region growth algorithm with similarity constraint, smoothness constraint and other related constraint criteria to finally obtain a subset of point clouds with specific meaning. This algorithm can guarantee the accuracy of the geometric primitive segmentation of the Dougong components and also significantly improve the efficiency of the algorithm.

RELATED WORK
At present, 3D point cloud segmentation is mainly divided into traditional point cloud segmentation and deep learning based point cloud segmentation. There are four main categories of traditional point cloud segmentation methods in common use, edge-based, feature clustering-based, model fitting-based, and region-based segmentation algorithms. Woo et al. (Woo, 2002) used voxelized point clouds for point cloud segmentation based on edge point extraction, which not only improved the efficiency of the algorithm, but also achieved the detection of edge points while considering voxel geometric features. The detection of edge points is achieved while considering the voxel geometric features. The clustering-based point cloud segmentation algorithm mainly calculates the geometric features of point clouds and clusters the point clouds with similar features by unsupervised classification method. The common ones are Euclidean clustering algorithm, K-mean clustering algorithm (Macqueen, 1965). Filin et al. (Filin, 2006) applied slope adaptive neighborhood to calculate point features. In addition, SHI et al. (SHI, 2013) used a new clustering method to segment urban point clouds, which does not require pre-estimation of the number of clusters and effectively reduces the complexity of the algorithm. The method based on ad hoc evidence clustering can ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume X-M-1-2023 29th CIPA Symposium "Documenting, Understanding, Preserving Cultural Heritage: Humanities and Digital Technologies for Shaping the Future", 25-30 June 2023, Florence, Italy effectively avoid the factors that affect the segmentation results caused by point cloud density and noisy points, but in large dense point clouds, calculating the feature information of points has considerable complexity, so the time cost will be significantly increased; the algorithm based on model fitting is to achieve the segmentation of point clouds by fitting them to specific geometric models (e.g., plane, rectangle, vertebrae, etc.), and the point clouds that conform to the same geometric The point clouds conforming to the same geometric model are assigned to the same group. Two commonly used methods are the Hough transform (Hulik, 2014) and the RANSAC algorithm (Li, 2017). The model-based algorithm utilizes a known mathematical geometric model for point cloud segmentation greatly improves computational efficiency while reducing the detrimental effect of noisy points. However, this algorithm is restricted to conditions where a well-defined physical shape exists in the scene, so the generalizability aspect is poor. The region-growth-based segmentation algorithm starts from a selected initial seed point based on a given growth criterion to continuously merge the surrounding point clouds to expand the segmentation region thus achieving point cloud segmentation (Nguyen, 2013). xu et al. (Xu, 2017) proposed a voxel-based region-growth segmentation method to extract the roof plane and achieve voxel-level region growth. The region-based growth algorithm can process all 3D point cloud data, thus ensuring that no useful data is lost. It is higher than the edge detection algorithm in segmentation accuracy, and the advantage is that it can segment small target objects within the scene more accurately, and the disadvantage is that its algorithm relies too much on manual work, which has a serious impact on the segmentation results.
Since the deep learning method was proposed, it has received wide attention in 3D point cloud segmentation. They can be classified into three categories based on the algorithms, voxelbased, multi-view-based, and point-based.Maturana et al. (Maturana, 2015) used VoxNet to process regularized voxel meshes and proposed the concept of 3D convolution to apply convolutional neural networks directly to point cloud processing.In 2015, Su et al. (Su, 2015) proposed a multi-viewbased convolutional view convolutional network framework to process point clouds, applying the CNN framework, which is important in 2D visual processing, to point cloud data processing. Voxelization achieves regularization of point cloud structure, but cannot balance resolution and memory well. In 2017, Qi (Qi, 2017) et al. proposed PointNet to directly process disordered point clouds to address the problem of disordered point clouds, opening up the research of point-based methods. Deep learningbased methods can provide better semantic information of point clouds, but they require a large amount of training data, and deep network models are usually complex and require high equipment requirements.

Characteristics of Dougong
Dougong is one of the unique and complex wooden components in Chinese ancient wooden architecture, taking the naming of Dougong in Qing Dynasty as an example, it is mainly divided into three categories according to the different positions in ancient wooden architecture: Pingshenke, Zhutouke and Jiaoke, as shown in Figure 1. Pingshenke is placed between the two columns, evenly placed in the E-Fang, Pingban-Fang above the Dougong, but also the most used Dougong in ancient wooden buildings in the Qing Dynasty. The Zhutouke is located between the beam frame and the column head, which can transfer the roof load conducted by the beam frame directly to the column, therefore, the Zhutouke has a more load-bearing role than the flat body section. The Jiaoke is located on the head of the corner part of hip roof, gable and hip roof or polygonal buildings, and has various functions such as turning, eave-raising and load-bearing.
The main components of the Dougong can be divided into four categories: Dou, Gong, Ang, and Sheng. Take the Pingshenke as an example to list the names of each part of the components from bottom to top, as shown in Figure 2. Slightly bow-shaped, positioned parallel to the surface of the building for the Gong, according to the shape of the Gong size and can be divided into Gua-Gong, Wan-Gong, Xiang-Gong; The Qiao form is similar to the Gong, but the direction is at a positive angle to the Gong; Qiao the outward end of the special lengthening, diagonal downward called Ang; in the intersection of the Gong and Qiao, in the two ends of the Gong, between the upper and lower two layers of the Gong, there is a bucket-shaped cubes called Sheng; In the two ends of the Qiao, between the upper and lower two layers of Qiao, the bucket-shaped cubes are called Dou.

Figure 2. Name of pingshenke components
As for the Dougong components, each of them is composed of major geometric primitive surfaces: planes, vertical surfaces, curved surfaces, etc., as shown in Figure 3. For example, the Gong is composed of two vertical surfaces in the front and back, two planes in the top and bottom, and two curved surfaces in the left and right, as shown in Figure 3. Therefore, when segmenting the Dougong, we need to first segment the geometric primitives of the components, and then merge the geometric primitives of the same components to achieve the segmentation effect of a single component.

Dougong components Primitive segmentation
As shown in Figure 4, the method proposed in this paper consists of two main parts. Firstly, the point cloud data is super voxelized, and secondly, the partitioning of the geometric primitive surface of the Dougong is achieved based on the super voxel data using a region growing algorithm.
In the first step, the point cloud data is converted into voxel data, and the seed voxels are screened by meshing to initialize the clustering algorithm, followed by feature calculation and distance metric, and finally the super voxel data is obtained using the clustering algorithm.
In the second step, the super voxel data are merged using the region growth algorithm with multiple geometric constraints, including smoothness constraint, similarity constraint, and coplanarity constraint, and finally the point cloud of the Dougong component geometric primitive surface is obtained.

Super voxel:
A super voxel is a collection of several voxels, and the basic principle of its data generation is to fuse the voxel data that satisfy the similarity constraint in the local range and divide the voxel data into super voxels according to the similar attributes, such as texture and normal vector (Papon, 2013). An octree is used to organize the initial point cloud, combine the Euclidean distance and normal vector information between neighboring voxels to obtain the feature distance and construct a voxel adjacency graph, and a clustering algorithm based on flow constraints divides the voxels to the closest seed voxels to form the super voxels.

Feature calculation and distance metric:
The similarity between voxels is measured by considering the edge properties, geometric features and spatial distances of the point cloud data, and the voxel data are clustered under a 37dimensional feature space, which includes curvature values, XYZ three-dimensional space and 33-dimensional point feature space. The feature vectors of the voxel data under the 37dimensional feature space are defined as:

F = [x, y, z, c, FPFH 1…33 ]
(1) where x, y, z are spatial three-dimensional coordinates; c denotes the curvature value of the voxel data; FPFH 1…33 is a 33dimensional Fast Point Feature Histograms (FPFH) of fast point feature values, which is a feature vector consisting of 33 floating point numbers.
In addition to the feature calculation, the distance between voxels needs to be taken into account in the clustering process, and the similarity between voxels is measured by combining the normal vector information and spatial distance of the point cloud data, and the feature distance between seed voxels and their neighboring voxels is calculated based on the normal vector angle difference, curvature characteristics and Euclidean distance: where D c is the curvature variation value between voxels, C max is the maximum curvature value within the neighborhood of voxels, D s is the Euclidean distance between voxels, D n is the dot product of the normal vectors between voxels with mutual adjacency, and R V is the seed resolution. In calculating the distance in this feature space, the components of which are first normalized using √3 times the seed resolution R V for The coordinate distance is normalized because the maximum search distance of the current seed point is the radius to its neighboring seed points, and the maximum value of this radius is √3R V . ω c 、 ω s 、ω n are the weights of D c 、D s 、D n , respectively. Since the distance scales of the two different spaces are different, the characteristic distances between neighboring voxels are obtained by normalizing D c 、D s 、D n , and they are used as the weights of the edges in the voxel neighboring graph to construct the 3D point cloud 26 neighboring graph.

Super voxel clustering:
The clustering algorithm using flow constraints partitions the voxel data, and the specific process of the algorithm is: (1) Determine the traversal order between connected voxels based on the adjacency graph, and search outward from the voxel closest to the center of clustering.
(2) Calculate the similarity distance between neighboring voxels and seed voxels, and label the voxels with the closest distance.
(3) Calculate the mean distance between neighboring voxels and all voxels in the cluster center.
(4) Repeat step (3) until the search reaches the grid boundary of the current super voxel, so that all voxels from the center outward are traversed and the iteration stops.
The clustering algorithm terminates when all voxels in the adjacency graph are traversed, or when none of the voxels in the traversal list meet the labeled condition. When the neighborhood graph search of all voxels is finished, the clustering centers are updated during the above execution until the clustering centers are stable or the maximum number of iterations is reached.

Regional growth clustering based on super voxels:
Region growth achieves fast growth around a seed point by measuring the difference between the seed point and the neighboring points. The algorithm is simple in structure, efficient in operation, and capable of using point cloud data of different expressions as input. There are three key factors in the region growth algorithm, which are the selection of seed points, the growth determination criterion and the growth stopping condition. Using super voxels as the original data for region growth not only ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume X-M-1-2023 29th CIPA Symposium "Documenting, Understanding, Preserving Cultural Heritage: Humanities and Digital Technologies for Shaping the Future", 25-30 June 2023, Florence, Italy can not only avoid the segmentation process of the original point cloud data directly, but also select the plane slice with the smallest mean square error (MSE) as the seed point for region growth after calculating the super voxel plane parameters, which overcomes the shortage of traditional region growth algorithms that are difficult to select robust seed points. In this paper, the super voxel-based region growth algorithm takes the super voxel as the basic unit and integrates three constraints, namely, smoothness constraint, coplanarity constraint and similarity constraint.
(1) Smoothness constraint Smoothness refers to the fact that a smooth surface should be formed between two interconnected point cloud blocks (Rabbani, 2006), which is one of the most commonly used binding constraints in the segmentation field. The smoothness of the local plane formed by two points or point cloud blocks is judged by comparing the angle of the normal vectors between them, as shown in Figure 6. The smaller the angular difference | 1 − 2 | between two normal vectors ⃗ 1 ， ⃗ 2 , the flatter the plane is. Usually, for the convenience of calculation, the result of dot product of two unit normal vectors can be used directly, and the closer its value is to 1, the smaller the angle of entrapment is. Its calculation formula is as follows. ∆Angle = ⟨ ⃗ 1 , ⃗ 2 ⟩ = cos −1 ( ⃗ 1 • ⃗ 2 ) (3)

Figure 5. Smoothness diagram
(2) Coplanarity constraint Coplanarity means that there should not be a large drop between the two faces constituting the connection relationship, i.e., forming a stepped connection state (Xu, 2018). It is judged by the spacing of two point cloud blocks in their normal vector direction, and the smaller the distance, the stronger the coplanarity is as shown in Figure 7. In its study, the drop between two planes is calculated using Eq.
∆Coplanarity=( ⃗ 1 − ⃗ 12 ) 2 +( ⃗ 2 − ⃗ 21 ) 2 (4) Figure 6. Schematic diagram of coplanarity where ⃗ 1 is calculated from the hidden plane representation defined by Dutta et al. and represents the distance of the proposed plane to the origin. The center of gravity ⃗ 1 and the normal vector ⃗ 1 of this point cloud block and the distance from the center of gravity to the origin are used to represent this proposed plane with the following expressions.
⃗ 12 can be derived from equation (5), which has the following expression: (3) Similarity constraint Similarity can be used to determine the degree of geometric similarity between two point cloud segments, and the higher the similarity between adjacent elements, the higher the probability that they belong to one object. xu et al. (xu, 2018) used the eigenvalue-based geometric features used to describe the shape of point clouds to determine the degree of consistency between point cloud blocks, and gave the calculation formula (6) in which the smaller indicates the higher the degree of similarity between the two. Where ( ) and ( ) denote the eigenvalue characteristics of voxels i and j, respectively.

Experimental Data
In this paper, the algorithm is tested using 3D point cloud data of three types of Dougong, namely,Zhutouke , Jiaoke, and Pingshenke of the Qing Dynasty. The photogrammetric modeling method was used to collect and reconstruct the image data for the overall Dougong model. The volume of the Dougong is very small, so a circular route is used to photograph it in three layers, upper, middle and lower, to ensure that the overlap of the photos is not less than 80%. The captured images need to be loaded into the Context Capture software platform to complete the processing such as null-three decomposition and image matching. In order to verify the effectiveness and generality of the algorithm, the experimental prototype system was implemented in Visio studio 2021 platform using C++. Photo collection information is shown in Table 1 Camera model iPhone 11 (

Experimental Results
Compared with other point cloud planar segmentation algorithms, the algorithm in this paper uses super voxels as the basic element of region growth, and adds similarity constraints and coplanarity constraints to improve the effect of point cloud segmentation based on the traditional region growth algorithm. Firstly, the point cloud is over-segmented using VCCS clustering algorithm to obtain the point cloud hyper voxelization results. The voxel resolution (voxel_resolution) value in the experiment is 0.008f, and the seed resolution (seed_resolution) value is 0.1f. In the process of expansion by seed points, it should be noted that since there is no color information, therefore, in this thesis Only the weight parameters of spatial position and normal vector are considered, and the spatial weight parameter (spatial_resolution) is set to 0.2 and the normal vector weight parameter (normal_resolution) is set to 0.8 through parameter adjustment and result optimization. As shown in Figure 8. Next, the region growth algorithm is used to calculate the features of the super voxels as the base data, filter and sort the seed points and merge the super voxels, and finally achieve the segmentation results of each primitive of the Dougong component. The segmentation results of the components are shown in Figure 9. From the segmentation results, we can see that the segmentation effect is ideal for the relatively uniform planes in the point cloud of the Dougong components, and the entire geometric primitive surface can be extracted. However, the segmentation effect is not ideal when the surface of the point cloud is relatively large, so it is necessary to combine the knowledge of the Dougong construction method in the subsequent work to classify the geometric primitive surface in order to complete the segmentation of the Dougong components.

CONCLUSIONS
In this paper, we propose a super voxel-based 3D point cloud region growth segmentation algorithm to segment the geometric primitive surfaces of Dougong components. Firstly, the point cloud is over-segmented into super voxels, and the super voxels are represented by the central voxel of the super voxel, which reduces the amount of point cloud data processing while preserving the local features of the point cloud. Then Euclidean distance and normal vector difference are used to measure the similarity between super voxels. Finally, the super voxels are merged into meaningful classes using a region growing algorithm.
The experimental results show that the algorithm in this paper can effectively extract the geometric primitive surfaces of Dougong components and prepare for the subsequent attribution of geometric primitive surfaces through the knowledge of shape, position and connection in the Dougong construction pattern. The algorithm achieves semi-automatic point cloud segmentation by setting algorithm parameters. However, if the Dougong point cloud is unevenly distributed, the segmentation results may be inadequate. In addition, when the point cloud is large in size and the local surface morphology of the point cloud varies greatly, the segmentation effect is poor due to the normal vector distribution. Therefore, some improvements are needed in the subsequent experiments.