A Boundary Construction Algorithm for a Complex Planar Point Set

It is difficult to extract the boundary of complex planar points with nonuniform distribution of point density, concave envelopes, and holes. To solve this problem, an algorithm is proposed in this paper. Based on Delaunay triangulation, the maximum boundary angle threshold is introduced as the parameter in the extraction of the rough boundary. *en, the point looseness threshold is introduced, and the fine boundary extraction is conducted for the local areas such as concave envelopes and holes. Finally, the complete boundary result of the whole point set is obtained. *e effectiveness of the proposed algorithm is verified by experiments on the simulated point set and practical measured point set. *e experimental results indicate that it has wider applicability and more effectiveness in engineering applications than the state-of-the-art boundary construction algorithms based on Delaunay triangulation.


Introduction
e point set is basic spatial data for representing the shape of objects. GNSS survey, 3D laser scanning, aerial photography, and aerospace remote sensing technology are producing massive point set data. e accurate and efficient processing of these data is a challenge to building information modeling (BIM), geographic information (GIS), remote sensing (RS), computer information technology (IT), computer-aided design/manufacturing (CAD/CAM), and other related fields [1]. e boundary information of the point set is composed of discrete points representing the original contour features of the measured object. e rapid and efficient construction of boundary information from the discrete point set is fundamental and crucial for spatial data processing, which plays an important role in GIS-related fields such as geographic boundary determination [2,3], building contour extraction [4,5], map generalization [6,7], statistics of the plot area, and the computation of road earthwork volume [8,9]. e physical shape of the real object is diverse and can be simple or complex. is indicates that the point set boundary used to digitally represent the physical shape of the object is also diverse and complex. e complexity of this boundary is manifested by the following four problems: (1) the effective organization of the spatial relations (geometry, topology) of the points; (2) nonuniform distribution of the point density; (3) accurate expression of the information of the boundary shape (concavity and convexity); and (4) internal multihole problem. ese are the main problems to be faced with the boundary construction of a complex planar point set.
At present, two kinds of algorithms are mainly exploited to construct the boundary of planar point set: the algorithm of point set based on convex hull and the algorithm of point set based on Delaunay triangulation. e former [10][11][12] starts from the convex hull polygon that constitutes the point set and uses different contraction algorithms to obtain the boundary characteristics of the point set, which can handle the point set with nonuniform distribution and the point set with concave envelope region under certain conditions. e biggest drawback of this kind of algorithm is that it cannot deal with the internal multihole issues. e latter must first construct the Delaunay triangulation. en, it extracts the corresponding boundary triangles, boundary line segments, or boundary points based on the geometric features of the triangulation to represent the contour characteristics of real objects. e Sculpture algorithm [13] and Alpha Shapes algorithm [14] are the main representatives of this kind of algorithm. e key point of the Sculpture algorithm and the improved algorithms such as χ-shape algorithm [15] and zRGG algorithm [16] is to gradually delete triangles that are not needed from the outside to the inside of the triangulation, until a boundary point set that meets the given conditions is finally generated. In essence, the Sculpture algorithm is a triangulation stripping algorithm. e major drawback of this algorithm is that it is not stable enough to deal with a complex concave boundary and the boundary with internal holes, especially long and narrow holes. e Alpha Shapes algorithm was first proposed by Edelsbrunner. Its main feature is to give a strict mathematical definition of "point set shape." On this basis, the algorithm constructs a two-dimensional point set boundary based on the Delaunay triangulation. e original Alpha Shapes algorithm is suitable for dealing with the boundary of the convex hull point set with uniform distribution, but it does not work well for a complex planar point set with concave envelopes and holes. Later, some improved versions of the Alpha Shapes algorithm, such as c-shape [17] and A-shape [18] are proposed. Based on local metric or global metric, these algorithms adopt different rules to solve the problems of constructing complex planar shape boundaries such as nonuniform density of point set and holes. However, some problems need to be addressed, such as too many required parameters and unsatisfactory extraction of the boundary of long and narrow holes.
In summary, Delaunay triangulation can easily record the spatial information of an irregular planar point set in a specific data structure. Also, it has strong extensibility, and its triangulation generation algorithm is mature and stable. erefore, compared with other types of algorithms, the Delaunay triangulation is relatively robust for constructing the boundary of a planar point set. Based on Delaunay triangulation, a new boundary construction algorithm is proposed in this paper to solve the existing problems in the boundary construction of the planar point set. e proposed algorithm first processes the convex hull boundary of the triangulation as a whole to form a rough boundary and then refines the processed results through the corresponding mathematical model to achieve a complete construction of the complex planar point set boundary. e results of the simulated comparative experiments and practical measurement experiments indicate that the proposed algorithm is effective and feasible.

