A New Method of Achieving Single Three-Dimensional Building Model Automatically Based on Oblique Photography Data

Operating and managing single three-dimensional building model individually are critical in the application of oblique photography models. However, these models are usually complete and continuous, and the single three-dimensional building model in these models cannot be managed individually. Generally, achieving a single three-dimensional building model requires a human-computer interaction to determine the cutting range, but this process is time-consuming and inefficient. To overcome this problem, this study proposed a new method for automatically achieving single three-dimensional building model without the need for human-computer interaction. First, the point clouds of an oblique photography model are divided into virtual grids, and the point clouds in each virtual grid are seen as a whole. In this way, the number of point clouds involved in the calculation is reduced, thereby improving computing efficiency. Second, the point clouds of a building facade are extracted by setting the height difference. By comparing the height difference between the highest point and the lowest point of the grid with height difference threshold, all point clouds in the grid that do not meet the requirements are eliminated. )ird, the point clouds of the building facade are classified, and the contour line is extracted by the classified point clouds. Finally, the single three-dimensional building model is achieved by reconstructing the triangles that intersect with the extracted contour line. Experimental results show that the proposed method can effectively achieve single bodies automatically from an oblique photography building model.)is method is then useful for achieving single three-dimensional building model from massive oblique photography data.


Introduction
With the increasing application of 3D Geographic Information System (GIS) [1,2], dealing with problems in the 3D space is considered more intuitive and efficient than those in the 2D space. 3D building models are important parts of 3D GIS, which are widely used in city map of smart city and Virtual campus [3].
ere are some ways to obtain 3D building models. One common method is to use LIDAR to collect point cloud data and then generate a 3D model. Although the method is effective, the cost is high because the equipment is expensive and the data processing is complicated. e development of oblique photography technology has enabled a low-cost and high-efficiency 3D reconstruction of real scenes through multiview aerial images [4]. Oblique photography is a new technology in the field of surveying and mapping where cameras are installed obliquely on a platform to obtain information about the ground features, especially the facade of buildings. Oblique photography has been applied in various fields, such as location services [5], disaster assessment [6], and archaeological research [7]. However, the original model from oblique photography is a continuous triangular net, and buildings and other features cannot be managed separately [8]. erefore, achieving single 3D building model is critical in the application of the oblique photography model in 3D GIS.
Single 3D building model can be achieved in three ways [9]. First, an ID is added to the vertices of triangles, and the single bodies can then be identified by different IDs. Second, dynamic achieving superimposes the corresponding vector on a single body, and the single body model in 3D rendering is identified by the vector face. ese two methods do not need to obtain the contour line information of the building model but cannot achieve an actual segmentation of continuous triangles.
ird, single bodies are achieved by cutting the complete and continuous one-scene model [10,11]. is method needs to obtain the contour information of the building model and then reconstructs the triangulation network according to the intersection relationship between the contour information and the triangle [12]. After cutting, the objects in the oblique photography are separated.
To cut the building model, the cutting range or contour line of the building needs to be obtained. Currently, the contour line is acquired via human-computer interaction. However, such method is time-consuming and may lead to certain errors that affect its application. Building contour information serves as the basis for building extraction and 3D model reconstruction, and it has been widely used in various applications, such as urban basic information database update [13], target recognition [14], disaster prediction [15], and other fields [16,17]. In addition to manual drawing, the contour line of the building can also be automatically extracted. Building contour information is mainly extracted in two ways. On the one hand, image-based building contour extraction [18] applies geometric boundary corner feature extraction and reconstruction methods to extract building outlines from high-resolution remote sensing images. However, it is difficult to extract accurate boundary from only aerial image partially due to shadows, occlusions, and poor contrast [19]. e process is complex and time-consuming. On the other hand, point-cloud-databased methods [20,21] use clustering to extract the point cloud of a building and then construct the building contour line using Alpha Shapes [22,23]. In addition to building point cloud, the collected point cloud data usually includes various types of ground objects, such as vegetation, ground, etc. In the process of extracting contour lines, other point clouds such as vegetation will greatly interfere with the results. So, first of all, the point cloud data of tree and ground will be removed [24]. Afterward, the triangle inside the obtained contour line is separated from the original model, and a new model is constructed. e triangles intersecting with the contour line are cut and subsequently classified. e triangles outside the contour line are added to the original model, whereas those inside the contour line are added to the newly generated single model. In this way, a single body can be achieved by cutting.
As shown in Figure 1, the oblique photography model is a continuous triangular mesh. It is impossible to detect the triangular network of the building model separately. ere are some studies that use vector files imported from outside or polygon by human-computer interaction to obtain single 3D building model of the oblique photography model [25]. Although its cutting effect is acceptable, this method relies on the baseline files imported from outside and does not realize the achieving single three-dimensional building model of the oblique photography model automatically.
ere are also some researches that used LIDAR point cloud data to extract the outline information automatically of buildings to represent the building model [26]. However, the final result is only to obtain the 2D information of buildings, not to obtain the 3D model of a single building [27]. us, 3D building models cannot be managed separately. Furthermore, the data source used in these studies is LIDAR data, which has high cost in actual production [28]. Given the large number of vertices in the oblique photography model, vertex data can be extracted as point cloud data. A large amount of discrete point cloud data can be extracted in this process. ese point cloud data are used to construct a virtual grid to reduce the amount and to achieve an even distribution of these data, thus improving computing efficiency. e difference in elevation between buildings can also be used to filter the point cloud of buildings, remove most point clouds that are not intended to improve accuracy, and use the clustering algorithm to achieve point cloud clustering [29]. e building contour can then be extracted through point cloud data [30]. erefore, based on the characteristics of oblique photography model data, a method for automatically achieving single bodies from a 3D building model is proposed in this study. is method avoids the complicated process of manually drawing the range, and the accuracy of the extracted contour line is high. Furthermore, the final result is to obtain the 3D information of buildings, and 3D building models can be managed separately.

