16 (
"SVD", cv::DECOMP_SVD)
17 (
"EIG", cv::DECOMP_EIG)
18 (
"Cholesky", cv::DECOMP_CHOLESKY)
19 (
"QR", cv::DECOMP_QR);
29 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
32 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=2);
35 vector<MxArray> rhs(prhs, prhs+nrhs);
38 int flags = cv::DECOMP_LU;
39 bool is_normal =
false;
40 for (
int i=2; i<nrhs; i+=2) {
41 string key(rhs[i].toString());
43 flags = DecompTypesMap[rhs[i+1].toString()];
44 else if (key ==
"IsNormal")
45 is_normal = rhs[i+1].toBool();
47 mexErrMsgIdAndTxt(
"mexopencv:error",
48 "Unrecognized option %s", key.c_str());
50 flags |= (is_normal ? cv::DECOMP_NORMAL : 0);
53 Mat src1(rhs[0].toMat(rhs[0].isSingle() ? CV_32F : CV_64F)),
54 src2(rhs[1].toMat(rhs[1].isSingle() ? CV_32F : CV_64F)),
56 bool ret = solve(src1, src2, dst, flags);
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.