# Precise Feature Removal Method Based on Semantic and Geometric Dual Masks in Dynamic SLAM
## 3 Methodology
### Geometric Consistency Verification  
During the pose estimation phase of ORB-SLAM3, the system minimizes the reprojection error of matched feature points through a PnP nonlinear optimization module to optimize the camera pose. To ensure the geometric validity of the matched points, ORB-SLAM3 incorporates a geometric consistency verification mechanism that verifies matched points through a reprojection model to identify and exclude mismatches. The core of geometric consistency verification lies in calculating the reprojection error. Let a map point in the world coordinate system be \(P_{w}\) and the camera pose be \((R_{cw},t_{cw})\), which in the camera coordinate system is  
\[P_{c}=R_{cw}\cdot P_{w}+t_{cw}. \tag{2}\]  
Projecting this onto the image plane using the intrinsic camera parameters yields the predicted pixel coordinates \(\hat{u}\), which when compared with the actual observed point \(u\) results in the reprojection error:  
\[e=\hat{u}-u. \tag{3}\]  
ORB-SLAM3 minimizes the reprojection error of all matched points to solve for the camera pose during pose optimization, as follows:  
\[\min_{R,t}\sum_{i}\rho(\|\hat{u}_{i}-u_{i}\|^{2}). \tag{4}\]  
In the above equation, the matrix \(R\) represents the camera's rotation matrix (belonging to the special orthogonal group \(SO(3)\)) with constraints \(R^{\mathsf{T}}R=I\) and \(\text{det}(R)=1\). These conditions ensure that the rotation matrix is orthogonal with a determinant of \(1\), conforming to the mathematical properties of rotational transformations in three-dimensional space, and are used to describe the rotational behavior of the camera's pose in space. The translation vector \(t\in\mathbb{R}^{3}\) can theoretically take any value in 3D Euclidean space without scene-specific constraints. Here, \(i\) represents the calculation of the \(i\)-th feature point, while \(\rho\) is a robust kernel function (such as the Huber kernel) used to mitigate the influence of outliers on optimization. When the reprojection error \(\|e\|\) of a feature point exceeds a set threshold, that point is determined to be a geometric outlier and is no longer involved in the pose optimization calculation for the current frame. The proposed approach utilizes the Levenberg-Marquardt nonlinear least-squares optimization algorithm to address the robust kernel-function formulated optimization problem. This represents a geometrically consistent validation process that operates synchronously during optimization iterations. As such, it forms a reliable outlier filtering mechanism within the system, particularly with innate recognition capabilities for feature points on dynamic objects. During the feature matching process in the current frame, ORB-SLAM3 directly excludes those feature points that were marked as outliers in the previous frame, meaning that these outliers participate in neither feature matching nor pose estimation. To more effectively utilize this information, in this paper we propose an improved strategy. First, outliers are further classified in the feature matching stage, and those falling within the potential dynamic object mask are marked as dynamic points. During the pose estimation process, while outliers are excluded, both dynamic points and regular feature points participate in the computation, with the dynamic points being assigned a weight of zero. This approach aims to identify current-frame outliers. This approach provides support for the judgment of dynamic objects and areas in the next frame, thereby forming a closed-loop system process. The strategy proposed in this paper is more efficient compared to methods that introduce additional binocular geometric constraints or lightweight PnP pose estimations for dynamic area filtering prior to the feature matching stage. We fully leverage the complete optimization process already inherent in ORB-SLAM3, allowing for dynamic point identification without additional computations. This reduces system overhead while also improving both the accuracy of dynamic object recognition and the overall robustness of the system.