Data Acquisition and Presentation.
e oblique photography model data of Northeastern University, which were collected by an unmanned aerial vehicle, are used in this study. Consistent with the content of this study, the area covered by these data includes multiple building models. In the data acquisition process, the UAV carries five lenses, and the sensor size is 23.2 mm × 15.4 mm. e 3D model format is generated using the ContextCapture Center software, and the final model is proven to have good quality. e data in the 3D model are formatted in OSGB, which is a common 3D model data format. is model has its own multilayer LOD and demonstrates natural advantages in browsing and loading large scenes. e OSGB model file stores all types of information, such as vertex coordinates, texture coordinates, and texture pictures of the model. e vertex coordinates and triangulation data of the model are easy to extract, thereby facilitating subsequent model processing.

Flowchart.
e proposed method is divided into two parts, namely, extracting the building contour and achieving single bodies by cutting a triangular net. Figure 2 illustrates the entire process. To extract the building contour, the point cloud data extracted from the oblique photography model are divided into virtual grids with a fixed size. Afterward, the height difference of t points in each grid is calculated, and both ground and vegetation are removed by setting a height difference. e point cloud data are then clustered, and the contour line is drawn by the cluster point cloud data. To achieve a single body from an oblique photography model, the cutting polygon is determined by the constructed building contour, the bounding box of the cutting polygon is intersected with bounding box of the first-level LOD [31] of the oblique photography model, and the intersecting models are extracted. e triangles of the intersecting model are divided into three parts, namely, inside, outside, and intersecting with the cutting polygon. e intersecting triangle is then cut, the resulting triangle is divided into inside and outside, the inner triangle is combined into a single model, and the outer model is modified to the original model file. All LODs of the oblique photography model are traversed to achieve a single body.

Extracting Building Contours Based on an Oblique Photography Model.
e vertex information extracted from the original data includes information related to the ground, trees, and buildings, among others. e distribution of the extracted point cloud data differs from that of the point cloud data scanned by a laser radar. To consider the model features and reduce the amount of data in the production process of the oblique photography model, the point cloud is dense in areas where the features are obvious yet sparse in those areas where the features are not obvious. erefore, the uneven distribution and density of point cloud data make the laser-point-cloud-based building contour extraction method very unsuitable for this work.

