Raspberry Pi Based Stereo Camera – Testing Ideas

This is an experiment that I have been thinking about for a while (and I expect I am not the first person to have a stab at this). I wanted to see if I could make a stereo camera with a Raspberry Pi and a couple of web cameras. As I already had a Playstation 3 camera and I found another in second-hand shop for £1.50, I decided that this would be the best option to see if the thing would work. The PS3 cameras are a bit rubbish, and output to 640×480 pixels, so the images aren’t great (I’m scaling them up at the moment to the target size, eventually better cameras will result in scaling down which will give better results).

The process works like this:
• Take a picture from each camera.
• Scale the images to a target size
• Process the image using a random colour look up table (at the moment, using just a Sepia one, but I have others on file that I can add eventually)
• Apply a random “shape” for the frame (currently using just an arched image, but I can add others), 
• Pick a random card background image
• Using the left/right photos and the card background, create a Holmes Card image sand save. It also creates one which can be viewed by crossing the eyes.
• If there is an internet connection, upload images to Dropbox (not necessary, but helpful, especially if the Pi is running headless)

This is an issue 1 Pi, so no wireless connections, and things are a bit slow. Processing the image with one of the filters can take up to 5 minutes.

Also, one big problem is that you can not fire the two cameras simultaneously with a single Raspberry Pi. There may be ways round this, but that’s for later experiments. Right now, each camera has to fire one after the other, which causes problems if there are moving items in the picture.

Next – a button. What’s a camera without a button? A status light to tell you when it’s ready (and possibly processing) That’s some physical wiring needing thinking about.

Once a button is added, I can package the thing in a box with one of those USB battery packs you can get for charging phones, and I have something portable. Right now, taking a photo requires the Pi to be tethered to the network using an Ethernet cable.

At the top of this article are a couple of examples (click the thumbnails to enlarge) – parallel at the top, cross eye viewing at the bottom. I’ve tried to get the cameras aligned as best I can. There are ways to analyse and align images after the photos are taken, but I’ve not found a Pi friendly way to do this (and fast – a photo should not take too long to process on the camera). To keep the cameras as aligned as possible, they’ve been lashed together with some elastic, a ruler and a pencil.

Maybe in the future, the Pi will take just the photos, and upload to a server that does the image processing before passing it to Dropbox. That would require an internet connection when out and about though.

Anyway, these images are things I am rather pleased to have created, even if they are a bit rubbish round the edges.