16 #ifndef _Aruco_CameraParameters_H
17 #define _Aruco_CameraParameters_H
20 #include <opencv2/core/core.hpp>
50 CameraParameters(cv::Mat cameraMatrix, cv::Mat distorsionCoeff, cv::Size size);
56 void setParams(cv::Mat cameraMatrix, cv::Mat distorsionCoeff, cv::Size size);
65 return CameraMatrix.rows != 0 && CameraMatrix.cols != 0 && Distorsion.rows != 0 &&
66 Distorsion.cols != 0 && CamSize.width != -1 && CamSize.height != -1;
74 void saveToFile(std::string path,
bool inXML =
true);
78 void readFromXMLFile(std::string filePath);
82 void resize(cv::Size size);
89 static cv::Point3f getCameraLocation(
const cv::Mat &Rvec,
const cv::Mat &Tvec);
104 void glGetProjectionMatrix(cv::Size orgImgSize, cv::Size size,
double proj_matrix[16],
105 double gnear,
double gfar,
bool invert =
false);
117 void OgreGetProjectionMatrix(cv::Size orgImgSize, cv::Size size,
double proj_matrix[16],
118 double gnear,
double gfar,
bool invert =
false);
122 static cv::Mat
getRTMatrix(
const cv::Mat &R_,
const cv::Mat &T_,
int forceType);
135 static void argConvGLcpara2(
double cparam[3][4],
int width,
int height,
double gnear,
136 double gfar,
double m[16],
bool invert);
137 static int arParamDecompMat(
double source[3][4],
double cpara[3][4],
double trans[3][4]);
138 static double norm(
double a,
double b,
double c);
139 static double dot(
double a1,
double a2,
double a3,
double b1,
double b2,
double b3);