23 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
34 for (
int i=3; i<nrhs; i+=2) {
35 string key(rhs[i].toString());
37 color = (rhs[i+1].isChar()) ?
38 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
39 else if (key ==
"Colors")
40 colors = MxArrayToVectorVec<double,4>(rhs[i+1]);
41 else if (key ==
"Thickness")
42 thickness = (rhs[i+1].isChar()) ?
44 else if (key ==
"LineType")
45 lineType = (rhs[i+1].isChar()) ?
46 LineType[rhs[i+1].toString()] : rhs[i+1].toInt();
47 else if (key ==
"Shift")
48 shift = rhs[i+1].toInt();
51 "Unrecognized option %s", key.
c_str());
56 if (rhs[1].isNumeric() && rhs[1].numel() == 2) {
57 Point center(rhs[1].toPoint());
58 int radius = rhs[2].toInt();
59 circle(img, center, radius, color, thickness, lineType, shift);
65 if (rhs[2].isNumeric() && rhs[2].numel() == 1) {
66 int radius = rhs[2].toInt();
67 for (
size_t i = 0; i < centers.
size(); ++i)
68 circle(img, centers[i], radius,
70 thickness, lineType, shift);
76 for (
size_t i = 0; i < centers.
size(); ++i)
77 circle(img, centers[i], radii[i],
79 thickness, lineType, shift);
struct mxArray_tag mxArray
Forward declaration for mxArray.
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< std::string, int > LineType
Line type for drawing.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
const ConstMap< std::string, int > ThicknessType
Thickness type for drawing.
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
const ConstMap< std::string, cv::Scalar > ColorType
Translates MATLAB color names (see ColorSpec) into OpenCV scalars.