PDA

View Full Version : Synchronize 2 camera possible?



ray@frontier
March 19, 2007, 09:41:43
Are there any function available to synchronize 2 camera during capture so that both camera capture image at the same time?

Stefan Geissler
March 19, 2007, 10:05:09
Hi Ray,

Yes, it is possible. The cameras must be synchronized with an external trigger signal. Our Dxx BF camera series has an external trigger input.

ray@frontier
March 20, 2007, 05:44:21
But what I want is software implementation instead of external trigger.
Are there any class or function in IC 3.0 to synchronize 2 camera?

Stefan Geissler
March 20, 2007, 09:18:52
Ray,


But what I want is software implementation instead of external trigger.
Are there any class or function in IC 3.0 to synchronize 2 camera?

This is hard, because the cameras do not know from each other. Thus their image will come when ever they are ready. Lets try an approach.
Imagine both cameras will save their images in a ringbuffer of size 10 images. You can be sure, that both camera should provide their images within the frame rates time, e.g. at 30 fps within 30 ms. The frames in the ring buffer contain a frame time too. The frame time is created by the cameras driver and is started when the live streams starts. Thus you must create the difference between the start times of your both grabber objects.

The method Grabber::getGraphStartReferenceTime() (http://www.imagingcontrol.com/support/documentation/class/meth_descGrabber_getGraphStartReferenceTime.htm ) give you the start times. You can calculate the difference of the start times to get a synchronisation time differenc for the frames.
For only one of both grabber objects you need a callback (GrabberListener::frameReady()). In the frameReady() you get a MemBuffer with a sample description, which contains the starttime of the current sample. Now you have to check the membuffers in the ringbuffer of the second grabber object and find the Membuffer with the nearest sample start time in the sample desc. You must subtract the start time difference to make the sample start times comparable.

Sounds complicated? It is not (I hope so). I suggest to check the graph start times first to get a feeling about them. Then you should have a look on the samle descriptions, to get an impression of their times. (http://www.imagingcontrol.com/support/documentation/class/meth_descIFrame_getSampleDesc.htm )

I must say, it is an interesting task. We did something like this with triggered cameras in VB6 only. If you have any more problems, please let me know!