CS 194-26 ~ Project #5 ~ Lightfield Camera

Matthew Sie : cs194-26-aep

Part 1: Depth Refocusing

This part of the project involved two steps: shifting and averaging. Shifting was completed by calculating the offset between each image and the center image. This offset was calculating by parsing the image file names, which contained information for x- and y-positions. I shifted each image by the offset multiplied by some coefficient factor, "c", and then averaged all the given images into one final image. The values for "c" ranged from 0 to -0.5, where the lower magnitude "c" corresponds to no shift and thus, subjects in the backgrouund are in focus. Higher magnitude "c" corresponds to larger shift (closer to the amount that the camera was shifted) and thus, subjects in the foreground are in focus. Changing values for "c", I was able to produce images with various parts of the image in focus.

Resulting depth-refocused images with "c" equal to 0.0, -0.1, and -0.2, respectively.

Resulting depth-refocused images with "c" equal to -0.3, -0.4, and -0.5, respectively.

GIF of images produced with range of "c" from 0 to -0.5, with "c" changing in increments of -0.1.

Part 2: Aperture Adjustment

This part of the project involved only the averaging step from the part before. However, what we are changing is the grid of images over which we are averaging the picture over. Again, I used a factor variable, "grid_size", to vary the size of this grid to be used to average pictures over. The larger the "grid_size" variable, the larger the amount of pictures to be used to average over. The grid is a ("grid_size"*2) + 1 by ("grid_size"*2) + 1 grid of images. By varying this variable, we can produce images that appear as if they were taken with varying aperture settings. With a larger "grid_size", the foreground becomes more blurry relative to the background. At a smaller "grid_size", the entire image is equally in focus.

Resulting depth-refocused images with "grid_size" equal to 0, 1, 2, and 3, respectively.

Resulting depth-refocused images with "grid_size" equal to 4, 5, 6, and 7, respectively.

GIF of images produced with range of "grid_size" from 0 to 7, with "grid_size" changing in increments of 1.

Part 3: Summary

Being a casual photographer, I've only ever really understood depth of field and aperture from the perspectives of numbers and camera settings, and some of the physical nature behind how it works and how settings changed (larger hole in my camera to let light in for larger aperture). Through this project, it was interesting to see how the nature of a lightfield could be modelled and used through the setup of many images taken of the same subject from different camera locations.