funkworks
Posts: 1
Joined: Tue Apr 15, 2014 8:08 pm

Multiple camera project

Tue Apr 15, 2014 8:35 pm

I design and build scale rc aircraft and have recently become interested in Raspberry Pi for one of my projects. I am in the process of building a 1/9th scale U-2 spyplane and would like to include the 5MP camera board somehow. What I am thinking is 2 to 3 camera boards that would save to a single storage device like an SD card. I am not interested in capturing video- only stills. Ive hacked cameras in the past and was able to get them to take photos remotely via and remote controlled switch. I've started doing a little bit of research and im thinking I'll need a Pi for each camera module. Would it be possible to link them together with LAN cables and have the images stored on a single storage device? I also need to figure out a trigger mechanism for the Pi to take photos. The onboard receiver that controls the flight servos runs on 4.8 volts but I will probably run the set up using a separate power source to help eliminate any possible interference in the flight controls. Please let me know if you guys this this is worth the effort. Any direction would be greatly appreciated. Thanks in advance.

User avatar
Gavinmc42
Posts: 3740
Joined: Wed Aug 28, 2013 3:31 am

Re: Multiple camera project

Thu Apr 17, 2014 6:18 am

Been thinking about a similar application, FPV planes/parts are cheap now, HobbyKing etc.

New Compute module looks good, only 7gms and could handle 2 cameras, colour plus noIR/red filter?
I dream of a triple RPi model C with 3 vertically stacked SODIMMs with 6 cameras running autopilot software;)
Mother board with MPU9150 9 axis sensor, barometric, air speed sensors and GPS module.
Long range 900MHz telemetry. More RPi's in the basestation with triple screen video wall.

A 3m wingspan model could handle the weight of a few RPi model A/B's.
Use high voltage 7.4V servos, a 2S 7.4V lithium polymer battery and 7.4V to 5V converter for RPi.

Bet someone is already working on it:)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

mikerr
Posts: 2778
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Multiple camera project

Thu Apr 17, 2014 11:45 am

The Pi can only have one CSI camera module, but any number of usb cameras in addition.
and if its still images, then there's no bandwidth problem of usb.

Or you could have multiple pI's one Pi per camera as you mention, all saving to one SD card (just NFS mount a directory on all Pi's),

More Pies mean more weight ;) :lol:
Android app - Raspi Card Imager - download and image SD cards - No PC required !

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Multiple camera project

Thu Apr 17, 2014 1:53 pm

The BCM chip can handle 2 cameras but only one is broken out... maybe one day someone will develop a board and drivers for the Pi Compute module with 2 broken out...? Early days but I can see the possibilities and advantages (less weight / power consumption) of using the Pi Compute module in airbourne projects. Maybe in a year this will be well documented with resellers selling the module singularly?

fredoll
Posts: 228
Joined: Thu Jan 10, 2013 10:30 am

Re: Multiple camera project

Thu Apr 17, 2014 2:10 pm

I thought the IO board provided 2 connectors for camera ?
I may be wrong ...

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

Re: Multiple camera project

Thu Apr 17, 2014 3:11 pm

fredoll wrote:I thought the IO board provided 2 connectors for camera ?
I may be wrong ...
It does. Also two for DSI displays. Not much else though - all the GPIO's plus HDMI and single USB (the other USB is for OTG so it can be programmed). It's going to be an expensive option if you just want two cameras though.
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."

alexc
Posts: 3
Joined: Tue Apr 22, 2014 5:45 pm

Re: Multiple camera project

Tue Apr 22, 2014 5:51 pm

I want to connect two cameras to the RPI without using USB.

I am confused as to whether this is possible or not.

* mikerr said the RPI has a single CSI module, and thus this was not possible.
* pygmy_giant seemed to think that the processor supported two CSI modules, but only one is broken out (i.e. agreed with mikerr)
* fredoll said the RPI provided two camera connectors.
* jamesh confirmed fredoll's comment about the RPI having two camera connectors.

Not sure what to conclude from this. Is it possible to attach two camera modules to the RPI?

As an aside, I was surprised I couldn't find the schematics for the camera board anywhere. Isn't this camera board part of the open hardware effort by the raspberry pi?

PS: Looking at the specs for the RPI, I see a single CSI connector. If this is the case, then my question would be whether it is viable to create a custom PCB with two ov5647 and the appropriate circuitry to allow the RPI to capture video from two cameras using a single CSI connector. (I am not familiar with the CSI spec, so I am not sure if it is a bus-like architecture which supports multiple devices connected to the same port, or if each device must have its own CSI port).

mikerr
Posts: 2778
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Multiple camera project

Tue Apr 22, 2014 6:31 pm

a) It's not possible to connect 2 CSI cameras to the Raspberry Pi Models A or B


b) What's confusing matters is that there's the upcoming compute module:
http://www.raspberrypi.org/raspberry-pi ... w-product/
which does have 2 CSI interfaces, accessed by an additional IO board.

The compute module isn't available for sale yet though.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

alexc
Posts: 3
Joined: Tue Apr 22, 2014 5:45 pm

Re: Multiple camera project

Tue Apr 22, 2014 7:03 pm

Thank you mikerr, that clears things out. I'll be on the lookout for this new RPI compute module.

My only remaining question is: What is the best design to connect two identical cameras to the RPI?

1) Wait for the upcoming RPI compute module, and use two camera modules one at each CSI port.
2) Design a custom PCB with two cameras which are broken out through the same CSI port.

