## Materials and Methods
### Segment Solution  
The particle swarm optimization algorithm using the omnidirectional search can quickly find the vicinity of the optimal position of the main stake of the track. However, due to the lack of local detailed search capabilities, it cannot perform a detailed search to find the minimum value of the objective function. Thus, the traversal method is used to search for the main stake point. According to the railway design specification, the time complexity of railway reconstruction in the literature [3] is: \(O(n^{3})\). When there is a only single basic unit of track curve in the railway reconstruction, the established model searching point amount is not large, and its calculating time cost is within the tolerance range. However, once the calculation is extended to multiple basic units, the time complexity will become \(O(n^{3m})\), where \(m\) is the number of basic unit curve segments on the entire track. From the perspective of practice, the algorithm cannot work well. Thus, the entire track containing multiple basic units must be divided into basic curve units, and the time complexity of the reconstruction goes from \(O(n^{3m})\) to \(O(mn^{3})\).  
The segmentation point of the plane basic units of the track curve is on a straight-line segment. Thus, it is necessary to roughly discriminate the position of the points on the straight line. The MLS ran at the same speed when it was mapping. The basic curve unit could be identified after a corresponding relationship between the fixed chord slope and the measurement point number is established. The fixed chord slope is calculated by:  
\[k_{i}=\frac{y_{i}-y_{i-1}}{x_{i}-x_{i-1}}(\mathrm{i}=2,\;3,\;4;\cdots\cdots n) \tag{12}\]  
where \(k_{i}\) is the slope corresponding to the curve chord calculated by the difference from the point cloud data, \(x_{i},y_{i}\) are the coordinates of the point cloud data, and \(i\) is the number of individual point cloud data.  
Due to the error of the point cloud data, the slope corresponding to the curve chord has \"noise\". It is very important to denoise the slope data in this study. The concept of filtering in signal processing is introduced, and the slope is treated as a discrete one-dimensional signal to process. After comparing various filtering methods, this paper uses the \"robustness local weighted moving average (flowess)\" for denoising. Local weighted regression is a specific nonparametric learning method that effectively solves the problem of under-fitting and over-fitting [32]. The basic principle is to check the data set and replace the value of a point in the digital signal with the weighted least squares value in each of the neighborhood points. The output is the value of the straight-line point fitted by the least squares value. As a result, the fitted value is closer to the true value and is used to process a signal with subtle noise. In this paper, 10 points are selected as the sliding window, and the points in the window are given weights according to Equation (13). Then, the least squares fitting is performed for the points.  
\[w(i)=\exp\left(-\frac{(X_{i}-X)^{2}}{2}\right) \tag{13}\]  
where \(\exp\) is an exponential function with the base of \(e\). When the value of \(X_{i}\) is closer to \(X\), the value of \(w(i)\) is closer to 1; when \(X_{i}\) is further from \(X\), the value of \(w(i)\) is closer to 0. In other words, if the point is close to the sliding window center point, then its weight is big, and if the point is far from the sliding window center point, then its weighted value is small.