Forums

Webcam synchronization

Started by Eduardo November 25, 2013
Hi,
is it possible to synchronize capture from two webcams by removing the crys=
tal oscillator from one of them and using the clock from the other as a mas=
ter clock for the two cameras? The goal is to build a stereo camera system =
and compute  stereo maps from disparity images. If it's not possible, is th=
ere any other inexpensive solution for this problem? I currently have two L=
ogitech C310 cameras, which (as far as I know) do not have any pin for an e=
xternal trigger signal.
Thanks in advance!
Hi Eduardo,

On 11/24/2013 10:01 PM, Eduardo wrote:
> Hi, > is it possible to synchronize capture from two webcams by removing > the crystal oscillator from one of them and using the clock from > the other as a master clock for the two cameras?
Doubtful -- esp not for cheap kit!
> The goal is to build a stereo camera system and compute stereo maps > from disparity images. If it's not possible, is there any other > inexpensive solution for this problem? I currently have two Logitech > C310 cameras, which (as far as I know) do not have any pin for an > external trigger signal.
If images are static, then synchronization is unimportant. How "unstatic" they can be depend on scan rates of cameras, project goals, etc. Why not combine two visual fields *optically into a single camera? I.e., left half of image sees scene from one perspective; right half sees same scene from slightly different perspective.
Well, I believe that would require more complex lenses, and might also intr=
oduce other problems into the system. Why do you say that using the same cl=
ock for both cameras will not work? The project goal is to obtain good qual=
ity depth information using the stereo system, and the images are not neces=
sarily static. In fact, I'm assuming the cameras can move at fairly high sp=
eeds. Regarding the frame rate, I can achieve up to 30 fps with the C310 ca=
ms.




On Monday, November 25, 2013 3:35:53 AM UTC-2, Don Y wrote:
> Hi Eduardo, >=20 >=20 >=20 > On 11/24/2013 10:01 PM, Eduardo wrote: >=20 > > Hi, >=20 > > is it possible to synchronize capture from two webcams by removing >=20 > > the crystal oscillator from one of them and using the clock from >=20 > > the other as a master clock for the two cameras? >=20 >=20 >=20 > Doubtful -- esp not for cheap kit! >=20 >=20 >=20 > > The goal is to build a stereo camera system and compute stereo maps >=20 > > from disparity images. If it's not possible, is there any other >=20 > > inexpensive solution for this problem? I currently have two Logitech >=20 > > C310 cameras, which (as far as I know) do not have any pin for an >=20 > > external trigger signal. >=20 >=20 >=20 > If images are static, then synchronization is unimportant. How >=20 > "unstatic" they can be depend on scan rates of cameras, project goals, >=20 > etc. >=20 >=20 >=20 > Why not combine two visual fields *optically into a single camera? >=20 > I.e., left half of image sees scene from one perspective; right half >=20 > sees same scene from slightly different perspective.
On Sun, 24 Nov 2013 21:01:43 -0800, Eduardo wrote:

> Hi, > is it possible to synchronize capture from two webcams by removing the > crystal oscillator from one of them and using the clock from the other > as a master clock for the two cameras? The goal is to build a stereo > camera system and compute stereo maps from disparity images. If it's > not possible, is there any other inexpensive solution for this problem? > I currently have two Logitech C310 cameras, which (as far as I know) do > not have any pin for an external trigger signal. > Thanks in advance!
If you started with identical cameras then at best you'd be able to make the frame rates exactly the same, but you wouldn't be able to make them happen at the same time. If you're lucky there's a cheap web cam that lets you do fine adjustment on frame rate. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On 2013-11-25, Eduardo <edufschmidt@gmail.com> wrote:
> Hi, > is it possible to synchronize capture from two webcams by removing the crystal oscillator from one of them and using > the clock from the other as a master clock for the two cameras?
probabaly not.
> The goal is to build a stereo camera system and compute stereo maps > from disparity images. If it's not possible, is there any other > inexpensive solution for this problem?
one camera and mirrors?
> I currently have two Logitech C310 cameras,
if you want to synchronise you probably need video cameras. -- For a good time: install ntp --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Hi Eduardo,

