Skip to content

MegaSaM: Accurate, Fast and Robust Structure and Motion from Casual Dynamic Videos

Best Paper Honorable Mention · CVPR 20253D & 4D reconstruction

Estimates cameras and depth from casual monocular videos with dynamic scenes and unconstrained camera motion. Training and inference changes to deep visual SLAM address violations of static-scene assumptions.

Explanation level

Casual phone videos often contain moving people and cars and little camera translation, which breaks classical SfM and SLAM. MegaSaM changes the training and inference of a learned SLAM system to cope with these cases. This analysis walks through the problem, method, numbers and limitations.

Overview

MegaSaM takes an ordinary single-camera video, possibly full of moving people, cars or animals, and estimates three things: the camera pose in every frame, the focal length if it is unknown, and a dense depth map for each frame. It adapts DROID-SLAM, a learned visual SLAM system, so that it keeps working when the scene is not static and when the camera barely translates. A second stage then refines the depth maps so they agree from frame to frame. CVPR 2025 listed the paper as a Best Paper Honorable Mention, which is an official conference recognition. How well it suits your own use case is something to judge from the experiments, not from the award. The authors are from Google DeepMind, UC Berkeley and the University of Michigan. The paper's contributions are a learned movement-probability map with a two-stage training scheme, a monocular-depth initialization, an uncertainty-aware global bundle adjustment, and a consistent-depth step that needs no test-time network fine-tuning.

Research Problem

Classical structure-from-motion and SLAM assume a mostly static scene and enough parallax, meaning the camera must translate so that near and far points shift differently. Casual videos violate this: objects move, the camera may only rotate, and the field of view is often unknown. Earlier learned alternatives either fine-tune networks on each video, which is slow, or become brittle with unknown focal length, rotation-heavy motion or dominant dynamic content. The task here is: given N frames of a monocular video, output camera poses, focal length when unknown, and per-frame depth, without restricting how the camera or the objects move. Evaluation uses camera pose error and depth error against ground truth where available.

Key Idea

The key idea is to keep the strong geometric machinery of DROID-SLAM, with its differentiable bundle adjustment, and change what is fed into it. First, a network predicts a motion probability map so that pixels on moving objects get less weight in the optimization. Second, this network is trained in a separate stage after the camera tracker has already been trained on static data, which the authors say is more stable than learning everything at once. Third, depth predicted from single images is used as an initialization and as a soft regularizer, but its strength is raised only when the system itself reports high uncertainty, for example when parallax is weak.

Methodology

