/***************************************************************************
* Copyright (C) 2008 by Luca Baronti *
* lbaronti@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/***************************************************************************
History
Modified by sottile on July 2009
****************************************************************************/
/** Tsai Methods -- Interface with the tsai lib
The class is static, so a simple call to calibrate()
is
sufficient to get a calibrated shot.
Comment:
Sometimes the Tsai Lib returns a irregular shifted translation values.
Since now no solution found.
*/
/****************************************************************************\
* *
* Camera parameters are usually the fixed parameters of the given camera *
* system, typically obtained from manufacturers specifications. *
* *
* Cy and Cy (the center of radial lens distortion), may be calibrated *
* separately or as part of the coplanar/noncoplanar calibration. *
* The same with sx (x scale uncertainty factor). *
* *
\*******************************************************************************/
#ifndef _TSAI_METHODS_
#define _TSAI_METHODS_
#include
#include
#include
#include
#include
// minimum points that need tsai for a proper calibration
static const int MIN_POINTS_FOR_CALIBRATE = 13;
struct TsaiCorrelation {
vcg::Point3d point3d;
vcg::Point2d point2d;
};
class TsaiMethods
{
public:
//Calibration of the shot according to the 2D and 3D points
static bool calibrate( vcg::Shot* shot,std::list* corr, bool p_foc); /// send all the valid binded points of the image at the calibration lib, then set the intinsic param of the image
///Transformation of the camera data between tsai structure and vcg structure
static void Shot2Tsai(vcg::Shot*);
///Transformation of the camera data between tsai structure and vcg structure
static void Tsai2Shot(vcg::Shot*, bool p_foc=true);
private:
static void Cam2Tsai(vcg::Shot*);
static bool createDataSet(std::list* corr,vcg::Shot* s);
};
#endif //_TSAI_METHODS_