nick.rollings
Posts: 2
Joined: Thu Mar 12, 2015 2:01 am

Re: Multiple cameras on a single raspberry pi board

Fri Mar 13, 2015 12:36 am

Hi

Great thread. I am interested in using the Pi RGB and NIR cameras together. I'll only need to grab a frame say every 0.5 seconds.

Does anyone have suggestions on how i can do this using one Raspberry Pi?

How about is I scale up to 6 cameras, each with its own optical filter?

thanks for any comments.

regards

Nick

bruce.simonson
Posts: 5
Joined: Wed Apr 08, 2015 6:06 am

Re: Multiple cameras on a single raspberry pi board

Wed Apr 08, 2015 6:29 am

Greetings,

Keeping the thread going, with a related idea.

I would like to take pairs of simultaneous images, at say, 1 pair of frames per second, with two cameras - a standard PiCAM and an IR PiCAM. The idea is to take both images, and then later create a single four band image with the RGB from the PiCAM and the IR from the IR PiCAM.

The twist is that the cameras will be moving at 85 nautical miles per hour (roughly 145 feet per second), at 3000 feet above ground level, shooting basically straight down. A series of such RGB+IR images will then (eventually, in the workflow) be mosaiced into an aerial orthophoto.

How can I get these two cameras to fire, at essentially, if not exactly, the same instant? (If they don't fire simultaneously, the cameras will be in different locations when their images are taken -- e.g., a tenth of second apart means the 2nd camera will be 14.5 feet further along the flight path -- this would not be good. While 100th second apart would be closer to acceptable, it's still not ideal. Firing 1000th second apart is probably at the upper range of a time difference that would be acceptable).

Do I really need two PIs (one for each camera), or is there a way to use one PI to help ensure the images are at taken at (very nearly) the same time? But if I need two PIs, how do I get them to communicate with each other so they will fire at the same instant?

Rocket science?

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Multiple cameras on a single raspberry pi board

Wed Apr 08, 2015 11:27 am

bruce.simonson wrote:How can I get these two cameras to fire, at essentially, if not exactly, the same instant? (If they don't fire simultaneously, the cameras will be in different locations when their images are taken -- e.g., a tenth of second apart means the 2nd camera will be 14.5 feet further along the flight path -- this would not be good. While 100th second apart would be closer to acceptable, it's still not ideal. Firing 1000th second apart is probably at the upper range of a time difference that would be acceptable).
The simple answer - you can't do that.

See discussion here:
http://www.raspberrypi.org/forums/viewt ... ra#p377084

One complex answer might be to accept that the two bands are not aligned and handle the overlapped mosaic tiles in post processing. For smooth motion some rolling shutter distortion can be corrected.

Use cameras that have global shutter and external synchronisation.

rathnec
Posts: 1
Joined: Fri Jun 19, 2015 7:05 am

Re: Multiple cameras on a single raspberry pi board

Fri Jun 19, 2015 7:09 am

Why do you have to multiplex the MIPI lines?. Multiplexing I2C lines should do.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6691
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Multiple cameras on a single raspberry pi board

Fri Jun 19, 2015 9:12 am

rathnec wrote:Why do you have to multiplex the MIPI lines?. Multiplexing I2C lines should do.
I2C runs at up to 400kHz (generally 100kHz on the Pi).
The MIPI lines are running at up to 1Gb/s, therefore up in the GHz range. Transmission line effects are therefore very significant. That means any mismatch in impedance results in reflections and potentially corrupt data. So, yes, you really do have to mux the MIPI lines properly if you want to be sure it will work.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

mmyekybod
Posts: 1
Joined: Sat Aug 06, 2016 9:36 am

Re: Multiple cameras on a single raspberry pi board

Sat Aug 06, 2016 9:42 am

hi.you can use "ip camera" and connect it to rpi ethernet port
with hub you can connect more ip camera to raspberry

fruggz
Posts: 2
Joined: Sun Oct 16, 2016 12:50 am

Re: Multiple cameras on a single raspberry pi board

