33 for (; first != last; first += 2) {
34 string key(first->toString());
35 const MxArray& val = *(first + 1);
37 max_iter = val.
toInt();
38 else if (key ==
"Threshold")
42 "Unrecognized option %s", key.c_str());
62 int id = rhs[0].toInt();
63 string method(rhs[1].toString());
66 if (method ==
"new") {
79 if (method ==
"delete") {
84 else if (method ==
"clear") {
88 else if (method ==
"load") {
89 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs==0);
91 bool loadFromString =
false;
92 for (
int i=3; i<nrhs; i+=2) {
93 string key(rhs[i].toString());
95 objname = rhs[i+1].toString();
96 else if (key ==
"FromString")
97 loadFromString = rhs[i+1].toBool();
100 "Unrecognized option %s", key.
c_str());
109 FileStorage fs(rhs[2].toString(), FileStorage::READ +
110 (loadFromString ? FileStorage::MEMORY : 0));
119 else if (method ==
"save") {
121 obj->
save(rhs[2].toString());
123 else if (method ==
"empty") {
127 else if (method ==
"getDefaultName") {
131 else if (method ==
"process") {
144 else if (method ==
"getRadiance") {
148 else if (method ==
"get") {
150 string prop(rhs[2].toString());
151 if (prop ==
"MaxIter")
153 else if (prop ==
"Threshold")
157 "Unrecognized property %s", prop.
c_str());
159 else if (method ==
"set") {
161 string prop(rhs[2].toString());
162 if (prop ==
"MaxIter")
164 else if (prop ==
"Threshold")
168 "Unrecognized property %s", prop.
c_str());
172 "Unrecognized operation %s", method.
c_str());
virtual void setThreshold(float threshold)=0
int toInt() const
Convert MxArray to int.
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
virtual Mat getRadiance() const=0
virtual bool isOpened() const
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
struct mxArray_tag mxArray
Forward declaration for mxArray.
map< int, Ptr< CalibrateRobertson > > obj_
Object container.
virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times)=0
virtual float getThreshold() const=0
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...
int last_id
Last object id to allocate.
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
Ptr< CalibrateRobertson > createCalibrateRobertson(int max_iter=30, float threshold=0.01f)
virtual String getDefaultName() const
Global constant definitions.
Ptr< CalibrateRobertson > create_CalibrateRobertson(vector< MxArray >::const_iterator first, vector< MxArray >::const_iterator last)
Create an instance of CalibrateRobertson using options in arguments.
double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
virtual int getMaxIter() const=0
virtual void save(const String &filename) const
virtual bool empty() const
virtual void setMaxIter(int max_iter)=0