Depth of Field. Light field cameras
Frédo Durand
MIT EECS
Light fields and plenoptic cameras
•Each pixel is the integral of many light rays across the aperture
•Which rays are integrated at which pixel changes the focus
•Idea: capture rays, not pixels
Focusing and defocus
lens
focal
plane
Plenoptic/light field cameras
•Different goals
-reproduce 3D impression
-enable refocusing
-do computer vision
Plenoptic/light field cameras
•Lipmann 1908
–"Window to the world"
•Adelson and Wang, 1992
–Depth computation
•Revisited by Ng et al. for refocusing
–turned into Lytro
Light fields
•Capture all rays reaching the lens
•4D:
-2D for lens aperture
-2D for focal plane (or any other plane)
For a camera
lens
focal
plane
•Same on the image side
•4D:
-2D for lens aperture
-2D for sensor
For a camera: conjugate
lens
focal
plane
Two-plane parameterization
•Line parameterized by intersection with 2 planes
–Careful, there are different "isotopes" of such parameterization (slightly different meaning of stuv)
•2D slices
-constant u, v: regular pinhole images from different aperture points
-constant x, y: aperture view
-how much the color of a point on the focal plane varies with angle (but depends on depth)
Understanding 4D
lens
focal
plane
u,v
s, t (or y, x)
lens
focal
plane
u,v
s, t (or y, x)
Cool visualization
From Gortler et al.
Demo light field viewer
Light field cameras
Plenoptic/light field cameras
✦[Lipmann 1908, Adelson and Wang, 1992, Ng et al. 06]
✦Record 4D set of rays
•using microlens array in front of sensor
Main lens
microlenses
aperture
sub-image
Plenoptic camera
•For depth extraction
MIT version
•Jason Yang
Bullet time
Robotic Camera
Image Leonard McMillan
Image Levoy et al.
Flatbed scanner camera
•By Jason Yang
Hand-Held Light Field Camera
Medium format digital camera
Camera in-use
16 megapixel sensor
Microlens array
Slide by Ren Ng.
New version: Lytro
•hexagonal microlens array
Plenoptic camera refocusing
Conventional Photograph
Slide by Ren Ng.
Light Field Photography
•Capture the light field inside the camera body
Slide by Ren Ng.
Hand-Held Light Field Camera
Medium format digital camera
Camera in-use
16 megapixel sensor
Microlens array
Slide by Ren Ng.
New version: Lytro
•hexagonal microlens array
Light Field in a Single Exposure
Slide by Ren Ng.
Light Field in a Single Exposure
Slide by Ren Ng.
Light Field Inside the Camera Body
Slide by Ren Ng.
Recap & Questions?
✦Record 4D set of rays
•using microlens array in front of sensor
Main lens
microlenses
aperture
sub-image
Reconstructing a normal image
✦Just integrate all the pixels in an aperture sub-image
Main lens
microlenses
aperture
sub-image
Stopping down the lens
✦Just integrate the pixels only in the center of an aperture sub-image
Main lens
microlenses
aperture
sub-image
Digitally stopping-down
stopping down  =  summing only the central portion of each microlens
Σ
Σ
Changing the viewpoint
•Just take one given pixel in each aperture sub-image
–Viewpoint limited to the lens aperture
Digital Refocusing by Ray-Tracing
Lens
Sensor
u
x
Slide by Ren Ng.
We have all the light rays
We can generate any virtual view
Digital Refocusing by Ray-Tracing
Lens
original
Sensor
u
new virtual
sensor
x
Slide by Ren Ng.
Digital Refocusing by Ray-Tracing
Lens
u
x
Slide by Ren Ng.
original
Sensor
new virtual
sensor
For each pixel of the new view
Integrate light rays
from different original
aperture images
Digital Refocusing by Ray-Tracing
Lens
Sensor
u
x
Imaginary film
Slide by Ren Ng.
Digital Refocusing by Ray-Tracing
Lens
Sensor
u
x
Imaginary film
Slide by Ren Ng.
Digital Refocusing
Slide by Ren Ng.
Digital Refocusing
Slide by Ren Ng.
Light Field Refocusing in Practice
lens
recorded
Digital Refocusing by Ray-Tracing
Let’s see where different aperture locations get reprojected
Lens
u
x
original
Sensor
new virtual
sensor
Digital Refocusing by Ray-Tracing
Let’s see where different aperture locations get reprojected
Similar triangles:
The rays from u1 are shifted with respect to the rays from u0 by the same amount
This amount is proportional to ||u1u0||
Lens
u
x
original
Sensor
new virtual
sensor
d
d
u1
u0
Algorithm
•For all aperture locations u, v in [-1, 1]
–translate image along y, x by ku, kv
–add to final image
•Note: we ignore a scale factor (recall, field of view changes with refocusing)
Lens
u
x
original
Sensor
new virtual
sensor
d
d
u1
u0
Input light field
•Yes, the focal stack was synthetic!
Input light field
Input light field
Aperture images are square because it’s captured with a a robotics rig
Epipolar slices
•y, v = constant
Results
Results
Results
Results
Results
Results
More results
More results
Epipolar slice
More results
More results
More results
More results
More results
Focal stack & plenoptic camera
Light Field Photography with a Hand-Held Plenoptic Camera, Ren Ng, Marc Levoy, Mathieu Brédif, Gene Duval, Mark Horowitz, Pat Hanrahan
•See next time
•Capture light field
•Refocus to create focal stack
•Use photomontage to
generate all-focus image
Focal stack & plenoptic camera
Autofocus
Phase detection focusing
•Used e.g. in SLRs
From The Manual of Photography
From the Canon red book
Phase detection focusing
•Stereo vision from two portions of the lens on the periphery
•Not at the equivalent
film plane but farther
can distinguish
too far and too close
•Look at the phase
difference between
the two images
From The Manual of Photography
In focus
Too close
Too far
Detector
phase
Optical aberration correction
Fredo’s vision
Practical matters
Do you lose all that resolution?
•It’s complicated
Can you do video
•Bandwidth is the challenge
Is it practical?
•Full frame sensor with cell phone density
•24x36mm ->
•Sony a7riii has 4.5micron pitch
•Bandwidth of phantom high speed camera: 6,600 fps at 2048 x 1920 4MPixel. -> 660 at 40MPixels -> 30fps at 40*4.5*4.5 [they say 26GPixels/sec] 12 bits
•XQD: 400MB/s -> budget of 1/8bit per pixel at full burst
•JPEG vs RAW: 70MB vs 7MB; 1 to 10 -> gets us still 1 order of magnitude short
•Big challenge: quick, local light field compression. Can dimensionality gap help? Steer DCT?
•Alternative: 2 microns, factor of 4 obviously, 10MPixels with 4.5x4.5
Diaphragm (or lack thereof)
Main lens
microlenses
aperture
sub-image
Fake depth of field for cell phones
(no light field)
Challenge
•Shallow depth of field hard with small sensors
sensor
lens
sensor
Point in focus
Object with texture
lens
Point in focus
Object with texture
Challenge
•Shallow depth of field hard with small sensors
sensor
lens
sensor
Point in focus
Object with texture
lens
Point in focus
Object with texture
•Machine learning-based foreground-background segmentation
•Use dual pixels to get a depth map
(or analyze local defocus)
•Predict desired per-pixel blur radius
•Render with non-linear blur
(more later)
Challenge with defocus blur
•Remember, not a convolution!
•Blur radius depends on input scene depth,
not output pixel location
•Plus occlusion matters
*
lens
sensor
Point in focus
Occlusion
•Divide the image into k (=5) depth layers with opacity values
•Process each layer independently
•Composite back to front (with “over” operator)
Challenges
•Masks are hard, especially around hair!
•Need notion of sub-pixel coverage