Project 5: Lightfields

In this project, I used existing lightfields captured using a LEGO gantry system, providing high resolution images (XY plane) as well as low resolution lightfield data for each pixel (the 17 by 17 grid of images produced). Using the shift and sum algorithm, I generated a GIF that displays a shifting focus plane. By sampling more or less of the UV image at each pixel, I generated another GIF that displays changing aperture while maintaining focus at the center of the image. Loading in the lightfield proved to be a substantial part of the project, involving some wrangling of MATLAB ND arrays, and filename parsing.

Depth Refocusing

I implemented a fairly straightforward algorithm for refocusing, iterating through each UV subimage and shifting each image's XY coordinates according to its distance from the UV center (this prevented an especially egregious black border from forming-- naturally, shifting without using the distance from center simply offsets the image slightly).

Gif.

Sample images

No refocusing.
c = 0.5
c = 1
c = 2

Aperture adjustment

In this section, I adjusted the aperture of the image by sampling from different-sized portions of each UV-image at each XY location. This was easily parallelized in MATLAB.

Gif.

Sample images

Small aperture (c = 0.1), i.e. sampling only from center point of each UV-image.
c = 0.5
c = 1