2
\$\begingroup\$

Pretext

I am currently playing with stereo vision (two cameras capturing images simultaneously) for my robot hobby project. There are a few traits that is important when processing the images captured for stereo, and the most important of all is that images are captured at exactly the same time (also known as frame sync or genlock).

Dedicated robot cameras with sync built in can be really expensive and so like many other hobbyists I want to leverage the price/performance found in mid to high-end consumer web cameras.

This works great for one camera but breaks down when working with stereo due to missing genlock. So I decided to see if it would be possible to hack a consumer webcam and retrofit a DIY genlock somehow.

I am a beginner in electronics, especially for high speed digital signals, but I can program atmel based MCUs. I happened to own two old logitech pro 9000 cameras, and I opened one up to peek inside (see photo below).

Logitech Pro 9000 PCB Front side

Logitech Pro 9000 PCB Back side

Questions

What I want to know is what I would look for in the board that could be used to retrofit/hack such a genlock?

My naive idea is that by simply disabling the oscillator crystal of one camera and connecting from the other, they would boot and operate at exactly the same clock and maybe this would also result in synchronized frames. Is this idea realistic? Why/Why not?

Any good ideas and suggestions are welcome.

Thanks

\$\endgroup\$
  • \$\begingroup\$ "My naive idea is that by simply disabling the oscillator crystal of one camera and connecting from the other, they would boot and operate at exactly the same clock and maybe this would also result in synchronized frames" - this will not work, the clocks will very quickly deysnc if they are not perfectly timed as the other one. There would need to be a 're-sync' quite often to adjust for clock drift. \$\endgroup\$ – KyranF Mar 6 '15 at 22:22
  • \$\begingroup\$ if they have VSYNC inputs you can perhaps use them to trigger frames simultaneously. Either that or the VSYNC output can be used to trigger the second camera? The issue with all this is how much you can access the hardware/firmware \$\endgroup\$ – KyranF Mar 6 '15 at 22:23
  • 1
    \$\begingroup\$ What you refer to as VSYNC is the same as GENLOCK (genlock is an older video production jargon). And my question is in a way, how I can find if there is such a clock source/input without any inside knowledge about this board, and if one does not exist, how I can make one. \$\endgroup\$ – Lennart Rolland Mar 6 '15 at 22:34
  • \$\begingroup\$ I suggest you find a cheap webcam/digital camera whose circuit board contains an external trigger/interrupt line and can be set up in a way which allows frames to be triggered by this - then you can just trigger both cameras with the same pulse and be sure that the frames are reasonably synchronized. \$\endgroup\$ – KyranF Mar 6 '15 at 23:32
  • \$\begingroup\$ I don't think those exist. :-( Any tips welcome on webcams that do support external sync. \$\endgroup\$ – Lennart Rolland Mar 7 '15 at 0:03
2
\$\begingroup\$

I'm afraid you're almost certainly out of luck. Your "naïve idea" isn't bad as a starting point, but the details are killers. First, the crystal is just part of an oscillator circuit which is contained in the SunPlus ASIC. It's not certain that the resulting clock signal actually appears outside the ASIC, although it is probably sent to the camera. If you can find that clock, in theory you can make a buffer circuit which would send a clock to the slave board. Problem is, you probably can't just feed the received signal into the ASIC crystal connections. (Maybe you can, maybe you can't, it depends on the circuit.) But if you can, this only locks the pixel clocks on the two boards, and does not guarantee that the frames are synchronized.

At a guess, each board has an RC combination which is used by the ASIC to produce a POR (power on reset) signal, and if you can find that you might be able to generate a signal which is sent to the slave board, and both boards would start in the same state at more or less the same time.

This would, in theory, do what you want. I say in theory. There is no way of determining at this remove what the driver software in the receiving PC does to the ASIC internals, and you would have to get the driver to configure both cameras more or less simultaneously. And I have no idea how you would do that. You can download the drivers from Logitech and try to reverse-engineer the code. Lots of luck. Neither Logitech nor Sunplus are likely to release the ASIC details, either.

So, I really can't recommend this as a starter project.

\$\endgroup\$
0
\$\begingroup\$

You have to use hardware-software approach. Think how they make movies. They always have that clap thingies, that starts each scene. They are using that device to actual sync all the cameras and sound equipment.

I think the only way is to use some sort of light strobe or something visual that cameras can synchronize on.

Synchronizing just clock on the devices may not work, there could be different firmware/processing pipe line, and even if time on devices passes in the same way, one device might take slightly longer, than the other to process the frame, so you would get constant lag between two cameras

\$\endgroup\$
  • \$\begingroup\$ Synchronization after-the-fact won't really work for objects in motion, as you will be stuck trying to compare an actual frame from one camera to the result of some interpolation algorithm trying to guess the position in between two actual frame samples from the other. \$\endgroup\$ – Chris Stratton Jun 4 '15 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.