CS 194-26 Project 5

Depth Refocusing and Aperture Adjustment with Lightfield Data

Franky Guerrero 25475670

Project Overview

The goal of this project is to simulate a camera focusing at different depths and different camera apertures focusing on a single point.

Depth Refocusing

Averaging all the images in the grid without any shifting will produce an image which is sharp around the far-away objects but blurry around the nearby ones. I computed the average by adding all the image matrices together and dividing by the number of images.

Shifting the images by some scalar k and then averaging allows one to focus on object at different depths. I used the scipy library function to shift the images and computed an average similar to above.

Aperture Adjustment

Averaging a large number of images sampled over the grid perpendicular to the optical axis mimics a camera with a much larger aperture. Using fewer images results in an image that mimics a smaller aperture.
The idea here is to average images within a radius. The circle created by this radius is what is treated as the camera's aperture. With the center of the image at (162%17, 162/17), I used the distance formula to find images within a specified radius. I then shifted each of the images by scalar k = 2 (arbitrarily chosen) and averaged them.

Summary

Through this project, I learned that computing simple operations on lightfield data produces beautiful effects.