# Multilevel Regularization Method for Building Outlines
## 2 Materials and Methods
### Overall Regularization of Building Outlines Using Hausdorff Distance and MBR
#### 2.2.2 Building Outline Regularization Using the Hausdorff Distance Method and Its Improvement
In the latter case, use Equation (4) to calculate point \((x_{u},y_{u})\) on the line segment where the distance to the MBR equals \(u\), and replace the part of Hausdorff distances less than \(u\) with the corresponding segments on the MBR. \[ \begin{cases}x_{u}=x_{i}+\frac{(x_{i+1}-x_{i})\times(u-H_{i})}{H_{i+1}-H_{i}},\\ y_{u}=y_{i}+\frac{(y_{i+1}-y_{i})\times(u-H_{i})}{H_{i+1}-H_{i}},\end{cases} \] (4) where \(H_{i}\) and \(H_{i+1}\) are the minimum distances from the endpoints \(P_{i}\) and \(P_{i+1}\) of the line segment, respectively, to an edge of the MBR. In Figure 4, where \(H_{i}>u\) and \(H_{i+1}=0\), the coordinates of point \(P_{in}\) can be calculated. Then, replace the part of the line segment from \(P_{in}\) to \(P_{i+1}\) whose Hausdorff distance is smaller than \(u\) with the corresponding orthographically projected line segment AB on the nearest edge of the MBR. 4. After iteratively processing all points on the building outline, the overall regularization result is obtained, as shown in Figure 4.  
The original Hausdorff distance method is highly versatile. In addition to being suitable for measuring the similarity between straight line segments, it can be applied to measure the similarity between curved line segments. In this paper, the calculation process was optimized by considering the linear nature of building outline features extracted from remote sensing images. Figure 5 compares the pre- and post-optimization methods. Figure 5 demonstrates the regularization process using the pre-optimization Hausdorff distance method, which firstly divides line segments \(P\) and \(Q\) into several smaller segments by equidistant points, computes \(h(P,Q)\) for each segment on \(P\), and then replaces line segment AB, for which \(h(P,Q)<u\), with the corresponding CD on \(Q\). Figure 5 presents  
Figure 4: Schematic of the improved regularization process using the Hausdorff distance method. (**a**) Calculate the distance \(H_{i}\) from point \(P_{i}\) to the MBR; (**b**) Calculate the proportion of distances that are smaller than the threshold; (**c**) Regularization result. the post-optimization Hausdorff distance method, which calculates point \(F\) located on line segment \(P\) with a perpendicular distance of \(u\) from line segment \(Q\) and computes the corresponding perpendicular foot \(H\) on \(Q\). Then, line segment \(EF\), for which \(h(P,Q)<u\), is replaced with the corresponding line segment \(GH\) on \(Q\). The proposed method reduces the need for segment division and separates the Hausdorff distance. Instead, line segments on P whose Hausdorff distances are less than or equal to the threshold are directly calculated and replaced. We compared the computational efficiency of the Hausdorff distance regularization algorithm before and after the improvement by selecting 300 buildings each from the two resolutions of 0.075 m and 0.5 m data, respectively. We set the parameters \(t=5\), \(s=10\), and \(u=0.15\) for the data with a resolution of 0.075 m and \(t=5\), \(s=10\), and \(u=1\) for the data with a resolution of 0.5 m. The time statistics used are listed in Table 1.  
As can be seen from Table 1, the computational efficiency of the improved Hausdorff distance algorithm has been significantly improved. The higher the resolution of the data, the greater the improvement. Moreover, the pre-optimization Hausdorff distance method relies on increasing the number of division points to find points on \(P\) that are infinitely close to a perpendicular distance of \(u\) from \(Q\), which may introduce errors. By contrast, the proposed method directly calculates points on \(P\) that have perpendicular distances equal to \(u\) from \(Q\), resulting in higher accuracy. Thus, the proposed Hausdorff distance optimization algorithm specifically tailored for building outline regularization achieves higher computational efficiency and precision than the original method.