Skimming the datasheet of the ov5647 I see it has a frame exposure (FREX) i/o pin could/perhaps be used to synchronize two or more cameras. However, I am not familiar with the MIPI interface/protocol, and thus I do not know if it makes sense to control two devices connected to the same MIPI bus (as in i2c).

Perhaps someone here can point me in the right direction?

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

Re: Multiple camera project

Tue Apr 22, 2014 8:07 pm

Option 2 doesn't really fly.
CSI-2 is the interface carrying the data from the sensor to the GPU - http://www.mipi.org/specifications/came ... rface#CSI2. It is a point-to-point multi-lane differential signalling link. I2C is used for the low bandwidth control of the sensor.
Muxing the CSI-2 bus whilst the sensor is running is almost guaranteed to be a non-starter. Stopping the sensor, changing muxes and starting may be possible, but others have already suggested it and it's generally been viewed as a tricky problem to sort due to the high frequencies, slightly odd bus PHY, and generally not being a particularly nice interface to work with.

The compute module will offer you the chance to run both cameras simultaneously. Syncing them accurately will be tricky, but many applications don't need the frame sync to less than a frame period (with a rolling shutter the whole frame from one sensor isn't being exposed at the same time anyway)
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.

alexc
Posts: 3
Joined: Tue Apr 22, 2014 5:45 pm

Re: Multiple camera project

Tue Apr 22, 2014 8:19 pm

Thanks 6by9.

I've been reading a bit more on the MIPI/CSI-2 spec. From the little I've read it seems MIPI is supposed to be a bus-like interface and supports multiple devices on the same bus; the problem is that the camera is the master and the application processor is the slave. This might explain why having two cameras in the same CSI port is difficult, since it equates to having multiple masters and a single slave (as opposed to a single master and multiple slaves).

[EDIT: The reference 6by9 sent is much clearer than what I had found on the web, and it seems the camera is the slave, and the processor is the master. This would suggest is possible to have multiple cameras, although the question is weather the non i2c part is fast enough to make sure only one slave transmits at a time (i.e. start-stop).]


Starting and stopping the connection between devices doesn't seem like a good solution, and it is unclear if the camera has a delay between starting/stopping that would prevent this from providing a reasonable FPS even when doing the start/stop with a single camera (much less interleaving with a second device between the stop-start intervals).

In my case inter-frame synch accuracy is desirable but not a requirement. I'll just wait for the RPI compute module and see what I can get working when that comes out (fortunately I have no immediate deadline for this project).
Last edited by alexc on Thu Apr 24, 2014 3:40 pm, edited 2 times in total.

mdsousa
Posts: 39
Joined: Wed Feb 12, 2014 4:29 pm
Location: New Hampshire
Contact: Website

Re: Multiple camera project

Thu Apr 24, 2014 2:36 pm

This multiple camera project sounds pretty cool.

Could two pi's with cameras be powered by the usb outputs from another pi (which would not have a camera)?

gtalckmin
Posts: 2
Joined: Thu May 15, 2014 5:37 pm

Re: Multiple camera project

Thu May 15, 2014 5:55 pm

Hi,

My name is Gustavo - and I am very keen on this possibility of having two camera modules on a raspberry pi.

I am doing a Msc. thesis on agricultural development and I am trying to figure out a way for low cost images for vegetation indexes (NDVI etc).

If understood correctly, one could plug a USB camera + the infrared camera module on a single raspberry pi. Is that correct?
If so, I could also communicate raspberry pi with an autopilot (let's say pixhawk) through mavlink - and have geo-referenced photos, right?
That would be very useful on my research.
Well, let me know if such is possible. And sorry for my simplicity on my reasoning - I believe there are many points I left behind on that.

Cheers,

Gustavo

Maxhdroom
Posts: 13
Joined: Sat Jan 25, 2014 11:22 pm

Re: Multiple camera project

Fri May 16, 2014 6:33 pm

I've connected a usb webcam and a picam to a single raspberry pi. If the webcam has its own encoded stream available (like MJPEG or H264) instead of just raw YUV you can easily stream out both of the captures or even more webcams until you saturate the USB bandwith or Wifi.

gtalckmin
Posts: 2
Joined: Thu May 15, 2014 5:37 pm

Re: Multiple camera project

Wed May 21, 2014 2:49 pm

Maxhdroom wrote:I've connected a usb webcam and a picam to a single raspberry pi. If the webcam has its own encoded stream available (like MJPEG or H264) instead of just raw YUV you can easily stream out both of the captures or even more webcams until you saturate the USB bandwith or Wifi.
Yep - that is the case; I am wondering how can I get to integrate both the RPi and the ArduPilot; i.e. I will need to georreference the images taken by the cameras - if you have any advices on that one, I would certainly appreciate.

Cheers

jonshorridge
Posts: 1
Joined: Sat Aug 02, 2014 2:50 pm

Re: Multiple camera project

Sat Aug 02, 2014 3:01 pm

Hi funkworks, are you into 3D? Two cameras needed for an instantaneous shot but one camera shooting twice and the aircraft movement provides displacement suitable for stereo. My Dad was the bomb aimer on a Halifax bomber. As well as dropping the bombs he was also required to take the photos - two before the drop and two after on the reciprocal course - to record the damage done. As a kid I played with his practice photos taken during training in Canada and now find cross-eyed viewing without a viewer very useful. Just a thought.

Return to “Camera board”