Abstract
Post-capture refocusing—the ability to adjust the focus of an image after acquisition—is a fundamental task in computational photography. Traditional methods often struggle with artifacts at depth edges and focus ambiguity. This paper introduces a geometrically grounded framework for refocusing using focal stacks. By leveraging a Composite Focus Measure (cFM) derived from unsupervised clustering and a compact scene representation that explicitly models occlusions and dual-focus pixels, we achieve high-fidelity refocusing. Our method yields an average reconstruction PSNR of 41.2 dB and preserves fine details like cinematic bokeh.
Introduction
Modern "Portrait Mode" features frequently produce artifacts around complex edges, such as hair or foreground objects. These issues arise because refocusing is often treated as a simple blurring operation rather than a geometric problem. Accurate refocusing must address three primary challenges: focus ambiguity (difficulty in identifying the sharpest pixel), depth edge occlusions (where a pixel receives light from multiple depths), and the unique behavior of saturated highlights (bokeh). We propose a framework that treats refocusing as a geometric reconstruction task to overcome these limitations.
Methodology
Composite Focus Measure (cFM)
A critical step in refocusing is determining the in-focus depth for every pixel. Relying on a single focus measure, such as the Laplacian, is often insufficient due to inherent failure modes in different scene textures. To improve robustness, we analyzed 39 distinct focus measures. Using unsupervised clustering, we identified a subset of measures that exhibit high consensus on focus peaks but low mutual correlation. This ensures that the combined measure is less likely to fail simultaneously across different image regions.
Compact Scene Representation
To avoid the storage overhead of full focal stacks, we compress the scene into a compact representation consisting of:
- In-focus Intensity ($F_{\mathcal{I}}$): The estimated sharp color of each pixel.
- Dual-Focus Map ($I_d$): A map identifying pixels at depth boundaries that may be partially in focus at two different depths.
- Bokeh Mask ($B$): A mask for saturated light sources requiring specialized rendering.
- Defocus Kernels ($\Pi$): A calibrated model of the spatially varying point spread function (PSF).
Geometrically Correct Refocusing
The rendering process is modeled as a "splatting" operation, distributing radiance from source points to the target sensor based on thin-lens geometry. We introduce an occlusion coefficient ($\beta$) to geometrically restrict light distribution. This prevents background blur from "bleeding" into foreground objects, a common artifact in alpha-blending approaches.
Evaluation and Results
The proposed framework was evaluated on a comprehensive dataset of 320 focal stacks, including 100 from the Light-Field Saliency Dataset, 80 from the Autofocus Dataset, and 140 custom stacks captured with various DSLRs and mobile devices.
Quantitatively, the method achieved an average PSNR of 41.2 dB when reconstructing original focal slices. Qualitatively, the geometric model significantly outperformed standard filtering techniques in edge preservation and bokeh realism. The occlusion coefficient effectively handled complex boundaries, ensuring that background light did not interfere with foreground sharpness.
Conclusion
Geometric Scene Refocusing moves beyond simple image filters by modeling the underlying physics of light transport in a camera. By combining robust focus measurement with a geometric rendering pipeline, we achieve state-of-the-art results in post-capture focus manipulation. Future work includes extending this model to dynamic scenes and integrating more complex, asymmetric lens PSFs.
Summary updated