19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
25 vector<MxArray> rhs(prhs, prhs+nrhs);
28 if (rhs[0].isNumeric()) {
30 Mat src(rhs[0].toMat(rhs[0].isSingle() ? CV_32F : CV_64F)), dst;
31 bool cn1 = (src.channels() == 1);
32 convertPointsFromHomogeneous(src, dst);
33 if (cn1) dst = dst.reshape(1,0);
36 else if (rhs[0].isCell() && !rhs[0].isEmpty()) {
37 mwSize dims = rhs[0].at<
MxArray>(0).numel();
40 vector<Point3d> src(rhs[0].toVector<Point3d>());
42 convertPointsFromHomogeneous(src, dst);
49 vector<Vec4d> src(MxArrayToVectorVec<double,4>(rhs[0]));
51 convertPointsFromHomogeneous(src, dst);
56 mexErrMsgIdAndTxt(
"mexopencv:error",
"Invalid input");
59 mexErrMsgIdAndTxt(
"mexopencv:error",
"Invalid input");
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.