Relevant Definitions
For the convenience of algorithm description, some basic concept definitions and symbols that will be used in this paper are presented here.
Let S � P 1 , P 2 , . . . , P n be the planar point set and DT(S) be the Delaunay triangulation generated based on S.
Let v, e, t be the triangle vertices, triangle edges, and triangles inDT(S), respectively: (1) Boundary edge: in the triangle set of DT(S), the edge belonging to only one triangle is denoted as Be; the result of the algorithm is a set of boundary edges, i.e., C(Be) � Be 1 , Be 2 , . . . , Be m . C represents the open area between Conv(S) and P, and each open area is represented by a closed curve C. e area formed by these closed curves is referred to as the concave envelope. In DT(S), the edges in the concave envelope are referred to as concave edges, and each concave envelope consists of a visible boundary edge and several concave edges. (7) Holes: a concave envelope with only concave edges and no boundary edges is a special case.

Algorithm Overview
e proposed algorithm consists of two steps: extracting the rough boundary and extracting the fine boundary. For preprocessing, a stable algorithm is exploited to generate the Delaunay triangulation DT(S). Based on this, the convex hull of the point set S is found, and the basic data is prepared for the smooth progress of the algorithm. Firstly, according to the parameter selection rule of the boundary angle Ba, a rough boundary is extracted by filtering inwardly from the initial edge of the convex hull. en, taking the maximum density and edge length of the point as parameters, the local areas such as the concave envelopes and holes are further refined to form the final complete boundary.

Extracting Rough Boundaries
e Delaunay triangulation of the point set needs to be generated as the input data. e algorithm of generating Delaunay triangulation is very mature, and an incremental insertion algorithm is exploited to generate the Delaunay triangulation of a point set by the proposed algorithm. Triangle point, triangle edge, and triangle are three kinds of geometric entities that constitute Delaunay triangulation. As listed in Table 1, a data structure 2 Complexity with topological relations for Delaunay triangulation is designed to save the storage space of the device and improve the operation efficiency of the proposed algorithm. It can be seen from Table 1 that the topological relationship of the geometric entities in Delaunay triangulation is defined in terms of triangle edge. After the start point and end point of the triangle edge are defined, the triangle edge becomes a vector and can conveniently record its adjacent triangles.
According to the Gestalt proximity principle [20], the boundary of a planar point set is formed by connecting points with similar distances from their peripheral points. As for a boundary triangle, if the boundary edge is very long and exceeds the given threshold, it violates the principle of proximity and needs to be deleted. erefore, the maximum boundary edge length can be used as a filtering condition to extract the boundary. However, the length threshold is a global metric. Once set, it is fixed for the entire process of processing the point set, which is not effective in dealing with the nonuniform distribution point set. In this case, using the maximum boundary angle as the boundary filtering condition is considered. Since the angle in the triangle is determined by the relative length of the three sides constituting the triangle, it is a local metric and is suitable for processing the nonuniform distribution of points. us, a maximum boundary angle threshold is chosen as the boundary filtering condition to extract the rough boundary of the point set. In the extraction process, to ensure the uniqueness of the results, the boundary edges need to be arranged in descending order according to the size of the boundary angle. e extraction process is illustrated in Figure 1.
Considering the rules for deleting boundary edges, two special cases need to be focused on, which are shown in Figure 2: (1) chain edge and suspended edge, which are not part of a DT(S) triangle; (2) the intersection point of more than two boundary edges, namely. When deleting a boundary edge, it is necessary to perform a topology check on the new boundary. If (1) and (2) appear, the deletion operation should be undone.

