# An Improved Visual SLAM Based on Map Point Reliability under Dynamic Environments
## 2 Proposed Method
### Unreliable Map Points Processing Strategy
#### 2.3.2 Unreliable Map Points Check Operation  
After calculating the pose of the current frame, we present an unreliable map points check (UMPC) operation. The details of the proposed UMPC operation are introduced as follows.  
First, we calculate the reprojection points of the U-MPs by the pose of the current frame. Then, we calculate the Euclidean distance between each projection point and its corresponding feature point. Map points whose distance exceeds the threshold will be removed from the current frame.  
The proposed SLAM can work in three modes: RGB-D, monocular and stereo. For each frame, the coordinate of the unreliable map point is \(P^{u}=[X,Y,Z]^{\text{T}}\); the observation point of the map point in the RGB-D image is \(p=[u,v,d]^{\text{T}}\), and the observation point of map point in mono image and left or right camera in stereo is \(p=[u,v]^{\text{T}}\).  
Thus, for the map point observed by the RGB-D camera, the reprojection \(\tilde{p}\) of \(P^{u}\) in the normalized plane is calculated by  
\[\tilde{p}=[x,y,z]^{\text{T}}=(T\cdot P^{u})_{1:3}, \tag{6}\]  
and for the right camera in stereo, the equation is  
\[\tilde{p}=[x,y,z]^{\text{T}}=(T_{ntrl}\cdot T\cdot P^{u})_{1:3} \tag{7}\]  
where \(T_{ntrl}\) is the right-to-left transformation matrix.  
Then, the coordinate of projection point \(p^{\prime}\) of \(\tilde{p}\) in the image from the RGB-D camera is shown as follows:  
\[p^{\prime}=[f_{x}\cdot\frac{x}{z}+c_{x},f_{y}\cdot\frac{y}{z}+c_{y},\frac{f_{x} \cdot x-bf}{z}+c_{x}]^{\mathrm{T}} \tag{8}\]  
while for the point in a mono camera and a left or right stereo camera, the \(p^{\prime}\) is calculated by:  
\[p^{\prime}=[f_{x}\cdot\frac{x}{z}+c_{x},f_{y}\cdot\frac{y}{z}+c_{y}]^{\mathrm{ T}} \tag{9}\]  
where \(f_{x},c_{x},f_{y},c_{y},bf\) are the internal parameters of the camera.  
The error between the reprojection point \(p^{\prime}\) and the observation point \(p\) is shown as follows:  
\[Error=\mu\times\|(p^{\prime}-p)\|_{2} \tag{10}\]  
where \(\mu\) is the effective coefficient, and in this paper, it is the scaling coefficient of the pyramid layer where the ORB feature point is located.  
To test whether the error exceeds the threshold \(\bigtriangleup\), we use a chi-square distribution, as described by  
\[\bigtriangleup(x;k)=\begin{cases}\frac{1}{2}\frac{1}{1}r(\frac{k}{2})^{x}\frac {k-1}{2}e^{-\frac{x}{2}},&x>0\\ 0,&\text{otherwise}\end{cases} \tag{11}\]  
\[\Gamma(k)=(k-1)! \tag{12}\]  
where \(k\) is the degree of freedom, and \(x\) is the degree of confidence. Since the dimension of the matching point of RGB-D is 3, and the 3 dimensions are independent of each other, we take the degree of freedom \(k=3\), and the degree of confidence \(x=0.05\). For mono and stereo images, we set \(k=2\), and \(x=0.05\). If \(Error\) exceeds the chi-square statistic, it is considered that the reprojection of the map point under the current pose is inconsistent with the original matching point, and it will be moved.  
The workflow of the proposed map points processing in the proposed method is shown in Figure 6.  
Figure 6: The workflow of the proposed map points treatment in the proposed method.