Added float, uint64, and uchar params to Algorithm

Made changes to work in cv::Algorithm with parameters of these types.
Also fixed SimpleBlobDetector -- now it can be created by
cv::Algorithm::create and it can work with cv::Algorithm::set/get.
This commit is contained in:
LeonidBeynenson
2013-02-04 20:25:18 +04:00
parent db9de43fa5
commit b85a098d9c
4 changed files with 425 additions and 22 deletions

View File

@@ -4340,6 +4340,8 @@ public:
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 float getFloat(const string& name) const;
CV_WRAP uint64 getUInt64(const string& name) const;
void set(const string& name, int value);
void set(const string& name, double value);
@@ -4376,6 +4378,8 @@ public:
void setMatVector(const char* name, const vector<Mat>& value);
void setAlgorithm(const char* name, const Ptr<Algorithm>& value);
template<typename _Tp> void setAlgorithm(const char* name, const Ptr<_Tp>& value);
void setFloat(const char* name, float value);
void setUInt64(const char* name, uint64 value);
CV_WRAP string paramHelp(const string& name) const;
int paramType(const char* name) const;
@@ -4457,6 +4461,26 @@ public:
Ptr<Algorithm> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
const string& help=string());
void addParam(Algorithm& algo, const char* name,
float& value, bool readOnly=false,
float (Algorithm::*getter)()=0,
void (Algorithm::*setter)(float)=0,
const string& help=string());
void addParam(Algorithm& algo, const char* name,
unsigned int& value, bool readOnly=false,
unsigned int (Algorithm::*getter)()=0,
void (Algorithm::*setter)(unsigned int)=0,
const string& help=string());
void addParam(Algorithm& algo, const char* name,
uint64& value, bool readOnly=false,
uint64 (Algorithm::*getter)()=0,
void (Algorithm::*setter)(uint64)=0,
const string& help=string());
void addParam(Algorithm& algo, const char* name,
uchar& value, bool readOnly=false,
uchar (Algorithm::*getter)()=0,
void (Algorithm::*setter)(uchar)=0,
const string& help=string());
template<typename _Tp, typename _Base> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0,
@@ -4476,7 +4500,7 @@ protected:
struct CV_EXPORTS Param
{
enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, SHORT=10 };
enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, SHORT=10, UCHAR=11 };
Param();
Param(int _type, bool _readonly, int _offset,
@@ -4579,6 +4603,13 @@ template<> struct ParamType<uint64>
enum { type = Param::UINT64 };
};
template<> struct ParamType<uchar>
{
typedef uchar const_param_type;
typedef uchar member_type;
enum { type = Param::UCHAR };
};
/*!
"\nThe CommandLineParser class is designed for command line arguments parsing\n"