Project 5: Lightfield Camera

Nikhilesh Vegesna

Overview

In this project, I used a dataset of images from the Stanford Light Field Archive. These images are of the same object but taken from different locations on an evenly spaced 17x17 grid. I used these images to implement depth refocusing and aperture adjustment.

Depth Refocusing

The first thing I did was to average over all the images. I saw that this focused on the part of the image that was far away. This is because the part of an image that is far away is the part that shifts the least when you take the image from a different location (hence different angle).

In order to simulate taking the image from different distances, I shifted each image in the grid by its offset from the center of the grid (times a constant). Changing the constant helps to change which part of the image has the most and least variance across the sample images, which determines which ones come into focus and which ones come out of focus. The resulting gif is

Aperture Adjustment

A nice way to simulate changing an aperture on a camera is by only using the set of images that are a certain "distance" away from the center of the grid. Distance here is defined by the euclidean distance in their x,y coordinates on the grid. By increasing the distance, we can simulate letting more light into the camera and having a fuzzier image. The opposite is true as well. The reason this works is that as the distance gets smaller, the positional variance for each individual feature in the image is smaller. So for example the center pendant in the bracelet across all the images are closer to each other in the set of images that are closest to the center. However, if you increase the distance, this variance is greater because there are more images, all of which are "farther" apart from each other.

Summary

I learned a lot about what it really means to focus on an image and increase and decrease aperture. The process of coding for this project also forced me to think about how an image would change if I viewed it from different angles and distances. I also obviously learned how to take multiple images of the same object and use that information to create interesting effects on one image.