# DI-SLAM: A Real-Time Enhanced RGB-D SLAM for Dynamic Indoor Environments
## 3 System Introduction
### Dynamic Filtering Strategy
#### 3.2.3 Multi-View Geometry Method  
Although the object detection module can effectively identify potential dynamic feature points, its discriminative ability has two main limitations: On the one hand, it cannot accurately distinguish between actual dynamic objects and static objects, which can lead to misclassification (for example, a car parked on the side of the road should be considered a static object if it remains stationary). On the other hand, the system may fail to detect objects belonging to categories absent from the model's training dataset. To overcome these limitations and achieve more precise dynamic feature identification, we compute another dynamic mask, \(mask_{geometry}\), for the current image frame. This mask is then fused with the mask generated by object detection, \(mask_{object}\), resulting in the final fused dynamic mask, \(mask_{final}\). Set:  
Condition 1 : \(mask_{object}\cap mask_{geometry}\). Condition 2 : \(mask_{object}\cap\sim mask_{geometry}\). Condition 3 : \(mask_{object}\cap mask_{geometry}\). The specific decision strategy is as follows:  
\[mask_{final}=\text{Condition 1}\cup\text{Condition 2}\cup\text{Condition 3} \tag{7}\]  
Figure 5: Improvements of the C3 module. **(a)** The original C3 structure in YOLOv5s, inspired by CSPNet, splits the input into two branches for feature reuse and lightweight computation. **(b)** The enhanced version introduces a three-branch design with an additional residual path and element-wise addition to improve feature interaction and representation. Here, Condition 1 represents consensus cases where both detection methods agree on a dynamic status. Condition 2 resolves discordant cases by trusting geometric static results over detection-based dynamic calls, mitigating the misclassification of static regions as dynamic. Condition 3 conversely accepts geometric dynamic indications that override detection static labels, as the geometric method may have captured dynamic regions missed by the object detection. Finally, the three types of judgments are logically fused to obtain \(mask_{final}\). The following will provide a detailed introduction to the multi-view geometric method used in this paper. To start, we first select the keyframe that overlaps most with the current frame by calculating the rotation and descriptor distances of ORB feature points. Then, as shown in Figure 6, for each feature point \(X\) in the keyframe \(KF\), we calculate its corresponding projection point \(x^{\prime}\) in the current frame, the reprojection angle \(\alpha\) between \(x\) and \(x^{\prime}\), and the projection depth \(d_{cf}\). If \(\alpha\) exceeds \(30^{\circ}\), it indicates a significant viewpoint difference, and we classify this feature point as dynamic. If \(\alpha\) is less than \(30^{\circ}\), we perform further analysis. In theory, the relation between \(x\) and \(x^{\prime}\) can be represented as  
\[d_{cf}x^{\prime}=d_{\mathit{kf}}Rx+t \tag{8}\]  
where \(d_{cf}\) and \(d_{\mathit{kf}}\) represent the projection depths of point \(X\) on the two frames, \(x^{\prime}\) and \(x\) are the normalized coordinates of \(X\) in the two frames, and \(R\) is the camera pose calculated during the tracking step. Since our algorithm uses an RGB-D sensor, we can directly obtain the depth \(d_{\mathit{cur}}\) of \(x^{\prime}\). When considering the reprojection error, we compare \(d_{cf}\) with the projection depth of \(x^{\prime}\). If \(\Delta d=d_{cf}-d_{\mathit{cur}}\) is greater than the threshold \(\tau\), we mark the point \(x^{\prime}\) as a dynamic point. By incorporating prior semantic insights with multi-view geometric methods, our SLAM system demonstrated strong performance in dynamic environments. Illustrated in Figure 7, across four different sequences, ORB-SLAM3 often includes dynamic features caused by moving objects, which compromise localization accuracy. In contrast, our method successfully filters out dynamic points, retaining only stable, static features and thereby significantly enhancing localization performance.