AnyCam: Learning to Recover Camera Poses and Intrinsics from Casual Videos

Felix Wimbauer, Weirong Chen, Dominik Muhle, Christian Rupprecht, Daniel Cremers · DOI

Abstract

Estimating camera parameters from unconstrained, "casual" videos remains a significant challenge in computer vision due to dynamic objects and unknown intrinsics. We present AnyCam, a transformer-based framework that recovers camera poses and focal lengths from uncalibrated footage without requiring labeled 3D data. By employing a novel uncertainty-aware reprojection loss and a discrete hypothesis strategy for intrinsics, AnyCam effectively ignores moving objects and generalizes across diverse environments. Our model achieves state-of-the-art performance on benchmarks like Sintel and TUM-RGBD while maintaining high computational efficiency, processing 50-frame sequences in approximately five seconds.

1. Introduction

The recovery of camera poses and intrinsics—fundamental to tasks like augmented reality and 3D reconstruction—has traditionally relied on Structure-from-Motion (SfM) or SLAM algorithms. However, these methods often assume a "static world." In "casual" videos, such as those found on social media or YouTube, dynamic elements like pedestrians or vehicles frequently violate this assumption, leading to tracking drift or failure. Furthermore, existing deep learning solutions typically require ground-truth 3D labels, which are scarce for real-world, unconstrained video.

AnyCam addresses these limitations by proposing a self-supervised approach that is robust to dynamic scenes and unknown focal lengths. By leveraging large-scale unlabeled video data, the model learns a robust prior for camera motion, enabling fast and accurate estimation in a feed-forward pass.

2. Methodology

AnyCam utilizes a transformer architecture that processes video frames alongside off-the-shelf monocular depth and optical flow estimates. The system's robustness stems from several key technical innovations.

2.1 Discrete Intrinsic Hypotheses

Directly regressing focal length is often unstable in deep learning frameworks. AnyCam sidesteps this by considering 32 discrete focal length candidates. For each candidate, a dedicated head predicts the corresponding camera poses and a per-pixel uncertainty map. A secondary sequence head then evaluates these candidates to select the most probable intrinsic parameters.

2.2 Uncertainty-Aware Flow Loss

To enable training without 3D labels, AnyCam employs a self-supervised reprojection loss. The model attempts to reconstruct optical flow using its predicted camera motion and depth. To handle dynamic objects, the model predicts an aleatoric uncertainty map. Pixels associated with independent motion (e.g., a moving person) result in high reprojection errors that cannot be explained by camera movement alone. The model learns to assign high uncertainty to these regions, effectively masking them out and preventing them from corrupting the pose estimation process.

2.3 Self-Supervised Training and Refinement

The model is trained on a massive, heterogeneous collection of unlabeled YouTube videos, including indoor, outdoor, and egocentric scenes. Training is guided by forward-backward consistency and temporal priors. While the core model is feed-forward, an optional test-time Bundle Adjustment (BA) step can be applied. This refinement utilizes the predicted uncertainty maps to fine-tune trajectories while ignoring dynamic distractors.

3. Experiments and Results

AnyCam was evaluated across a variety of challenging datasets, including Sintel (synthetic), TUM-RGBD (dynamic indoor), and Waymo (autonomous driving).

3.1 Performance and Generalization

Despite the absence of 3D supervision, AnyCam matches or exceeds the performance of supervised methods on the Sintel and TUM-RGBD benchmarks. Its "zero-shot" capabilities are particularly noteworthy; the model performs accurately on specialized domains like autonomous driving and head-mounted camera footage without domain-specific fine-tuning.

3.2 Computational Efficiency

A primary advantage of AnyCam is its speed. The feed-forward pass for a 50-frame video takes only 5 seconds. Even with the optional refinement step, the total processing time is approximately 2 minutes—a significant improvement over competing methods like CasualSAM, which can require over an hour for similar sequences.

4. Discussion and Limitations

While AnyCam represents a significant step forward, it remains dependent on the quality of pre-trained depth and flow models. Failures in these underlying "foundation" models (e.g., in low-light or reflective scenes) can propagate to the pose estimation. Additionally, the model lacks a global loop-closure mechanism, which can lead to accumulated drift over very long video sequences.

5. Conclusion

AnyCam demonstrates that robust camera pose and intrinsic estimation can be achieved through self-supervised learning on diverse, unlabeled video data. By treating uncertainty as a natural motion segmenter and discretizing the search for intrinsics, the model provides a fast, scalable solution for processing casual video content. Future work will focus on reducing dependency on external flow and depth networks and incorporating global scene representations for long-term stability.

Summary updated

BibTeX
@inproceedings{wimbauer2025anycam,
  author = {Felix Wimbauer and Weirong Chen and Dominik Muhle and Christian Rupprecht and Daniel Cremers},
  title = {{AnyCam: Learning to Recover Camera Poses and Intrinsics from Casual Videos}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01558},
}
Figure