Point-and-Shoot All-in-Focus Photo Synthesis from Smartphone Camera Pair

Xianrui Luo, Juewen Peng, Weiyue Zhao, Ke Xian, Hao Lu, Zhiguo Cao

Smartphone photography often faces a fundamental physical limitation: the trade-off between aperture size and depth-of-field (DOF). While professional cameras can "stop down" their aperture to ensure everything from the foreground to the background is sharp, smartphone cameras typically have fixed apertures. This results in a shallow DOF, where focusing on a nearby object inevitably blurs the background—a phenomenon known as defocus blur or "bokeh."

Traditional solutions like focal stacking require capturing a sequence of images at different focus distances and merging them. However, this method is prone to failure if the subject moves or if the photographer lacks a tripod. This paper introduces EasyAIF, a novel framework that leverages the existing multi-camera hardware on modern smartphones to synthesize an All-in-Focus (AIF) image in a single shot.

The EasyAIF Framework

The core innovation of EasyAIF lies in utilizing the ultra-wide camera as a reference. Because ultra-wide lenses have shorter focal lengths and smaller apertures, they possess a naturally deep DOF, keeping almost the entire scene sharp. The challenge is that the main and ultra-wide cameras differ significantly in perspective (parallax), color reproduction, and resolution.

EasyAIF addresses these challenges through three specialized modules:

  1. Spatial Alignment: The system uses a two-stage process to align the images. It first applies Homography warping for global alignment, followed by Optical Flow warping (using the RAFT architecture) to achieve pixel-level precision, accounting for the parallax caused by the physical distance between the two sensors.
  2. Wavelet-Based Dynamic Color Alignment (WDC-Net): To match the color and brightness of the ultra-wide reference to the high-quality main camera, the researchers employed a Discrete Wavelet Transform (DWT). By applying dynamic convolutions in the low-frequency domain, the network adapts its color correction logic to the specific lighting conditions of each shot.
  3. Occlusion-Aware Synthesis (OAS-Net): This module handles the final fusion. It uses an encoder-decoder structure with DWT and deformable convolutions to predict a fusion mask, carefully blending sharp details from the ultra-wide image into the defocused regions of the main image while managing areas where one camera's view is occluded.

Dataset and Training

To train and evaluate the model, the authors created a comprehensive AIF dataset consisting of 2,686 unique indoor and outdoor scenes. Each entry includes a foreground-focused main image, a background-focused main image, an ultra-wide image, and a ground-truth AIF image synthesized from the two main images. To test the model's robustness, the researchers also collected a 120-image test set using an iPhone 13, demonstrating that the model generalizes well across different hardware manufacturers.

Results and Performance

EasyAIF demonstrates significant improvements over existing single-image deblurring and dual-camera super-resolution methods. Quantitatively, it achieved a PSNR of 28.16, outperforming state-of-the-art models like Restormer and DCSR.

Figure 4: Comparison between a standard main camera shot and the EasyAIF synthesized result. The top half shows the main camera's shallow DOF (blurry background monitor), while the bottom half shows the synthesized All-in-Focus result where both foreground and background are sharp.

Qualitatively, the system excels at restoring crisp textures—such as text on a screen or fine details in an illustration—that are typically lost to defocus blur. The total processing time is approximately 1.59 seconds on a modern mobile GPU, making it a viable solution for a seamless "point-and-shoot" user experience.

Conclusion

EasyAIF represents a significant step forward in mobile computational photography. By treating the ultra-wide camera as a "free" sharpness reference rather than just a secondary lens, the framework enables high-quality, all-in-focus photography without the constraints of traditional focal stacking. Future work will focus on refining object boundaries in cases of extreme parallax and improving color consistency in challenging lighting environments.

Summary updated

BibTeX
@article{luo2023point,
  author = {Xianrui Luo and Juewen Peng and Weiyue Zhao and Ke Xian and Hao Lu and Zhiguo Cao},
  title = {{Point-and-Shoot All-in-Focus Photo Synthesis from Smartphone Camera Pair}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2023},
}
Figure