Virtual Grid Generation.
e point cloud is denser where the features are obvious, and the point cloud is sparse where the features are not obvious. Unevenly distributed point clouds will affect the extraction of contour lines. To improve the calculation efficiency and accuracy of the drawing contour, the neighborhood relationship of the point cloud should be constructed. In this study, a virtual grid [32] is constructed from point clouds to facilitate the subsequent analysis and processing. A virtual grid is then constructed as follows.
Calculate the bounding box of the input point cloud to obtain the minimum (x min , y min , z min ) and maximum point coordinates (x max , y max , z max ) of the point cloud area. e number of rows (r) and columns (c) of the entire grid is calculated as where w is the size of the virtual grid that needs to take into account the point cloud density. e row and column number of the virtual grid at any point i (x i , y i ) can be calculated as where (x i , y i ) is the plane coordinate of point i.
All point cloud data are eventually divided into several grids of the same size. e point cloud data contained in each grid are represented by the central point cloud of the grid. In this way, the problems related to the large amount of point cloud data and their uneven distribution can be solved.

Point Cloud Extraction of Building Façade Based on Height Difference.
e largest difference between buildings and the ground is reflected in elevation. In the oblique photography model, the elevation change between adjacent points is not obvious. However, the building has walls, and the elevation obviously changes at the edge of the building. erefore, most of the plane point clouds can be eliminated by setting a height difference threshold. ese point clouds include ground points and the top surface of buildings and the most of the vegetation points. e extraction process can be roughly divided into several steps. First, the height difference threshold is set, all grids are traversed, and the point clouds whose height difference is below this threshold are removed from the grid. Second, the retained point clouds are mostly the facade points of buildings, and few of these points are residual point clouds from tall trees.

Point Cloud Classification and Contour Generation.
Many algorithms, such as DBSCAN [33,34] and K-means [35,36], are used for point cloud classification. is study adopted the density-based DBSCAN clustering method, which divides regions with sufficiently high density into several clusters. Unlike K-means, this method does not need to know the number of clusters in advance and can identify noise points [37]. Afterward, the Alpha Shapes [38] algorithm is used to construct the contours of each building from the classified point cloud.

Cross Detection and Classification of Triangular Face.
An oblique photography 3D model has a large number of triangles. If each of these triangles intersects with the cut polygon formed by the building contour, then the processing Mathematical Problems in Engineering efficiency will be greatly affected [39]. e following processing flow is therefore adopted. First, the intersection relationship between the bounding box of the polygon and the bounding box of the model is determined. Second, the model whose bounding box intersects with that of the cut polygon is identified. ird, AABB is applied to detect the intersection of triangular surfaces. Fourth, these triangular surfaces are divided into three categories, namely, inside the area, outside the area, and intersecting. Finally, the intersecting triangular facets are cut, and the results are divided into two categories, namely, inside and outside the ranges. e triangles outside the area are removed, and those inside the area are preserved as a single body model.

