## 2 3D Measurement Point Cloud Acquisition and Preprocessing
### Point Cloud Data Preprocessing
#### 2.3.2 Point Cloud Splicing  
The original point cloud data of the surface of the supporting block obtained by the three-dimensional scanner is located at the scanner coordinate system, and the origin of the coordinate system is the phase center of the scanner. The point cloud data is overlapped in the scanner coordinate system, which is inconsistent with the actual supporting block position, as shown in Figure 3. In order to achieve the registration of the point cloud and the standard track slab model, it is necessary to first splice the point cloud of each supporting block to restore the true position of the point cloud. Considering the field of view of the 3D scanner, the placement of the track slab, the processing time of the point cloud data and the efficiency of the system detection, we use the direct conversion method of the coordinate system to realize the splicing of each part of the point clouds, as shown in Figure 4. The detailed process is as follows:  
Step 1: The robot carries the 3D scanner to move to the specified position to obtain the point cloud data of the corresponding area, and obtains the current position and posture parameters of the camera-type 3D scanner coordinate system (TOOL) in the base coordinate system, including three rotation parameters (\(\varepsilon_{X}\), \(\varepsilon_{Y}\), \(\varepsilon_{Z}\)) and three translation parameters (\(\Delta X\), \(\Delta Y\), \(\Delta Z\)) and a proportional parameter [30; 31] which are shown in Figure 5.  
Figure 4: Schematic diagram of point cloud splicing. Figure 3: Overlapping scattered original point cloud data. Step 2: According to the position and attitude parameters of the transmitted flange (FLANGE), the conversion matrix (rotation matrix \(R_{t}\) and translation matrix \(T_{t}\)) between the two coordinate systems (photographed 3D scanner coordinate system and robot base coordinate system) is calculated. First, the origin of the coordinate system is coincident by the translation of the coordinate origin, and then the rotation between the coordinate axes is realized by the rotation around the coordinate axis. Among them, the rotation matrix around the \(X\), \(Y\), and \(Z\) axes are  
\[R_{1}(\varepsilon_{X})=\left[ \begin{array}{ccc}1&0&0\\ 0&\text{\it cos}\varepsilon_{X}&\text{\it sin}\varepsilon_{X}\\ 0&-\text{\it sin}\varepsilon_{X}&\text{\it cos}\varepsilon_{X}\\ \end{array} \right] \tag{1}\]  
\[R_{2}(\varepsilon_{Y})=\left[ \begin{array}{ccc}\text{\it cos}\varepsilon_{Y}& 0&-\text{\it sin}\varepsilon_{Y}\\ 0&1&0\\ \text{\it sin}\varepsilon_{Y}&0&\text{\it cos}\varepsilon_{Y}\\ \end{array} \right] \tag{2}\]  
\[R_{3}(\varepsilon_{Z})=\left[ \begin{array}{ccc}\text{\it cos}\varepsilon_{ Z}&\text{\it sin}\varepsilon_{Z}&0\\ -\text{\it sin}\varepsilon_{Z}&\text{\it cos}\varepsilon_{Z}&0\\ 0&0&1\\ \end{array} \right] \tag{3}\]  
The rotation matrix is  
\[R_{t} =R_{1}(\varepsilon_{X})R_{2}(\varepsilon_{Y})R_{3}(\varepsilon_{Z}) \tag{4}\]  
\[R_{t}=\left[ \begin{array}{ccc}\text{\it cos}\varepsilon_{Y}\text{\it cos} \varepsilon_{Z}&\text{\it sin}\varepsilon_{X}\text{\it sin}\varepsilon_{Y} \text{\it cos}\varepsilon_{Z}+\text{\it cos}\varepsilon_{X}\text{\it sin} \varepsilon_{Z}&-\text{\it cos}\varepsilon_{X}\text{\it sin}\varepsilon_{Y} \text{\it cos}\varepsilon_{Z}+\text{\it sin}\varepsilon_{X}\text{\it sin} \varepsilon_{Z}\\ -\text{\it sin}\varepsilon_{X}\text{\it sin}\varepsilon_{Y}\text{\it sin} \varepsilon_{Z}+\text{\it cos}\varepsilon_{X}\text{\it cos}\varepsilon_{Z}& \text{\it cos}\varepsilon_{X}\text{\it sin}\varepsilon_{Y}\text{\it sin} \varepsilon_{Z}+\text{\it sin}\varepsilon_{X}\text{\it cos}\varepsilon_{Z}\\ \text{\it sin}\varepsilon_{Y}&-\text{\it sin}\varepsilon_{X}\text{\it cos} \varepsilon_{Y}&\text{\it cos}\varepsilon_{X}\text{\it cos}\varepsilon_{Y}\\ \end{array}