DC2: Dual-Camera Defocus Control by Learning to Refocus

Hadi Alzayer, Abdullah Abuolaim, Leung Chun Chan, Yang Yang, Ying Chen Lou, Jia-Bin Huang, Abhishek Kar

Introduction

Modern smartphone photography has made significant strides in image quality, yet it remains physically constrained by fixed-aperture hardware. Unlike professional DSLR systems, where a mechanical iris allows photographers to adjust the depth-of-field (DoF) and focal plane, smartphones are generally limited to the optical properties of their small sensors. While "Portrait Mode" has successfully popularized synthetic bokeh (background blurring), it remains a unidirectional process: users can add blur, but they cannot easily remove it or shift the focus to a different subject after the shutter is pressed.

Existing software-based deblurring methods often struggle with "hallucination" artifacts, creating waxy textures when attempting to reconstruct details lost to optical blur. This paper introduces DC² (Dual-Camera Defocus Control), a framework that leverages the inherent hardware asymmetry of dual-camera systems (Wide and Ultra-wide) to provide professional-grade, post-capture refocusing and defocus control.

Leveraging Hardware Asymmetry

Most modern smartphones feature a multi-camera array. DC² utilizes the specific relationship between the primary Wide (W) lens and the secondary Ultra-wide (UW) lens:

  1. The Wide Image: Typically high resolution but characterized by a shallower DoF, meaning objects outside the focal plane are naturally blurred.
  2. The Ultra-wide Image: Often lower resolution but possesses a significantly deeper DoF, ensuring that a larger portion of the scene remains sharp.

By treating the Ultra-wide image as a "sharpness reference," the DC² system can extract high-frequency details that are physically absent in the blurred regions of the Wide image. This approach moves away from generative "guessing" and toward a data-driven fusion of available optical information.

Methodology: The Detail Fusion Network (DFNet)

The core of the DC² framework is the Detail Fusion Network (DFNet). The architecture is designed to process the W and UW images through separate refinement paths before merging them.

The "Learning to Refocus" Proxy Task

A significant challenge in training defocus models is the lack of ground-truth data for arbitrary focal shifts. The authors address this by framing the problem as a refocusing proxy task. Using "focus stacks" (sequences of images of the same scene with varying focal points), the model is trained to transform one image from the stack into another. This forces the network to learn the underlying physics of both deblurring (removing blur from a newly focused area) and reblurring (adding realistic bokeh to a newly defocused area) simultaneously.

Fusion and Blending

To integrate the two camera inputs, the DFNet employs Atrous Spatial Pyramid Pooling (ASPP). This module predicts pixel-wise blending masks that determine the optimal balance between the original Wide sensor data and the sharp details pulled from the Ultra-wide guide. This ensures that the final output maintains the high resolution of the primary sensor while benefiting from the depth-of-field information of the secondary sensor.

Experimental Results

The researchers curated the DC² Dataset, consisting of 100 focus stacks captured via a Google Pixel 6 Pro across diverse environments. The framework was evaluated against state-of-the-art (SoTA) methods across three primary tasks:

  • Defocus Deblurring: DC² achieved a PSNR of 24.79, outperforming the previous leading method, DRBNet (24.27). Qualitative results showed superior restoration of text and fine textures.
  • Bokeh Rendering: The system reached a PSNR of 29.78, a significant improvement over BokehMe (26.65), producing more realistic out-of-focus highlights.
  • Image Refocusing: In shifting the focal plane, the model achieved a PSNR of 28.58, proving more effective than pipelines that treat deblurring and reblurring as separate, disjointed steps.

Furthermore, the model demonstrated robust cross-hardware generalization. Despite being trained on Pixel 6 Pro data, it performed effectively on images from an iPhone 14 Pro without requiring additional fine-tuning, suggesting the learned optical principles are broadly applicable to mobile sensor architectures.

Limitations and Future Work

While DC² represents a leap forward in mobile defocus control, it is not without limitations. The system is dependent on the quality of pre-processing steps, such as optical flow for camera alignment and stereo depth estimation. Errors in these stages can lead to ghosting or alignment artifacts. Additionally, if an object is so extremely out of focus that it appears blurred even on the Ultra-wide sensor, the model lacks a sharp reference to utilize.

Future iterations may explore the integration of additional sensors, such as telephoto lenses, to further refine scene depth modeling and extend the range of professional-grade defocus effects available to smartphone users.

Summary updated

BibTeX
@inproceedings{alzayer2023dc,
  author = {Hadi Alzayer and Abdullah Abuolaim and Leung Chun Chan and Yang Yang and Ying Chen Lou and Jia-Bin Huang and Abhishek Kar},
  title = {{DC2: Dual-Camera Defocus Control by Learning to Refocus}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure