Command Palette
Search for a command to run...
التركيز التلقائي المتباين مكانياً
التركيز التلقائي المتباين مكانياً
Yingsi Qin Aswin C. Sankaranarayanan Matthew O'Toole
الملخص
تُوفِّر العدسة مستوى تركيز واحدًا على مستشعر مسطح؛ ومن ثمَّ فإنَّ أجزاء المشهد الواقعة خارج مستوى التركيز المستوي هذا تُلتقَط في حالة انحراف عن التركيز. هل يمكن كسر هذا المبدأ بتمكين "عدسة" قادرة على تغيير عمق مجالها بشكل اعتباطي؟ تبحث هذه الدراسة في تصميم وتنفيذ عدسة حاسوبية ذات تركيز انتقائي مكاني. يعتمد تصميمنا على ترتيب بصري يتكوّن من عدسة لومان ومُعدِّل ضوء مكاني يعمل على الطور فقط، بما يتيح لكل بكسل التركيز على عمق مختلف. نوسِّع تقنيات التركيز التلقائي الكلاسيكية لتشمل السيناريو المتباين مكانياً، حيث تُقدَّر خريطة العمق تكرارياً باستخدام مؤشِّرات التباين والإزاحة المجسّمة، مما يمكِّن الكاميرا من تشكيل عمق مجالها تدريجياً ليتوافق مع عمق المشهد. ومن خلال الحصول على صورة شاملة التركيز بصرياً، تتقدَّم تقنيتنا على الأعمال السابقة في جانبين جوهريين: القدرة على إحضار مشهد بأكمله إلى التركيز في آنٍ واحد، والقدرة على الحفاظ على أعلى دقة مكانية ممكنة.
One-sentence Summary
Carnegie Mellon University presents a computational lens combining a Lohmann lens with a phase-only spatial light modulator that allows each pixel to focus at a different depth, and extends classical autofocusing to iteratively estimate the scene depth map using contrast and disparity cues, thereby achieving all-in-focus imaging optically while maintaining maximum spatial resolution.
Key Contributions
-
A spatially selective computational lens is introduced that uses a Lohmann lens and a phase-only spatial light modulator to let each sensor pixel focus at a different depth. This arrangement optically forms an all-in-focus image on the sensor.
-
Passive autofocus based on contrast detection and phase detection is extended to spatially varying imaging, where a scene depth map is iteratively estimated from contrast and disparity cues to shape the depth of field to scene geometry.
-
The method avoids dense focal-stack captures and forms all-in-focus images without computational post-processing. It preserves higher spatial resolution than light-field methods that trade spatial resolution for angular sampling.
Introduction
In imaging systems, a lens can normally focus only one planar region of a scene, so points above or below that plane become increasingly blurred. This matters for applications such as surveillance, machine vision, and microscopy, where detailed focus across objects at different depths is valuable. Prior approaches face tradeoffs: smaller apertures increase depth of field but reduce light and introduce diffractive blur, while methods such as focus stacking, coded apertures, light fields, or postprocessing-based refocusing require computational reconstruction, large image sets, or loss of spatial resolution. The authors leverage a programmable computational lens adapted from a Lohmann lens design and a phase-only spatial light modulator to shape a spatially varying focal surface. Their main contribution is an optical all-in-focus imaging method that can bring non-planar scenes into focus on the sensor without computational postprocessing, supported by spatially varying contrast and phase autofocus techniques that can recover depth and focus with as few as two images.
Method
The authors build a Split-Lohmann computational lens that gives a camera spatially varying focus control rather than relying on a single global focal length. The optical core is derived from a Lohmann or Alvarez lens, which consists of two cubic phase plates. If the plate profiles are h1(x)=κx3 and h2(x)=−κx3, stacking them with a lateral offset Δ produces a combined phase modulation of
h1(x+Δ)+h2(x−Δ)=κ(6Δx2+2Δ3).The term 2Δ3 is constant with respect to x, so the remaining quadratic phase acts like a lens whose focal length is inversely proportional to Δ. The authors remove the mechanical translation step by replacing the relative movement of the plates with a programmable phase ramp placed at a Fourier plane. The slope of that phase ramp controls the effective focal length. For camera use, the authors invert the display formulation by replacing the OLED with a camera sensor and adding a camera lens. When the sensor is optically collocated with a spatial light modulator, displaying different phase ramp slopes across regions defines different local focal settings. Refer to the framework diagram.
To program the lens for all in focus imaging, the authors solve a spatially varying autofocus problem. In the contrast based module, each local region is treated as an independent autofocus task. Contrast is used as the focus metric because a patch reaches maximum contrast when it is near its correct focus setting. The authors assume the full working range is from 0 to W diopters. At each search iteration, they capture three measurements at W/4, W/2, and 3W/4, estimate local contrast for each patch, and keep the half interval that contains the strongest contrast. This ternary, range halving search is applied independently and in parallel across image regions. The patching is performed with superpixel segmentation using SLIC, because depth edges often align with texture edges and superpixels tend to avoid crossing large depth discontinuities. Superpixels are updated after each iteration as sharper captured images improve segmentation. When an updated superpixel contains pixels assigned to different depths during the search, the module assigns the most common contrast maximizing depth. As shown in the figure below, this produces a progressively refined per region focus or depth map.
The authors also design a phase based autofocus module that uses a dual pixel sensor. Such a sensor contains photodiodes beneath each microlens that observe light through different parts of the aperture, producing a stereo like pair. The disparity between the two views indicates the signed distance from the current focal plane. A point that is sharply focused produces no disparity, while a point focused in front of or behind the sensor produces a directional disparity. The authors estimate this signed disparity by adapting a conjugate gradient based optical flow solver. The resulting magnitude and direction of optical flow give the focus correction needed for each region. Depth boundaries create a special challenge because horizontal disparity is associated with vertical gradients, making it difficult to assign the correct shift to each side of a boundary using only local context. To address this, the authors segment the dual pixel image into semantically meaningful layers, compute masked optical flow within each layer independently, and sum the layer flows into a global flow map. This flow map then updates the focus settings and triggers another capture. Refer to the phase based pipeline shown in the figure below.
Experiment
The experiments evaluate a prototype spatially-varying autofocus system built around a dual-pixel camera, a phase-only spatial light modulator, and a custom cubic phase plate, with validation through point spread function measurements, all-in-focus imaging, freeform depth-of-field control, and spatial resolution analysis. The results show that the system can produce freeform focus effects such as tilt-shift-like imaging, selective focus on isolated depth regions, and optical suppression of thin structures. For all-in-focus results, phase-based autofocus provides the most reliable performance, followed by contrast-based autofocus and focal-stack methods, while focal sweep shows consistently lower spatial resolution based on modulation transfer function comparisons.
The comparison distinguishes optical all-in-focus imaging from methods that achieve extended depth of field through small apertures, intentionally blurred captures, or computational reconstruction. The proposed approach forms all-in-focus images optically while retaining a large aperture, needing at least one image to estimate scene geometry and another image for the final capture. This design supports dynamic scenes and can provide depth as a byproduct. Compared methods often reduce sharpness by using small apertures or by introducing depth-invariant blur. Focal stacks can produce high all-in-focus quality, but they require many captures rather than a small number of images. Phase-based autofocus is reported as the strongest captured-result method, with focal sweep showing lower modulation transfer function performance.
The experiments compare optical all-in-focus imaging with methods that rely on small apertures, artificial blur, computational reconstruction, or dense captures. The proposed method is shown to produce all-in-focus results optically while retaining a large aperture and using only a few captures, enabling dynamic scenes and auxiliary depth estimation. The compared approaches either sacrifice sharpness or require many frames, while phase-based autofocus performs best among captured-result baselines and focal sweep yields weaker image quality.