Skip to content
Zoltan Derzsi edited this page May 30, 2018 · 25 revisions

You cannot calibrate the Optotrak system.
The calibration process is done in NDI's factory/workshop, and they make sure that the sensor units are as accurate as possible. Provided that you don't physically abuse your cameras or you won't subject them to extreme temperatures, they won't get mis-aligned. If you are way too curious for your own good and decided to look inside a camera and you meddled with an optical assembly, you will have to send it back to NDI. In the MOTOM toolbox, the returned coordinates are always in millimetres. What you can do is to align a coordinate system of a camera to your liking, and if you have many cameras looking at your experimental rig from many angles, you can register them together into a common coordinate system.
Registration and alignment, irrespective of how many cameras you use, will need the following:

  • A working Optotrak system
  • A working rigid body
  • You being able to move and strategically place the rigid body accordingly.

You can manipulate the coordinate system using OptotrakChangeCameraFOR() at will, but please do so at your own risk.

How does it work?

You need to initialise your system with the standard camera parameters, and be able to record a couple of hundred frames of raw data to your disk. You will also need to load a rigid body to the system as well, the alignment is the process of assigning the rigid body's local coordinate system to the camera's global coordinate system. In the toolbox, this happens by calling optotrak_align_coordinate_system(), which is a wrapper function of nOptotrakAlignSystem(). The freshly generated camera file contains the new camera parameters, and you will need to load it in your own experiment.

If you use many cameras, you will have additional steps to do.

  1. Initialise the system with the standard camera parameter file
  2. Record raw data while you are moving the rigid body. Be sure that it stays visible to all cameras all the time
  3. Generate the registered camera file with optotrak_register_system_dynamic(), which is a wrapper function of nOptotrakRegisterSystem().
  4. Re-initialise the system, but this time, load the newly generated registered camera file, instead of the standard one.
  5. Position your rigid body very carefully, where you want your coordinate system to align to
  6. Record raw data again, but this time make sure that the rigid body is aligned the way you want it and is visible to all cameras
  7. Generate the new camera file using optotrak_align_system()
  8. Save the newly generated camera file, which now holds the perfect registration and alignment to your desire.

Implementation

The stand-alone scripts that are not included in the path by default are located in the Alignment directory.
From the toolbox, an implementation that detects your environment is available by calling optotrak_align_my_system(config_file, rigid_body_file).
Please follow the instructions as they appear in the command window. If you have to perform the registration process, which requires you stepping away from the monitor, the system will interact with you via a visible dialogue box and will tell you exactly what to do when, like so:

As you have more than one camera, you will need to register them together. This requires the rigid body to be moved about in a volume.
There will be a countdown in a dialogue box. When this dialogue box disappears, the recording begins. When the dialog box re-appears, the recording has finished.
Press Enter in the command window to continue.
>> 

It is also worth noting that the execution of this function will create the following files with a timestamp in their names in the directory it is executed from:

  • recording_used_for_aregistration_yyyy-mm-dd_HH-MM.dat If you are lucky enough to have many cameras, the script will record you moving the rigid body with the unregistered and unaligned camera parameters to this file.
  • Registered_yyyy-mm-dd_HH-MM.cam This is the output camera file after the execution of optotrak_register_system_dynamic().
  • Registration_yyyy-mm-dd_HH-MM.log The registration process also generates a logfile. This is useful to check for errors when the registration error is larger than what you would expect.
  • recording_used_for_alignment_yyyy-mm-dd_HH-MM.dat This file contains the raw data recording of the stationary rigid body, for the purpose of aligning the global coordinate system to the rigid body's local coordinate system. This is the recording that is used in optotrak_align_coordinate_system()
  • Aligned_yyyy-mm-dd_HH-MM.cam This is the output camera file after the execution of optotrak_align_coordinate_system(). Save this file, and use it in your application or experiment.
  • Alignment_yyyy-mm-dd_HH-MM.log Just like the registration, the alignment algorithm generates a logfile too. Again, this is useful to check for errors when the registration error is larger than what you would expect.