15 (
"7Point", cv::FM_7POINT)
16 (
"8Point", cv::FM_8POINT)
17 (
"Ransac", cv::FM_RANSAC)
18 (
"LMedS", cv::FM_LMEDS);
28 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
31 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=2);
34 vector<MxArray> rhs(prhs, prhs+nrhs);
37 int method = cv::FM_RANSAC;
40 for (
int i=2; i<nrhs; i+=2) {
41 string key(rhs[i].toString());
43 method = FMMethod[rhs[i+1].toString()];
44 else if (key==
"Param1")
45 param1 = rhs[i+1].toDouble();
46 else if (key==
"Param2")
47 param2 = rhs[i+1].toDouble();
49 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
54 if (rhs[0].isNumeric() && rhs[1].isNumeric()) {
55 Mat points1(rhs[0].toMat(CV_32F)),
56 points2(rhs[1].toMat(CV_32F));
57 F = findFundamentalMat(points1, points2, method, param1, param2,
58 (nlhs>1 ? mask : noArray()));
60 else if (rhs[0].isCell() && rhs[1].isCell()) {
61 vector<Point2f> points1(rhs[0].toVector<Point2f>()),
62 points2(rhs[1].toVector<Point2f>());
63 F = findFundamentalMat(points1, points2, method, param1, param2,
64 (nlhs>1 ? mask : noArray()));
67 mexErrMsgIdAndTxt(
"mexopencv:error",
"Invalid argument");
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.