## 3 Data Processing
### Analytical Point Cloud Segmentation  
The longitudinal axis of RK investigation was a prerequisite for the proposed analytical solution, and at the same time, its exact position in the factory coordinate system was up to now unreliable. Graphical or manual selection of interesting features in a large point cloud is very time-consuming and error-prone. The analytical solution's basic idea is based on calculating the distance of the point from the line, which is represented by two points on the RK's real axis. Processing of the partially cut raw point cloud was performed in MatLab(r) environment. The core part of the procedure is shown in the following paragraphs. The distance of a point to a line (Figure 10) in a three-dimensional Euclidean space \(\varepsilon^{3}\) is mathematically defined as follows: Consider a point B and line p, which is given by the point A and by the direction vector of the line u, then the shortest distance d of the point to the line is defined by the formula:  
\[d=\frac{\|\mathbf{u},\times,\mathbf{AB}\|}{\|\mathbf{u}\|} \tag{5}\]  
where  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Tire**} & \multirow{2}{*}{ \begin{tabular}{c} **Coordinates of** \\ **Tire Cylinders** \\ **Centers** \\ \end{tabular}  } & \begin{tabular}{c} **Manual Point** \\ **Cloud** \\ **Segmentation** \\ **[m]** \\ \end{tabular}  & \begin{tabular}{c} **Analytical** \\ **Solution—Preselection** \\ **[m]** \\ \end{tabular}  & \ \begin{tabular}{c} **Analytical** \\ **Solution—Fine** \\ **Segmentation** \\ **[m]** \\ \end{tabular}  & \begin{tabular}{c} **Difference Manual** \\ **vs. Analytical** \\ **Segmentation** \\ **[mm]** \\ \end{tabular}  \\ \hline A & Y & 580.489 & 580.526 & 580.485 & +4 \\  & X & 1006.564 & 1006.565 & 1006.564 & 0 \\  & Z & 206.173 & 206.164 & 206.173 & 0 \\ \hline B & Y & 551.599 & 552.089 & 551.601 & \(-2\) \\  & X & 1006.551 & 1006.553 & 1006.551 &  
**d--**A distance of a point in the point cloud to the real axis of RK,  
**u--**direction vector of the true longitudinal axis of RK,  
**AB--**vector defined by the point of the RK axis and point of the point cloud. For every point in the point cloud, the distance to the real kiln axis was calculated. The whole raw point cloud contained about 20 million points, including unnecessary points on a distant object. The manually cut point cloud, which contained 6,422,263 points (Figure 11) on RK and its periphery, was processed by MatLab software. As a result, the perpendicular distances of each point to the kiln axis were obtained. The histogram function was repeatedly applied to count the number of points in each interval. The peaks of the function were traced and reviewed. Separate data files for the partial point clouds were created for every investigated peak. Using the calculated distances of points to the RK axis in the whole point cloud, the preliminary histogram was created. The range of the investigated distances is up to 16,000 mm, and the width of the intervals is 100 mm (Figure 12). Since the points on the shell and carrier tires are the closest to the kiln axis, in another part of the gradual selection of points, only the Point cloud with the distance from the kiln axis of up to 3200 mm was processed. Figure 11: Point cloud containing points on RK and its surroundings with radius up to 16,000 mm. Figure 10: Distance from a point to a line in three-dimensional Euclidean space \(\epsilon^{3}\). Figure 13 shows that the point cloud with approximately 3 million points where their distance from the rotary kiln axis is up to 3200 mm contains indeed points forming the shell of the rotary kiln and the tires. For this point cloud, the following histogram of the calculated radiuses with a width of the interval of 1 mm was created (Figure 14). The peaks of this graph show two significant areas. The first contains points on the shell; the second contains points on the three tires of the RK.