**5. Experiment**

Experiments are carried out on both the artificial rail and a practical rail to verify the proposed method. All algorithms are run on a computer whose specifications are listed in Table 1.



The homemade 3D laser vision system proposed in Section 2 is used for constructing the PCM of the rail-surface. The main specifications of the line laser and the camera used in the system are listed in Tables 2 and 3 respectively. The parameters in the system mentioned in Section 2 are listed in Table 4.


**Table 2.** The main specifications of the line laser.



**Table 4.** The parameters in the 3D laser vision system.


The artificial 50 Kg/m-rail presented in Figure 14a is used in the first experiment. The length of the rail is 1 m, the scanning time for obtaining the data is 1/0.04 = 25 s and the time of data processing to form the 3D PCM of the rail-surface (Figure 14b) is 10.63 s.

The scratch-recognition algorithm presented in Section 3 is performed on the PCM of the rail-surface. There is no need to carry out the filtering algorithm because of the fine quality of the PCM as shown in Figure 14b. A series of point-cloud profiles are generated by splitting the rail-surface PCM and subsequently processed separately following the method described in Figure 7 with the values of the parameters listed in Table 5. The classification result of the point-cloud profiles is reflected in Figure 15a, where the red profiles and the blue profiles are classified into the damaged area and the undamaged area, respectively. A few point-cloud profiles incorrectly classified are restored with the method expressed in Figure 8 in which the width of the sliding window is set as 5 profiles. Figure 15b indicates the scratch-surface PCM which is the final result of the scratch-recognition algorithm with the total running time of 1.27 s.

**Table 5.** The values of the parameters mentioned in Figure 7.

**Figure 15.** The result of the scratch-recognition algorithm performed on the rail-surface PCM. (**a**) The classification result of the point-cloud profiles displaying the damaged area (red) and the undamaged area (blue); (**b**) The scratch-surface PCM identified by the algorithm as indicated in the gray-white area.

The reference PCM can easily be acquired by extending an undamaged point-cloud profile selected from the rail-surface PCM using the Equation (4) with the extending step length *x*Δ = 0.5 mm. The extension vector in Equation (4) can be calculated from preliminary vectors (see Figure 9) using the Equation (5) with θ1 = 0.5, θ2 = 0.5. Table 6 displays the calculation results of the parameters mentioned here.


**Table 6.** The calculation results of the extension vector.

After the above calculations, the reference PCM is constructed as seen in Figure 16a. Then, the depthdifference between the reference PCM and the scratch-surface PCM shown in Figure 16b is calculated. If the depth-difference is larger than the set threshold of 0.2 mm, the reference PCM and the scratch-surface PCM are selected to construct the original scratch-data PCM shown in Figure 16c. The total time for acquiring the scratch-data PCM starting from the reference PCM construction is 3.23 s.

**Figure 16.** The acquisition of the scratch-data PCM. (**a**) The result of constructed reference PCM; (**b**) The depth-difference between the reference PCM and the scratch-surface PCM; (**c**) The original scratch-data PCM with noise points; (**d**) The filtered scratch-data PCM.

The 3D triangulation-algorithm proposed in Section 4 is performed on the scratch-data PCM. The filtering of the PCM is firstly done before the formal triangulation based on the method of neighborhood radius presented in Figure 6 with *rn* = 4 mm and *n* = 50, leading to the result of Figure 16d. Then, the triangulation of the reference PCM (Figure 17a) and the scratch-surface PCM (Figure 17b) are finished by using the algorithm presented in Figure 11. Finally, a complete closed mesh model required for laser cladding technology as shown in Figure 18a (the magnified details presented in Figure 18b) is well established by stitching the triangle-meshes of the reference PCM and the scratch-surface PCM through the boundary mesh, which is the end of the whole experiment. The triangulation-algorithm costs 5.22 s in our experiment. Table 7 lists the time required for each step in the experiment and the total time is 45.35 s.

The second experiment is carried out on the practical 50 Kg/m-rail presented in Figure 19a to further verify the reliability of the proposed method. The final complete closed mesh model of the practical damaged rail is established by the same method described in the first experiment, which is shown in Figure 19b (the magnified details presented in Figure 19c). The total time for the second experiment is 47.51 s. The detailed process of the second experiment which is similar to the one presented above for the artificial rail, is well described with Figures S1–S5 and Tables S1–S3 included in the supplementary materials.

**Figure 17.** The triangulation of the PCM. (**a**) The triangle-meshes of the reference PCM; (**b**) The trianglemeshes of the scratch-surface PCM.

**Figure 18.** The final complete closed mesh models of the scratch-data of the artificial damaged rail. (**a**) Five complete closed mesh models corresponding to five scratch-data; (**b**) The local magnified model of <sup>a</sup>−1 and the full magnified ones of <sup>a</sup>−2, <sup>a</sup>−3, <sup>a</sup>−4, <sup>a</sup>−5, respectively.

**Table 7.** The time required in the experiment for the artificial damaged rail.

**Figure 19.** The practical damaged rail and final result in the second experiment. (**a**) The practical damaged-rail; (**b**) The final complete closed mesh model of the practical damaged rail; (**c**) The local magnified model of b.
