## 2 Evaluation Index of Segmentation Accuracy
### Profile Fitting Degree
The above calculation of \(OF_{ang}(P_{i}P_{i+1})\) and \(OF_{dis}(P_{i}P_{i+1})\) is applicable to the case where the original trajectory points are on the same side of the compressed trajectory. As shown in Figure 2, the original trajectory points \(P_{i}\), \(P_{i+1}\) are on both sides of the compressed trajectory. The calculation of \(OF_{ang}(P_{i}P_{i+1})\) and \(OF_{dis}(P_{i}P_{i+1})\) are described as follows. Figure 1: Schematic diagram of contour fit calculation. Figure 2: Original points on both sides of compressed trajectory. The projection angle factor \(OF_{ang}(P_{i}P_{i+1})\) is defined as the ratio of the projection length \(d(P_{i}^{\prime}P_{i+1}^{\prime})\) to the original sub segment length \(d(P_{i}P_{i+1})\), and \(d(P_{i}P_{i+1})=d(P_{i}^{\prime}P_{i+1}^{\prime})\), therefore \(OF_{ang}(P_{i}P_{i+1})=d(P_{i}^{\prime}P_{i+1}^{\prime})/d(P_{i}^{\prime\prime}P_ {i+1}^{\prime})=d(P_{i}^{\prime}P_{i+1}^{\prime})/d(P_{i}P_{i+1})\) can reflect the influence of \(\theta\) on the trajectory approximation degree, and the calculation of \(OF_{ang}(P_{i}P_{i+1})\) is consistent with the situation of the same side of the trajectory point. However, the original sub segment \(P_{i}P_{i+1}\) and projection \(P_{i}^{\prime}P_{i+1}^{\prime}\) intersect at point \(O\), and the influence of distance \(d(P_{i}P_{i}^{\prime}),d(P_{i+1}P_{i+1}^{\prime})\) on the trajectory similarity has been considered in the calculation of \(OF_{ang}(P_{i}P_{i+1})\), therefore \(OF_{dis}(P_{i}P_{i+1})=0\). The method of the vector cross product is used to judge whether the projection \(P_{i}^{\prime}P_{i+1}^{\prime}\) intersects with the original sub segment \(P_{i}P_{i+1}\). We define  
\[ \begin{split} c_{1}=P_{i}^{\rightarrow}P_{i}^{\prime}\times P_{ i}^{\rightarrow}P_{i+1}^{\rightarrow},c_{2}=P_{i}^{\rightarrow}P_{i+1}^{ \rightarrow}\times P_{i}^{\rightarrow}P_{i+1}^{\rightarrow}\\ c_{3}=P_{i}^{\prime}P_{i}\times P_{i}^{\prime}P_{i+1}^{\prime},c_ {4}=P_{i}^{\prime}P_{i+1}^{\prime}\times P_{i}^{\prime}P_{i+1}^{\prime}\end{split}  \tag{4}\]  
when \(P_{i}P_{i+1}\) intersects \(P_{i}^{\prime}P_{i+1}^{\prime}\), \(c_{1}\) and \(c_{2}\) have different signs, and \(c_{3}\) and \(c_{4}\) are the same. The projection angle factor and distance factor of the original trajectory segment \(TRSub_{1}\) and the approximate trajectory segment \(TRSub_{1}^{\prime}\) can be expressed by the aggregation of the calculation results of each sub segment:  
\[OF_{ang}(TRSub_{1})=\sum_{i=1}^{len_{1}-1}\omega_{i}\cdot OF_{ang}(P_{i}P_{i+ 1}) \tag{5}\]  
\[OF_{dis}(TRSub_{1})=\sum_{i=1}^{len_{1}-1}\omega_{i}\cdot OF_{dis}(P_{i}P_{i+ 1}) \tag{6}\]  
where \(\omega_{i}\) is the occupancy of the original sub segment \(P_{i}P_{i+1}\) in the trajectory segment, which is expressed by its length proportion as  
\[\omega_{i}=d(P_{i}P_{i+1})\bigg{/}\sum_{j=1}^{len_{1}-1}d(P_{j}P_{j+1}) \tag{7}\]  
Based on the above calculation, the projection angle factor and distance factor of the whole trajectory can be obtained:  
\[OF_{ang}(TR)=\sum_{n=1}^{Ns}\varepsilon_{n}\cdot OF_{ang}(TRSub_{n}) \tag{8}\]  
\[OF_{dis}(TR)=\sum_{n=1}^{Ns}\varepsilon_{n}\cdot OF_{dis}(TRSub_{n}) \tag{9}\]  
where \(N_{s}\) is the number of segments of the trajectory, and \(\varepsilon_{n}\) is the occupancy of the original trajectory segment \(TRSub_{n}\) in the trajectory \(TR\), which can also be expressed by its length proportion. Finally, the trajectory profile fitting degree is defined as \(OF=\varphi_{ang}\cdot OF_{ang}+\varphi_{dis}\cdot OF_{dis}\), \(\varphi_{ang}\) and \(\varphi_{dis}\) are the importance weights of projection angle factor and projection distance factor respectively, and the sum of them is 1. In summary, the calculation of trajectory profile fitting degree is an aggregation process from sub segment trajectory segment to the whole trajectory, which fully reflects the influence of the angle and distance difference between the approximate trajectory and the original trajectory on the similarity.