## 2 Point Cloud Data Acquisition and Its Pre-Processing
### Point Cloud Downsampling Processing  
Since the 3D point cloud data collected by the 3D line laser sensor contains 4,137,760 points, the data volume is extremely large. In order to improve the efficiency of the later point cloud processing, it is necessary to undertake downsampling processing of the original data under the condition of keeping the spatial structure of the initial point cloud unchanged in order to reduce the data volume. Commonly used downsampling methods include voxel filtering, stochastic filtering, uniform filtering, and farthest point filtering.  
\begin{table}
\begin{tabular}{c c} \hline
**Model Number** & **ECCO 75.200** \\ \hline Field of view & 125/190/250 mm \\ Measuring range & 250 mm \\ Optimum working distance & 325 mm \\ Vertical resolution & 12–25 \(\upmu\)m \\ Horizontal resolution & 66–138 \(\upmu\)m \\ Z linearity & 0.01\% (0.1 \(\upmu\)m/mm) \\ Z repeatability & 2.5 \(\upmu\)m \\ Weight & approx. 480 g \\ \hline \end{tabular}
\end{table}
Table 1: 3D line laser sensor parameter list.  
Figure 3: 3D point cloud data of rail profile. (**a**) 3D data coordinates; (**b**) point cloud model of rail profile.  
Figure 2: Flow chart of 3D rail profile data acquisition.  
Voxel filtering involves creating a voxel grid in the original point cloud data and replacing the original points with all the center of gravity points contained in the grid, which can retain the original spatial characteristics of the data. Stochastic filtering involves randomly removing a certain proportion of the point cloud from the original point cloud data for downsampling, and the stochastic nature of the downsampling can be realized quickly. Uniform filtering is a way of preserving points at certain intervals, and the preserved points show uniformity in the overall distribution. The farthest point filtering method is to take the farthest point among the \(k-1\) points obtained in the previous time as the preserved point, so it can ensure that the downsampled point cloud has a better coverage. In order to retain the original spatial shape of the point cloud and improve the efficiency of point cloud alignment in the later stage, the above four filtering methods are used to downsample the original 3D point cloud data. The sampling rate was kept at about 0.16% (6612 points), and the downsampling effect is shown in Figure 4.  
Figure 4: Point cloud downsampling effect. (**a**) Raw 3D point cloud; (**b**) voxel filtering; (**c**) stochastic filtering; (**d**) farthest-point filtering; (**e**) uniform filtering.  
From the sampling results, it can be seen that all four filtering methods can retain the original spatial pattern. The running times of voxel filtering and uniform filtering are 141.3 ms and 230.8 ms. The point cloud obtained after both downsampling methods is uniformly distributed, where the light band in the upper left corner of Figure 4b belongs to the reflection effect of this image in 3D coordinates, not the filtering effect of voxel filtering, which will not have any effect on the results of this experiment. Meanwhile, the running times of stochastic filtering and farthest-point filtering are 92.4 ms and 133,328.4 ms. The point clouds obtained after downsampling with these methods has obvious uneven distributions, which affects the accuracy of point cloud alignment in the later stage. Therefore, considering the running time of the algorithm and the influence on the point cloud alignment in the later stage, voxel filtering is finally selected as the preprocessing method for point cloud.