Fall 2018

CS 194-26: Image Manipulation and Computational Photography

Project 5: Depth Refocusing and Aperature Adjustment with Lightfield data

Kyla Woyshner, cs194-26-agr



Overview

The Stanford Light Field Archive has several datasets containing images of the same object/scene taken from each location in a 17x17 grid of cameras. The goal of this project is to use these images to create single images with different depths of focus and different aperatures.

Depth Refocusing

Task

As discussed above, the dataset I used contains 289 images taken from different cameras located on a 17x17 grid. Each image is saved with the grid location of the camera used, as well as the (x,y) coordinates of the subaperature view. I defined my reference image as the one captured from the camera at the center location on the grid (8,8), and the coordinates of its subaperature view as (mx, my). The shift (u,v) is calculated for each image, as ((mx-x), (my-y))*c where c is some scalar. I then averaged all of the shifted images. Without shifting, averaging the images would result in the far away objects to be in focus, as their position varies little across the set of images, and the close-up objects to be more blurry, as their positions vary significantly between images. By adjusting the scalar c, I am able to change where the focus is in the image.

Results

c = -0.5
c = -0.2
c = 0.1
GIF of Depth Refocusing with c in range [-0.6, 0.1]

Aperature Adjustment

For the second part of the project I adjusted the aperature rather than the depth of focus. To do this I set a fixed c = -0.2 (which focuses the image around the middle of the board) and selectively chose the images used to create the final image. To create the effect of different aperature values, I only included images located within a certain radius r of the center image. For each image I first calculated the Euclidean distance between the camera's location in the grid (a,b) and the location of the center camera (8,8). Only those images with a distance less than r would be used to create the final averaged image.

Results

r = 1
r = 6
r = 12
GIF of Aperature Adjustment with r in range [1, 12]

Conclusion

I thought this project was very interesting because this technique allows you to alter aspects of the image (that are usually set before capturing the image) afterwards. It was surprisingly easy and effective for the data we were provided. However, this technique would not always be a useful way to edit an image post-capture, because it requires the entire lightfield to be captured. We cannot use this technique to simply edit the depth of focus or aperature of some single image we captured.