CS 194 HW5

Depth Refocusing

To refocus, I read all the images into a 17x17 array and performed a transformation on each one of them relative to the center image (8,8). For the transformation, I calculated the distance between the picture and the center picture (calculated using the x/y coordinates given in the image name). I then multiplied this distance by some factor and shifted the image by that value (in both x and y directions). I then calculated the average of all of these transformed images. Sorry the images are a bit grainy!

Images
Factor = .2

Factor = .7

Factor = .1

Factor = .15

Factor = -.5

Factor = -.9

Factor = -.12
The below gif was made with factors of .02, .07, .1, .15, -.05, -.09, -.12


Aperture Adjustment

For the aperture adjustment part, I just used the above transformation on a certain window.

Images
width of 1

width of 2

width of 3

width of 4

width of 5

width of 6

width of 7

Below is the gif of the images.