Cutting Triangulation Net.
e relationship between the cutting line and the triangulation net can be divided into three categories, namely, the triangle is tangent to the cutting line, the triangle intersects with a cutting line, and the triangle intersects with two cutting lines. Figure 3 presents four cases of intersections and tangencies between a triangle and a cutting line. First, a cutting line intersects with two sides of the triangle. Second, a cutting line intersects with one vertex and one side of the triangle. ird, a cutting line is tangent to one side of the triangle. Fourth, a cutting line is tangent to a point of the triangle. Meanwhile, Figure 4 presents four cases of intersections between a triangle and two cutting lines. First, a vertex of the cut polygon is located inside the triangle, and two sides intersect with two points of the triangle. Second, a vertex of the cut polygon is located inside the triangle, and two sides intersect with one side of the triangle.
ird, a vertex of the cut polygon is located inside the triangle, a vertex of the triangle is located inside the cut polygon, and two sides intersect with two sides of the triangle. Fourth, a vertex of the cut polygon is located inside the triangle, and two sides intersect with one point and one side of the triangle. e cutting process cuts the minimum geometric element and ensures that the geometric characteristics are still met afterward. Given that the oblique photography model used in this study comprised triangular slices, after cutting the minimum unit of the model, the topological relationship between triangular slices should still be maintained.
In Figures 3(c) and 3(d), given that the cutting line is tangent to the triangle, cutting triangles is not necessary. When a triangle is related to two lines, and one line is  tangent to the triangle and the other line interests with the triangle, this case can be seen that the triangle is cutting by one line. Different cutting methods are used for each intersecting mode. For the case in Figure 3(a) where one side of the cut polygon intersects with two sides of a triangle, the intersecting part is clipped as follows. Figure 5 shows that a cutting line cuts the triangle into two triangles and that a topological relation among the triangles is established. For the case in Figure 3(b), one side of the cut polygon passes through the vertex of a triangle and intersects with one side of the triangle, and the intersecting part is clipped as follows. Figure 6 shows that a cutting line cuts the triangle into two triangles and that a topological relation is established among the triangles.
In Figure 4(a), one vertex of the cut polygon is located in a triangle, two cutting lines pass through two vertices of a triangle, and the intersecting part is clipped as follows. Figure 7 shows that two cutting lines cut the triangle into three triangles while maintaining their topological relation.
In Figure 4(b), a vertex of the cut polygon is located in a triangle, two cut lines intersect one side of a triangle, and the intersecting part is clipped as follows. Figure 8 shows that two cutting lines cut the triangle into five triangles, and a topological relation is established among the triangles.
In Figure 4(c), a vertex of the cut polygon is located inside a triangle, one of two cutting lines crosses the vertex of a triangle, whereas the other intersects with one side of this triangle, and the intersecting part is clipped as follows. Figure 9 shows that two cutting lines cut the triangle into four while establishing a topological relation among these triangles.
In Figure 4(d), a vertex of the cut polygon is located in a triangle, a vertex of cutting polygon is located in the triangle, two cut lines intersect with two sides, and the intersecting part is clipped as follows. Figure 10 shows that two cutting lines cut the triangle into five and that a topological relation among these triangles is established.

Reconstructing the 3D Model.
e reason for the reconstruction of the 3D model is that the single body by cutting triangular elements is the physical single body; this method will increase the number of vertices and triangular elements. erefore, the data in the 3D model should be reorganized.
e intersecting triangular slices are cut according to the method described in Section 2.2.2. e intersecting points generated in this process will become new vertices of the 3D model, and a single triangular slice will be divided into multiple slices. To achieve the effect of 3D model display, the texture coordinates of the newly added vertices should be calculated. Afterward, the intersecting triangular slices are removed from the model, and the newly generated triangular slices are divided into two types, namely, outside and inside the area. All triangles inside the cut polygon are fused Figure 3: Intersection relation between a triangle and a line.

Experimental Results and Discussion
To verify the effectiveness of the proposed method, this study adopted C/C++, OpenSceneGraph (OSG), and point cloud library (PCL) to carry out experiments. e original oblique photographic data have a large number of building models, and a certain building model is selected in this study for the experiment.

