# Multilevel Regularization Method for Building Outlines
## 2 Materials and Methods
### Overall Regularization of Building Outlines Using Hausdorff Distance and MBR
#### 2.2.3 MBR Calculation Method and Its Improvement  
Most building outlines have rectangular shapes, either in their entirety or locally. Therefore, the MBR method has been widely applied in the regularization of building outlines. There are two common types of MBRs: the minimum area bounding rectangle (MABR) and minimum perimeter bounding rectangle (MPBR). For building outlines with clear orthogonal features or simple structures, little difference exists between these two MBR types. However, for non-orthogonal or complex building outlines, differences may arise. The algorithms for MABR and MPBR follow a similar approach: both compute the MBRs for the building outline in all directions and select the one with the smallest area or perimeter as the result. In practice, owing to the unique nature of building outlines, calculating the MBRs aligned with the edges of the convex hull before making a comparison is sufficient [23]. The specific steps are as follows: \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Data Resolution** & **Pre-Improvement** & **Post-Improvement** & **Efficiency Improvement** \\ \hline
0.075 m & 1:38\({}^{\prime}\)56\({}^{\prime\prime}\) & 3\({}^{\prime}\)26\({}^{\prime\prime}\) & 96.53\% \\ \hline
0.5 m & 16\({}^{\prime}\)21\({}^{\prime\prime}\) & 1\({}^{\prime}\)05\({}^{\prime\prime}\) & 93.83\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of computational efficiency before and after improving the Hausdorff distance method. Figure 5: Comparison between the pre- and post-optimization Hausdorff distance methods. (**a**) Pre-optimization; (**b**) Post-optimization. 1. Employ the Graham scan algorithm [24] to compute the convex hull of the building outline, as shown in Figure 6a,b. 2. Calculate all MBRs aligned with the edges of the convex hull and record the area and perimeter for each direction, as depicted in Figure 6c. 3. Select the MBR with the smallest area as the MABR and the one with the shortest perimeter as the MPBR, as illustrated in Figure 6d, where the green rectangle represents the MABR, and the pink rectangle represents the MPBR of the building outline. Maintaining the area is an important principle to consider during the regularization of building outlines. The regularization process should minimize changes in area. Therefore, in most cases, the MABR is chosen as the reference for regularization, resulting in satisfactory outcomes. However, for building types such as A and B in Figure 7a, situations arise in which the main orientation of the MABR does not align with the primary orientation of the building outline. Figure 6: Process of determining MABR and MPBR. (**a**) Building outline; (**b**) Convex hull of the building outline; (**c**) MBRs aligned with each edge of the convex hull (Black rectangles indicate MBR in each direction); (**d**) MABR (in green) and MPBR (in pink). Figure 7: Comparison of three types of MBRs. (**a**) MABR results; (**b**) MBR results with the maximum number of containing nodes; (**c**) Node distribution of building outline C; (**d**) MBR results based on the Hausdorff distance method. Considering that building outlines extracted from high-resolution remote sensing images have many densely distributed nodes, [PERSON] and [PERSON] [1] proposed an improved MBR algorithm to solve this issue. Firstly, they calculated the MBRs in various directions for the building outline. Then, they computed the number of nodes on the building outline for which the distance to each MBR outline is shorter than the preset threshold. Finally, they selected the MBR with the maximum number of containing nodes as the result, as shown in Figure 7b. Their method performs well for building outlines with uniformly distributed nodes but may introduce significant errors for building outlines C and D, which have uneven node distributions. As illustrated in Figure 7c, building outline C has a high node density near the corners.