Raspberry Pi(s) and Cameras

I think I want to use Raspberry Pi cameras for this project, as they are relatively cheap and higher quality than available Arduino cameras. There is also a fish eye lens camera available for the Pi, which I expect will become very important as this project continues. Fortunately, the raspberry pi supports a camera and Raspbian has a time-lapse function. Unfortunately, each Pi only natively supports 1 camera, so in theory I may need 1 Pi per camera*.  I’ll need to do tests to confirm this, but I anticipate needing at least 4 cameras to get a full 360×360 field of view. 3 cameras would form an equilateral triangle facing outwards and the fourth would point at the sky.

3 Pi Camera Triangle
Top View of the 3 Camera triangle. The fourth camera (not shown), would face out of the screen

This is where the fisheye cameras become crucial. I believe the viewing angle of the fisheye lenses is more than twice that of the regular Pi cameras, so if I use regular lenses I’ll likely need several more cameras or a rotating platform.I’m worried that if the cameras facing outwards and the camera facing the sky are perpendicular to each other, there may be an unstitchable hole in the sky due to the lack of camera overlap. This is another reason that the fisheye lenses will be very important.

If I built all the cameras onto a servo platform, I could have them all take a photo, rotate 60 degrees together, and then take another photo. This reduces the need for more cameras, and may be a technique I evaluate more closely in the future. One concern I have with this idea is if I use the cameras for a time-lapse in a crowded area, the time between pictures may disrupt the stitched frame and clone people that moved.

Top View of the 3 Camera Triangle superposed with its 60 degree rotation
Top View of the 3 Camera Triangle superposed with its 60 degree rotation

If I decide to build a rotating platform, I may be able to get away with one less camera and setup two cameras back to back. This will require more rotation and more pauses for photos.

Basic 2 Camera configuration
Basic 2 Camera configuration

 

*One Pi Per Camera

The Raspberry Pi only natively supports 1 camera through its CSI (Camera Serial Interface) port. This presents a few issues, including cost and power considerations.The CSI port is only available on the model A and B Pi, so unfortunately I cannot use the super cheap Raspberry Pi Zero. At $20-$40 per Pi and $20-40 per camera (depending on model), this requirement could quickly become expensive, costing upwards of $300 before I get to the mounting hardware or any other add-ons. The more Pi’s I have, the more I need to power. While each Pi’s power consumption is relatively small, this setup will ultimately need to be powered for many hours (at least 12) in locations potentially lacking in nearby outlets. Reading about the power requirements and difficulty of battery powered Pi has revealed this to be an additional challenge for the future of this project.

 

To try and circumvent the one Pi per camera problem, I started looking into options to attach more than one camera per Pi. I found this module which looks promising, although I don’t know if it works with the 8MP Raspberry Pi camera or the 5MP fisheye camera. In further searching, I also found this ArduCam board which is cheaper and looks to support Raspberry Pi. I don’t yet know if this device is compatible with Raspberry Pi cameras or if there are fisheye cameras for Arduino. It is compatible with the Pi Zero, making it a potentially very cost effective option.

(Note to the reader – At this point, I am updating this post as I learn more, which may cause the following passages to seem contradictory with the statements above or vacillating in nature.)

It seems that the ArduCam board is only compatible with Arduino cameras, which seem to be more expensive or significantly lower quality than the Raspberry Pi cameras I had looked at before. There do not seem to be any fish eye cameras for Arduino, but I did find this tutorial on connecting a peephole lens to a camera. This is an intriguing idea that might allow me to use normal Pi cameras, although I am not yet sure if how the cost benefits will play out.