Abstract
In cinema, large camera lenses create beautiful shallow depth of field (DOF), but make focusing difficult and expensive. Accurate cinema focus usually relies on a script and a person to control focus in realtime. Casual videographers often crave cinematic focus, but fail to achieve it. We either sacrifice shallow DOF, as in smartphone videos; or we struggle to deliver accurate focus, as in videos from larger cameras. This paper presents a new approach to cinematic focus for casual videography. We present a system that synthetically renders refocusable video from a deep DOF video shot with a smartphone and analyzes future video frames to deliver context-aware autofocus for the current frame. To create refocusable video, we extend recent machine learning methods designed for still photography, contributing a new dataset for machine training, a rendering model better suited to cinema focus, and a filtering solution for temporal coherence. To choose focus accurately for each frame, we demonstrate autofocus that looks at upcoming video frames and applies AI-assist modules such as motion, face, audio, and saliency detection. We deliver, for example, a shallow DOF video where the autofocus transitions onto each person before she begins to speak—a feat impossible for conventional reactive camera autofocus.
Introduction
Professional cinematography utilizes shallow depth of field (DOF) to isolate subjects and guide the viewer's narrative attention. Achieving this effect traditionally requires large sensors, expensive lenses, and a dedicated "focus puller" to manually adjust focus in real-time. Casual videographers using smartphones face two primary hurdles: hardware limitations that result in a "deep" DOF where everything is in focus, and reactive autofocus systems that adjust focus only after a subject moves or speaks. This leads to distracting "focus hunting" or lagging transitions. Our system addresses these by shifting focus control from a reactive hardware task to a proactive post-processing or buffered task.
Methods
Our framework consists of two primary components: Refocusable Video Rendering (RVR) and Look-Ahead Autofocus (LAAF).
Refocusable Video Rendering (RVR)
To transform standard deep-DOF video into a cinematic output, the RVR pipeline estimates depth and renders synthetic blur. Key innovations include:
- HDR Recovery: Standard 8-bit video often clips bright highlights. We utilize a neural network to recover High Dynamic Range (HDR) data, which is essential for rendering realistic "bokeh balls" (bright, circular out-of-focus highlights).
- Occlusion-Aware Rendering: We implement a back-to-front rendering model to prevent background blur from "bleeding" into foreground subjects, maintaining sharp edges.
- Temporal Stabilization: To eliminate flickering caused by frame-by-frame depth estimation, we employ optical flow and occlusion-aware temporal filtering.
Look-Ahead Autofocus (LAAF)
LAAF acts as the system's "brain." By analyzing future frames, the algorithm can execute proactive focus pulls. The system integrates several AI-assist modules:
- Contextual Detection: Face detection, audio localization (identifying upcoming speakers), and saliency/motion detection identify new focus targets.
- AF-Net: A data-driven CNN trained on our new VAF (Video Autofocus) dataset to predict optimal focus regions and the probability of a focus shift across a wide temporal window.
Datasets
We introduced several datasets to support this work:
- Large-Scale Aperture Dataset: 1.2K image pairs and 0.8K triplets (f/2, f/8, f/22) for training depth and HDR estimators.
- VAF Dataset: 419 high-quality videos annotated with ground-truth focus targets using a custom GUI.
- DHF1K: An eye-tracking dataset used as a proxy for focus region prediction.
Results and Evaluation
Our RVR system achieved disparity estimation accuracy comparable to state-of-the-art models like MegaDepth, despite lacking direct depth supervision. Qualitatively, the LAAF system successfully transitioned focus to speakers before they began talking in 72% of test cases.
When compared to high-end hardware like the Olympus EM1.2, our LAAF system demonstrated superior tracking and smoother transitions during rapid subject changes, where the physical camera often lagged or failed to shift focus entirely.
Conclusion
By combining synthetic defocus with look-ahead analysis, we bring professional cinematic focus capabilities to casual smartphone videography. The ability to "see the future" allows our system to mimic the artistic intent of a human focus puller. Future work will focus on reducing edge artifacts and exploring self-supervised learning from professional cinema to further automate the artistic decision-making process.
Summary updated