15 (
"AGAST_5_8", cv::AgastFeatureDetector::AGAST_5_8)
16 (
"AGAST_7_12d", cv::AgastFeatureDetector::AGAST_7_12d)
17 (
"AGAST_7_12s", cv::AgastFeatureDetector::AGAST_7_12s)
18 (
"OAST_9_16", cv::AgastFeatureDetector::OAST_9_16);
28 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
31 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
34 vector<MxArray> rhs(prhs, prhs+nrhs);
38 bool nonmaxSupression =
true;
39 int type = cv::AgastFeatureDetector::OAST_9_16;
40 for (
int i=1; i<nrhs; i+=2) {
41 string key(rhs[i].toString());
42 if (key ==
"Threshold")
43 threshold = rhs[i+1].toInt();
44 else if (key ==
"NonmaxSuppression")
45 nonmaxSupression = rhs[i+1].toBool();
46 else if (key ==
"Type")
47 type = AgastTypeMap[rhs[i+1].toString()];
49 mexErrMsgIdAndTxt(
"mexopencv:error",
50 "Unrecognized option %s",key.c_str());
54 Mat image(rhs[0].toMat(CV_8U));
55 vector<KeyPoint> keypoints;
56 AGAST(image, keypoints, threshold, nonmaxSupression, type);
const ConstMap< std::string, int > AgastTypeMap
AGAST neighborhood types.
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.
std::map wrapper with one-line initialization and lookup method.