Sun Oct 16, 2016 12:58 am

punktea wrote:I have connected and used 3 logitech webcams via a powered USB hub. Since the output of the webcams are already in MJPEG format, the RPi CPU does not have to do any encoding and the CPU load is low. Since you just need to take snapshots, the bandwidth required across the USB port will also be low and I don't see any problem connecting a large number of webcams. When you do hit limits then just add another RPi. With webcam, the highest resolution is 1920x1080, not sure if that will meet your requirements.
Would you mind sharing how you accomplished this setup? I am looking to do something very similar and I am new to RPi so any help is appreciated.

pootle
Posts: 320
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

Re: Multiple cameras on a single raspberry pi board

Sun Oct 16, 2016 7:45 pm

I found that even using fairly low (1 every 10 seconds) photos using USB cameras I could not reliably capture at more than 640 x 480 resolution (i was using motion to drive the cameras in timelapse mode)

details here:
viewtopic.php?f=43&t=155761&p=1017320#p1017320

I think it would be worth trying two pi's running a script to capture_continuous in burst mode. Then use a home brew iterator to delay to sync to the same time. As long as you have the 2 pi's clocks synced to a local master this should get pretty close timing - it would be useful to see just how close this can get

Shahab.kianmanesh
Posts: 1
Joined: Mon Apr 30, 2018 6:30 pm

Re: Multiple cameras on a single raspberry pi board

Mon Apr 30, 2018 6:50 pm

Howdy all,


I beleive this is the solution you are looking for:

https://www.amazon.com/Arducam-Camera-A ... B012UQWOOQ


Its a multicamera adaptor. You can extend this module so that you would connect more and more cameras to your single Pi through MIPI.

This code may be likewise useful to figure out your solution, with respect to running it:

http://www.arducam.com/downloads/module ... ture_A.zip


This project could be interesting for you as well:

https://www.pyimagesearch.com/2016/01/1 ... nd-opencv/


Hope this helps and just take it easy!

Best, Shahab

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6691
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Multiple cameras on a single raspberry pi board

Tue May 01, 2018 10:53 am

Shahab.kianmanesh wrote:
Mon Apr 30, 2018 6:50 pm
I beleive this is the solution you are looking for:
https://www.amazon.com/Arducam-Camera-A ... B012UQWOOQ

Its a multicamera adaptor. You can extend this module so that you would connect more and more cameras to your single Pi through MIPI.
That's the same board that has already been referenced earlier in this thread.
https://www.indiegogo.com/projects/ivpo ... ultiplexer#/
http://www.ivmech.com/magaza/en/develop ... lexer-p-90
https://hackaday.io/project/2847-ivport ... ultiplexer
It does not allow simultaneous capture from 2 cameras - there simply isn't a solution for that (edit:) except on the Compute Module.
Last edited by 6by9 on Tue May 01, 2018 11:56 am, edited 1 time in total.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

HermannSW
Posts: 1213
Joined: Fri Jul 22, 2016 9:09 pm

Re: Multiple cameras on a single raspberry pi board

Tue May 01, 2018 11:51 am

6by9 wrote:
Tue May 01, 2018 10:53 am
It does not allow simultaneous capture from 2 cameras - there simply isn't a solution for that.
In other threads you stated that you can record two cameras simultaneously with compute model, which is a "raspberry pi board" from title as well.
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6691
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Multiple cameras on a single raspberry pi board

Tue May 01, 2018 11:57 am

HermannSW wrote:
Tue May 01, 2018 11:51 am
6by9 wrote:
Tue May 01, 2018 10:53 am
It does not allow simultaneous capture from 2 cameras - there simply isn't a solution for that.
In other threads you stated that you can record two cameras simultaneously with compute model, which is a "raspberry pi board" from title as well.
Edited to add the CM as a solution.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22215
Joined: Sat Jul 30, 2011 7:41 pm

Re: Multiple cameras on a single raspberry pi board

Tue May 01, 2018 12:53 pm

