DoF-NeRF: Depth-of-Field Meets Neural Radiance Fields

Zijin Wu, Xingyi Li, Juewen Peng, Hao Lu, Zhiguo Cao, Weicai Zhong · DOI

Abstract

Standard Neural Radiance Fields (NeRF) assume a pinhole camera model where every pixel is perfectly in focus. However, real-world photography often utilizes wide apertures to create a shallow depth-of-field (DoF), resulting in a "bokeh" effect where only specific planes are sharp. When trained on such images, standard NeRF models struggle, often incorrectly representing blur as part of the 3D geometry or texture. This paper introduces DoF-NeRF, an extension to the NeRF framework that explicitly models the physics of geometric optics. By treating aperture and focus as learnable parameters and utilizing a novel "Concentrate-and-Scatter" rendering approach, DoF-NeRF can reconstruct sharp 3D scenes from blurry inputs and enable post-capture control over focus and bokeh effects.

Introduction

The success of Neural Radiance Fields (NeRF) has revolutionized novel view synthesis, yet its reliance on the ideal pinhole camera model remains a significant limitation. In professional photography and consumer mobile imaging, shallow depth-of-field is a common aesthetic choice. In these scenarios, light rays passing through a lens converge at a specific focal plane; objects outside this plane appear as blurred disks known as the Circle of Confusion (CoC).

When standard NeRF is applied to images with shallow DoF, it attempts to minimize photometric loss by embedding the blur into the scene's radiance field. This results in "cloudy" or "ghosting" artifacts in the reconstructed geometry. DoF-NeRF addresses this by incorporating a differentiable lens model into the volume rendering pipeline, allowing the system to disentangle the scene's true radiance from the optical effects of the camera.

Methodology

DoF-NeRF modifies the standard volume rendering equation to account for the physical process of light scattering through a lens.

Explicit Aperture Modeling

Rather than assuming fixed camera settings, the authors treat aperture size ($K$) and focus distance ($F$) as learnable parameters for each training view. This allows the model to optimize the camera's optical state alongside the scene geometry. By making these parameters differentiable, the model can backpropagate errors through the blur, effectively "learning" how the lens was configured during the capture of each image.

Concentrate-and-Scatter Rendering

Simulating depth-of-field traditionally requires distributed ray tracing—sampling multiple rays per pixel—which is computationally prohibitive for NeRF. To maintain efficiency, the authors propose a Concentrate-and-Scatter method:

  1. Concentrate: The model calculates the emitted radiance along a single ray, concentrating it at a specific depth.
  2. Scatter: This radiance is then "scattered" across a Circle of Confusion (CoC) on the imaging plane based on the learned aperture and focus parameters.

This approximation allows the model to simulate physical blur with minimal computational overhead, increasing training time by only ~3.8% and rendering time by ~0.6% compared to standard NeRF.

Optimization Strategy

To ensure stable convergence, the authors implement a Patch-based Ray Selection strategy. Instead of sampling random pixels, the model selects local patches to ensure that neighboring radiance information is available to calculate the scattering effect. Furthermore, a Two-Stage Optimization is employed: the model first establishes coarse geometry using a pinhole assumption before switching to the full DoF-NeRF model to refine the scene and lens parameters.

Evaluation

The method was evaluated on two primary datasets:

  • Real-World Dataset: Seven scenes (e.g., amiya, camera, plant) containing image triplets with varying focus points and apertures.
  • Synthetic Dataset: Derived from the Real Forward-Facing (LLFF) dataset with synthetic bokeh applied via depth estimation and rendering frameworks.

Key Results

DoF-NeRF demonstrates significant improvements in both reconstruction quality and flexibility:

  • Superior Fidelity: In the "camera" scene, DoF-NeRF improved PSNR from 25.59 (vanilla NeRF) to 27.71. It successfully removes the "cloudy" artifacts typical of standard NeRF on blurry data.
  • All-in-Focus Synthesis: The model can synthesize completely sharp novel views from a set of blurry training images, effectively performing 3D deblurring.
  • Post-Capture Control: Because the geometry is decoupled from the lens effects, users can manipulate the virtual aperture, shift the focus point, or even alter the bokeh shape (e.g., circular to hexagonal) during inference.

Discussion and Limitations

While DoF-NeRF significantly advances the handling of real-world optical effects in neural rendering, it relies on a simplified thin-lens assumption. It does not currently account for complex phenomena such as lens aberrations, vignetting, or radial distortion. Additionally, the "Concentrate-and-Scatter" approximation assumes that radiance originates from a narrow depth interval, which may pose challenges for highly transparent or complex volumetric media like smoke.

Future work may involve integrating more complex lens models and improving the robustness of the joint optimization to eliminate the need for a two-stage training process. Despite these limitations, DoF-NeRF provides a robust framework for bringing the flexibility of physical photography to the world of neural scene representation.

Summary updated

BibTeX
@inproceedings{wu2022dof,
  author = {Zijin Wu and Xingyi Li and Juewen Peng and Hao Lu and Zhiguo Cao and Weicai Zhong},
  title = {{DoF-NeRF: Depth-of-Field Meets Neural Radiance Fields}},
  booktitle = {ACM Multimedia},
  year = {2022},
  doi = {10.1145/3503161.3548088},
}
Figure