Abstract
Whether to attract viewer attention to a particular object, give the impression of depth or simply reproduce human-like scene perception, shallow depth of field images are used extensively by professional and amateur photographers alike. To this end, high quality optical systems are used in DSLR cameras to focus on a specific depth plane while producing visually pleasing bokeh. We propose a physically motivated pipeline to mimic this effect from all-in-focus stereo images, typically retrieved by mobile cameras. It is capable to change the focal plane a posteriori at 76 FPS on KITTI images to enable real-time applications. As our portmanteau suggests, SteReFo interrelates stereo-based depth estimation and refocusing efficiently. In contrast to other approaches, our pipeline is simultaneously fully differentiable, physically motivated, and agnostic to scene content. It also enables computational video focus tracking for moving objects in addition to refocusing of static images. We evaluate our approach on the publicly available datasets SceneFlow, KITTI, CityScapes and quantify the quality of architectural changes.
Introduction
Professional photography often utilizes a shallow depth of field to isolate subjects, creating a soft background blur known as bokeh. While DSLR cameras achieve this through large sensors and wide apertures, mobile devices are physically constrained. Current "Portrait Mode" solutions often rely on monocular depth and segmentation masks, which frequently fail on complex boundaries or non-human subjects and lack physical accuracy.
SteReFo (Stereo Refocusing) addresses these limitations by providing a scene-agnostic, physically accurate, and computationally efficient pipeline. By leveraging stereo vision, the system can synthesize high-quality bokeh for any object in real-time, moving beyond the limitations of traditional heuristic-based mobile blur.
Methodology
The SteReFo pipeline is divided into two primary stages: Disparity Estimation and Layered Depth of Field (LDoF) Rendering.
- Disparity Estimation: Using a stereo pair, the system employs a deep neural network to generate a high-resolution disparity map, establishing the precise depth of every pixel in the scene.
- LDoF Rendering: The scene is decomposed into depth layers. Each layer is blurred independently based on its distance from a user-defined focal plane using a radial kernel that mimics real lens physics. These layers are then composited back together.
A key innovation is the pipeline's differentiability. By replacing discrete layer assignment logic with a smooth hyperbolic tangent ($tanh$) approximation, the entire system can be trained end-to-end. Furthermore, adaptive downsampling ensures efficiency; areas requiring heavy blur are processed at lower resolutions, allowing the system to maintain high frame rates without sacrificing visual quality.
Key Results and Insights
The authors evaluated SteReFo on benchmarks including SceneFlow, KITTI, and CityScapes. Several critical insights emerged:
- Depth Quality is Paramount: Direct supervision of the depth map ("Sequential Depth") proved superior to learning depth solely from the final refocused image. Accurate geometry is essential for realistic bokeh.
- Real-Time Performance: The pipeline achieves a processing speed of 76 FPS on KITTI images (using an NVIDIA GTX 1080 Ti), making it fast enough for interactive video applications.
- Versatility: Unlike segmentation-based methods, SteReFo is agnostic to scene content. It can refocus on any object—from a cyclist to a license plate—and supports automated focus tracking for moving subjects in video sequences.
Conclusion and Limitations
SteReFo demonstrates that DSLR-quality refocusing is achievable on mobile hardware through efficient stereo vision. However, challenges remain regarding thin structures (e.g., wires or mirrors) which can be lost during multi-scale processing. Additionally, occlusion artifacts can occur when the system lacks information about the background behind foreground objects. Future work may integrate semantic segmentation to further sharpen boundaries between focus regions.
Summary updated