Commit 0d12f451 authored by Andrey Kamaev's avatar Andrey Kamaev Committed by OpenCV Buildbot

Merge pull request #524 from LeonidBeynenson:add_float_and_unsigned_parameters_to_cv_algorithm

parents 11b83d40 41dc8293
...@@ -4479,6 +4479,26 @@ public: ...@@ -4479,6 +4479,26 @@ public:
Ptr<Algorithm> (Algorithm::*getter)()=0, Ptr<Algorithm> (Algorithm::*getter)()=0,
void (Algorithm::*setter)(const Ptr<Algorithm>&)=0, void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
const string& help=string()); 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, template<typename _Tp, typename _Base> void addParam(Algorithm& algo, const char* name,
Ptr<_Tp>& value, bool readOnly=false, Ptr<_Tp>& value, bool readOnly=false,
Ptr<_Tp> (Algorithm::*getter)()=0, Ptr<_Tp> (Algorithm::*getter)()=0,
...@@ -4498,7 +4518,7 @@ protected: ...@@ -4498,7 +4518,7 @@ protected:
struct CV_EXPORTS Param 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();
Param(int _type, bool _readonly, int _offset, Param(int _type, bool _readonly, int _offset,
...@@ -4601,6 +4621,13 @@ template<> struct ParamType<uint64> ...@@ -4601,6 +4621,13 @@ template<> struct ParamType<uint64>
enum { type = Param::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" "\nThe CommandLineParser class is designed for command line arguments parsing\n"
......
This diff is collapsed.
...@@ -658,6 +658,7 @@ protected: ...@@ -658,6 +658,7 @@ protected:
virtual void findBlobs(const Mat &image, const Mat &binaryImage, vector<Center> &centers) const; virtual void findBlobs(const Mat &image, const Mat &binaryImage, vector<Center> &centers) const;
Params params; Params params;
AlgorithmInfo* info() const;
}; };
......
...@@ -130,6 +130,26 @@ CV_INIT_ALGORITHM(GFTTDetector, "Feature2D.GFTT", ...@@ -130,6 +130,26 @@ CV_INIT_ALGORITHM(GFTTDetector, "Feature2D.GFTT",
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(SimpleBlobDetector, "Feature2D.SimpleBlob",
obj.info()->addParam(obj, "thresholdStep", obj.params.thresholdStep);
obj.info()->addParam(obj, "minThreshold", obj.params.minThreshold);
obj.info()->addParam(obj, "maxThreshold", obj.params.maxThreshold);
obj.info()->addParam_(obj, "minRepeatability", (sizeof(size_t) == sizeof(uint64))?Param::UINT64 : Param::UNSIGNED_INT, &obj.params.minRepeatability, false, 0, 0);
obj.info()->addParam(obj, "minDistBetweenBlobs", obj.params.minDistBetweenBlobs);
obj.info()->addParam(obj, "filterByColor", obj.params.filterByColor);
obj.info()->addParam(obj, "blobColor", obj.params.blobColor);
obj.info()->addParam(obj, "filterByArea", obj.params.filterByArea);
obj.info()->addParam(obj, "maxArea", obj.params.maxArea);
obj.info()->addParam(obj, "filterByCircularity", obj.params.filterByCircularity);
obj.info()->addParam(obj, "maxCircularity", obj.params.maxCircularity);
obj.info()->addParam(obj, "filterByInertia", obj.params.filterByInertia);
obj.info()->addParam(obj, "maxInertiaRatio", obj.params.maxInertiaRatio);
obj.info()->addParam(obj, "filterByConvexity", obj.params.filterByConvexity);
obj.info()->addParam(obj, "maxConvexity", obj.params.maxConvexity);
);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
class CV_EXPORTS HarrisDetector : public GFTTDetector class CV_EXPORTS HarrisDetector : public GFTTDetector
{ {
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment