06-18-2009 03:08 PM
06-19-2009 02:08 PM
Hey nrfowl,
Are both cameras working properly? If you can acquire from both cameras using your code to capture a single camera at a time, you should not have any trouble acquiring from both of them at the same time. On the most basic level you can simply copy the code for grabbing from a single camera and paste paste it below the first. Then all you have to do is change the resource name to your second camera. If you would like you could put the grabs for both cameras in a single while loop and have all of your configuration steps separate.
If you are looking for synchronization, you could consider some sort of triggering to get both cameras on capturing at the exact same times. But if you are simply looking to acquire from two cameras at the same time, you should not HAVE to implement additional code control steps such as semaphores or rendezvous.
06-23-2009 03:45 AM
06-23-2009 02:02 PM
I have figured out how to aquire from both cameras simultaneously. However, their frame rates sometimes differ from one another. I would like them to be as close as possible. Also, the other problem that I am having now is that the frame rates of both cameras, or just one, will sometimes fall as low as 49 FPS for a few seconds. The frame rates of the two cameras usually oscillate together between 60 FPS and 59.94 FPS.
The variation between 60 and 59.94 is acceptable, but any variation greater than about 1 or 2 FPS is unacceptable.
I am trying to figure out how to have the two cameras nearly exactly synchronized at a constant frame rate. Can you give me an idea on how I can learn more about triggers? I haven't heard much about those. And I'm not sure if the semaphores and those other methods will work, because I am not sure what is causing these random drops in frame rate
It seems that when I lower the framerates there is less variation, but there are still occasional drops of frame rate.
06-23-2009 03:19 PM
06-23-2009 03:36 PM
Hi Nathan,
...I'm the AVT engineer you were speaking with...I lurk here in the NI space too. 😉
On synchronizing two cameras, from an AVT perspective:
http://goavt.mykb.com/Article_9244B.aspx
On triggering in general, from an AVT perspective:
http://goavt.mykb.com/Article_B68F8.aspx
I also attach a "Trigger2" Labview code segment prepared by a colleague, in case that helps you with your "via Labview" preference.
Naturally others on this forum may offer additional insights.
Best regards,
Scott Smith
Allied Vision Technologies
06-24-2009 08:17 AM
Without external triggers we're talking a software timed situation - meaning you cannot be precise because there will always be significant 'jitter' in how your computer assigns processes/threads. They'll never be truly synchronized.
In the shipping examples you should be able to find Triggered Grab.vi under Hardware Input and Output»IMAQdx»Signal Input and Output»Triggered Grab.vi.
06-25-2009 09:41 AM
I am guessing you are not using a large buffer when acquiring the images. If you are just using grab, you will lose some images due to Windows lags.
If you acquire both cameras into a circular buffer, you should not lose any frames and they should stay synchronized as long as they are both setup exactly the same (frame rate, shutter speed, etc.)
Synchronizing the start would be the only issue. You should probably use a hardware trigger if you need them to start at exactly the same time.
Post your code so we can figure out why you are getting drops in the frame rate. This should not happen in normal circumstances.
Bruce
06-25-2009 10:13 AM
Bruce, do you mean increasing the number of buffers? I think I tried that with no success.
Here is my code:
06-25-2009 10:25 AM
nrfowl,
You can't get synchronized acquisitions when using the "next" buffer mode. This is designed for cases where you don't care about processing every image, just the latest one. If your time processing one image ever takes slightly longer than a frame interval you will skip frames rather than catch up on the next loop iteration. Instead, switch the buffer number mode to "buffer number" and wire the requested buffer number into a shared shift register that increases by one each time. You can check if you are getting behind by ensuring that the buffer number returned matches the one you asked for on both cameras.
The other item you likely want to do is have them share the same trigger so that you don't get slightly out of sync over a period of time. This will happen if you have both cameras in free-running mode because although they are set for 60fps they each have their own internal clock that will drift. Over enough time one camera will have acquired more images than the other. Scott gave a link that explained how to do this without any extra hardware. "Connect the Output1 (IntEna) from the master-camera with Input1 (Trigger)". This will still let you have your free-running 60fps without an external trigger but will guarantee the second camera acquires images at the exact same rate.
Eric