Selecting Maximum Boundary Angle
reshold α 0 . In the process of extracting the rough boundary, the threshold value of the maximum boundary angle α 0 cannot be determined by a definite calculation formula. Instead, it needs to be determined by experiments. In the proposed algorithm, the L 2 norm [15] calculated by formula (1) is used to evaluate the accuracy of the extraction results: In formula (1), O represents the polygon of the original graph, and R represents the polygon of the graph surrounded by the boundary that is extracted by the algorithm.
e L 2 norm represents the boundary extraction effect through the proportional relationship between the polygon area of the original graph and the polygon area of the graph surrounded by the extracted boundary. e smaller the L 2 , the higher the coincidence degree between the extracted boundary and the original graphic boundary, and the better the effect.
In this paper, the experiment was conducted through three groups of symbol shapes, including isoline A, F, and K. e number of experimental points was, respectively, 100, 150, 200, and 250, representing different point densities. Meanwhile, the points were uniformly distributed in the shape, and it is ensured that the point set within each shape could cover the shape boundary. e range of the maximum boundary angle was [0, 180] with an interval of 10 degrees. Figure 3 illustrates the boundary extraction effect of the shape F, and Figure 4 shows the corresponding L 2 change curve. e experimental results indicate that the threshold value of the maximum boundary angle falls within the range of [60, 100], and the algorithm can achieve satisfactory boundary extraction results.

Extraction of Fine Boundary
e boundary obtained by the rough boundary extraction can represent the contour shape characteristics of the point set to a certain extent. However, the expression of the complex concave envelopes is not precise enough, and the boundary of holes cannot be processed completely. It can be seen from the red triangle in Figure 5(a) that there may be very small boundary angles when irregular triangles are in the concave envelope region. As a result, the boundary edges may be ignored in the process of deletion, thus affecting the quality of boundary results. To delete such boundary edges, the threshold of the maximum boundary angle must be lowered. However, this will cause the boundary to shrink excessively and become broken. In this case, the ideal boundary cannot be obtained either. Considering the boundary of holes shown in Figure 6, since its boundary edge is not the edge of the boundary triangle in DT(S), the rule of extracting the boundary edge through the maximum boundary angle is invalid. erefore, it is necessary to design special rules for concave envelopes and holes to extract fine boundaries.
Since a hole is a special case of a concave envelope, the concave envelope described below contains the characteristics of the hole unless otherwise specified. It can be seen from Figures 5 and 6 that in the point set S containing concave envelopes, the point density of the concave envelope region is significantly lower than that of the normal region. From the normal region to the concave envelope region or vice versa, the point density changes greatly, and the change can be expressed by a parameter called point looseness. Let P be any point in the Delaunay triangulation DT(D) generated by the given point set D, and L P is the looseness of the point, which can be calculated by the following formula: where d P and σ d P are the average length and the standard deviation of the line segment between point P and the connecting point, respectively. e smaller the value of L P , the more subtle the difference between the edge length of point P and the connecting point, and the less likely P is to be a boundary point; otherwise, the more likely P is to be a boundary point. As shown in Figures 5(b) and 6(b), the looseness of the normal boundary points and concave envelope boundary points is large, while that of the interior points is small. erefore, a looseness threshold l 0 can be set as a parameter to detect the concave envelope region, and the looseness set of the concave envelope region is presented in the following formula: e boundary point set of concave envelopes can be obtained by L C . Specifically, a large looseness of the concave envelope boundary points indicates that the length of the line segments between the boundary points and the connecting points is greatly different. Filtering these line segments to remove the unnecessary long edges is essential to the following processing. An edge length constraint parameter d 0 is obtained by the following formula: where d P is the average length of the line segment between point P and the connecting point and σ d P is the average value of all points σ d P in the given point set D.
For any point P in the point set processed by the rough boundary extraction, if the edge length of its connecting points is greater than d 0 , it should be deleted according to the boundary edge deletion rules. Otherwise, the retained connecting points and edges are processed following the rough boundary extraction method to generate the required boundary results. e fine boundary extraction process is shown in Figure 7.
It worth noting that the processing sequence of the fine boundary extraction cannot be reversed. e concave envelopes (without holes) should be processed before the holes are processed. As for the algorithm, it is necessary to filter the point looseness before the boundary edge. is can filter out the most irregular triangles. Besides, the point looseness traversal and edge length traversal of connecting points are arranged in a descending order to ensure the uniqueness of the boundary extraction result.

