Reply to topic  [ 1 post ] 
Building a Stereo Camera - Phase 1 
Author Message
What's a life?
User avatar

Joined: Thu Apr 23, 2009 7:27 pm
Posts: 11684
Reply with quote

I originally posted this on FaceBook a few days ago, so some of you may have read this already.

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 640x480 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 upto 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.

Below are a couple of examples - 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.


Images processed by the Pi after the photos were taken, using ImageMagick

All the best,
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation

Thu Jan 19, 2017 11:15 am
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.