Merge branch '2.4'

This commit is contained in:
Andrey Kamaev
2013-02-28 11:10:40 +04:00
39 changed files with 6898 additions and 386 deletions

View File

@@ -4458,6 +4458,26 @@ public:
Ptr<Algorithm> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
float& value, bool readOnly=false,
float (Algorithm::*getter)()=0,
void (Algorithm::*setter)(float)=0,
const std::string& help=std::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 std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
uint64& value, bool readOnly=false,
uint64 (Algorithm::*getter)()=0,
void (Algorithm::*setter)(uint64)=0,
const std::string& help=std::string());
void addParam(Algorithm& algo, const char* name,
uchar& value, bool readOnly=false,
uchar (Algorithm::*getter)()=0,
void (Algorithm::*setter)(uchar)=0,
const std::string& help=std::string());
template<typename _Tp, typename _Base> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0,
@@ -4477,7 +4497,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 };
enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, UCHAR=11 };
Param();
Param(int _type, bool _readonly, int _offset,
@@ -4572,12 +4592,19 @@ 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 };
};
// The CommandLineParser class is designed for command line arguments parsing
class CV_EXPORTS CommandLineParser
{
public:
public:
CommandLineParser(int argc, const char* const argv[], const std::string& keys);
CommandLineParser(const CommandLineParser& parser);
CommandLineParser& operator = (const CommandLineParser& parser);
@@ -4586,11 +4613,11 @@ public:
template <typename T>
T get(const std::string& name, bool space_delete = true) const
{
{
T val = T();
getByName(name, space_delete, ParamType<T>::type, (void*)&val);
return val;
}
}
template <typename T>
T get(int index, bool space_delete = true) const