22 const Point2d& principalPoint,
double aspectRatio)
24 const char* fieldnames[] = {
25 "fovx",
"fovy",
"focalLength",
"principalPoint",
"aspectRatio"};
29 s.
set(
"focalLength", focalLength);
30 s.
set(
"principalPoint", principalPoint);
31 s.
set(
"aspectRatio", aspectRatio);
43 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
49 vector<MxArray> rhs(prhs, prhs+nrhs);
52 Mat cameraMatrix(rhs[0].toMat(CV_64F));
53 Size imageSize(rhs[1].toSize());
54 double apertureWidth = rhs[2].toDouble(),
55 apertureHeight = rhs[3].toDouble(),
56 fovx, fovy, focalLength, aspectRatio;
57 Point2d principalPoint;
58 calibrationMatrixValues(cameraMatrix, imageSize,
59 apertureWidth, apertureHeight,
60 fovx, fovy, focalLength, principalPoint, aspectRatio);
61 plhs[0] =
toStruct(fovx, fovy, focalLength, principalPoint, aspectRatio);
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
MxArray toStruct(const std::vector< cv::ml::DTrees::Node > &nodes)
Convert tree nodes to struct array.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
static MxArray Struct(const char **fields=NULL, int nfields=0, mwSize m=1, mwSize n=1)
Create a new struct array.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.