CS194 Project 5: Lightfield Camera
Matthew Waliman, cs194-26-afq



Lightfields allow us to produce a variety of images from a given scene. Here I implemented depth refocusing and aperture adjustment.

The equation for focal length is 1/f = 1/s_i + 1/s_o, where s_i is sensor distance and s_o is distance from the scene. Thus there are three ways to change the focus plane, change the focal length, the scene distance, or the sensor distance. We implement depth refocusing by simulating a change in sensor distance. Shifting the sensor plane forwards results in shifting all the captured images inward, giving a longer effective focal length. Shifting the sensor backwards shifts all the images outward, giving a smaller focal length.

We accomplish this by first finding the angular difference from the optical axis, u and v.


And then multiply by a scaling factor c to find the pixel shift.

The result are images focused at different focus depths. As c increase focal length increases, focusing at greater depths in the scene.

c = [-3.5:5]
c = [-6:2]

As shown in the above diagrams, for a given sensor size, stopping down the aperture results in a greater depth of field, so that more objects are in focus. Below we see the DOF for a single camera in the center of the angular array, on the left. This is equivalent to stopping down the aperture to the smallest possible size. The right is an average of all images captured by the camera array, simulating a larger effective aperture, thus, it has a smaller depth of field.


Varying aperture size from 0.5 to 7.5.


I used a programmable aperture to capture real light field data. I placed an LCD in front DSLR, and placed a singlet in front of the LCD. By displaying different images on the LCD we are able to programmatically change the aperture shape, size and position, allowing for high resolution light field capture. After background noise subtraction and post processing, these are the results.

c = -4
c = -2
c = -0
c = 1
c = 3
c = 5

Varying aperture size from 0.5 to 7.5.

The algorithm seems to work, if you focus on small details like the edge of the cup. However, the images suffer from low SNR and stray light in the scene. This is attributed to the experimental nature of the prototype,

This project was interesting becuase I work with light fields in my research. I was aware of the shift and add algorithm but had yet to implement it and I had to think through the details of exactly how it works.