CS194-26 Proj 5: Light Field Camera

Sean Lobo

Part 1.1: Depth Refocusing

In this part of the project we had to simulate refocusing the images by shifting each of 289 images to align with a predetermined image from the set. The 289 images come from a 17 by 17 array of cameras, which each take a picture of a scene. Each of the images ends up being at a slightly different angle, which causes the averaged image to look blurry. However, due to the angles between the cameras and the scene, the further areas of the scene will shift less from camera to camera, causing the further parts of the image to be in more focus.

Below we have a gif showing the focus shift from the background to the foreground.

Each frame of this gif is a generated image. The images are generated by taking an average of all frames after shifting them to align with the center image. Each picture in the 17 by 17 array also comes with information about the height and width (u and v), so shifting a given image with height u' and width v' to the center image with height u and width v is as simple as rolling the given image by (u' - u) in the y direction and (v' - v) in the x direction. The images in the gif differ in the alpha term multplied to the shift factor. Here the alpha varies from ~ -.1 to .6. By varying the alpha factor we can over or under shift the images, which has the effect of focusing different parts of the image.


Part 1.2: Aperture Adjustment

In this part of the project we had to simulate adjusting the aperture of the camera taking the "average" image. Instead of varying the alpha factor, for this part of the project we vary the radius of the chunk of images used from the center. Using a radius of 0 amounts to only using the center image, which will create a very focused image. Increasing the radius allows for adjacent images to be included in the average, which slightly blurs the image, moreso on the outside than the center. As we iteratively add more and more layers the image gets progressively more blurred, particularly on the edges.

In this gif the images vary from a radius of 0 (only the center image) to a radius of 8 (every image in the 17 by 17 grid). As we can see, the edges get progressively more blurry.