19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
25 vector<MxArray> rhs(prhs, prhs+nrhs);
28 Mat F(rhs[0].toMat(CV_64F));
29 if (rhs[1].isNumeric() && rhs[2].isNumeric()) {
30 Mat points1(rhs[1].toMat(CV_64F)),
31 points2(rhs[2].toMat(CV_64F)),
32 newPoints1, newPoints2;
33 correctMatches(F, points1.reshape(2,1), points2.reshape(2,1),
34 newPoints1, newPoints2);
35 if (points1.channels() == 1)
36 newPoints1 = newPoints1.reshape(1, newPoints1.cols);
37 if (points2.channels() == 1)
38 newPoints2 = newPoints2.reshape(1, newPoints2.cols);
43 else if (rhs[1].isCell() && rhs[2].isCell()) {
44 vector<Point2d> points1(rhs[1].toVector<Point2d>()),
45 points2(rhs[2].toVector<Point2d>()),
46 newPoints1, newPoints2;
47 correctMatches(F, points1, points2, newPoints1, newPoints2);
53 mexErrMsgIdAndTxt(
"mexopencv:error",
"Invalid input");
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.