23 const Point2d& principalPoint,
double aspectRatio)
25 const char* fieldnames[] = {
26 "fovx",
"fovy",
"focalLength",
"principalPoint",
"aspectRatio"};
30 s.
set(
"focalLength", focalLength);
31 s.
set(
"principalPoint", principalPoint);
32 s.
set(
"aspectRatio", aspectRatio);
54 Size imageSize(rhs[1].toSize());
55 double apertureWidth = rhs[2].toDouble(),
56 apertureHeight = rhs[3].toDouble(),
57 fovx, fovy, focalLength, aspectRatio;
60 apertureWidth, apertureHeight,
61 fovx, fovy, focalLength, principalPoint, aspectRatio);
62 plhs[0] =
toStruct(fovx, fovy, focalLength, principalPoint, aspectRatio);
MxArray toStruct(double fovx, double fovy, double focalLength, const Point2d &principalPoint, double aspectRatio)
Create a new MxArray from characteristics of camera matrix.
struct mxArray_tag mxArray
Forward declaration for mxArray.
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output 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.
void calibrationMatrixValues(InputArray cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double &fovx, double &fovy, double &focalLength, Point2d &principalPoint, double &aspectRatio)