Light Field Camera is a special camera that captures 4D light fields instead of 2D flat images. A light field contains light position and light direction. Therefore, with light directions saved, we can adjust focus length and aperture size after the photo is taken by a light field camera. Based on Light Field Photography with a Hand-held Plenoptic Camera by Ng et al., it's surprising that actually we can repoduce the effects of a light field camera using simple operations of 2D images.
In this project, I'm trying to mimic the pictures taken by a light field camera with varying focus length and aperture size using pictures taken by normal cameras from different positions on a plane orthogonal to the optical axis.
The sample images are from Stanford Light Field Archive. Images are acquired using a 17*17 camera array which capture a object from slighly different directions.
Because of different position of different cameras in the array, if the camera array is right in front of the object, objects far from camera and objects close to camera will move in opposite direction from images captured by from left most camera and right most camera. Furthermore, further the object is from cameras, less the object will shift in images captured by cameras on diiferent positions. Therefore, if we shift images by the camera position * a fixed parameter, we can make sure images can match each other on some fixed depth. If we average all those images together, we can reproduce an image which mimics the effect of a light field camera focusing on that depth with other parts on the image blured.
Because we have a 17*17 camera array, I will take camera on row 8, column 8 as the central camera, represented as (8,8) (row, col). For image taken by camera (i,j), the shift (vertical, horizontal) will be C * (i-8, j-8), where C is the parameter of different focusing depth. Smaller the C, further the focusing depth is.
Below are some examples of varying refocusing depth using varying C value.
To mimic varying aperture size, we only need to change the number of images averaged to get the result. The more images used, the larger the aperture size, because larger aperture can capture lights from more directions, which means images from more positions in this case. For a specific aperture size, we have a parameter C such that I will average images (i,j) which satisfy |i-8|<=D and |j-8|<=D to produce output.
For examples below, I choose several different C values for different aperture sizes.
created with
Website Builder Software .