Project 5: Light Fields
Joyce Luong
Part 1: Focusing
To focus an image at various places given a (16 x 16) light field:
- Determine how the data set is indexed, which is different for every set.
- Determine pixel displacement in
x, y
directions towards the center (8, 8) image.
- Multiply displacements by a scalar
C
; the smaller, the farther the focus.
- (Optional) Cry because it shouldn't be so hard.
- Shift image the required distance into the center.
- Mean images together into a frame.
- Compile frames for many
C
values and make a .gif.
Left to Right: C value of 0, C value of 2, C value of 3
Displayed: Animated .gif of two results
Part 2: Aperture
To modify aperture given a (16 x 16) light field:
- Similar steps as above, but only take the aperture value A's worth of images around the center.
- For example, for A = 1, we take images from all indices in (8 +/- 1, 8 +/- 1). Then we shift and mean images with C value -1.
Left to Right: A value of 1, A value of 5, A value of 9
What I Learned
Be less stubborn when recieving help from friends. Caching is really nice for debugging. IPython is the best. Also, just do enough work and move on. :)