HermannSW wrote:
Tue May 01, 2018 11:51 am
6by9 wrote:
Tue May 01, 2018 10:53 am
It does not allow simultaneous capture from 2 cameras - there simply isn't a solution for that.
In other threads you stated that you can record two cameras simultaneously with compute model, which is a "raspberry pi board" from title as well.
That's because on the CM both CSI ports are exposed. This is not the case on the other P models. But CM would be a solution for 2 cameras, but it's not that user friendly.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Multiple cameras on a single raspberry pi board

Tue May 01, 2018 2:40 pm

6by9 wrote:
Tue May 01, 2018 10:53 am
Shahab.kianmanesh wrote:
Mon Apr 30, 2018 6:50 pm
I beleive this is the solution you are looking for:
https://www.amazon.com/Arducam-Camera-A ... B012UQWOOQ

Its a multicamera adaptor. You can extend this module so that you would connect more and more cameras to your single Pi through MIPI.
That's the same board that has already been referenced earlier in this thread.
https://www.indiegogo.com/projects/ivpo ... ultiplexer#/
http://www.ivmech.com/magaza/en/develop ... lexer-p-90
https://hackaday.io/project/2847-ivport ... ultiplexer
It does not allow simultaneous capture from 2 cameras - there simply isn't a solution for that (edit:) except on the Compute Module.
Just for completeness, it is possible to stream live video from two USB webcams at low resolution and a USB camera can run simultaneously with a Pi camera. It may be possible to run more than two USB cameras if they have on-board compression to fit within USB2 data rates.
I believe the multiplexer allows rapid switching, maybe a frame time lost so multiple cameras can be run "at the same time" at reduced frame rate, in some conditions .

None of these options provides any sort of frame synchronisation or actual simultaneous exposure.

JayG
Posts: 1
Joined: Fri Jul 20, 2018 7:27 pm

Re: Multiple cameras on a single raspberry pi board

Fri Jul 20, 2018 7:33 pm

I apologize if this has been covered before....but I'm new to Raspberry Pi...I just took delivery on a Raspad, and am getting started with exploring what else is possible.

i do Structure form Motion Photography and I'm interested in mounting four or five evenly spaced camera sensors on a 8-10 foot long stalk. I'd love to be able to trigger them with one controller, and then have them dump all of the images into one folder on a harddrive....From there I could copy them over to my desktop machine and then processs the images normally.

I'm not looking to stream video at this point, just capture multiple images, preferrably JPEG at the same time. Obviously it would be battery powered, and the longest distance that any cable or wire would have to cover would be about five feet. Within reason, I'm looking for as much resolution as I can get, but I understand that the limitations might be profound.

Any suggestions on where to look for inspiration or a similar project?

sanjaya
Posts: 14
Joined: Thu Jul 05, 2018 11:00 am

Re: Multiple cameras on a single raspberry pi board

Sat Jul 21, 2018 1:21 am

@JayG:
https://lb.raspberrypi.org/forums/viewt ... 3&t=218576
easy yet brutal way.
- 4 pi + ov5647 camera with the frex pads exposed
- a centralized pwm wired to the cameras frex
- run the cameras with the same settings (they don't have to start simultaneously)
- set pwm frequency according to camera frequency then trigger the pwm
- 2nd frame (after the pwm) onwards should be in sync

to verify: set a digital stopwatch as the target. compare the readout from each camera

since you don't seem to care about rolling shutter effect nor about high frame rate the concerns raised in that thread don't apply to you.


laurent
Posts: 279
Joined: Thu Jul 26, 2012 11:24 am

Re: Multiple cameras on a single raspberry pi board

Tue Jan 15, 2019 12:02 pm

Hello,
Perhaps my recently posted tutorial could help you with your requirements :
viewtopic.php?f=63&t=230819

The trick is to use a Raspberry Pi zero between your main Raspberry Pi and cameras boards you want to connect (with no any additional µSD card) ;) And you have a total control on your cameras to synchronize captures (within the limit of the Raspbian scheduler), store wherever you want, with the format you want, and so on.

Return to “Camera board”