The fundamental basis of this entire project is using images which were capture over a plane
orthogonal to the optical axis to mimic various effects of an actual camera. These include adjusting focus
as well as adjusting aperture which can result in a more shallow depth of field. In order to
do so we can use shifting and averaging of the images to the center image that is captured.
In this example we will adjust the focus of the image. In order to do so we first determine the middle image which
in this case we choose the index (8, 8) since the lightfield grid is 18x18. Now that we have our center image,
we can shift the rest of the images by the offset given by the dataset. After shifting, we average all the photos and
we can get the second photo below. What we can do from here is use a constant C and multiply the displacement to move the focus
backwards (negative C) or forwards (positive C). We demonstrate this full effect with a gif consisting of 10 frames with C
going from 0 to 1 for chess and -0.5 to 0.5 for the crystals.
-
chess gif
-
crystals gif
Instead of changing C we can also create the effect of changing the aperture by
only averaging the images within a certain radius around the center images. This was also found by using the coordinates
given by the dataset. A small radius will choose less photos thus making the blurriness go away and vice versa.
I also applied the first part to my own images which I took on my phone. You can clearly see the
focus moving but not only are there 9 images to make the blurriness less smooth but also, when taking the
images I didn't have exact pixel offsets and they were estimated so the images don't overlap correctly. However,
the effect still remains which is pretty neat.
All in all this project was very short but had some pretty incredible effects. There was really one hiccup
that took awhile to figure out which was inverting the displacement coordinates which resulted in an overall more blurry image
but not a different focus point image. It was really interesting though and well worth the time to complete./p>