SwisTrack/Components/CalibrationFileTSAI
Description
editCamera 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
editParticles
Output
editParticles
Parameters
editCalib. Points
editThis 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:
<?xml version="1.0"?> <pointlist> <points> <point> <xworld>0.3</xworld> <yworld>0.9</yworld> <ximage>9.8</ximage> <yimage>10.3</yimage> </point> <point> <xworld>34.1</xworld> <yworld>7.9</yworld> <ximage>44.3</ximage> <yimage>25.9</yimage> </point> </points> </pointlist>
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.
editPath the XML file containing the calibration parameters. The file must have the following format:
<?xml version="1.0"?> <calibration> <parameters> <R> <aa>-0.0009487</aa> <ab>-0.95497</ab> <ac>0.29671</ac> <ba>1</ba> <bb>-0.00062456</bb> <bc>0.0011873</bc> <ca>-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> <value>4.65e-006</value> </dx> <dy> <value>4.65e-006</value> </dy> <sx> <value>1.042</value> </sx> <k> <value>-0.066654</value> </k> <f> <value>-0.01293</value> </f> </parameters> </calibration>