## 3 Methods
### Keyframe Window  
When a new keyframe is obtained, a sub-Gaussian, as described by Equation (3), is constructed. The point cloud is generated from the RGB-D image and downsampled at a certain ratio to initialize the sub-Gaussian. This sub-Gaussian is then added to the sliding keyframe window \(W_{s}\). The new sub-Gaussian is based on the camera coordinate system corresponding to the current keyframe. As the pose of this keyframe changes during fine-tuning, the new sub-Gaussian adjusts accordingly, as shown in Figure 2. To maintain a constant size for \(W_{s}\), the sub-Gaussian that exceeds the window limit is removed from \(W_{s}\). The earliest sub-Gaussian undergoes the most fine-tuning, and its result is relatively stable (discussed in Section 4.3). Therefore, it is removed from the sliding window \(W_{s}\). The removed sub-Gaussian is transformed into the world coordinate system using Equation (5) and then united with the already refined Gaussians \(\mathbf{G}_{0}\). At the same time, a related keyframe window \(W_{r}\) is also constructed. To ensure a strong correlation between the selected keyframes and the current keyframe, co-visibility is used as the metric for measuring inter-frame correlation. Additionally, to optimize the mapping of the current frame from a broader range of perspectives, the spatial distance between frames is also taken into consideration. Based on these factors, we design the related keyframe selection algorithm (Algorithm 1) as follows:  
```
1:Input: keyframes \(W_{re}=[1,2,\ldots,n]\), the observed Gaussians for all keyframes \(\mathbf{V}=[V_{1},V_{2},\ldots,V_{n}]\), the pose of all keyframes \(Ps=[p_{1},p_{2},\ldots,p_{n}]\), the current keyframe \(k\), and the max size for the related keyframe window \(l\)
2:Output related keyframe window \(W_{r}\)
3:\(CoV\_Sores\leftarrow[0,0,\ldots,0]\)
4:for\(i\)in\(W_{re}\)do
5:\(CoV\_Sores[i]\gets CoV^{2}(V_{k},V_{i})\)
6:endfor
7:\(W_{r}\leftarrow[~{}]\)
8:\(Dist\leftarrow[inf,inf,\ldots,inf]\)
9:\(last\_p\gets k\)
10:while\(len(W_{r})<l\)do
11:for\(i\)in\(W_{re}\)do
12:\(Dist[i]\gets min(dist(Ps[last\_p],Ps[i]),Dist[i])\)
13:endfor
14:\(last\_p\leftarrow\arg\underset{i\in W_{re}}{max}(Dist[i]\cdot CoV\_Sores[i])\)
15:\(W_{r}\gets W_{r}+[last\_p]\)
16:endwhile
17:return\(W_{r}\)
```  
**Algorithm 1** Related keyframe selection algorithm. \(W_{re}\) contains the fine-tuned keyframes, \(\mathbf{V}\) represents the Gaussians observed by all keyframes, and \(Ps\) denotes the 3D spatial positions of the keyframes. In Algorithm 1, we first calculate the co-visibility between all fine-tuned keyframes and the current keyframe as Equation (12) using its square as the measure of consistency (line 5). Next, we iteratively update the nearest distances for the keyframes. This iteration prevents the selected keyframes from being overly concentrated in a specific region. By iterating, the selected keyframes are more evenly distributed across the 3D space. During each iteration, after updating the nearest distances (line 12), we compute the relation of  
Figure 2: Sub-Gasussians. each keyframe as the product of its minimum distance and consistency score. Keyframes with the highest relations are added to \(W_{r}\) (line 14). This process continues until the number of keyframes in \(W_{r}\) meets the desired size, after which \(W_{r}\) is returned. To provide a more intuitive demonstration of the related window, we extracted an example from the experiment, as shown in Figure 3. The figure shows the RGB images of the current frame and its related frames and their order in the SLAM sequence. From the figure, it is evident that the visible area of all related frames overlaps with the current frame. Furthermore, these related frames offer observations of the current scene from multiple views. This observation mode is beneficial for both the localization and mapping of the current frame.