SwisTrack/Components/CalibrationFileTSAI

Description
Camera calibration using an algorithm proposed by Tsai. We use it to transform the image coordinates in world coordinates. More information about it can be found in his paper : "An Efficient and Accurate Camera Calibration Technique for 3D Machine Vision", Roger Y. Tsai, Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Miami Beach, FL, 1986, pages 364-374." or on this website. The calibration code come from this website.

For a deformed image, TSAI is better than a purely linear second order calibration method. However, it is slower, and sometimes, when the camera axis is orthogonal the to setup plan, TSAI method can lead to error in computation and tremendous errors, and even crash of the method.

A good presentation of the parameters can be found here.

This component is different from CalibrationTSAI as it does not compute the parameters and load them from a xml file.

Tools to compute these parameters with matlab/octave are provided in calibrationTools/Matlab_Octave. The following files can be used:
 * computeTsaiCalibrationParameters.m: Compute the Tsai parameters from calibration points coordinates (coplanar calibration)
 * TsaiImage2World.m: Transform the image coordinates to world coordinates using the Tsai calibration parameters (It is the same implementation than the one used in this component)
 * WriteTSAICalibrationParametersXMLFile.m: Write a Tsai calibration parameters in the right format for the component.
 * WriteSwisTrackCalibrationXMLFile.m: Write calibration points to a xml file compatible with swisTrack
 * readSwisTrackCalibrationXMLFile.m: Read calibration points from a xml file compatible with swisTrack
 * optimizeSx.m: Search for the optimal value of sx for the calibration
 * computeError.m: Compute the calibration errors

Input
Particles

Output
Particles

Calib. Points
This file is not mandatory as they are not used to compute the calibration paramters. If provided, the component compute the calibration errors and write them in a log file. Path the XML file containing the calibration points. The file must have the following format:

 0.3      0.9       9.8       10.3       34.1       7.9       44.3       25.9

More points can be added in the same way as the two points in this example. A minimum of 5 non-collinear points is needed to compute the calibration.

Calib. Param.
Path the XML file containing the calibration parameters. The file must have the following format:

  -0.0009487 -0.95497 0.29671 1 -0.00062456 0.0011873 -0.00094847</ca> <cb>0.29671</cb> <cc>0.95497</cc> </R> <T> <Tx>7.2682</Tx> <Ty>-1.1722</Ty> <Tz>-15.1438</Tz> </T> <C> <Cx>516</Cx> <Cy>389</Cy> </C> <dx> 4.65e-006 </dx> <dy> 4.65e-006 </dy> <sx> 1.042 		</sx> <k> -0.066654 		</k> <f> -0.01293 		</f>