# Geometric Similarity Measurement Method for Micro Scene Generalization
## 2 Methodology
### Shape Similarity
#### 2.1.3 Shape Feature Extraction by Hausdorff Distance and Included Angle Chain  
The Included Angle Chain is suitable for the calculation of local similarity, but the global features of a curve cannot be described by only the Euclidean distance of the angle chain [33]. The Hausdorff distance is often used as a method of measuring geometric similarity, but its disadvantage is that only the maximum offset value is considered; the detailed features of the curve are not reflected [34].  
Thus, this paper proposes a shape similarity calculation method that combines the Included Angle Chain and Hausdorff distance under a curvature constraint. The method is mainly divided into the following three steps:  
Step 1: The process of using the Included Angle Chain to determine the equal-length polyline is time consuming, and the curve may not be equally divided into \(n\) at the same time. In view of this, the process is transformed in the process of dividing a curve into equal segments, and the curvature is used as the basis of the equal division of the curve.  
Taking Figure 3 as an example, the black lines are curves \(P\) and \(Q\), which are to be compared, and the number of nodes is \(m\) and \(n\); \(P=((p_{x,1},p_{y,1}),(p_{x,2},p_{y,2}),\dots,(p_{x,m},p_{y,m}))\), \(Q=((q_{x,1},q_{y,1}),(q_{x,2},q_{y,2}),\dots,(q_{x,m},q_{y,m}))\). The red line and the green line are the fitted lines, which are composed of a sequence of equal points, and angle sequences (\(\alpha_{1}\), \(\alpha_{2}\)... \(\alpha_{9}\)) and (\(\beta_{1}\), \(\beta_{2}\)... \(\beta_{9}\)) are obtained.  
To further extract the morphological features of a curve, the number of equally divided segments needs to be increased. Since the first and second derivati  
Figure 3: Curve shape feature extraction: (**a**) curve \(P\); and (**b**) curve \(Q\).  
approximated by numerical differentiation, the curvature at the node (\(a_{x,i}\), \(a_{y,i}\)) is as shown in Equation (4).  
\[\rho\big{(}a_{x,i},a_{y,i}\big{)}=\frac{\left|a^{\prime}_{x,i}a^{\prime\prime}_{ y,i}-a^{\prime\prime}_{x,i}a^{\prime}_{y,i}\right|}{\left(\left(a^{\prime}_{x,i} \right)^{2}+\left(a^{\prime}_{y,i}\right)^{2}\right)^{3/2}} \tag{4}\]  
Here, \(a^{\prime}_{x,i}\) and \(a^{\prime}_{y,i}\) are the first partial derivatives at the node, respectively; \(a^{\prime\prime}_{x,i}\) and \(a^{\prime\prime}_{y,i}\) are the second partial derivatives, respectively.  
Given a curvature threshold \(\zeta\), the mean value of the absolute curvature of each segment is sorted. When the sorted value is less than \(\zeta\), the equal division of the linear feature is stopped.  
Step 2: The angle sequence and the corresponding length sequence are synthesized to obtain feature sets: \(M=\{(p_{1},\,a_{1}),(p_{2},\,a_{2})\,\dots\,(p_{9},\,a_{9})\}\) and \(N=\{(q_{1},\,\beta_{1}),(q_{2},\,\beta_{2})\,\dots\,(q_{9},\,\beta_{9})\}\). Coordinate origin O is taken as the pole, the counterclockwise direction is treated as the positive direction, the length is treated as the polar diameter, and the angle is treated as the polar angle. Then, Equation (5) is used to scatter the points sequence, and the polar coordinate systems (\(p_{i}\), \(a_{i}\)) and (\(q_{i}\), \(\beta_{i}\)) are constructed (Figure 4). Finally, according to \(x=cos\theta\), \(y=psin\theta\), the polar coordinates are converted into rectangular coordinates, and the feature point sequences of the curves are converted into description sequences of geometric features.  
\[\theta=\pi-arctan\frac{p_{y,1}-p_{y,2}}{p_{x,1}-p_{x,2}}-arctan\frac{p_{y,3} -p_{y,2}}{p_{x,3}-p_{x,2}} \tag{5}\]  
Step 3: The median Hausdorff distance of the point groups is calculated, and the similarity between the two curves can be obtained according to:  
\[\text{Sim}_{P,\,\,\,\,Q}^{\text{geometric}}=1-\left|\frac{H_{M,P}(P,Q)-H_{M,Q} (P,Q)}{\text{max}\big{(}H_{M,P}(P,Q),H_{M,Q}(P,Q)\big{)}}\right| \tag{6}\]  
where \(H_{M,P}(P,Q)\) and \(H_{M,Q}(P,Q)\) are the median Hausdorff distance, and \(\text{Sim}_{P,\,\,Q}^{\text{geometric}}\) is the similarity between \(P\) and \(Q\).