17 (
"single2", CV_32FC2);
21 (
"Ortho", cv::PROJ_SPHERICAL_ORTHO)
22 (
"EqRect", cv::PROJ_SPHERICAL_EQRECT);
32 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
35 nargchk(nrhs>=4 && (nrhs%2)==0 && nlhs<=3);
38 vector<MxArray> rhs(prhs, prhs+nrhs);
42 int projType = cv::PROJ_SPHERICAL_EQRECT;
44 for (
int i=4; i<nrhs; i+=2) {
45 string key(rhs[i].toString());
47 m1type = (rhs[i+1].isChar()) ?
48 M1Type[rhs[i+1].toString()] : rhs[i+1].toInt();
49 else if (key ==
"ProjType")
50 projType = ProjTypeMap[rhs[i+1].toString()];
51 else if (key ==
"Alpha")
52 alpha = rhs[i+1].toDouble();
54 mexErrMsgIdAndTxt(
"mexopencv:error",
55 "Unrecognized option %s", key.c_str());
59 Mat cameraMatrix(rhs[0].toMat(CV_64F)),
60 distCoeffs(rhs[1].toMat(CV_64F)),
62 Size imageSize(rhs[2].toSize());
63 int destImageWidth = rhs[3].toInt();
64 float scale = initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize,
65 destImageWidth, m1type, map1, map2, projType, alpha);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.