A light field describes the amount of light flowing in all directions through every point in a space. Normal cameras only capture a small part of the plenoptic function, a 5D vector function that generates the space of all posible light rays in 3D space. By using the data from the Stanford Light Field Archive, where they used a special light field camera, we can post-process the images to demonstrate depth refocusing and aperture adjustment.
For each photo in the data set, we parse the file name to get the coordinates. We calculate the difference between the coordinates and the center. We multiply the difference with a scaling factor, and finally shift the photo by this shift. We then average all the shifted photos.
We use the same method as above but instead of using all the photos, we only use photos within a certain radius r.