# DM-SLAM: Monocular SLAM in Dynamic Environments
## 2 Materials and Methods. ### DLRSAC for Reconstructing Static Map  
For SLAM in a dynamic scene, the key is to reduce the interference of moving objects on localization and reconstruction. The core issues with this are as follows:  
1. The problem has chicken-and-egg characteristics, and the natural difference between motion and static is the key to solving the problem. 2. Due to the presence of inherent sensor noise, motion of different moving objects and camera motion are distinguished only when the motion exceeds noise interference. The second issue can be resolved simply by checking more frames, or in two frames with larger time intervals. In the DS-SLAM system to be introduced later, we designed a targeted mechanism to avoid noise interference in order to construct a map with high confidence and more accurate camera pose. We believe that understanding the nature of static and motion is the key to solving the problem inherent in the chicken-and-egg situation. In the relative motion of the camera with the environment, all motion models solved in the scene can be characterized as Equation (1). \[\mathrm{T}=\mathrm{T_{c}}\ \square<\mathrm{T_{S}},\mathrm{T_{1}},\mathrm{T_{2}}, \ldots\ \mathrm{T_{n}}> \tag{1}\]  
\(\square\) represents the synthesis of two motions; \(\mathrm{T}\) represents the motion of the object (including rotation and translation), \(\mathrm{T_{c}}\) represents the motion of the camera, and \(\mathrm{T_{s}}\) represents the motion of the static object, which is the only constant in the equation (rotation as identity matrix and translation into three-dimensional 0 vector), \(\mathrm{T_{n}}\) represents the motion of the nth motion model. Due to the coupling with \(\mathrm{T_{c}}\), the value of \(\mathrm{T_{c}}\ \square\ \mathrm{T_{s}}\) is constantly changing. \(\mathrm{T_{c}}\) is indistinguishable when there is no prior information of \(\mathrm{T_{c}}\) or \(\mathrm{T_{n}}\). However, considering first the issue from agents in the environment, we find a way to define static. For the exploring agent, it is necessary to provide a reference coordinate system with a wide distribution and constant motion state so that the agent can locate itself and conveniently reconstruct the environment. This is the difference in nature between static and motion in our living environment. Therefore, we designed the DLRSAC based on three basic observations as follow:  
* The definition of static relies on the distribution of inliers within the model, not the numerical score of the motion model and the number of feature points included. * Models between different moving objects share a few inliers. Taking into account the above observations, our algorithm aims to create a motion model that is solved by a set of feature points geometrically as close as possible, with the final inliers within the model distributed as evenly as possible. Equation (2) below defines our objective function:  
\[\mathrm{arg}_{F-(x_{1},x_{2},\ldots,x_{8})}\frac{D(x_{s1},x_{s2}\ldots x_{s8} )}{D(x_{t1},x_{t2}\ldots x_{tn})} \tag{2}\]  
In Equation (2), (x\({}_{s1,}\)x\({}_{s2}\)\(\bullet\)\(\bullet\)\(\bullet\) x\({}_{s8}\)) refers to the 8 points sampled from current frame, F is the fundamental matrix solved through eight-points algorithm by(x\({}_{s1}\),x\({}_{s2}\)\(\bullet\)\(\bullet\)\(\bullet\) x\({}_{s8}\)). (x\({}_{t1}\),x\({}_{t2}\)\(\bullet\)\(\bullet\)\(\bullet\) x\({}_{tn}\))are all inliers of F. \(D(\cdot)\) is the function of calculating the distribution of input variables. The specific form of \(D(\cdot)\) is shown in Equation (3). \[D(X)=\frac{1}{n}\sqrt{\sum_{p\in X}(p_{i}-\overline{p})^{2}} \tag{3}\]  
\[\overline{p}=\frac{1}{n}{\sum_{p\in X}p_{i}} \tag{4}\]In (3), X is the features set, which is also the input variables of D(\(\bullet\)). p\({}_{i}\) is the feature belonging to X. \(\overline{p}\) is the centroid of X and n is the number of features in X. To reduce the complexity of solving the problem, we designed the DRLRSAC algorithm to extract static features.