42 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
53 for (
int i=2; i<nrhs; i+=2) {
54 string key(rhs[i].toString());
56 color = (rhs[i+1].isChar()) ?
57 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
58 else if (key ==
"MarkerType")
59 markerType = (rhs[i+1].isChar()) ?
61 else if (key ==
"MarkerSize")
62 markerSize = rhs[i+1].toInt();
63 else if (key ==
"Thickness")
64 thickness = (rhs[i+1].isChar()) ?
66 else if (key ==
"LineType")
67 line_type = (rhs[i+1].isChar()) ?
68 LineType[rhs[i+1].toString()] : rhs[i+1].toInt();
71 "Unrecognized option %s", key.
c_str());
76 Point position(rhs[1].toPoint());
77 drawMarker(img, position, color, markerType, markerSize, thickness,
const ConstMap< string, int > MarkerTypeMap
Marker types for option processing.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
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 drawMarker(Mat &img, Point position, const Scalar &color, int markerType=MARKER_CROSS, int markerSize=20, int thickness=1, int line_type=8)
const ConstMap< std::string, cv::Scalar > ColorType
Translates MATLAB color names (see ColorSpec) into OpenCV scalars.
std::map wrapper with one-line initialization and lookup method.