Focus Changes as a Metric Ruler for Video Depth

A camera lens blurs everything that is not at its focus distance, and the amount of blur grows with distance from that focal plane. That makes blur a depth cue that is pure optics: it obeys the same thin-lens equation in a renderer and in a real phone. It has two well-known weaknesses. With an ordinary round aperture, blur does not tell you whether a point is in front of or behind the focal plane. And from a single image, blur only measures depth up to an unknown lens constant. Modern video depth models have the opposite profile. They are temporally smooth and semantically strong, but they output depth only up to an unknown scale and shift, and they treat blur as noise. Our proposal is that ordinary consumer video already contains what is needed to join the two. Autofocus hunting, rack focus (deliberately moving focus from one subject to another), and focus ramps all change the focal plane over time. We show that once the focus distance takes two or more distinct values within a clip, the lens constant, metric scale, and blur sign all become identifiable. We then fit them once for the whole video.

The concrete system has three parts. A blur-magnitude estimator is trained only on synthetic data. A video depth model supplies relative inverse depth. A small global solver fits one set of metric and lens parameters to every frame of the clip. The solver uses the changing focal plane to resolve the front/back ambiguity, and it uses the shared parameters to prevent per-frame scale flicker. Nothing in the pipeline learns the appearance of real blur. The real-world input is restricted to a sign-free blur magnitude and the focus distance that phones already record. That restriction is how the design addresses the synthetic-to-real gap.

Core Claim

Let $r_t(x)$ be the relative inverse depth that a video depth model predicts at pixel $x$ in frame $t$, which is correct only up to scale $s$ and shift $b$. Let $f_t$ be the focus distance of frame $t$ and $K$ the unknown lens constant (aperture times focal-length factors). Under the thin-lens model, the blur-circle diameter is

$$c_t(x) = K\,\bigl|\,s\,r_t(x) + b - 1/f_t\,\bigr|.$$

If the focus is fixed ($f_t = f$), only the products $Ks$ and $K(b - 1/f)$ can be recovered. In that case metric depth cannot be identified from blur, no matter how many frames are observed. If $f_t$ takes at least two distinct values, the offset term varies linearly in $1/f_t$ with slope $-K$. That pins down $K$, and with it $s$ and $b$. The absolute value encodes the focal-plane sign ambiguity. A change in focus also resolves that ambiguity independently of the depth model: at a pixel tracked across frames, blur shrinks as $1/f_t$ moves toward the pixel's inverse depth, and this direction of change reveals which side of the focal plane the pixel is on.

We claim two things. First, a joint fit of $(K, s, b)$, plus a per-pixel sign wherever the depth model's ordering disagrees with the blur evidence, gives metric, temporally stable depth on focus-varying video. Second, a substantial share of the flicker that defocus-based depth shows on video comes from independent per-frame choices of which side of the focal plane each point lies on. Fitting one sign per tracked point for the whole clip removes that share.

Relation to Prior Work

Two papers supply the physics argument and constrain the design. Focus on Defocus trains a network that predicts defocus maps from focal stacks rendered in Blender and transfers zero-shot to real phone stacks. It reports MSE 0.045, against 0.184 for a direct-regression network. This is the main evidence that blur magnitude, unlike appearance, survives the synthetic-to-real transfer, and our estimator reuses its order-invariant design. That work processes static stacks independently and gives no account of time. Repurposing Marigold fits metric scale and shift to a diffusion depth prior by rendering thin-lens blur and matching a real shallow-depth-of-field shot. It needs a co-registered all-in-focus and wide-aperture pair of a still scene, and it optimizes each pair independently. We keep its central idea, that a physical blur loss should calibrate a learned prior. We replace its aperture pair with the focus changes already present in video, and its per-image optimization with one closed-form-plus-discrete fit per clip. BokehDepth generates virtual blur stacks with a diffusion editor and shows that blur radius is linear in inverse-depth offset under a calibrated sweep. Our equation rests on the same linearity. BokehDepth hallucinates its sweep per frame, and its authors note that this flickers on video. We instead use the sweep the camera physically performed.

Three video depth models supply the temporal machinery and also motivate the gap. RollingDepth aligns overlapping snippet predictions with a global solve for scale and shift. Our solver extends exactly that step: it adds $K$, the focus terms, and signs, so that the alignment becomes metric. DepthCrafter and Depth Any Video give temporally consistent relative depth from large synthetic and pseudo-labeled training. All three assume sharp, pinhole-like frames, and none uses blur as a measurement.

The closest work on the exact problem is Video Depth-From-Defocus. It estimates depth from handheld focus ramps with blur-matched PatchMatch alignment and hand-tuned spatial and temporal smoothing, and it also refines imprecise focus metadata. It has no learned prior, so it fails in textureless regions and on fast motion. We borrow its blur-matched alignment to track points across frames. Per-scene methods such as D²RF and Dynamic Gaussian Splatting from Defocused and Motion-blurred Videos model blur inside a 3D reconstruction. They need hours of optimization per scene, and the second depends on an initial monocular depth that can itself flicker. They target sharp view synthesis, not metric depth, and we treat them as context rather than competitors.

Research Program

The first component is a blur-magnitude estimator: a lightweight network that maps a short window of frames to an unsigned blur map with a confidence score. The confidence is low wherever texture is too weak for blur to be observable, which Focal Split and Focus on Defocus both identify as the regime where blur carries no signal. We train it only on synthetic video. To build that video, we render Sintel and DA-V-style clips with a thin-lens model whose focal plane follows sampled autofocus-hunting, rack-focus, and ramp trajectories. Training also randomizes the blur kernel: disk, Gaussian, and aberrated or vignetted shapes. The estimator therefore learns blur size rather than one renderer's kernel. This targets the optical-simulation gap identified for idealized blur engines.

