15 (
"Standard", cv::HOUGH_STANDARD)
16 (
"Probabilistic", cv::HOUGH_PROBABILISTIC)
17 (
"MultiScale", cv::HOUGH_MULTI_SCALE)
18 (
"Gradient", cv::HOUGH_GRADIENT);
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);
36 Mat image(rhs[0].toMat(CV_8U));
39 int method = cv::HOUGH_GRADIENT;
41 double minDist = image.rows/8;
46 for (
int i=1; i<nrhs; i+=2) {
47 string key(rhs[i].toString());
49 method = HoughModesMap[rhs[i+1].toString()];
51 dp = rhs[i+1].toDouble();
52 else if (key==
"MinDist")
53 minDist = rhs[i+1].toDouble();
54 else if (key==
"Param1")
55 param1 = rhs[i+1].toDouble();
56 else if (key==
"Param2")
57 param2 = rhs[i+1].toDouble();
58 else if (key==
"MinRadius")
59 minRadius = rhs[i+1].toInt();
60 else if (key==
"MaxRadius")
61 maxRadius = rhs[i+1].toInt();
63 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
67 vector<Vec3f> circles;
68 HoughCircles(image, circles, method, dp, minDist,
69 param1, param2, minRadius, maxRadius);
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.