Data flow: video, mono depth, camera tracking, backend, consistent depth
EyeCode schematic (original illustration of the method as described in the paper; not a reproduction of the authors' figure). · EyeCode Tech (Original EyeCode illustration) · Source

The pipeline has four steps. (1) Single-image depth from Depth Anything is aligned with metric depth from UniDepth by matching medians; UniDepth also supplies an initial focal length. (2) The tracker, a ConvGRU that predicts flow and confidence on a frame graph, is initialized with 8 keyframes using camera-only bundle adjustment, then runs sliding-window optimization with a depth regularizer. (3) A backend runs global bundle adjustment on keyframes, pose-graph optimization for remaining frames, and a final global adjustment over all frames. (4) A consistent depth stage fixes the cameras and optimizes depth and uncertainty with a flow-reprojection loss using RAFT flow, a temporal consistency loss and a depth-prior loss. Training uses 163 TartanAir scenes and 5K static Kubric videos for stage one, then 11K dynamic Kubric videos for stage two.

Experiments & Results

Table 1 of the paper: camera estimation on Sintel (ATE, RTE, RRE: lower is better; '-' means not reported; Time as printed, per-frame average, s = seconds, m = minutes). MegaSaM is best in every column.
MethodCalibrated ATECalibrated RTECalibrated RREUncalibrated ATEUncalibrated RTEUncalibrated RRETime
CasualSAM0.0360.0130.200.0670.0190.471.6m
LEAP-VO0.0410.0230.17---1.3s
ACE-Zero0.0530.0280.300.0650.0281.9210s
Particle-SfM0.0620.0321.260.0570.0381.6421s
RoDynRF0.1100.0491.680.1090.0511.3215m
MonST3R---0.0780.0380.491.0s
MegaSaM (ours)0.0180.0080.040.0230.0080.061.0s
Table 4 of the paper: video depth on Sintel and DyCheck (abs-rel and log-rmse lower is better, delta 1.25 higher is better). The paper's table says DepthCrafter while its baseline text says VideoCrafter.
MethodSintel abs-relSintel log-rmseSintel δ1.25DyCheck abs-relDyCheck log-rmseDyCheck δ1.25
DA-v20.370.5558.60.200.2784.7
DepthCrafter0.270.5068.20.220.2983.7
CasualSAM0.310.4964.20.210.3078.4
MonST3R0.310.4362.50.260.3566.5
MegaSaM (ours)0.210.3973.10.110.2094.1
Table 5 of the paper: ablation on Sintel. '-' means not applicable. Note: the Full row prints ATE 0.019 while Table 1 prints 0.018 for MegaSaM on Sintel; both arXiv versions print the same, and the paper does not explain it.
ConfigurationATERTERREDepth abs-relDepth δ1.25
Droid-SLAM0.0300.0220.50--
w/o mono-init.0.0380.0260.49--
w/o m^i (no movement map)0.0320.1270.14--
w/o 2-stage train.0.0350.1360.17--
w/o u-BA0.0330.0130.11--
w/ ft-pose0.0410.0180.330.2371.2
w/o new C_prior---0.3672.5
Full0.0190.0080.040.2173.1
Bar chart of Sintel ATE with known focal length for six methods
EyeCode bar chart of the calibrated ATE column of Table 1 (lower is better); original illustration, values copied from the paper. · EyeCode Tech (Original EyeCode illustration) · Source
Bar chart of Sintel RTE for the ablation configurations
EyeCode bar chart of the RTE column of Table 5 (lower is better); original illustration, values copied from the paper. · EyeCode Tech (Original EyeCode illustration) · Source

Camera pose is scored by ATE, RTE and RRE after aligning each trajectory to ground truth; depth by abs-rel, log-RMSE and the fraction of pixels within a 1.25 ratio (delta 1.25). Benchmarks are MPI Sintel, DyCheck and 12 in-the-wild DynIBaR videos, with known (calibrated) and unknown (uncalibrated) focal length. Baselines are CasualSAM, LEAP-VO, ACE-Zero, Particle-SfM, RoDynRF and the concurrent MonST3R; for depth also DepthCrafter and Depth Anything V2. The tables below copy Tables 1, 4 and 5. On Sintel (Table 1), MegaSaM reaches ATE 0.018 calibrated against 0.036 for CasualSAM, and 0.023 uncalibrated against 0.078 for MonST3R. On DyCheck (Table 2) its ATE is 0.020, against 0.062 and 0.056 for the best baseline, ACE-Zero; on the in-the-wild set (Table 3) it is 0.004, against 0.016 for LEAP-VO. For depth (Table 4), Sintel abs-rel is 0.21 against 0.27 for DepthCrafter, and DyCheck abs-rel is 0.11 against 0.20 for Depth Anything V2. Per-frame running time is 0.7 to 1.0 s. In the ablation (Table 5), Sintel RTE rises from 0.008 to 0.127 without the movement map and to 0.136 without two-stage training. Qualitatively, the authors show closer trajectories (Figure 5), more consistent depth (Figure 6), and on rotation-dominant DAVIS clips CasualSAM gives distorted point clouds while MonST3R treats rotation as translation (Figure 7).

Limitations

Reported by the authors

The paper has a short Limitations paragraph and Appendix B. Camera tracking fails if moving objects dominate the entire image or if there is nothing for the system to track reliably (Figure 8, top row). It also struggles when camera motion and object motion are colinear, for example the selfie video in the bottom row of Figure 8. The system cannot handle videos with varying focal length or strong radial distortion. The authors note that these failures resemble findings from prior work (CasualSAM) and name better priors from vision foundation models as a promising direction. Failures are shown as visualizations, not as numbers.

EyeCode analysis (editorial interpretation)

Ground truth for the in-the-wild benchmark comes from COLMAP after masking, so it measures agreement with another vision pipeline, not a sensor. The system relies on pretrained Depth Anything, UniDepth and RAFT, and the paper does not study how their errors propagate. Training is synthetic only and the ablation covers one small benchmark.

Key Takeaways

Four points. First, MegaSaM keeps a differentiable SLAM core and fixes its weakness on dynamic video with a movement map and staged training. Second, single-image depth helps as initialization and regularizer, used adaptively by the optimizer's own uncertainty. Third, it beats the listed baselines on pose and depth on three benchmarks at about one second per frame. Fourth, limits remain: dominant motion, colinear motion, changing focal length.

Suggested directions (EyeCode suggestions, not claims from the paper)

  • Test clips with zoom or strong distortion to see where the fixed-focal-length assumption begins to fail.
  • Swap the mono-depth models and measure how sensitive pose error is to them.

References

  1. MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (arXiv abstract; Tables 1-5 and appendices checked in HTML v1 and v2)
  2. MegaSaM paper (arXiv PDF)
  3. MegaSaM, CVPR 2025 open-access page
  4. MegaSaM supplemental material (CVF)
  5. MegaSaM project page
  6. MegaSaM code repository
  7. CVPR 2025 award listing

KEEP EXPLORING

Keep connecting the ideas.