36 int id = rhs[0].toInt();
37 string method(rhs[1].toString());
40 if (method ==
"new") {
53 if (method ==
"delete") {
58 else if (method ==
"clear") {
62 else if (method ==
"load") {
63 nargchk(nrhs>=3 && (nrhs%2)!=0 && nlhs==0);
65 bool loadFromString =
false;
66 for (
int i=3; i<nrhs; i+=2) {
67 string key(rhs[i].toString());
69 objname = rhs[i+1].toString();
70 else if (key ==
"FromString")
71 loadFromString = rhs[i+1].toBool();
74 "Unrecognized option %s", key.
c_str());
83 FileStorage fs(rhs[2].toString(), FileStorage::READ +
84 (loadFromString ? FileStorage::MEMORY : 0));
93 else if (method ==
"save") {
95 obj->
save(rhs[2].toString());
97 else if (method ==
"empty") {
101 else if (method ==
"getDefaultName") {
105 else if (method ==
"computeDistance") {
108 if (rhs[2].isNumeric() && rhs[3].isNumeric()) {
114 else if (rhs[2].isCell() && rhs[3].isCell()) {
116 contour2(rhs[3].toVector<Point2f>());
123 else if (method ==
"get") {
125 string prop(rhs[2].toString());
126 if (prop ==
"DistanceFlag")
128 else if (prop ==
"RankProportion")
132 "Unrecognized property %s", prop.
c_str());
134 else if (method ==
"set") {
136 string prop(rhs[2].toString());
137 if (prop ==
"DistanceFlag")
139 else if (prop ==
"RankProportion")
143 "Unrecognized property %s", prop.
c_str());
147 "Unrecognized operation %s", method.
c_str());
Common definitions for the shape module.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
const ConstMap< int, std::string > NormTypeInv
Inverse norm type map for option processing.
virtual bool isOpened() const
struct mxArray_tag mxArray
Forward declaration for mxArray.
virtual void read(const FileNode &fn)
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...
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
FileNode getFirstTopLevelNode() const
virtual String getDefaultName() const
Global constant definitions.
virtual void save(const String &filename) const
virtual bool empty() const
cv::Ptr< cv::HausdorffDistanceExtractor > create_HausdorffDistanceExtractor(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of HausdorffDistanceExtractor using options in arguments.
const ConstMap< std::string, int > NormType
Norm type map for option processing.