On 11/24/2013 10:54 PM, Eduardo wrote:
> Well, I believe that would require more complex lenses,
Yes. "No free lunch" :>
> and might also introduce other problems into the system.
Possibly.
> Why do you say that using the same clock for both cameras > will not work?
Because there are several "clock" involved in video that are all "harmonicly" related (bad choice of words). An image is composed of frames/fields (depends on whether the image is interlaced or not). These occur at a fixed "frame/field" rate. I.e., think of a "clock" that marks the start of a field/frame and repeats as often as fields/frames repeat! Fields/frames, in turn are composed of *scan lines*. Some number of scan lines per field/frame. So, there is a fixed *line* rate! Think of (another) clock that runs at some MULTIPLE of the field/frame clock rate that marks the start of each successsive "scan line" and repeats as often as the scan lines repeat! Each scan line consists of some number of dots (pels). Some number of dots per scan line. So, there is a fixed *dot* rate! Think of (yet another!) clock that runs at some multiple of the scan line clock rate that marks the start of each *dot* and repeats as often as the dots repeat. Which eventually determines how often the scan lines repeat. Which eventually determines how often the field/frames repeat. The "clock" you are thinking of is probably most closely related to (though not necessarily identical to!) the dot clock. If you drive two identical cameras with an identical clock signal, all you can guarantee is that the dots are *sampled* at the same rate. But, on any particular clock, camera 1 could be sampling dot 27 of line 19 in field 0 while camera 2 is sampling dot 294 of line 300 in field 1! They aren't "looking" at the same thing at the same time. If you can tolerate this, then you can probably tolerate the skew that will invariably exist between two "free-running" cameras!
> The project goal is to obtain good quality depth information using > the stereo system, and the images are not necessarily static.
Then if one "snapshot" of he image is 1/100th of a second skewed from the other, in time, it will have moved relative to the image the other camera is reporting.
> In fact, I'm assuming the cameras can move at fairly high speeds. > Regarding the frame rate, I can achieve up to 30 fps with the C310 cams.
29.97 is all RS170 equired :>
On Sun, 24 Nov 2013 21:01:43 -0800 (PST), Eduardo
<edufschmidt@gmail.com> wrote:

>Hi, >is it possible to synchronize capture from two webcams by removing the crystal oscillator from one of them and using the clock from the other as a master clock for the two cameras? The goal is to build a stereo camera system and compute stereo maps from disparity images. If it's not possible, is there any other inexpensive solution for this problem? I currently have two Logitech C310 cameras, which (as far as I know) do not have any pin for an external trigger signal. >Thanks in advance!
How about using a stroboscope as the light source ?
On a sunny day (Sun, 24 Nov 2013 21:01:43 -0800 (PST)) it happened Eduardo
<edufschmidt@gmail.com> wrote in
<c57ed3eb-2f66-4259-af2e-3db1be53cbef@googlegroups.com>:

>Hi, >is it possible to synchronize capture from two webcams by removing the crys= >tal oscillator from one of them and using the clock from the other as a mas= >ter clock for the two cameras? The goal is to build a stereo camera system = >and compute stereo maps from disparity images. If it's not possible, is th= >ere any other inexpensive solution for this problem? I currently have two L= >ogitech C310 cameras, which (as far as I know) do not have any pin for an e= >xternal trigger signal. >Thanks in advance!
I already did that, used a PLL with a transistor on one of the crystals, you need a H, V comparator, and allow some time for the lock to happen, for a small delta f that may take seconds (depends how far you can tune the xtal). Was published here, google should have it, some pics of the mod: http://panteltje.com/pub/PAL_camera_freq_control_img_1600.jpg http://panteltje.com/pub/PAL_camera_internal_genlock_mod_img_1594.jpg http://panteltje.com/pub/PAL_camera_mod_extra_external_connecton_img_1598.jpg http://panteltje.com/pub/PAL_camera_module_sensitive_spot_img_1590.jpg http://panteltje.com/pub/PAL_camara_module_box_img_1585.jpg Remember you can only tune _down_ , so you have to modify the fastest camera. I played a bit with it, but never finished that project, it reminded me a bit of syncing a TV studio to an outside broadcast in the sixties of last century. The plan is to use it perhaps for stereo from my drone, but I already have a third analog camera (Sony starlight super HAD 2) so that would make 3. The 2 older ones would only work in daylight. Where to put those (so those do no see the propeller), 2 on each wing tip. One (Sony) facing down, transmit frame sequential, use LCD shutters for stereo on the locked ones.. http://panteltje.com/panteltje/space/mars/lcd_shutters.png That gives you 12.5 fps for each eye, flicker, see the problems? Digital HAS advantages... But latency, latency latency. So it is not at the top of the to do list to hang it on the plane for stereo. :-) 2 Sony Super HADs, now that would be.... But do not want to mess with that board (DSP), although it is more easily accessible.
Thanks for the replies!
On a sunny day (Mon, 25 Nov 2013 03:33:51 -0800 (PST)) it happened Eduardo
<edufschmidt@gmail.com> wrote in
<945788f2-ac4d-48ae-826a-65cae516b266@googlegroups.com>:

>Thanks for the replies!
Please note if you want color and PAL it is not sufficient to sync to any frame, as the color phase of the PAL signal will be only the same every 4 frames (8 fields). http://en.wikipedia.org/wiki/Color_framing This requires quite some extra electronics in the phase comparator.