30 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=2);
37 double ransacReprojThreshold = 3.0;
38 size_t maxIters = 2000;
39 double confidence = 0.99;
40 size_t refineIters = 10;
41 for (
int i=2; i<nrhs; i+=2) {
42 string key(rhs[i].toString());
45 else if (key ==
"RansacThreshold")
46 ransacReprojThreshold = rhs[i+1].toDouble();
47 else if (key ==
"MaxIters")
48 maxIters = rhs[i+1].toInt();
49 else if (key ==
"Confidence")
50 confidence = rhs[i+1].toDouble();
51 else if (key ==
"RefineIters")
52 refineIters = rhs[i+1].toInt();
55 "Unrecognized option %s", key.
c_str());
60 if (rhs[0].isNumeric() && rhs[1].isNumeric()) {
64 method, ransacReprojThreshold, maxIters, confidence, refineIters);
66 else if (rhs[0].isCell() && rhs[1].isCell()) {
68 to(rhs[1].toVector<Point2f>());
70 method, ransacReprojThreshold, maxIters, confidence, refineIters);
cv::Mat estimateAffine2D(InputArray from, InputArray to, OutputArray inliers=noArray(), int method=RANSAC, double ransacReprojThreshold=3, size_t maxIters=2000, double confidence=0.99, size_t refineIters=10)
struct mxArray_tag mxArray
Forward declaration for mxArray.
InputOutputArray noArray()
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
const ConstMap< string, int > MethodsMap
Estimation methods for option processing.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.