Noise Robust Depth from Focus Using a Ring Difference Filter

Jaeheung Surh, Hae-Gon Jeon, Yunwon Park, Sunghoon Im, Hyowon Ha, In So Kweon

Abstract

Depth from Focus (DfF) offers a compelling alternative to active depth sensors by estimating 3D structure from focal sweeps. However, DfF typically struggles with sensor noise, where local focus measures are overly sensitive and non-local measures blur fine details. This paper introduces the Ring Difference Filter (RDF), a novel focus measure that utilizes a "ring-and-disk" geometry to achieve exceptional noise robustness. By ignoring redundant immediate neighbors and focusing on informative gradients, the RDF provides high-confidence depth anchors. When integrated into an efficient pipeline featuring global alignment and tree-based cost aggregation, the method reduces computation time from twenty minutes to under seven seconds while maintaining superior detail in noisy conditions.

Introduction: The Noise Challenge in DfF

Depth from Focus (DfF) estimates a scene's 3D structure by analyzing how pixel sharpness changes as a camera shifts its focal plane. While advantageous for mobile devices due to its lack of specialized hardware requirements, DfF is plagued by a "noise problem." Traditional Focus Measures (FMs) generally fall into two categories: local methods (like the Laplacian), which are precise but highly sensitive to sensor grain, and non-local methods, which are robust but often blur fine structural details.

Figure 1: Focal stack input and detailed regions highlighting the challenges of noise and focus estimation in real-world scenes.

The goal of this research is to bridge this gap, creating a focus measure that operates reliably on noisy mobile phone sensors without sacrificing the sharp edges necessary for high-quality depth maps.

Methodology: The Ring Difference Filter

The core innovation is the Ring Difference Filter (RDF). Unlike standard filters that examine immediate neighbors, the RDF employs a specific three-part geometry:

  1. The Disk: A central region of interest (ROI).
  2. The Gap: A "dead zone" immediately surrounding the disk.
  3. The Ring: An outer band of pixels.

The RDF calculates focus by finding the difference between the average value of the central disk and the outer ring, intentionally ignoring the "gap" pixels. This design is based on the insight that pixels immediately adjacent to a point are often redundant. By skipping them, the filter captures more informative gradients, allowing it to suppress noise through averaging while maintaining high confidence at edges.

The DfF Pipeline

The authors propose a comprehensive pipeline to support the RDF:

  • Global Homography Alignment: Compensates for camera movement and lens magnification changes during the focal sweep.
  • Initial Depth Acquisition: Uses the RDF to construct a "cost volume" of focus scores.
  • Cost Aggregation: Employs a tree-based method to propagate confident depth labels from edges into smooth regions.
  • Unreliable Depth Rejection: A two-step masking process using Median Absolute Deviation (MAD) and an intensity-based mask to handle "bokeh" artifacts caused by out-of-focus highlights.

Key Results and Discussion

The RDF-based pipeline demonstrates significant improvements in both robustness and efficiency. In high-noise environments (sigma = 0.02), the RDF maintains a "Bad Pixel Ratio" of approximately 13.9%, whereas traditional methods like the Modified Laplacian (LAP) see error rates climb toward 50%.

Figure 6: Qualitative results showing the estimated depth map (left) alongside the original color image (right). Note the preservation of fine details and smooth surfaces.

Furthermore, the pipeline is remarkably fast. While previous state-of-the-art methods required roughly 20 minutes to process a 25-image stack, this approach achieves superior results in just 6.7 seconds. Qualitatively, the depth maps exhibit significantly finer detail in thin structures, such as hair or petals, compared to existing non-local measures.

Conclusion and Future Work

The Ring Difference Filter successfully addresses the trade-off between noise robustness and detail preservation in DfF. By prioritizing high-confidence "anchor" pixels, the method provides a stable foundation for depth estimation. Future research will focus on reducing color dependency in the refinement step, addressing depth quantization through photometric cues, and integrating semantic information to resolve ambiguities in complex scenes.

Summary updated

BibTeX
@inproceedings{surh2017noise,
  author = {Jaeheung Surh and Hae-Gon Jeon and Yunwon Park and Sunghoon Im and Hyowon Ha and In So Kweon},
  title = {{Noise Robust Depth from Focus Using a Ring Difference Filter}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  doi = {10.1109/cvpr.2017.262},
}
Figure