CS194-26 Project 5 - Lightfield Camera

Eilam Levitov - cs194-26-acx
This notebook runs on python 2.7

Overview ( As extracted from project description)

As this paper by Ng et al. demonstrated, capturing multiple images over a plane orthogonal to the optical axis enables achieving complex effects using very simple operations like shifting and averaging. The goal of this project is to reproduce some of these effects using real lightfield data.

We will demonstrate the power of these simple mathematical operations on images from the Stanford Light Field Archive and display the results below

Part 1 - Depth Refocusing

In this part we shift the grid pictures and average which creates a moving focus effect.
We control the location of our focus effect by shifting each image to a centralized reference and multiplying by a scalar, which we will see in the gif. But first, we shall see a simple example of averging:

In [4]:
# Set Parameters
In [5]:
# Construct the image grid
CPU times: user 2min 53s, sys: 23.9 s, total: 3min 17s
Wall time: 5min 26s
In [6]:
# Set reference images and center point
In [7]:
# Set a starting point and align
In [8]:
# Simple average and display

Now that we saw the effect of averaging, we can demonstrate a slightly more elaborate process by using a reference patch and aligning according, followed by the same process.

In [ ]:
# Here we shift, align, average, and display

chess

Part 2 - Aperture Adjustment

In this part we use a variable number of images, n, to creates a corresponding aperature adjustment effect.
We define the radius of the aperature by setting n to a sepcific number, as n grows so does the radius and vice versa.

In [15]:
# Set radius=2 and display
In [19]:
# Set radius=12 and display
In [36]:
# We tune the radius from 2 to 14 with jumps of 3 

radius

Summary

This project demonstrated how a simple trick can make a big difference. Ren's idea of microlenses is as straight forward as it is inspring. I throughly enjoyed working on this project.