wrapped Algorithm class.

This commit is contained in:
Vadim Pisarevsky
2012-04-20 17:03:02 +00:00
parent 8b6d1f6e45
commit 9213bba48a
3 changed files with 72 additions and 13 deletions

View File

@@ -4272,7 +4272,7 @@ template<typename _Tp> struct ParamType {};
/*!
Base class for high-level OpenCV algorithms
*/
class CV_EXPORTS Algorithm
class CV_EXPORTS_W Algorithm
{
public:
Algorithm();
@@ -4281,13 +4281,22 @@ public:
template<typename _Tp> typename ParamType<_Tp>::member_type get(const string& name) const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const char* name) const;
void set(const string& name, int value);
void set(const string& name, double value);
void set(const string& name, bool value);
void set(const string& name, const string& value);
void set(const string& name, const Mat& value);
void set(const string& name, const vector<Mat>& value);
void set(const string& name, const Ptr<Algorithm>& value);
CV_WRAP int getInt(const string& name) const;
CV_WRAP double getDouble(const string& name) const;
CV_WRAP bool getBool(const string& name) const;
CV_WRAP string getString(const string& name) const;
CV_WRAP Mat getMat(const string& name) const;
CV_WRAP vector<Mat> getMatVector(const string& name) const;
CV_WRAP Ptr<Algorithm> getAlgorithm(const string& name) const;
CV_WRAP_AS(setInt) void set(const string& name, int value);
CV_WRAP_AS(setDouble) void set(const string& name, double value);
CV_WRAP_AS(setBool) void set(const string& name, bool value);
CV_WRAP_AS(setString) void set(const string& name, const string& value);
CV_WRAP_AS(setMat) void set(const string& name, const Mat& value);
CV_WRAP_AS(setMatVector) void set(const string& name, const vector<Mat>& value);
CV_WRAP_AS(setAlgorithm) void set(const string& name, const Ptr<Algorithm>& value);
void set(const char* name, int value);
void set(const char* name, double value);
@@ -4297,10 +4306,10 @@ public:
void set(const char* name, const vector<Mat>& value);
void set(const char* name, const Ptr<Algorithm>& value);
string paramHelp(const string& name) const;
CV_WRAP string paramHelp(const string& name) const;
int paramType(const char* name) const;
int paramType(const string& name) const;
void getParams(vector<string>& names) const;
CV_WRAP int paramType(const string& name) const;
CV_WRAP void getParams(CV_OUT vector<string>& names) const;
virtual void write(FileStorage& fs) const;
@@ -4310,8 +4319,8 @@ public:
typedef int (Algorithm::*Getter)() const;
typedef void (Algorithm::*Setter)(int);
static void getList(vector<string>& algorithms);
static Ptr<Algorithm> _create(const string& name);
CV_WRAP static void getList(CV_OUT vector<string>& algorithms);
CV_WRAP static Ptr<Algorithm> _create(const string& name);
template<typename _Tp> static Ptr<_Tp> create(const string& name);
virtual AlgorithmInfo* info() const /* TODO: make it = 0;*/ { return 0; }