CS194 Project 5

CS194-26 Project 5: Lightfields

by Max McArthur

Part 1: Refocusing Photos

Given a group of collected from a lightfield, I was able to refocus the photos by shifting pictures towards the center photo by varying amounts and averaging these pictures. Specifically, given the 17x17 grid of pictures, I shift each picture by a constant multiplied by its offset from the center picture. The results are as follows:


(note that gifs had to be compressed for submission)

It's notable that I didn't need nearly as high constants to achieve focus on the full subject in the chess example, so I didn't end up having results for constants above 0.5 in that specific example. However, for the case of the jellybeans, it took much longer (until ~c=0) for them to fully come into focus, indicating something interesting about this dataset that is rather unique and different from the others; scrolling through individual images, the jellybeans closer to the camera appear to move less. I believe that this is due to the geometry in which they've been placed; they are not on the same plane, and as we move the camera, they will not move as predictably as the chess image did.

Dataset c = -3.0 c = -2.0 c = -1.0 c = 0 c = 1.0 c = 2.0 c = 3.0
chess (unnecessary) (unnecessary) (unnecessary)
jellybeans
truck



Part 2: Aperture Changing

In this part, we were asked to mimic changing the aperture size of the camera taking an image. An easy way to mock this is by allowing light from more angles to be let into the camera (i.e. the same effect of opening the aperture), so we can think of this as averaging together more and more images. Therefore, in order to achieve this, I simply chose varying radii to sample from, and then averaging together squares with dimensions of those radii. This essentially imitates the effect of shifting aperture size, as seen below:


(note that gifs had to be compressed for submission)

Dataset r = 1 r = 3 r = 5 r = 7
chess
jellybeans
truck



Part 3: Reflection

This project honestly helped me learn a lot about the physical interpretation of aperture and light intake. Theoretically it made sense to me beforehand but understanding that we could essentially think of light as coming from all different kinds of angles into the camera lens and being able to filter out certain parts of the image based on how much light we allow into the camera was certainly an interesting lesson.