Depth from Videos in the Wild

Gordon 2019 · Paper

One-line summary — This work (ICCV 2019) pushed self-supervised depth learning to truly unconstrained video by learning the camera intrinsics (including lens distortion) along with depth, ego-motion, and object motion — enabling training on arbitrary videos with unknown cameras.

Problem

Self-supervised depth methods in the SfM-Learner tradition learn from raw video by warping one frame into another and penalizing photometric error — but they assume the camera intrinsics are known, restricting training to calibrated datasets like KITTI, and they degrade when scenes contain independently moving objects or occlusions. If the goal is learning geometry from the world’s video (arbitrary cameras, arbitrary content), calibration and the static-scene assumption both have to go.

Method & architecture

Two convolutional networks are trained jointly with only cross-frame consistency as supervision: a depth network (UNet on a ResNet-18 base, softplus activation z=log(1+e)z=\log(1+\mathrm{e}^{\ell}) mapping logits to depth) predicting depth from a single image, and a motion network (FlowNet-inspired UNet) that from two frames predicts camera rotation r0r_0, global translation t0t_0, a residual per-pixel translation field, and the camera intrinsics — each intrinsic emitted by its own 1x1 convolution from the bottleneck. The backbone warp between adjacent frames is

zp=KRK1zp+Kt,z^{\prime}p^{\prime}=KRK^{-1}zp+Kt,

where KK is the intrinsic matrix, p,pp,p^{\prime} homogeneous pixel coordinates, z,zz,z^{\prime} depths, and R,tR,t the motion.

Why intrinsics are learnable. The loss depends on KK only via KtKt and KRK1KRK^{-1}; translations give no signal (a wrong K~\tilde{K} with t~=K~1Kt\tilde{t}=\tilde{K}^{-1}Kt leaves the loss unchanged), but rotations do — no K~,R~\tilde{K},\tilde{R} can reproduce KRK1KRK^{-1}. The paper derives the tolerance on focal lengths from the inter-frame rotation:

δfx<2fx2w2ry;δfy<2fy2h2rx,\delta f_{x}<\frac{2f_{x}^{2}}{w^{2}r_{y}};\quad\delta f_{y}<\frac{2f_{y}^{2}}{h^{2}r_{x}},

with rx,ryr_x,r_y rotation angles (radians) and w,hw,h the image size — more rotation pins the focal length more tightly.

Object motion. RR is held constant across the image; tt may deviate from constant only inside a rough “possibly mobile” mask mm (a union of detection bounding boxes suffices — no instance segmentation or tracking):

t(x,y)=t0+m(x,y)δt(x,y).t(x,y)=t_{0}+m(x,y)\,\delta t(x,y).

Occlusion-aware losses. Each source pixel is unprojected with its predicted depth, moved by the motion field, and reprojected; a pixel enters the (L1 photometric + depth + motion cycle-consistency) losses only where its transformed depth satisfies zi,jzi,jtz^{\prime}_{i^{\prime},j^{\prime}}\leq z^{t}_{i^{\prime},j^{\prime}} — i.e. it lands in front of the target depth map — applied symmetrically in both directions. SSIM is weighted down where depth discrepancy is large. Randomized layer normalization — layer norm with multiplicative Gaussian noise on the means and variances — replaces batch norm, which had shown anomalous behavior (accuracy degrading with batch size).

Results

Why it matters for SLAM

This paper removed the last practical barrier to learning geometry from unlimited video: calibration. The idea of treating camera parameters as just another learnable output reappears in learned camera models (Neural Ray Surfaces) and resonates with today’s calibration-free feed-forward reconstruction (DUSt3R-style models predicting geometry without given intrinsics). For SLAM practitioners, it is also a reference point for handling dynamic objects and occlusion inside photometric self-supervision — persistent failure modes of direct methods.