CS194-26 Project 5

Isabel Zhang: cs194-adi

Project Overview

This project used the Stanford Lightfield data set to generate images that can alter its focus and aperture after the photo is taken. Lightfields like normal photographs, capture the intensity of light in a given seen. However, it is also able to distinguish the direction that light rays have traveled from, essentially creating many slightly varied images of the same subject (albeit at slightly lower resolution).



Part 1: Depth Refocusing

The goal for this section was to refocus the image at different focal depths within the image.

Implementation

  1. Get the center image's position (which is stored in the image's name: out_08_08_u_v.png)
  2. For all other images in the set of 17x17, calculate the offset from the center's (u,v) by doing: (image_uv - center_uv) * c. c is a constant that determines where the image is focused. Smaller c focuses the image further while larger c brings the focus to the closer areas of the image.
  3. Average all the shifted images together (all 289).

Results

Refocus from c: [0.0, 0.55]
Refocus at furthest point: c = 0


Part 2: Aperture Adjustment

The goal for this section was to readjust the aperture size. A camera's aperture is the opening that allows light to pass through and hit the image plane. A small aperture allows less light in and allows more of the subject to be in focus. A large aperture allows more light in and decreases the subject's focus.

Implementation

  1. Given a value r, find the appropriate set of images, centered at the center image out_08_08*.png. If r=0, get the center image. If r=1, get 3x3 window.
  2. Shift all images within the window by the appropriate offset. I used c = 0.1 for my images which worked well.
  3. Average all images within the window together.

Results

r = 0
r = 1
r = 2
r = 3
r = 4
r = 5
r = 6
r = 7
r = 8
r = [0, 8]


Summary

Lightfields were very interesting to work with. With fairly minimal code, I was able to create interesting results that will allow photographers to have another method of photo post-processing. Having taken CS184 (Graphics) in the past, it was interesting to be able to actually see the application of the theory and idea.