Result of Building Contour Extraction.
Vertex information is extracted from the original data as the initial point cloud, and then, ground and vegetation points are eliminated by setting the virtual grid and the height difference threshold. Different grid sizes and height difference thresholds will greatly influence the extracted point cloud effect.
When the parameters are inaccurate, many wrong clustering results will be generated mainly due to the tall trees and the characteristic information of the building ( Figure 11). As a rule of thumb, no intersection and inclusion are observed between the contours of separate buildings. erefore, the clustering results affected by the characteristic information inside the building can be eliminated.
e other interference clusters can be eliminated based on the shape and area of the polygon of the contour line. Figure 11(a) shows that many wrong clustering results are observed. e clustering results inside the building are eliminated by the intersection of polygons in Figure 11(b). e clustering results of tall trees can then be removed by the area and shape of the polygon in Figure 11(c). e height difference threshold is set to 18 m, the grid size is set to 0.5, 1, and 2 m, and the extracted point cloud results are shown in Figure 12.
e effects of the point clouds extracted by 0.5 m and 1 m grids do not greatly differ. Meanwhile, the point cloud extracted by the 2 m grid is sparse, and the contour line from the sparse point cloud shows a poor effect. e extraction efficiency of the 1 m grid is higher than that of the 0.5 m grid. erefore, the 1 m grid is adopted in this study. e grid size is set to 1 m, the height difference threshold is set to 14, 16, and 18 m, and the extracted point cloud results are shown in Figure 13.
e above results show that the point cloud of the building has been extracted completely, but many noise points are observed when the height difference threshold is set to 14 m. ese noise points will affect the extraction of contour lines. e point cloud of the building is not completely extracted when the height difference threshold is set to 18 m, which will make the extracted contour line ineffective. Meanwhile, the point cloud of the building is completely extracted, and only few noise points are observed when the height difference threshold is set to 16 m. erefore, the height difference threshold is set to 16 m in this study. Different point cloud extraction effects are obtained by setting grid size and elevation difference as shown in Table 1.
e DBSCAN algorithm is adopted to segment the above point cloud, and Alpha Shapes is used to construct the contour lines for each point cloud cluster. e point cloud data are clustered by setting the search range to 4 m and the minimum number of clusters to 100, 150, and 200. e effect diagrams are shown in Figure 14.
e characteristic information inside the building is also clustered when the minimum number of clusters is set to 100. Meanwhile, when the number of clusters is 200, smaller buildings are omitted, and when the minimum number of clusters is 150, the building outline is extracted correctly and an improved effect is recorded.
By combining the building contour information with the elevation difference information of each virtual grid, the building bounding box is drawn and superposed on the oblique photography 3D model. e effect is shown in Figure 15, which reveals that the bounding box can accurately contain the building model.

Effect of Achieving a Single Body Based on an Oblique Photography Model.
e building contour obtained by the above method is used as a polygon to cut the oblique photography model and achieve a single body. In this study, a single building model is separated from the original scene and transformed into a child node of the original scene. Figure 16(a) shows that the building model can be managed individually, Figure 16(b) shows that this building model is independent, and Figure 16(c) shows that the edge of this model is a straight line.

Discussion
e measurement accuracy of oblique photography is relatively high, and the measurement result has an elevation error between 2 and 10 cm [40,41]. Compared with the elevation of buildings, the impact of the measurement error is slight. e point cloud data of the building is distributed in multiple grids, which are connected. When the grids of the building are detected, the height difference of each grid is calculated. Finally, the average of these height differences is  Elevation information of the building is extracted from the original point cloud data, and the minimum number of clusters is determined by the point cloud density of the grid. For different data, the final parameters are not same, but the contour lines of the building can be accurately extracted in the end. erefore, the algorithm is suitable for different examples. Figure 17 is the processing result of another example.

Conclusion
Achieving single bodies is one of the major problems that need to be solved in the application of oblique photography technology. To address this problem, this study proposed a method of automatically achieving single bodies. At present, a single body is achieved by drawing a contour line via human-computer interaction or importing vector files. However, this method is time-consuming and has poor accuracy. is study used the point cloud data extracted from an oblique photography model to realize an automatic extraction of contour lines. In the contour line extraction, the initial point cloud data are screened by setting the size of the virtual grid and the height difference threshold to improve efficiency and accuracy. Afterward, the point cloud is clustered using the DBSCAN clustering algorithm, and the building outline is constructed by the algorithm. e extracted contour line is then used to cut the original model, and the boundary triangulation is reconstructed to generate a new single model. is new model can be managed separately without affecting the overall display effect. Experimental results show that the proposed method is easy to implement and has high accuracy. is method is of great significance in achieving a single body and can further promote the application of oblique photography technology.
Data Availability e data used in this article is oblique photography data obtained by drones, which is relatively easy to obtain.

Conflicts of Interest
e authors declare that they have no conflicts of interest.