36 int id = rhs[0].toInt();
37 string method(rhs[1].toString());
40 if (method ==
"new") {
52 if (method ==
"delete") {
57 else if (method ==
"clear") {
61 else if (method ==
"load") {
62 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs==0);
64 bool loadFromString =
false;
65 for (
int i=3; i<nrhs; i+=2) {
66 string key(rhs[i].toString());
68 objname = rhs[i+1].toString();
69 else if (key ==
"FromString")
70 loadFromString = rhs[i+1].toBool();
73 "Unrecognized option %s", key.
c_str());
82 FileStorage fs(rhs[2].toString(), FileStorage::READ +
83 (loadFromString ? FileStorage::MEMORY : 0));
92 else if (method ==
"save") {
94 obj->
save(rhs[2].toString());
96 else if (method ==
"empty") {
100 else if (method ==
"getDefaultName") {
104 else if (method ==
"interpolate") {
110 to_points(rhs[5].toVector<Point2f>());
112 to_image, to_points, dense_flow);
115 else if (method ==
"get") {
117 string prop(rhs[2].toString());
120 else if (prop ==
"Sigma")
122 else if (prop ==
"Lambda")
124 else if (prop ==
"UsePostProcessing")
126 else if (prop ==
"FGSLambda")
128 else if (prop ==
"FGSSigma")
132 "Unrecognized property %s", prop.
c_str());
134 else if (method ==
"set") {
136 string prop(rhs[2].toString());
138 obj->
setK(rhs[3].toInt());
139 else if (prop ==
"Sigma")
141 else if (prop ==
"Lambda")
143 else if (prop ==
"UsePostProcessing")
145 else if (prop ==
"FGSLambda")
147 else if (prop ==
"FGSSigma")
151 "Unrecognized property %s", prop.
c_str());
155 "Unrecognized operation %s", method.
c_str());
virtual void setK(int _k)=0
virtual void interpolate(InputArray from_image, InputArray from_points, InputArray to_image, InputArray to_points, OutputArray dense_flow)=0
virtual float getFGSSigma()=0
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
virtual void setFGSSigma(float _sigma)=0
virtual float getFGSLambda()=0
virtual float getLambda()=0
virtual bool isOpened() const
struct mxArray_tag mxArray
Forward declaration for mxArray.
virtual void setLambda(float _lambda)=0
virtual void setFGSLambda(float _lambda)=0
map< int, Ptr< EdgeAwareInterpolator > > obj_
Object container.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
virtual void read(const FileNode &fn)
virtual float getSigma()=0
Ptr< EdgeAwareInterpolator > createEdgeAwareInterpolator()
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 void setUsePostProcessing(bool _use_post_proc)=0
virtual String getDefaultName() const
virtual void setSigma(float _sigma)=0
Global constant definitions.
virtual bool getUsePostProcessing()=0
int last_id
Last object id to allocate.
virtual void save(const String &filename) const
virtual bool empty() const