CS 194-26 Project 5:
Lightfield Camera:
Depth Refocusing and Aperture Adjustment with Light Field Data

Sol Ah Yoo


Overview

In this project, I was able to digitally refocus images and change the aperture using light field data from the Stanford Light Field Archive. Doing so involved a very simple shift and add algorithm provided in Ren's slides.

Depth Refocusing

Averaging all the images in the dataset will produce an image that is in focus on farther objects and blurry around the nearby ones. So to change the focus in images, you can shift the images by a certain amount and average all of them together. To get the shift amounts, I used the u and v coordinates provided in the name of the file and subtracted the center image u, v coordinates from them. Then, I averaged all the images together to get the resulting images.

Jellybeans

C = 0
C = -0.2
C = -0.4
C = -0.6

Aperture Adjustment

To change aperture, all you have to do is shift and average different number of images. For large aperture (small depth of field), you average large number of images, and for small aperture (large depth of field), you average small number of images.

For the images below, I averaged images that were close to the center image, then added images farther and farther away for the large aperture image.

It makes sense that averaging more pictures togther produces an image that looks like it was taken with a camera with large aperture because the more images you add, the blurrier the edges will become since objects farther from the focal point vary their position more. And vice versa for the small aperture - ie. if you use one image everything will be sharp and in focus; adding more images will make it less sharp for outside the focal point.

Jellybeans (from smallest to largest aperture)