CS194-26: Image Manipulation and Computational Photography


Project 5: Lightfield Camera

1) Depth Refocusing

For this part of the project, we used a collection of images taken over a regularly spaced grid to simulate a change in the depth of focus of the images. When you take pictures of the same object from slightly different angles, the objects that are farther away will remain in relatively the same position, where the objects closer to the camera will appear in more significantly different positions. So, when you take the average of these images, the objects farther from the camera will appear clear and more in focus, whereas the images that are closer to the camera will appear blurry and out of focus. To create a change of depth of focus over the average of these images, I shifted the images before taking the average with a shift proportional to the distance of the center of focus from the center of focus of a single image. This results in objects at a different distance being more aligned, creating a change in depth of focus of the final averaged image.
Here is an example of changing the depth of focus over a chess board:



2) Aperture Adjustment

For this part of the project, we used the same collection of images to simulate changing the aperture size. With a small aperture, everything is in focus; with a large aperture, the "background" of the image will be out of focus. To create this effect, I chose a single image to act as the center of focus. For every other image in the collection, I calculated the distance between the center of focuses of the images. To simulate a smaller aperture, I kept only the images that had a small difference. This meant that more of the objects in the image were already aligned. To simulate a larger aperture, I kept more images, including those with a greater difference. This meant that the objects farther from the center of focus were less aligned. So, when I averaged the images in the selection, those kept for the smaller aperture were clear, whereas the misaligned objects in the images I kept for the larger aperture created a blurred effect around the edges when averaged together.
Here is an example:

3) Summary

I learned that light fields are really cool, and allow you to produce images with really cool effects!