# DI-SLAM: A Real-Time Enhanced RGB-D SLAM for Dynamic Indoor Environments
## 3 System Introduction
### Dynamic Filtering Strategy
#### 3.2.1 Dynamic Feature Point Detection  
ORB-SLAM3's visual odometry relies on the feature points method for interframe pose estimation, providing reliable tracking even during high-speed camera motion. This paper introduces an algorithm built on ORB feature extraction, which is fast, stable, and capable of real-time representation of an image's core features and can also quickly perform frame-to-frame matching through feature descriptors. Figure 1: Framework of the DI-SLAM System. The orange section within the green box outlines the principal innovation of this study, and the remaining areas outlines the principal structure of ORB-SLAM3. Building upon this, we further estimate the fundamental matrix using frame-to-frame matching of ORB feature points. Then, we apply epipolar constraints to filter out certain dynamic feature points in the scene. 1. Estimation of the Fundamental Matrix  
The fundamental matrix describes the geometric relationship between two cameras, and its decomposition provides their relative pose. By decomposing the known fundamental matrix, the relative pose between the two cameras can be determined. The following section details the process of solving the fundamental matrix using ORB feature points:  
Initially, feature matching is conducted on two consecutive frames from the camera input, and a set of matched ORB feature points is obtained based on the feature descriptors, denoted as \(P=\{\ p_{1},p_{2},\cdots p_{n}\}\) and \(Q=\{\ q_{1},q_{2},\cdots q_{n}\}\), where \(P\) and \(Q\) represent the matched feature points in the two frames. Subsequently, the fundamental matrix is computed by randomly selecting 8 pairs of matching points through RANSAC [40]. As shown in Figure 2, \(C_{1}\) and \(C_{2}\) represent the camera's optical centers at two different locations. The epipolar plane is established by \(C_{1}\), \(C_{2}\), and \(X\). The baseline connecting \(C_{1}\) and \(C_{2}\) intersects the image planes at epipoles \(e_{1}\) and \(e_{2}\). The intersection of the epipolar plane and the image planes \(I_{1}\) and \(I_{2}\) forms the epipolar lines \(I_{1}\) and \(I_{2}\). According to the epipolar geometry constraint principle, the transformation relationship between each pair of feature points \(\{\ p_{n},q_{n}\}\) is described as  
\[p_{n}^{\mathrm{T}}Fq_{n}=0 \tag{1}\]  
where \(F\) represents the fundamental matrix. For a pair of matched points \(\{p,q\}\), set \(p=\left[u\ v\ 1\right]^{T}\) and \(q=\left[u_{1}\ v_{1}\ 1\right]^{T}\). Substituting these into Equation (1), we obtain  
\[\left[u\ v\ 1\right] \begin{bmatrix}f_{1}&f_{2}&f_{3}\\ f_{4}&f_{5}&f_{6}\\ f_{7}&f_{8}&f_{9}\end{bmatrix} \left[u_{1}\ v_{1}\ 1\right]^{T}=0 \tag{2}\]  
\[\text{Set}\ f=[f_{1}\ f_{2}\ f_{3}\ f_{4}\ f_{5}\ f_{6}\ f_{7}\ f_{8}\ f_{9}].\]  
After simplification, we derive  
\[[u_{1}u_{2}\ v_{1}u_{2}\ u_{2}\ u_{1}v_{2}\ v_{1}v_{2}\ v_{2}u_{1}\ u_{2}\ 1]f=0 \tag{3}\]  
While the fundamental matrix can be derived with only 8 points through this method, RANSAC is employed to iteratively refine the selection of feature point pairs for precision. Additionally, by utilizing the geometric properties of epipolar lines, a cost function is constructed to further refine \(F\) through optimization:  
\[J(F)=\sum_{i=1}^{N}\left(p_{i}^{\mathrm{T}}Fq_{i}\right)^{2} \tag{4}\]  
where \(J(F)\) measures the sum of squared polar line constraint errors for all matching point pairs in the two frames. During iteration, when \(J(F)\) reaches its minimum, the corresponding fundamental matrix is the optimal estimate. 2. Epipolar Constraint for Filtering Dynamic Features  
With \(F\) solved, the polar line \(I_{1}\) is generated leveraging \(F\) and coordinates of the feature points:  
\[l_{1}= \begin{bmatrix}X\\ Y\\ Z\end{bmatrix} Fp_{1} \tag{5}\]where \(X\) and \(Y\) characterize the orientation vector of the epipolar line. That is, the mathematical representation of epipolar line \(l_{1}\) takes the form \(Xu+Yv+Z=0\), where \((u,v)\) represents the image coordinates.