# RD-SLAM: Real-Time Dense SLAM Using Gaussian Splatting
## 3 Materials and Methods
### 3D Gaussian Scene Representation  
We represent the underlying map of the environment as a set of 3D Gaussians, and its overall overview is shown in Figure 3. Each 3D Gaussian initialized by the point cloud contains center \(\mathbf{\mu}\in\mathbb{R}^{3}\), spatial covariance \(\mathbf{\Sigma}\in\mathbb{R}^{3\times 3}\), opacity \(\alpha\in\mathbb{R}\), and color \(\mathbf{c}\). \(\mathbf{c}\) is represented by spherical harmonics for view-dependent radiance. All properties are learnable and optimized by means of back-propagation.  
\[\mathbf{G}=\{G_{i}:(\mathbf{\mu}_{i},\mathbf{\Sigma}_{i},\alpha_{i},\mathbf{c}_{i})|i=1,\dots, N\}, \tag{1}\]  
where \(\mathbf{\Sigma}_{i}=\mathbf{R}_{i}\mathbf{S}_{i}\mathbf{S}_{i}^{\mathrm{T}}\mathbf{R}_{i}^{\mathrm{ T}}\), \(\mathbf{S}\in\mathbb{R}^{3}\) is a 3D scale vector, and \(\mathbf{R}\in\mathbb{R}^{3\times 3}\) is the rotation matrix, which participates in computation as a 4D quaternion. The influence of a single 3D Gaussian function on a physical point \(\mathbf{x}\in\mathbb{R}^{3}\) in 3D space is calculated using the following equation:  
\[f(\mathbf{x})=\alpha\mathrm{exp}\bigg{(}-\frac{1}{2}(\mathbf{x}-\mathbf{\mu})^{\mathrm{T} }\mathbf{\Sigma}^{-1}(\mathbf{x}-\mathbf{\mu})\bigg{)}. \tag{2}\]  
In order to obtain the rendered RGB-D image, we calculate it with the input image and optimize the Gaussian parameters. We use the following equation to render the 3D Gaussian projection onto the 2D image plane:  
\[\mathbf{\mu}^{\mathrm{2D}}=K\frac{\mathbf{\frac{\mu}{d}}}{d}, \tag{3}\] \[\mathbf{\Sigma}^{\mathrm{2D}}=\mathbf{\mathrm{J}}\mathbf{\Sigma}\mathbf{\Sigma}^ {\mathrm{T}}\mathbf{\mathrm{J}}^{\mathrm{T}},\] \[d=(\mathbf{\mathbf{E}}\mathbf{\mu})_{z},\]  
Figure 2: Overview of RD-SLAM. Our approach takes RGB-D frames as input and initializes the point cloud by reprojecting the RGB-D image, and then performs an alignment algorithm using G-ICP to obtain the current frame pose. The dual keyframe selection strategy determines whether the current frame is a tracking or mapping keyframe, which initializes new 3D Gaussians to perform the densification operation. The Gaussian parameters are optimized by applying depth, color, and regularization loss to the rendered RGB-D frames, and a pruning operation is performed after a fixed number of iterations to remove anomalous Gaussians. Finally, a dense 3D environment map is obtained.  
where \(K\) is the camera intrinsic matrix, \(\mathbf{E}\) is the extrinsic matrix capturing the rotation and translation of the camera, \(\mathbf{J}\) is the Jacobian of the affine approximation of the projective transformation, and \(d\) is the center depth of the 3D Gaussian obtained by projecting onto the z-axis in the camera coordinate system.  
The 3D Gaussians projected to the image plane are sorted in depth order, and front-to-back blending rendering is performed to synthesize a pixel color \(C_{p}\):  
\[C_{p}=\sum_{i\in N}\mathbf{c}_{i}f_{i}\prod_{j=1}^{i-1}(1-f_{j}). \tag{4}\]  
Similarly, the depth \(D_{p}\) is rendered by the following equation:  
\[D_{p}=\sum_{i\in N}d_{i}f_{i}\prod_{j=1}^{i-1}(1-f_{j}). \tag{5}\]