15 (
"SqDiff", cv::TM_SQDIFF)
16 (
"SqDiffNormed", cv::TM_SQDIFF_NORMED)
17 (
"CCorr", cv::TM_CCORR)
18 (
"CCorrNormed", cv::TM_CCORR_NORMED)
19 (
"CCoeff", cv::TM_CCOEFF)
20 (
"CCoeffNormed", cv::TM_CCOEFF_NORMED);
30 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
33 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
36 vector<MxArray> rhs(prhs, prhs+nrhs);
39 int method = cv::TM_SQDIFF;
41 for (
int i=2; i<nrhs; i+=2) {
42 string key(rhs[i].toString());
44 method = (rhs[i+1].isChar() ?
45 MatchMethod[rhs[i+1].toString()] : rhs[i+1].toInt());
47 mask = rhs[i+1].toMat(CV_8U);
49 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
53 Mat image(rhs[0].toMat(rhs[0].isUint8() ? CV_8U : CV_32F)),
54 templ(rhs[1].toMat(rhs[1].isUint8() ? CV_8U : CV_32F)),
56 matchTemplate(image, templ, result, method, mask);
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput 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.