Saturday, January 6, 2018

Raspberry PI Stereo Camera

Raspberry PI Stereo Camera


There are more demands on the stereo camera, I think.
I am not computer vision engineer but I hear people asking for the stereo camera.
You can get the USB stereo cameras but not many cameras are available for DIY people.


Then, I wondered if it is possible to do the stereo camera streaming using raspberry pi.
The raspberry pi camera module v2 has Sony image sensor and the performance is so nice.
The raspberry pi site has the comparison chart between camera module v1 and v2.
The camera module v2 supports 8M pixel resolution, 1080p@30, 720p@60, and 640 × 480p@60/@90. As an eye of the stereo camera, it has quite good spec.
Unfortunately, raspberry pi can only supports 1 camera module for now, so the potential solution to develop the stereo camera system is either using something like this.


Thanks to ArduCam and they have great camera products. I have been using there products in my previous blogs here and here.
The above adapter is basically multiplexer and it can easily switch the multiple camera views.
I think it is great module for the camera surveillance projects or my car accessory projects here (in progress now).
However, I would like to try different method for this project which is using 2 raspberry pi and each raspberry pi use the 8MP camera module v2.
The reason why I wanted this is to record the 2 camera views simultaneously and maximize the image resolution and frames.

Using 2 Raspberry PI with Camera Module V2
For the first attempt, I came up with this method.

  1. Add external button and wire the signal to both raspberry pi
  2. Use the hardware interrupt to trigger the recording start event
  3. Launch script to star the stream at the input trigger
    1. The script just waits for camera recording until the input trigger is detected
  4. Offline operation to merge 2 recorded video files


Synchronize the Frames from 2 Raspberry PI and Camera Module V2
There are another trick I did for this test which is to try synchronizing the 2 individual camera timing as much as possible.
What I did was to share the clock signals on the camera module v2.
Fortunately, the camera module use CMOS output clock device to feed the clock signal to the image sensor chip, so it was really easy to wire and share the 1 clock signal to the other.

Result
Here is the result. (Not great quality, sorry...)
The camera was not aligned well, but the shifted image is due to the left and right side camera view angle.



Thank you for reading!
I will update this project as I make progress.



                 

1 comment: