/*! initialise the camera from a calibration matrix. Using a calibration matrix leads to a camera without distorsion The K matrix in parameters must be like: \f$ K = \left(\begin{array}{ccc} p_x & 0 & u_0 \\ 0 & p_y & v_0 \\ 0 & 0 & 1 \end{array} \right) \f$ \param _K : the 3by3 calibration matrix */ void vpCameraParameters::initFromCalibrationMatrix(const vpMatrix& _K) { if(_K.getRows() != 3 || _K.getCols() != 3 ){ throw vpException(vpException::dimensionError, "bad size for calibration matrix"); } if( std::fabs(_K[2][2] - 1.0) > std::numeric_limits<double>::epsilon()){ throw vpException(vpException::badValue, "bad value: K[2][2] must be equal to 1"); } initPersProjWithoutDistortion (_K[0][0], _K[1][1], _K[0][2], _K[1][2]); }
/*! Constructor for perspective projection without distortion model \param cam_px,cam_py : pixel size \param cam_u0,cam_v0 : principal points */ vpCameraParameters::vpCameraParameters(const double cam_px, const double cam_py, const double cam_u0, const double cam_v0) : px(DEFAULT_PX_PARAMETER), py(DEFAULT_PY_PARAMETER), u0(DEFAULT_U0_PARAMETER), v0(DEFAULT_V0_PARAMETER), kud(DEFAULT_KUD_PARAMETER), kdu(DEFAULT_KDU_PARAMETER), width(0), height(0), isFov(false), m_hFovAngle(0), m_vFovAngle(0), fovNormals(), inv_px(1./DEFAULT_PX_PARAMETER), inv_py(1./DEFAULT_PY_PARAMETER), projModel(DEFAULT_PROJ_TYPE) { initPersProjWithoutDistortion(cam_px,cam_py,cam_u0,cam_v0) ; }
/*! Constructor for perspective projection without distortion model \param px,py : pixel size \param u0,v0 : principal points */ vpCameraParameters::vpCameraParameters(const double px, const double py, const double u0, const double v0) { initPersProjWithoutDistortion(px,py,u0,v0) ; }