Part 1 - Depth Refocusing

The Stanford dataset's camera setup we used has a 17x17 grid of cameras, providing us with a view of an object from many slightly different angles. Each image is given coordinates defining it as well as the grid location of the camera shooting the image in the filename itself. We use this to our advantage in part I, where we implemented depth refocusing. To do this, we first fixed the center image's coordinates given in the filename as those of the camera located at (8,8) (call this P_center). Following this, we shifted each image by alpha * (P_image - P_center) and then summed the shifted images up together and averaged them. This process of interpolation allowed us to focus on different depths of the image by varying alpha, as an alpha of 0 would correspond to focusing on an image much farther away, while an alpha of 0.5 would mean a far greater shift for an image, meaning that we would be focusing on objects closer to the camera itself.

On the left, you see the center image that we try to align. On the right, you can see a gif of the alignments with alphas ranging from -0.5 to 0.5 and back to -0.5 (to create one smooth gif).

center image center image

Part 2 - Aperture Adjustment

This part of the project is where we try to simulate a larger aperture through performing the interpolation (align and then average) described in part 1 on all images within a certain radius of the center point. This allows us to simulate the effect of letting in light from a "larger" camera lens, as we are capturing more light in the image through exploring more angles with a larger radius. For this part, the alpha used was 0.2 and the gif used radii from 4 to 10.

On the left is the original chessboard image, and on the right, you see the gif showing the alignment with different radii (one image for each integer between radii of 4 and 10, inclusive).

center image aperture gif

I learned a lot about lightfields from this project. Specifically, I learned about how varying the shift of the image can affect the location at which our image "focuses", and that smaller alpha values in interpolation/shifting correspond to focusing on the background on the image due to the backgrounds being in relatively identical positions with small camera shifts, whereas the foreground object positions would change drastically.