02-16-2012 10:17 AM
I need to capture images from 8 USB cameras at the same time. I don't need to continuously acquire images (just one set every few seconds), but I need the 8 cameras to capture at very close to the same exact time. Just testing with two cameras at the moment, and one camera always seems to capture about 0.4 seconds after the other. Attached is the current VI I'm testing with.
Any idea how to speed this up? I thought having both grab.vi's in a separate frame would help make them occur at the same time, but it's still a lot slower than I hoped for. Thanks for any suggestions.
02-16-2012 10:24 AM
Well, I just tried putting the Configure Grab VI's in the first frame and set the "wait for next buffer" to False. I'm now down to about 0.1 second difference between the two cameras. That's quite a bit better, but it still may not be fast enough for me, as demanding as that sounds....
02-16-2012 11:09 AM - edited 02-16-2012 11:11 AM
All depends from precision. 100 ms is not bad result. For better precision I would like to suggest to use cams with external triggers. The cameras with USB interface are also available, for example:
http://www.thorlabs.de/newgrouppage9.cfm?objectgroup_id=2916
http://www.edmundoptics.com/products/displayproduct.cfm?productid=3356
http://www.ptgrey.com/news/pressreleases/details.asp?articleID=230
Otherwise they may be incompatible with IMAQdx (the only DirectShow compliant cameras are supported). Point Gray Chameleon seems to be DirectShow compatible.
02-16-2012 11:44 AM
Thanks for the reply. Unfortunately, for this project I really can't afford any of these specialized cameras. The cameras I'm planning on using (have 1 right now) are the Microsoft HD-5000 webcams, at $25 a pop.
What's strange to me is that I can capture video at 30 fps from both cameras, at the same time. So I would think that I'd be able to get two cameras synchronized to within 1/30th of a second. If I could actually capture video from 8 cameras at 30 fps, I'd just do that, but unfortunately I can only do that with 3 cameras at most.
02-16-2012 12:17 PM
Your code has the start of the acquisition in the same frame as the grab. This means that one camera could be still starting while you get an image from the second. Additionally, you are using the high-level grab and not specifying which frame you want, so you may get different frame numbers from each camera even if they started at the same time.
Here's a suggestion:
-Move the start to the first frame, then change your Grab call to always return the newest image, rather than next (this ensures it doesn't block and so all of them in parallel run at the same time).
Eric
02-17-2012 01:37 AM
Hello,
First, as your cameras are running at 30fps and are not hardware triggered, the best you can get is 1/30s between two consecutive frames.
Then I suppose your cameras are RGB VGA, so the throughput is about 6480*480*3*30=26MB/s (unless the video is compressed)
And an USB 2.0 offers 60MB/S so be carrefull not to plug all your camera on the same port.
Regards
02-17-2012 09:31 AM
BlueCheese, when you say "change Grab to always return newest image," is that achieved by setting "wait for next buffer" to false? Or is there a different Grab vi that I should be using?
07-15-2013 01:18 PM
murrdpirate, is it possible to get me a screenshot of this vi? Even better save in the previous version for 8.2?
I am trying to get 4 cameras up and running but couldn't succeed so far.
Thanks,
Emre