3

I need to frame synchronize a stereo camera for a computer vision application. The synchronization should be on a millisecond level possibly. I would like to get about 10 FPS either as video or still images.

I think basically I have 2 options:

  1. Get two standalone Raspberry Pi units each with a camera on it. Synchronize them via an external GPIO trigger. Cost is 2x25+2x16 = £82.

  2. Get the new Compute Module Development Kit and connect both cameras to the single board. Couple the two cameras for a simultaneous release with software. Cost is 126+16+16 = £158.

Which option will get better sync results? Is option #1 actually a HW genlock that could have better results or will they be same? Also, cost is a key factor for me. In case the results will be same I will prefer cheaper solution.

Also I would rather like still image output than video output, because I will need to extract given frames from the video anyways. The still images would preferably be uncompressed not to loose image detail, but JPEG is OK too. I am not sure how many FPS can do the GPIO external trigger with still imaging.

Using a USB webcam will not work for me since USB devices cant be synced easily.

3

I am currently using the Compute Module IO board for my undergraduate project and up to now, the best I can come up with is a refresh rate of 2Hz implemented using c++.

Mr. David Barker at Argon design were able to implement it at 1Hz using C and 12 frames per second by using machine language on the video core.

Mr. Nalan Karunanayake was able to implement stereo vision using a model B+ and two usb webcams set at 10 frames per second in c++.

I read an IEEE paper if I am remembering it correctly being able to sync both camera modules using v4l2 drivers (Raspberry PI Based Stereo Vision For Small Size ASVs).

  • 1
    What do you mean by 2Hz? How far apart are the 2 images? I would like to use compute module also. – bakalolo Jan 18 at 2:56
  • @bakalolo My final implementation was at 5Hz at 320 by 240 pixels (can be forced up to 10Hz but occassional errors occur). I was using the old Compute Module IO board using the 700MHz SoC. It was very slow and there was no hardware provision for syncing the two cameras. The only way to get them reasonably synchronized was using the stereoscope function of uv4l driver wherein you get one combine image from both cameras (you have to separate them manually). You can try the newer board or use Odroid XU4 and its cameras (Ocam) as it's used by many papers or you can order a depth camera instead :) – user123456098 Jan 19 at 7:51
2

Sony IMX219PQ , can be configured as master slave and thus frame synchronized, there is even a sony app note about it. I have used this on a custom stereo camera board, but proper configuration of the sensor is needed.

1

After lot of research and even myself trying to set up 2 RPis with one camera each for a frame synchronized stereo capture I did not really come all the way to precisely measure the sync visually but I realized just this at that time from various discussions and tech specs:

Even though it is possible to sync RPi boards themselves via common GPIO signal (for whatever task) it is not possible to sync their cameras for continuous stereo capture. The main reason is that the camera sensors and boards does not support external trigger functionality (neither v1 OmniVision OV5647 nor v2 Sony IMX219PQ camera board). The OV5647 actually has a so-called FREX input pin which could be used for frame sync but it is neither routed out of the sensor to the board nor is it supported in official RPi camera driver/software. The ArduCam board has a FREX pinout on board but still no software to use it.

It may be possible to sync a single shot (no continuous stereo) though - I guess there was a project for a bullet-time photography - I explored their python code at github (cant remember the exact project name now) - they synced RPis via Ethernet and then called raspistill binary synchronously for a single shot. I think this can work even as there was a 1000ms delay at the beginning of raspistill to allow cameras to set exposure (the timout is same on all cameras so the sync should still work). I think different exposure times may be an issue with PiFace though. Once raspistill is started (and hopefully after the first frame) the sensor enters so called "free running mode" where video is streamed from the sensor at given FPS. Because each camera board has its own oscilator the FPS will never be 100% same for two boards even if started at the same time and the frames will drift from each other the longer the video runs.

TL;DR:

While it may be possible to sync a single stereo shot it is not easily possible to frame synchronize two RPi camera boards for continuous stereo capture due to a lack of external trigger feature on the cameras' sensors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.