DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 1: Computational Photography Primer.
DIY Camera Array 2: Computational Refocusing With Just One Camera.

You don't need to register to download the PDF because I have made them available here and here.

This Instructable is a primer on the field of Computational Photography, which is a new field of research that is developing extremely powerful cameras. These cameras allow the Depth of Field, the object in focus, and the position of the camera to be modified after the picture is taken. None of those things are possible with a traditional camera.

We show how to build one kind of computational camera -- a light field array. There are many other designs out there.

Before you go to all the trouble of building your own array, you should know that you can play with computational refocusing with just one camera.


DIY Camera Array 2: Computational Refocusing With Just One Camera


You can think of it like this: 12 cameras taking a picture in a row is the same as 1 camera taking 12 pictures in a row.

DIY Camera Array 2: Computational Refocusing With Just One Camera


Can work like this:

DIY Camera Array 2: Computational Refocusing With Just One Camera


What you need:

A digital camera. (Any kind is fine)
A clamp.
A ruler, T-square, or meterstick.
A table or flat surface.
Patience.
Time.
LFTEXTURES.

Step 1: Oh Man Here Comes Some Theory; Stick With Us.

DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
There are many methods to achieve computational refocusing. We do it the simplest way.

I'm going to try to explain this intuitively and imprecisely, because the mathematical definition has been well explained elsewhere.. First of all, light field imaging treats light as rays, each with a direction and intensity. So think of the light around you as a bunch of long thin rays traveling through space. They shoot around in all directions, all the time, reflecting off things, refracting through glass, air, water, etc.

What we want to do is select certain light rays from certain angles to form our final image. To do this, first we need to actually capture rays which are coming in from different angles.

It goes without saying that the most obvious way to capture rays from different angles is to measure them from different points in space. What is not so obvious is how to recombine these intermediate images into the final, refocused image.

Let's try to think of this in terms of cameras. Imagine you have an object sitting on a table. You have a camera centered on it. You take a picture.

DIY Camera Array 2: Computational Refocusing With Just One Camera


When you move the camera left and right, the object moves right and left in the image, respectively.

DIY Camera Array 2: Computational Refocusing With Just One Camera


Think about this for a minute -- by looking at the object like this, you have captured different rays of light moving in different directions from the surface of the object. And in the extremes of the left and right image, you can actually see around the object a little bit. If you took enough pictures, you could "see through" the object by choosing only the rays of interest.

DIY Camera Array 2: Computational Refocusing With Just One Camera


The clever trick here is that by placing our cameras at exactly the same distance apart every time, we "know" the angle of incoming rays relative to each other. We don't know them in an absolute sense (like in radians or degrees), but that's not really very important -- if we overlay the images and shift them all relative to each other, we "select" different rays by blurring out the ones we're not interested in.

In other words, the important thing is that by making the distance between the cameras the same every time, we automatically preserve the angular relationships between incoming rays.

DIY Camera Array 2: Computational Refocusing With Just One Camera
?

Step 2: Capturing the damn images already.

DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
DIY Camera Array 2: Computational Refocusing With Just One Camera
So how to do that? Well, it's simple.

Just clamp a ruler, t-square, or meter stick to a table.

DIY Camera Array 2: Computational Refocusing With Just One Camera

?
Set your camera on the table, pointed at whatever you are interested in photographing.

DIY Camera Array 2: Computational Refocusing With Just One Camera


Move the camera from left to right or right to left, moving exactly the same distance every time and take a picture at a some interval -- every 2 inches is a good start.

DIY Camera Array 2: Computational Refocusing With Just One Camera


Copy this set of images to a folder on your computer.

DIY Camera Array 2: Computational Refocusing With Just One Camera

Step 3: Refocusing with LFtextures.

DIY Camera Array 2: Computational Refocusing With Just One Camera
This is where LFtextures comes in. Matti Kariluoma wrote LFtextures in C with OpenGL. The primary purpose of LFtextures is to allow you to easily do this refocusing.

So go download it already. :) To install it, just unzip the contents of the folder. To start it, just click on "lftextures.exe" and wait.

To refocus, LFtextures makes all the images transparent, and lays them on top of each other. By scrolling the mouse wheel, you are able to refocus your captured image by shifting the images relative to each other. By pressing "P" you save a copy of your refocused image in the working directory of lftextures.

We provide a couple of data sets for you to play with, but we hope you'll go try capturing your own. To use them, just copy your images into the "lf" directory that comes in the LFtextures archive. Be sure to delete the ones that are there already.

Please remember that LFtextures only works if your images are perfectly evenly spaced. If you get nothing else from this Instructable, please get that your images must be on a single line and perfectly spaced!!!

DIY Camera Array 2: Computational Refocusing With Just One Camera

That's it for the moment. The next few articles will be about how to build the array we built, which makes a lot more interesting things possible.
 
 

Tag cloud

make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel