Abstract
We introduce GSVisLoc, a visual localization method designed for 3D Gaussian Splatting (3DGS) scene representations. Given a 3DGS model of a scene and a query image, our goal is to estimate the camera's position and orientation. We accomplish this by robustly matching scene features to image features. Scene features are produced by downsampling and encoding the 3D Gaussians while image features are obtained by encoding image patches. Our algorithm proceeds in three steps, starting with coarse matching, then fine matching, and finally by applying pose refinement for an accurate final estimate. Importantly, our method leverages the explicit 3DGS scene representation for visual localization without requiring modifications, retraining, or additional reference images. We evaluate GSVisLoc on both indoor and outdoor scenes, demonstrating competitive localization performance on standard benchmarks while outperforming existing 3DGS-based baselines. Moreover, our approach generalizes effectively to novel scenes without additional training.
Introduction
Visual localization—the process of determining a camera's precise position and orientation from a single image—is a fundamental challenge in fields like autonomous navigation and augmented reality. Traditional approaches often rely on extensive databases of reference images or require training scene-specific neural networks, which can be computationally expensive and difficult to scale.
Recently, 3D Gaussian Splatting (3DGS) has emerged as a powerful tool for 3D scene representation, offering fast training and high-quality rendering. However, utilizing 3DGS for localization has typically required initial pose guesses or scene-specific optimization. GSVisLoc addresses these limitations by providing a "plug-and-play" solution that performs visual localization directly on 3DGS representations. It matches learned 3D scene features to 2D image patches, achieving high accuracy and, crucially, generalizing to entirely new scenes without retraining.
Methodology
GSVisLoc establishes robust 3D-2D correspondences through a multi-stage deep-learning pipeline. The process begins with Dual Encoding, where a ConvFormer-based 2D encoder extracts features from image patches and a KPFCNN (Kernel Point Convolution) encoder processes the 3D Gaussians. To handle the noise and density of Gaussians, the 3D encoder groups them into descriptive "3D regions."
Following encoding, Feature Alignment is performed using interleaved self-attention and cross-attention layers, allowing the 3D and 2D features to refine each other based on mutual context. The matching then proceeds in a Coarse-to-Fine manner:
- Coarse Matching: Broad correspondences are identified between 3D regions and 8x8 image patches.
- Fine Matching: For each coarse match, precise pixel-level coordinates are predicted within the patch using a heatmap-based expectation.
Finally, these matches are processed by a standard PnP+RANSAC solver to obtain an initial pose. This estimate is further polished through a Pose Refinement step that renders the scene from the estimated pose and uses a 2D-2D matcher (MASt3R) to minimize residual errors.
Experimental Results
The performance of GSVisLoc was evaluated across three major benchmarks: 7-Scenes (indoor), Cambridge Landmarks (outdoor), and ScanNet++ (cross-scene generalization).
State-of-the-Art Performance
GSVisLoc significantly outperforms previous 3DGS-based methods such as 6DGS and GSplatLoc. In indoor environments (7-Scenes), it achieved a median error of 1.3 cm and 0.33°, rivaling top-tier scene-specific methods like ACE while maintaining greater flexibility.
Generalization Capabilities
A key strength of GSVisLoc is its ability to generalize. When tested on novel, unseen rooms in the ScanNet++ dataset, the model achieved an average median error of 0.47 cm and 0.15°. This demonstrates that the framework learns the underlying geometry of matching rather than simply memorizing specific scenes.
Outdoor Localization
While GSVisLoc surpassed other 3DGS methods on the Cambridge Landmarks dataset, it currently trails behind hierarchical methods like HLoc. This is primarily attributed to the challenges 3DGS faces in rendering large-scale outdoor environments with complex lighting and distant backgrounds.
Conclusion and Future Work
GSVisLoc represents a significant advancement in visual localization by treating 3DGS as a native map for direct 3D-2D matching. While it demonstrates impressive generalization and indoor precision, limitations remain regarding outdoor rendering quality and processing speed (currently ~2.82 seconds per query). Future research will focus on optimizing the implementation for real-time performance and exploring efficient 3DGS pruning techniques to reduce the computational overhead of processing large numbers of Gaussians.
Summary updated