Project 5 Submission

Name: Rohan Murthy(cs194-26-adk)

Overview: Lightfield Camera

This project explores how we can use a lightfield (a 17x17 grid of camera images) to refocuse images based on depth and show how changing the sample size of images creates a picture of something at different aperature sizes.

Part 1: Depth refocusing

In this part I used the images in the 17x17 lightfield to refocuse an image! The way I did this was shifting all images towards the center image and averaging them. To figure out how much to shift each image, I first found the difference between the (x,y) point of the image and the (x', y') center image point. I then multiplied this difference by some alpha. Increasing the alpha resulted in focusing on parts of the chessboard that are closer the camera.

This is the chessboard with alpha 0, 0.5:
This is the chessboard with alpha 1, 1.5:
This is the chessboard with alpha 2, 2.5, 3:
This is a gif of going from alpha 0 to alpha 3!:
Notice how as alpha increases, the focus starts to go towards the bottom of the chessboard (towards the camera).

Part 2: Aperature Adjustment

In this part of the project I analyzed what a certain view would look like with differing aperature sizes. The way I did this was essentially doing what I did in the prior part, except I kept a constant alpha of 1.0 and only used certain images in the lightfield that were within a certain radius of the center for the average. The idea here is that the more images we use (higher radius), the blurrier the picture gets because we are averaging more images; this is essentially increasing the aperature size.

This is the chessboard with radius 0 (just the center image of the lightfield):
This is the chessboard with radius 1, 2:
This is the chessboard with radius 3, 4:
This is the chessboard with radius 5, 6:
This is the chessboard with radius 7, 8:
This is a gif of going from radius 0 to 8!:
Notice how as the aperature/radius increases, the focus on the middle becomes more apparent. The top and bottom of the chessboard become very blurry with higher radius.