Determination of Looseness
reshold l 0 . Determination of the point looseness threshold l 0 is a crucial step in the process of fine boundary extraction. According to the definition of point looseness, the looseness of the boundary point is significantly greater than that of the interior point. e determination of the point looseness threshold can be regarded as a conic segmentation problem. e objective function shown in formula (5) is exploited to detect the point set and find the point in the transition region between the initial boundary and the final boundary to automatically determine l 0 . To this end, it is necessary to construct a set L � l 1 , l 2 , . . . , l n which contains the looseness of all points arranged in an ascending order: where l i is the ith element of the set L; l is the mean value of the set L; σ L is the standard deviation of the set L; and k is the adjustment parameter. e larger k is, the larger the corresponding looseness threshold l 0 will be, and more boundary details will be retained. After judged by the objective function, the looseness set L of the point set is segmented into two parts. To achieve the best effect of conic segmentation (the minimum intraclass variance and the maximum interclass variance), the PBM index [21] is introduced to automatically solve the parameter k. is index is a relative evaluation index, which can meet Complexity 5 the clustering criteria of compactness and separation. e formulas for calculating this index are as follows: where N c represents the number of classification; N i represents the number of points in the classification C i ; o i represents the centroid of classification C i ; S i represents the internal distance of classification C i (the sum of distances between all points in the classification and the centroid of classification); S N c represents the internal distance of the clustering of point set divided into N c classes; and D N c represents the separation degree of the classification of the point set. e higher the PBM index, the higher the reliability of classification results.

Simulated Comparative Experiments
To verify the effectiveness of the proposed algorithm, this paper designed simulation experiments for three scenarios, including a nonuniform distribution point set, a uniform distribution point set with concave envelopes, and a uniform distribution point set with holes. Meanwhile, to verify the applicability of the proposed algorithm, the Delaunay triangulation-based algorithms χ-shape and c-shape were taken as the reference. e experimental results and analysis were as follows.

Nonuniform Distribution Point
Set. 150 points were drawn manually in a circular area with a radius of 35 length units by the CAD software. As shown in Figure 8, the density 6 Complexity of the points decreased from left to right. e two-dimensional coordinate data file of these points was exported from the CAD software and then imported into the algorithm verification program as the point set data. e results are shown in Figure 8 and Table 2. e experimental results indicate that the three algorithms can successfully extract the boundary of the point set, and the roughness of the extracted boundary varies with the algorithm parameters. Since the χ-shape algorithm used the threshold of the global measurement of the edge length as a parameter, the effect of boundary extraction was not stable. For a small λ, this algorithm might produce more sawtooth in the areas with smaller point densities. Both the c-shape algorithm and the proposed algorithm obtained better boundary results.

Uniform Distribution Point Set with Concave Envelopes.
200 points were drawn manually with uniform distribution in a closed area with a width of about 20 length units. e  closed area was drawn by the CAD software, and it was surrounded by the peripheral outline of the letter C in Arial Black font, as shown in Figure 9. e two-dimensional coordinate data file of these points was exported from the CAD software and then imported into the algorithm verification program as the point set data. e results are shown in Figure 9 and Table 3.
e experimental results indicate that the three algorithms can successfully extract the boundary of the point set with good effect. Compared with the χ-shape algorithm and c-shape algorithm, the proposed algorithm provided a reasonable mathematical definition and detection method based on the fact that the conic segmentation index had a strong theoretical basis.

Uniform Distribution Point Set with
Holes. 280 points were drawn manually with uniform distribution in a circular area with a radius of 35 length units by the CAD software. en, 40 points were deleted along the horizontal direction of the diameter to form a narrow hole, as shown in Figure 10. e two-dimensional coordinate data file of these points was exported from the CAD software and imported into the algorithm verification program as the point set data. e results are shown in Figure 10 and Table 4. e experimental results indicate that the χ − shape algorithm failed to extract the hole boundary, and the c-shape algorithm extracted the hole boundary only when α is appropriate, while the proposed algorithm extracted the hole boundary with better effect than the c-shape algorithm when α is appropriate. Although the proposed algorithm can extract the boundary of holes, it may also fail sometimes and the extraction result will be quite different from that of the actual situation if the parameter value is not reasonable. In this case, artificial discrimination is needed in practical applications.

