# 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  
[PERSON] et al. [15] and [PERSON] et al. [22] applied the Hausdorff distance method to the regularization of building outlines. Their method can be summarized as follows: let \(P_{build}\) and \(Q_{rect}\) denote the line segments on the building outline and MBR, respectively, and set a threshold \(u\). Then, replace line segments \(P_{build}\) on the building outline of Hausdorff distances less than \(u\) with the corresponding line segments \(Q_{rect}\) on the MBR, as illustrated in Figure 3. Specifically, if \(h(P,Q)<u\), replace the line segment on the building outline with the corresponding line segment on the MBR. If \(h(P,Q)>u\), further divide this line segment into multiple segments; then, replace the line segments on the building outline of Hausdorff distances less than \(u\) with the corresponding segments on the MBR, while keeping the rest of the segments unchanged. The definition of \(u\) is given by Equation (3):  
\[u=\frac{S_{build}}{S_{mrb}}\times\frac{L_{short}}{2}\times\omega, \tag{3}\]  
where \(S_{build}\) is the enclosed area of the building outline; \(S_{mrb}\) is the area of the MBR; \(L_{short}\) is the length of the shorter side of the MBR; and \(\omega\) is a scaling factor, \(\delta\leq\omega<1\). If the value of \(u\) is set equal to the data resolution value, the minimum value \(\delta\) of the range of \(\omega\) can be obtained. After several experiments, it is known that \(\delta\) can be used as the initial value of \(\omega\) for regularization. When the regularization results are unsatisfactory, \(u\) can be adjusted to an appropriate value by gradually increasing the scaling factor \(\omega\). The accuracy of the Hausdorff distance calculation between two line segments given in Section 2.2.1 depends on the number of segment divisions; using fewer divisions results in lower accuracy, whereas using more divisions increases the computational complexity. In addition, the accuracy of the Hausdorff distance directly impacts the precision of building outline regularization. Because a building outline extracted from remote sensing images consists of line segments connected by straight lines between adjacent nodes, as shown in Figure 2b, the minimum Euclidean distance \(H_{ik}\) from division point \(P_{ik}\) on line segment \(P_{i}P_{i+1}\) to the nearest division point \(Q_{jf}\) on line segment \(Q_{j}Q_{j+1}\) must either linearly increase or decrease from \(H_{i0}\) to \(H_{im}\). Therefore, the Hausdorff distance must necessarily be achieved at one of the endpoints of a line segment. Accordingly, this study proposes an improved algorithm for building outline regularization using the Hausdorff distance and MBR as follows:  
1. Take the ordered set of nodes from the building outline as the point set \(P\) and treat the four corner points of the MBR as the point set \(Q\). Then, in sequence, calculate the perpendicular distance from each point in set \(P\) to the line segments formed by adjacent points in set Q. Use the minimum distance among the four distances as the distance \(H_{i}\) from point \(P_{i}\) to the MBR. As shown in Figure 4a, calculate the perpendicular distances from point \(P_{1}\) to line segments \(Q_{0}Q_{1}\), \(Q_{1}Q_{2}\), \(Q_{2}Q_{3}\), and \(Q_{3}Q_{0}\), and then, select the minimum distance \(H_{1}\) as the distance from point \(P_{1}\) to the MBR. Figure 3: Process of building outline regularization using the Hausdorff distance method. For any line segment \(P_{i}P_{i+1}\) on the building outline, take the larger of \(H_{i}\) and \(H_{i+1}\) as \(h(P,Q)\). 3. If \(h(P,Q)<u\), replace the line segment on the building outline with the corresponding orthographically projected line segment on the nearest edge of the MBR. If \(h(P,Q)>u\), there are two possible cases: either both endpoints of the line segment are farther from the MBR than \(u\), in which case the outline segment remains unchanged, or only one endpoint has a distance greater than \(u\) from the MBR.