CS 194-26: Image Manipulation and Computational Photography

Project 5: Lightfield Camera: Depth Refocusing and Aperture Adjustment with Light Field Data

Kijung Kim, CS194-26-agm


Overview

Through datasets of multiple images captured over a plane orthogonal to the optical axis, we are able to achieve complex effects using simple operations such as shifting and averaging. The goal of this project is to reproduce some of these effects using real lightfield data.


Depth Refocusing

I chose to focus at the center of the light field, which was the sub aperature (8, 8). I shifted the other aperatures (u,v) by this:

Let shift = (sx, sy) (sx, sy) = C * ((u, v) - (8, 8)), where C is in the range of (-4, 4), which I arbitrarily chose.

I applied this shifting to every sub-aperature, and then I averaged all the images to produce the refocused image. C affects the focus in that larger values of C means we are focusing further from current focus whileas smaller values mean we are focusing closer to physical focus.

Here are some pictures of linear interpolation with various C values

C = -3
C = 0
C = 3

Here is the animation on lego blocks

Aperature Adjustment

As said on the spec, averaging a number of images sampled over a large grid perpendicular to the optical axis mimics a camera with a much larger aperture. Using the same logic, averaging images from a smaller grid results in an image that mimics a smaller aperture. How we can do so is to first select an aperature with radius r (in terms of u,v). Then, we can do the following.

For each r in 0,2,..,12, we can only use pictures that are within r (u,v) distance of the (8,8) picture. So, for r=0, there's only the (8,8) picture. for r = 1, there are only up,right,left,bottom additional pictures used with (8,8), and for r=12, all pictures are used, since the furthest is 8sqrt(2), which is only 11.31 distance away.

Here are some sample pictures of different radiuses

r = 0
r = 3
r = 6
r = 9
r = 12

Here is a gif

Summary

Light field cameras are cool...