Experimental Study on the Strip Terrain Point Set of Mountain Highway
To verify the effectiveness of the algorithm for the practical measured point set, 17 km long highway strip terrain data composed of more than 8000 GPS points were selected as the experimental data. e practical measured point set was obtained from a strip topographic map survey task undertaken by the author in May 2016, and the highway strip was located in a section of the rural road from Guquan town to Shuiyang town in Xuancheng city, Anhui province. e purpose of the task was to provide topographic maps for local road planning. e technical requirements of the task (3) e mapping content consisted of vegetations, river networks, roads, buildings, and structures along the centerline. e general situation of the task site is shown in Figure 11. e survey task in May 2016 was not specifically performed to verify the effectiveness of the proposed algorithm. As for a mountainous highway, there are many belt-shaped terrain bends, dense collection points in high and low undulating areas, and sparse collection points in flat areas. is is characterized by a uniform distribution of the point set, many concave envelopes (as shown in the red circle in Figure 12(a), and some holes such as the pit ponds in some areas (as shown in Figures 12(c) and 12(d)). us, the GPS terrain point set obtained by the survey task is suitable to be used as the data source to verify the effectiveness of the proposed algorithm.
8156 GPS terrain points were used in the experiment, and the length of the road was about 17 km. e experiment was conducted on a laptop equipped with Intel ® Core ™ i7-10750H CPU@2.60 GHz and 16 GB memory. e operating system was 64-bit Windows 10, and the experimental program of the proposed algorithm was implemented by C# program language based on Microsoft Visual Studio 2010 IDE. e experimental results are shown in Figure 12 and Table 5. Figure 12    rough to fine as the maximum boundary angle threshold α changes from large to small. is result is consistent with that of the simulation experiment. e number of holes extracted by the proposed algorithm changes from less to more as the maximum boundary angle threshold α changes from large to small. However, the correct number of holes in  accordance with the actual position does not increase. For a larger α, some holes with smaller area are ignored, and a smaller number of holes are extracted. For a smaller α, the tiny holes are retained, and the number of holes increases. It should be noted that the extracted holes are not completely correct. Some of them are "pseudo holes" caused by the nonuniform distribution of practical measured points and need artificial discrimination.

Conclusion
Based on the Delaunay triangulation and two constraint parameters, i.e., the threshold of maximum boundary angle α 0 and the threshold of point looseness l 0 , an algorithm is proposed in this paper for constructing the boundary of the complex planar point set with nonuniform point density distribution, concave envelopes, and holes. e proposed algorithm consists of rough boundary extraction and fine boundary extraction. Compared with the existing algorithms, the proposed algorithm has two main advantages: (1) e proposed algorithm has wide applicability, and it can be applied to construct complex planar boundary with nonuniform point density distribution, concave envelopes, holes, etc. (2) A reasonable mathematical definition and a detection method based on conic segmentation index are given for processing concave envelopes, which provides a strong theoretical basis for the proposed algorithm.
is paper has not given a quantitative analysis on the execution efficiency of the proposed algorithm, namely, the time complexity and the space complexity. At present, the application of this algorithm is only limited to the twodimensional planar point set. Further research should be conducted on the quantitative analysis of efficiency and three-dimensional surface reconstruction.

Data Availability
e data used to support the findings of this research are generated from experiments.  Figure 12: Boundary extraction of the highway strip terrain data in a mountainous area. (a) Overall boundary extraction effect (α � 120, k � 3.12). (b) Boundary extraction effect at curve t (α � 120, k � 3.12). (c) Boundary extraction effect at curve t (α � 100, k � 3.12). (d) Boundary extraction effect at curve t (α � 80, k � 3.12). Note. e number of holes formed by pit ponds in the task site is 12.