NaCR: Visual Localization via NeRF-aided Camera Ray Regression
Organizations: Shanghai Jiao Tong University
Abstract
Visual localization (VL) is a fundamental technology for vision applications such as virtual reality. Recently, a novel VL paradigm, Camera Ray Regression (CRR), has emerged, which maps 2D image patches to 3D camera rays, but its accuracy is limited. To improve CRR accuracy, we notice a compelling duality: the inverse of this mapping is inherently performed by the novel view synthesis model, \ie, Neural Radiance Fields (NeRF). While NeRF renders image patches from camera rays via differentiable ray marching, CRR predicts the rays from image patches. Motivated by this complementary relationship, we propose NeRF-aided Camera Ray Regression (NaCR), a unified framework that seamlessly bridges NeRF and CRR at the ray level. First, NaCR incorporates three simple yet effective enhancements into the CRR baseline. Second, leveraging a pre-trained NeRF, NaCR augments the training data by synthesizing novel views tailored for efficient, patch-level consumption. Finally, exploiting the differentiability of NeRF, NaCR forms a closed-loop supervision pipeline where photometric rendering errors are back-propagated to optimize the predicted camera rays. To ensure stable convergence within the highly non-convex image space, we introduce a two-stage training curriculum. Extensive experiments across indoor and outdoor benchmarks demonstrate that NaCR achieves competitive accuracy. Comprehensive ablation studies validate the efficacy of each proposed component.
Figures & tables
| Category | Method | Chess | Fire | Heads | Office | Pumpkin | Kitchen | Stairs | Average |
| ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ( / ∘ ) | ||
| SCR | DSAC* [ 4 ] | 0.5/0.2 | 0.8/0.3 | 0.5/0.3 | 1.2/0.3 | 1.2/0.3 | 0.7/0.2 | 2.7/0.8 | 1.1/0.3 |
| ACE [ 3 ] | 0.5/0.2 | 0.8/0.3 | 0.6/0.3 | 1.0/0.3 | 1.0/0.2 | 0.8/0.2 | 2.9/0.8 | 1.1/0.3 | |
| GLACE [ 37 ] | 0.6/0.2 | 0.9/0.3 | 0.5/0.3 | 1.1/0.3 | 0.9/0.2 | 0.8/0.2 | 3.2/0.9 | 1.2/0.3 | |
| RPR | ExReNet [ 39 ] | 5.0/1.6 | 7.0/2.5 | 3.0/2.7 | 6.0/1.8 | 7.0/2.0 | 7.0/2.1 | 19.0/4.9 | 8.0/2.5 |
| Reloc3r [ 8 ] | 3.0/0.9 | 3.0/0.8 | 1.0/1.0 | 4.0/0.9 | 6.0/1.1 | 4.0/1.3 | 7.0/1.3 | 4.0/1.0 |
| Scene | SCR | APR | CRR | ||||||
| DSAC* | ACE | PN | MST | DIMM | NaCR | NaCR+NPR | |||
| [ 4 ] | [ 3 ] | [ 12 , 13 , 14 ] | [ 34 ] | [ 6 ] | [ 6 ] | [ 43 ] | Ours | Ours | |
| Throughput (fps) | 17.9 | 17.9 | 166.7 | 28.4 | 55.6 | 55.6 | 20.1 | 33.4 | 16.5 |
| Bears | 82.6%/91.6% | 80.7%/92.6% | 12.9%/35.7% | 0.5%/12.8% | 80.7%/99.3% | 80.7%/99.5% | 82.4%/97.1% | 95.5%/99.3% | 96.4 %/ 99.7 % |
| Cubes | 83.8%/98.1% | 97.0 %/ 98.1 % | 0.0%/0.4% | 0.00%/9.9% | 72.4%/96.9% | 71.8%/96.9% | 71.5%/89.8% | 72.5%/85.7% | 73.8%/87.9% |
| Inscription | 54.1%/69.7% | 49.0%/69.6% | 1.1%/6.3% | 1.3%/9.7% | 37.8%/74.2% | 37.1%/74.1% | 21.3%/72.6% | 57.8 %/75.1% | 56.1%/ 77.3 % |
| Component | Model Params (M) | Time | Role |
| ACE Mapping | 2.10 | 5 min | SCR mapping |
| GLACE Mapping | 9.45 | 33 min | SCR mapping |
| DIMM Mapping | 18.31 | 1.32 h | baseline mapping |
| NaCR Mapping Cost | 39.53 | 3.63 h | mapping |
| Scene NeRF training | 16.79 | 0.42 h | mapping |
| Stage-1 training | 39.53 | 2.08 h | mapping |
| Method | Arch. | NVS aug. | TST | 7-Scenes | STD | Wayspots | STD | |
| DIMM | 3.6/1.0 | 0.034 | 42.3/64.0 | 0.215 | ||||
| DA3 only | DA3 | 3.3/0.9 | 0.037 | 45.9/63.8 | 0.052 | |||
| DIMM ∗ | Full | 3.2/0.9 | 0.019 | 45.8/63.7 | 0.555 | |||
| NaCR ( ) | Full | 2.4/0.5 | 0.022 | 52.7/65.5 | 0.040 | |||
| DIMM ∗ + | Full | 2.9/0.7 | 0.023 | 51.0/64.3 | 0.117 | |||
| NaCR-SST | Full | 6.7/3.3 | 0.027 | 39.1/60.0 | 0.099 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Scene | NaCR | NaCR w/o Adversarial Loss |
| chess | 0.9/0.2 | 1.0/0.3 |
| fire | 1.0/0.2 | 1.2/0.5 |
| heads | 1.3/0.4 | 1.7/0.6 |
| office | 4.7/0.6 | 4.9/0.9 |
| Proportion of Synthesized Images | Recall ( ) | Time (h) | Training Steps |
| DIMM (Baseline) | 82.4 | 0.83 | 20K |
| 0% (Improved DIMM) | 84.1 | 1.15 | 20K |
| 20% | 84.6 | 1.87 | 30K |
| 50% | 87.1 | 2.25 | 40K |
| 70% | 92.3 | 2.67 | 50K |
| 100% | 95.5 | 3.22 | 60K |
| Scene | NaCR | NaCR | NaCR | RAP [ 17 ] | GRLoc [ 16 ] |
| NVS model | Nerfacto [ 36 ] | Deblur-NeRF [ 24 ] | 3DGS [ 41 ] (w/o rendering loss) | 3DGS | 3DGS |
| chess | 0.9 / 0.2 /23.67 | 1.0/ 0.2 /22.91 | 1.1/0.5/ 23.95 | 1.0/0.8/- | 1.0/0.3/- |
| fire | 1.0 / 0.2 /22.75 | 1.1/0.5/21.33 | 1.4/0.3/ 23.86 | 6.0/3.4/- | 2.9/1.0/- |
| heads | 1.3 / 0.4 /18.89 | 1.5/1.0/18.09 | 1.7/1.3/ 19.07 | 4.0/5.5/- | 1.4/0.9/- |
| office | 4.7/ 0.6 /21.98 | 3.2 /0.8/ 22.85 | 5.3/1.3/22.69 | 5.1/1.1/- | 5.0/1.9/- |
| NVS reference views (%) | NaCR | Nerfacto PSNR | RAP | 3DGS PSNR |
| 0 | 2.9/0.7 | N/A | 7.1/2.9 | N/A |
| 25 | 3.2/1.1 | 13.7 | 8.3/3.6 | 15.3 |
| 50 | 2.6/0.6 | 17.4 | 7.5/3.2 | 19.4 |
| 75 | 2.3/0.4 | 19.8 | 6.8/2.8 | 22.3 |
| 100 | 2.2/0.4 | 21.0 | 5.0/2.5 | 23.4 |
| Model | Bears | Cubes | Lawn | The Rock |
| I: DIMM | 82.4 | 71.5 | 22.4 | 95.4 |
| II: DIMM + Nerfacto | 91.7 | 72.1 | 29.6 | 96.0 |
| III: II + DA3 DINOv2 | 92.5 | 72.3 | 30.2 | 96.5 |
| IV: III + Ref. Token Cond. (random) | 92.1 | 72.1 | 29.8 | 96.9 |
| V: III + Ref. Token Cond. (centered) | 94.6 | 72.3 | 32.5 | 98.1 |
| VI: V + Ray-Confidence Head | 95.5 | 72.5 | 34.2 | 97.9 |
Camera Pose Estimation
Camera pose estimation recovers a camera’s position and orientation from images, visual features, scene geometry, and sometimes sensor measurements.
See all 237 papers