## 3 Design and Implementation  
In this section, we focus in more detail on the procedure by which we try to identify dynamic objects in the mapped space. The whole procedure is summarized in Algorithm 1. The presumption for the functionality of the algorithm is available data in the form of 2D measurements and information about the position in which the measurement is performed. These input data are provided by the SLAM algorithm. The position estimate is written in the form of a matrix [x y 0], where x, y are the global coordinates of the measuring point and 0 is the angle of rotation of the scanner. The first measurement is performed at coordinates [0 0 0]. The whole procedure is based on a comparison of three measurements, where \(j\) is the measurement number. Figure 4: Representation of space. The used SLAM algorithm cannot directly generate global measurement coordinates; therefore, it is necessary to calculate them by estimating the measurement position. To recalculate the coordinates into the global system, we use relation, Equation (1), where \(x^{\prime}\) and \(y^{\prime}\) are the coordinates of the measurement position. The third coordinate is also needed to create a point cloud. This coordinate has a value of 0 for each measuring point. \[ \begin{pmatrix}x\\ y\end{pmatrix} \;=\; \begin{pmatrix}cos\theta&-sin\theta\\ sin\theta&cos\;\theta\end{pmatrix}\begin{pmatrix}x^{\prime}\\ y^{\prime}\end{pmatrix} \;. \tag{1}\]  
After this step, we arrive at the data processing in the loop where scan matching is performed. At the beginning of the loop, three independent cloud points are created from three consecutive measurements ptCloudC(j), ptCloudA(j + 1), ptCloudB(j + 2). For ptCloudA and ptCloudB, segmentation and clustering of points based on Euclidean distance is applied. To compare individual clusters, it is necessary to define their properties, based on which they are compared. Here, a method is used to describe eigenvalue-based features. In this method, a vector consisting of seven values, (v)\({}^{\rightarrow}\) = [linearity, planarity, scattering, omnivariance, anisotropy, eigenentropy, change in curvature], is created. The calculation of these values is made on the basis of the following relations, Equations (2)-(8). \[L_{\lambda}\;=\;\frac{e_{1}\;-\;e_{2}}{e_{1}}, \tag{2}\]  
\[P_{\lambda}\;=\;\frac{e_{2}\;-\;e_{3}}{e_{1}},\  
Assuming a point cloud formed by a total number of \(N\) 3D points and a given value \(k\in N\), we may consider each individual 3D point \(X=(X,\,Y,\,Z)^{T}\in R^{3}\) and the respective k neighbors defining its scale. For describing the local 3D structure around X, the respective 3D covariance matrix also known as the 3D structure tensor \(\mathsf{S}\in R^{3\times 3}\) is derived, which is a symmetric positive definite matrix. Thus, its three eigenvalues \(\lambda_{1}\), \(\lambda_{2}\), \(\lambda_{3}\in R\) exist, are nonnegative, and correspond to an orthogonal system of eigenvectors. The author dealt with this issue in more detail in [24]. This whole process can be called function extraction. After assigning a property to each segment, you can move to the segment comparison technique. The segment recognition algorithm (SegMatch) is used for comparison. The comparison is performed between two point clouds (source and destination), which are divided into segments and have extracted segment functions. The SegMatch algorithm was designed for online real-time loop closure detection and localization. The principle of the functionality of the whole algorithm is shown in Figure 5. From the whole algorithm, we use only the part that is marked in red in the figure. A more detailed description of the algorithm is discussed by the author in [14,25]. Properties from ptCloudA and ptCloudB are compared with each other. This comparison results in a set of matching and a set of mismatched elements. With matching elements, it is assumed that these are static elements of the map and they are no longer worked with. The set of mismatched elements from ptCloudB is processed as follows.