AnyMap: Learning a General Camera Model for Structure-from-Motion with Unknown Distortion in Dynamic Scenes

Andrea Porfiri Dal Cin, Georgi Dikov, Jihong Ju, Mohsen GhafoorianCVPR 2025

Introduction

Traditional Structure-from-Motion (SfM) pipelines, such as the widely used COLMAP, typically rely on the "pinhole" camera model. While these systems can account for lens distortion, they often require precise manual initialization or struggle with the complex, non-linear distortions characteristic of wide-angle and fisheye lenses. Furthermore, SfM assumes a static world; moving objects like cars or pedestrians violate epipolar constraints. In distorted videos, these challenges are compounded: a model might incorrectly attribute lens warp to object motion, leading to failed reconstructions.

AnyMap addresses these issues with a differentiable SfM framework that jointly learns a general camera model and estimates 3D geometry from distorted videos of dynamic scenes. By replacing fixed parametric camera models with an Invertible Neural Network (INN) and regularizing scene motion through learnable basis trajectories, it achieves state-of-the-art results in camera calibration and image rectification.

Methods

AnyMap introduces a fully differentiable pipeline that treats the camera model, scene geometry, and motion as learnable components.

Overview of the AnyMap pipeline for joint camera calibration and 3D reconstruction.

General Camera Model via Invertible Neural Networks

Instead of relying on fixed mathematical formulas like the Kannala-Brandt model, AnyMap utilizes an Invertible Neural Network (INN). This network learns a bidirectional mapping between 2D image pixels and 3D light ray directions. The INN architecture ensures that every pixel maps to a unique ray, providing a flexible, "model-free" approach to handling arbitrary lens geometries without the optimization instabilities associated with raw distortion coefficients.

Spherical Range Representation

Standard depth representations (distance along the Z-axis) become numerically unstable as the field of view approaches 180 degrees. To mitigate this, AnyMap predicts "range"—the direct distance from the camera center to a point in spherical coordinates—ensuring stability across wide-angle views.

Low-Dimensional Motion Basis

To handle dynamic scenes without overfitting, AnyMap represents scene motion using a small set of learnable basis trajectories (SE(3) transformations). A lightweight MLP predicts per-pixel weights to interpolate these trajectories. This low-dimensional constraint acts as a strong regularizer, preventing the model from inventing arbitrary per-pixel motion to mask calibration errors.

Joint Optimization

The system is optimized end-to-end using a combination of reprojection loss, monocular depth consistency, and a parametric prior loss. This prior keeps the learned INN close to a standard camera model, preventing divergence in textureless regions.

Key Results

AnyMap consistently outperforms both monocular and multi-view baselines across several challenging datasets, including MipNeRF-360, LLFF, and the Aria Everyday Activities (AEA) dataset.

Qualitative comparison of AnyMap's rectification performance against state-of-the-art baselines.
  • Calibration & Rectification: On the AEA dataset, AnyMap achieved a PSNR of 20.38 for image rectification, significantly outperforming COLMAP (17.23) and specialized monocular methods like GeoCalib (14.92).
  • Pose Estimation: In terms of Average Trajectory Error (ATE), AnyMap proved to be an order of magnitude more accurate than DROID-SLAM or MASt3R on distorted sequences.
  • Novel View Synthesis: When integrated with 3D Gaussian Splatting (3DGS), AnyMap produced cleaner renders with fewer artifacts, particularly at the frame edges where distortion is most severe.
  • Efficiency: While 2.8x slower than standard COLMAP, it is 3.1x faster than COLMAP MVS, making it a viable candidate for high-quality offline reconstruction.

Limitations and Future Work

Despite its strengths, AnyMap is more memory-intensive than "zero-shot" methods. It also relies on off-the-shelf monocular depth and correspondence models; significant failures in these "expert" models can degrade AnyMap's performance. Future work may involve integrating motion masks to better handle scenes where moving objects dominate the frame.

Summary updated

BibTeX
@inproceedings{cin2025anymap,
  author = {Andrea Porfiri Dal Cin and Georgi Dikov and Jihong Ju and Mohsen Ghafoorian},
  title = {{AnyMap: Learning a General Camera Model for Structure-from-Motion with Unknown Distortion in Dynamic Scenes}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01554},
}
Figure