Abstract
Existing depth-from-focus methods can struggle with weak focus cues, new cameras, or fewer focal slices. We present FocusAnchor, a recurrent model that uses focus-volume lookups to refine metric depth and repeatedly aligns a relative depth prior from a frozen foundation model to the current depth estimate. The aligned prior guides subsequent refinement in a feedback loop, carrying metric scale recovered from textured regions into regions where focus cues are weak while preserving scene structure. To support transfer across cameras, we synthesize training stacks with randomized camera parameters and focus distances. However, stack synthesis blurs existing image noise differently across slices, creating artificial depth cues even on textureless surfaces. We add independent per-slice noise to suppress these cues. We also introduce variable-stack training to improve robustness with fewer focal slices and support more practical mobile capture. Compared with FOSSA ViT-B, FocusAnchor reduces AbsRel by 36% on NYU Depth V2 and by 9% on DDFF-12 after fine-tuning. In zero-shot evaluation, FocusAnchor and its variable-stack variant, FocusAnchor-flex, achieve the two lowest AbsRel values on all five benchmarks. On ZEDD test, FocusAnchor achieves 9% lower AbsRel than the best competing method FOSSA ViT-B, while FocusAnchor-flex achieves lower AbsRel with 40% fewer focal slices on ZEDD validation.
Method

- Focus volume. A CNN encodes every slice. 3D convolutions along the stack turn the features into a focus volume that scores sharpness for each pixel and slice. The focus distances are known, so the volume carries metric depth.
- Prior alignment. A frozen Depth Anything V2 predicts relative inverse depth from the all-in-focus image. Before each step, the prior is aligned to the current estimate with a confidence-weighted local scale and shift. This carries metric scale from textured regions into regions where focus cues are weak.
- Recurrent refinement. A ConvGRU first rescales the estimate in a scale stage. A step stage then reads the focus volume around the estimate and moves it along the plane index, guided by the aligned prior.
- Robust training. Training stacks use randomized cameras and focus distances. Independent per-slice noise removes an artificial depth cue that stack synthesis creates on textureless surfaces. Variable-stack training supports two to five slices (FocusAnchor-flex).
Samples
Drag the divider to compare. Click a thumbnail to show it on the right. All depth maps of a scene share one color scale. Relative error is |prediction - ground truth| / ground truth, clipped at 0.3.
Drag to rotate. Scroll or pinch to zoom. Right-drag or shift-drag to pan. Double-click to reset. Surfaces are built from the predicted metric depth and the camera intrinsics of each dataset, restricted to pixels with ground truth. Edge cutoff hides triangles that span a large depth jump.
FocusAnchor starts from the single-image prior scaled to the focus range (T = 0). The scale stage ends at T = 4. The default is T = 16. Numbers are per-image AbsRel at the full resolution of the benchmark.
Zero-shot results
Metric depth on five benchmarks. FocusAnchor was trained on NYU Depth V2 only. Best is bold, second best is underlined. ZEDD shows test / validation, ranked separately.
Values are copied from the paper. ZEDD test and Infinigen numbers of prior methods are from the FOSSA paper, except for methods marked with * and our models. All ZEDD validation and ARKitScenes results are our own evaluations.