## 3 Methodology
### Dynamic Feature Point Removal Method  
(1)To compute the optical flow vector for the feature point \((x,y)\), a \(5\times 5\) pixel window is selected, centered around the feature point. An overdetermined system of equations is then formulated based on the window's pixel values. \[ \begin{bmatrix}I_{x}&I_{y}\end{bmatrix} _{k} \begin{bmatrix}\mathbf{u}\\ \mathbf{v}\end{bmatrix} =-I_{t}^{k},\mathbf{k}=1,\ldots,25. \tag{12}\]  
The motion vector is then solved using the least squares method, expressed as follows:  
\[ \begin{split}\mathbf{A}=\begin{bmatrix}[I_{x},I_{y}]_{1}\\ \vdots\\ [I_{x},I_{y}]_{k}\end{bmatrix},\mathbf{b}=\begin{bmatrix}I_{t}^{1}\\ \vdots\\ I_{t}^{k}\end{bmatrix}.\end{split}  \tag{13}\]  
It can be simplified as:  
\[ \begin{split}\mathbf{A}\begin{bmatrix}\mathbf{u}\\ \mathbf{v}\end{bmatrix}=-\mathbf{b}.\end{split}  \tag{14}\]  
When the coefficient matrix \(\mathbf{A}\) is overdetermined, the components of the motion vector, \(\mathbf{u}\) and \(\mathbf{v}\), can be computed using the least squares method as follows:  
\[ \begin{bmatrix}\mathbf{u}\\ \mathbf{v}\end{bmatrix} ^{\text{T}}=-(\mathbf{A}^{\text{T}}\mathbf{A})^{-1} \mathbf{A}^{\text{T}}. \tag{15}\]  
(2) Dynamic Feature Point Removal Algorithm  
The LK optical flow algorithm is employed to filter and remove dynamic feature points. Feature points in the current frame are categorized into two groups: those within known and potential dynamic target anchor boxes, classified as dynamic feature points and added to set D, and those outside the anchor boxes, classified as static feature points and placed in set S.  
For each feature point in set S, the optical flow displacement (\(\mathbf{u},\mathbf{v}\)) between the current and subsequent frames is calculated. If the magnitude of this displacement exceeds a predefined threshold L, the feature point is deemed dynamic, removed from set S, and added to set D. The final static feature points set S, with dynamic points removed, is then returned. Building on the LK optical flow method's role in distinguishing dynamic feature points, the selection of the threshold L plays a pivotal role in the algorithm's effectiveness, as it governs the sensitivity of dynamic feature classification. A low L risks misclassifying static points as dynamic (false positives), thereby reducing the pool of usable features for pose estimation. Conversely, a high L may overlook subtle dynamic motions, permitting dynamic points to disrupt tracking accuracy. To identify an optimal L, we conducted a sensitivity analysis using the TUM RGB-D dataset's \"walking_xyz\" sequence, which exhibits significant dynamic motion. We evaluated a range of L values (0.5, 1.0, 1.5, 2.0, and 2.5 pixels) based on their impact on pose estimation accuracy (measured by Absolute Trajectory Error, ATE RMSE) and the percentage of feature points retained as static. The results of this analysis are presented in Table 1. At L = 0.5, the ATE RMSE is 0.0187 m, with only 62.3% of feature points retained, indicating excessive removal of static points. As L increases to 1.5, the ATE RMSE decreases to 0.0134 m, with 87.6% of points retained, striking a balance between dynamic point removal and static point preservation. Beyond L = 1.5, the ATE RMSE increases, as more dynamic points are retained, degrading accuracy. Based on this analysis, we selected L = 1.5 pixels as the default threshold, as it minimizes pose estimation error while maintaining a sufficient number of static featuresfor robust tracking. This value aligns with typical motion characteristics in indoor dynamic scenes, where small displacements often correspond to noise or minor camera motion, while larger displacements indicate object motion. The proposed algorithm effectively leverages both spatial information from dynamic and potential dynamic objects and the LK optical flow method to analyze feature point motion. Compared to more complex dynamic feature detection methods, it offers lower computational costs, making it suitable for real-time SLAM systems in dynamic environments.