===================================================
  Camera Sync Tester Version 0.1.1, July 18, 2005
===================================================


Copyright
---------

(c) 2004-2005 by Peter Wimmer
Camera Sync Tester is free for non-commercial use.

You use this software at your own risk, we are not responsibility for any
loss or damage that might result from its use or misuse.


Contact
-------

Peter Wimmer
Ghegastr. 30
4020 Linz
Austria

http://www.3dtv.at
office@3dtv.at


Command Line Parameters
-----------------------

-x  Horizontal screen resolution
-y  Vertical screen resolution, limited to 768 pixel
-f  Refresh rate

Example: Synctest.exe -x1024 -y768 -r100 runs the Camera Sync Tester at a
resolution of 1024 x 768 pixel at 100 Hz.


Introduction
------------

The Camera Sync Tester software has been developed to measure the mis-sync
of video cameras using a CRT monitor's electron beam as reference motion.
Knowing the mis-sync of cameras is, for example, important when recording
stereoscopic videos using two cameras.

Measuring mis-sync is usually done by recording a well known motion so that
the time offset based on different stages of motion can be calculated
afterwards. Real moving objects are difficult to handle. It is much simpler to
use a CRT monitor's electron beam as reference motion instead.


Using Camera Sync Tester
------------------------

To measure the mis-sync, run the Camera Sync Tester and capture the screen
using the cameras under test. Try to keep the exposure time of both cameras as
short as possible. Please note that only CRT monitors can be used for this
purpose, LCD displays don't work!

Afterwards, analyze corresponding frames taken from the first and second
camera. In each frame, you see the position of the monitor's electron beam,
but usually this position will be different for the frames of the first and
second camera (except they are 100% in sync). The difference of the last
visible lines corresponds to the mis-sync. Depending on the exposure time,
more than one line will be visible. We strongly recommend to use the positions
of the bottom lines for doing the calculations, because these are the ones
drawn most recently (the top lines are fading away, so there will be no sharp
edge).

For the following calculations, we need the monitor's horizontal (fHoriz) and
vertical (fVert) refresh rates. You monitor's on-screen menu will tell you
these value. The time the electron beam needs to draw one line is:

  tLine = 1 / fHoriz
  
The time the electron beam needs to draw a whole frame is:

  tFrame = 1 / fVert  

To calculate the mis-sync tOffset, we multiplay tLine with the difference of the last
line numbers z1 and z2 visible in the left and right image:

  tOffset = (z2 - z1) / fHoriz

If left and right frames do not show the same number of vertical bars then the
mis-sync is greater than the duration of one screen refresh cycle! In this
case, one or more screen refresh cycles (tFrame) must be added to the
previous result.

  tOffset = (z2 - z1) / fHoriz + (b2 - b1) / fVert

The Camera Sync Tester package includes an Excel spreadsheat which allows to
evaluate the results of multiple measurements conveniently.


Example
-------

Take a look at Sample.bmp included in the Camera Sync Tester package. As you
can see, the right image was recorded slightly earlier, since the electron beam
has just reached line z1 = 223 whereas it is already at line z2 = 403 on the
left image. Both images where taken during the same refresh cycle because the
number of vertical bars are equal (b1 = b2 = 2).

In our example, the screen was set to the standard VGA mode at 60 Hz (fHoriz =
31.5 kHz, fVert = 60 Hz) while taking the images. Don't confuse horizontal and
vertical frequencies. The horizontal frequency fHoriz is always higher than the
vertical frequency, which is usually in the range of 60 - 200 Hz.

  tOffset = (403 - 223) / 31500 Hz + (2 - 2) / 60 Hz = 5.7 ms


Choosing resolution and refresh rate
------------------------------------

What resolution and refresh rates should be used? For videos, the default
settings, 640 x 480 pixel at 60 Hz are sufficient. A higher resolution does
not make sense because you would not be able to distinguish lines anymore.
A higher refresh rate does not make sense either. However, if you want to
measure the mis-sync of your high resolution stereo photo camera, a higher
resolution could make sense.