The second component is the relative inverse depth $r_t$, taken unchanged from RollingDepth or DepthCrafter. The third is the solver. Given confident blur samples and focus metadata, it first fits $(K, s, b)$ by robust regression on pixels where the depth model's ordering and the blur agree. It then assigns a per-track sign by comparing the observed change in blur with the change in $1/f_t$ along tracks from blur-matched alignment, and flags pixels where that sign contradicts the ordering from $r_t$. Finally, it alternates the continuous fit with these sign flips. The fitted metric depth then replaces the depth model's prediction in the flagged regions, while the model's output fills textureless regions. For clips with substantial camera motion, the per-snippet affine terms from RollingDepth are tied to one shared $K$ and to a smoothly varying scale.

The analytic work has two parts. First, we state the identifiability conditions: how many distinct focus values are required, and how large their spread must be relative to the scene's inverse-depth range, as a function of blur-estimate noise. Second, we measure how often per-frame defocus methods switch sign branches on real footage.

Baselines

The naive reference point is the video depth model alone. We run RollingDepth and DepthCrafter, aligned to ground truth in two ways: with per-video median scaling, and with a single metric scale from the first frame. This shows what the depth model achieves when the blur in its input is simply ignored. For context, RollingDepth reports AbsRel 9.6% on PointOdyssey and Depth Any Video reports a Temporal Alignment Error of 2.1 on ScanNet++. Neither number was measured on focus-varying footage, and we found no reported result on Lacuna for any video depth model on focus-varying video.

The strongest existing method on the specific question is Video Depth-From-Defocus. It is the only published system designed for real focus-ramp video, and it already handles temporal coupling and refinement of focus metadata. We will reimplement it on the same clips, giving it the same metadata and the same evaluation crops. We will tune its smoothing weights on the same validation split we use for ours. It reports no quantitative figure in the file that we can reuse.

The strongest metric-calibration baseline is Repurposing Marigold. Its reported RMSE is 0.273 m on its real DSLR plus RealSense set, against 0.349 m for Metric3D. Because it requires an aperture pair, we run it per frame on our capture, pairing each frame with the sharpest nearby frame from the focus sweep as its all-in-focus reference. We give it the same GPU budget per clip that our solver uses. On static stacks, DefocusNet itself is the reference, at MSE 0.045 on the Mobile Depth Dataset.

To compete directly with learning blur end to end, we fine-tune DepthCrafter's spatial layers on our synthetic focus-varying renders. We use the same data and a matched number of GPU-hours. This baseline tests whether learning blur appearance end to end can match fitting it explicitly.

The key ablations are a fixed-focus variant, which isolates identifiability; removing the temporal sign cue, which isolates the ambiguity claim; and a per-frame rather than clip-wide fit, which isolates inter-frame consistency.

We beat a baseline if we lower metric AbsRel and RMSE, and also lower TAE, against every baseline on held-out real focus-varying clips. The fixed-focus ablation should fail to recover metric scale, which would confirm the identifiability claim.

Why not just…?

Why not just fine-tune a video depth model on synthetic defocused video? This is the most serious threat, and it is a baseline above rather than something we argue around. The concern is that a network trained on rendered blur learns the renderer's kernel and resolves the front/back sign from scene semantics. Real-world blur appearance and texture-depth confusion are exactly where Repurposing Marigold shows learned metric models degrading. The test is direct. If the fine-tuned DepthCrafter matches us on real clips captured with lenses whose blur shapes are absent from training, the explicit solver is unnecessary, and we will say so.

Why not just run per-frame defocus depth and then a temporal stabilizer? NVDS+ (Neural Video Depth Stabilizer) fuses frames along optical flow. Video Depth-From-Defocus documents that flow breaks between frames focused at different distances. RollingDepth shows that smoothing after the fact cannot repair scale drift when frames do not share an affine fit. A stabilizer also smooths over sign flips rather than correcting them. We include DefocusNet followed by NVDS+ and report the rate of sign errors as well as flicker.

Why not just deblur first and run a sharp-video depth model? D²RF and the dynamic Gaussian splatting paper both report that 2D deblurring before reconstruction introduces temporal inconsistency. Deblurring also throws away the only signal that fixes metric scale. We include a deblur-then-DepthCrafter pipeline mainly to confirm that it remains scale-ambiguous.

Proposed Experiments

We evaluate in three stages of increasing realism. The first uses the Mobile Depth Dataset, whose focal stacks amount to focus-sweep videos from a static camera. This tests the solver against DefocusNet with metric MSE, and tests whether combining the blur fit with a relative depth model fills textureless regions. The second uses synthetic focus-varying Sintel renders that are held out from training renders by kernel family. There we measure AbsRel, RMSE, TAE, and the per-pixel sign error against ground truth, under controlled focus spread. This produces the identifiability curve, plotting metric error against the number and spread of distinct focus values. The third, and the decisive one, is a new capture of about fifty real phone clips with focus hunting and rack focus, paired with depth from a phone LiDAR sensor and with per-frame focus metadata. We will collect these clips because the file lists no real focus-varying video benchmark with ground-truth depth. The D²RF dataset and the Focal Split dynamic captures serve as secondary real tests where metadata permits.

The decisive checks are as follows. Metric error should drop sharply between the fixed-focus and two-focus conditions, as the identifiability argument predicts. Removing the temporal sign cue should raise both sign errors and TAE. If neither happens, the central mechanism is wrong. Finally, the method should beat the synthetically fine-tuned DepthCrafter on clips taken with lenses unseen in training. If it does not, the right conclusion is that learning blur end to end suffices.