Close

Stereo Camera Development

A project log for Mouse Bot

A tiny robot to give an interesting perspective with interacting with cats.

dryerziniaDrYerzinia 02/25/2017 at 15:100 Comments

My first thought when designing the mini stereo camera was, I'll just take the Raspberry Pi Camera schematic and redraw it so there are to of them next to each other, but then I found out how not actually open the Pi Camera is... So I had to reverse engineer the schematic from the PCB, fortunately not to difficult and that effort is documented here.

The first step was to test some wide angle lenses. So where do you go when you want the narrowest wide angle lenses so you can get an interpupillary distance of just 11mm? After a lot of searching the internet and getting no where I came up with a source, if anyone knows of a place that sells all kinds of lens off the shelf and knows what combo I need to make a better lens than what I am about to describe please leave a comment.

Yes, Home Depot to the rescue with a peep hole lens, why didn't I think of it sooner? The peep hole fit perfectly on the end of the camera but the the barrel took up most of the cameras field of view, the actually scene was a small fraction of it, and I want all the pixels. What followed was disassembly of the peep hole and a lot of experiments tweaking the distance of the lens, trying the Pi Camera at different focuses or with no lens of it's own at all. Eventually I settled on this solution:

Using the 2 upper elements of the lens suspended 18mm above the camera with its lens screwed all the way out provided an image that filled most of the field of view of the camera sensor and was in focus. There are to problems with the picture quality however, one is you need a fair bit of light to get good pictures, probably because the itty bitty lens on the Pi Camera, which is why I would like to find a lens solution that doesn't use it so I can get all the light that comes into the 11mm wide Fisheye lens down onto the sensor instead of bouncing around in the barrel. The other issue's where blurring toward the outside of the field of view, and it just doesn't have very high dynamic range, shooting indoors with a bright window in the background will ruin your day. But overall the pictures where quite immersing.

This is a photo of Fiona and you can see the scene almost fully fills the field of view vertically.

After all the testing and figuring out how to arrange the lenses I drew up the dual camera board and built and tested it. That was a bit painful in that somehow I managed to kill one of my $30 image sensors along the way, plus having to deal with moving over that evil ATSHA204 driver lock down IC just felt so wrong. But after some careful debugging and replacing some common mode chokes who's transfer damaged them I had to working cameras 11mm apart.

Before I could get photos of anything but my desk I needed a way to make this camera portable. Currently for testing I had it hooked up to a Raspberry Pi 2 and a Raspberry Pi 3. I used a cheap 5v buck converter from china, a drone battery, and a tiny breadboard to breakout power for the Pi's. A pair of wires between them for synchronizing the camera trigger. Then everything was controlled via wifi with python scripts.

I thought it was pretty funny that when I first showed this to some one they asked me, "Why are you showing me soup?" Apparently it also makes a pretty stealthy little camera.

But then I turned it around and they understood.

Lots of hot glue, that's how these things get built! I was actually in the middle of 3D printing a nice mounting bracket for it to attach to a robot platform, but then I thought I want to try this now!

So next up are some stereo imagines I encourage you to view in a proper viewer. If you have a cardboard or equivalent so far the best app I've found for this is VR Player (free) and let me tell you I looked at a lot (10+) of apps and this was the only one I found that would do a Dome (180°) projection with SBS stereo. Unfortunatly the images are actualy 160° so if anyone knows of a cardboard viewer that lets you set that please comment below. If you are lucky enough to have an Occulus or Vive use Whirligig it is by far the best VR content viewer I have found. Set it up for fish eye projection, SBS, 160° and you will be in business. Now without further ado stereo images with an 11mm interpupillary distance and 160° field of view!

This first piece I call "Angry cat get that camera out of my face!"

Next we have "Doggo"

"The work bench"

And finally "My Face", probably just skip over this one...

So I loved to hear what you think of the image quality in the comments, its not the best but I'm hopping the immersiveness makes up for it, especially when its tracking your head motions in real time. Right now I'm going to stick with the Pi Cameras, but if I can source a custom lens solution I might look into using higher quality sensors, particularly I want more dynamic range and low light performance.

Thanks for reading hope you enjoyed it.

Discussions