aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp
diff options
context:
space:
mode:
authorcathook <b01902109@csie.ntu.edu.tw>2014-06-01 14:16:38 +0800
committercathook <b01902109@csie.ntu.edu.tw>2014-06-01 14:16:38 +0800
commitc60dba253906a30d3042f1dc4e9b7fe38f053fbe (patch)
tree57018f05908f0edef30cba255d46688ebfd5cd85 /meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp
parent8bc9f2e8496c0c021b80eb0fb21e828f5900f08d (diff)
downloadmeow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar.gz
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar.bz2
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar.lz
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar.xz
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.tar.zst
meow-c60dba253906a30d3042f1dc4e9b7fe38f053fbe.zip
add test...
Diffstat (limited to 'meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp')
-rw-r--r--meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp b/meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp
new file mode 100644
index 0000000..ebcca5b
--- /dev/null
+++ b/meowpp.test/src/autostitch_FeaturePointsDetector_Harris.cpp
@@ -0,0 +1,73 @@
+#include "autostitch.h"
+
+#include "meowpp/oo/ObjBase.h"
+#include "meowpp/oo/ObjSelector.h"
+#include "meowpp/geo/Vectors.h"
+#include "meowpp/gra/FeaturePointsDetector_Harris.h"
+
+using namespace meow;
+
+class Harris: public MyFeaturePointsDetector{
+ private:
+ FeaturePointsDetector_Harris<RGBf_Space> _body;
+ public:
+ Usage usage() const{
+ Usage ret;
+ ret.optionAdd('K',
+ "Specify the constant K of 'R = detM - KtraceM'",
+ "<floating point>", stringPrintf("%.10f", _body.paramK()),
+ false);
+ ret.optionAdd('R',
+ "Specify the threshold of R to determind whether is "
+ "featuer point or not",
+ "<floating point>", stringPrintf("%.10f", _body.paramR()),
+ false);
+ ret.optionAdd('W',
+ "Specify the sigma of the gaussian blur",
+ "<floating point>", stringPrintf("%.10f", _body.paramW()),
+ false);
+ ret.optionAdd('N',
+ "Specify the sigma of the gaussian blur to de-noise",
+ "<floating point>", stringPrintf("%.10f", _body.paramN()),
+ false);
+ ret.optionAdd('G',
+ "Specify the sigma of the gaussian blur to generate feature",
+ "<floating point>", stringPrintf("%.10f", _body.paramG()),
+ false);
+ ret.optionAdd('L',
+ ".........",
+ "<floating point>", stringPrintf("%.10f", _body.paramL()),
+ false);
+ ret.optionAdd('B',
+ "Description size",
+ "<number>", stringPrintf("%lu", _body.paramB()),
+ false);
+ return ret;
+ }
+ bool usage(meow::Usage const& usg){
+ double K = atof(usg.optionValue('K', 0).c_str());
+ double R = atof(usg.optionValue('R', 0).c_str());
+ double W = atof(usg.optionValue('W', 0).c_str());
+ double N = atof(usg.optionValue('N', 0).c_str());
+ double L = atof(usg.optionValue('L', 0).c_str());
+ double G = atof(usg.optionValue('G', 0).c_str());
+ size_t B = atoi(usg.optionValue('B', 0).c_str());
+ _body.paramK(K);
+ _body.paramR(R);
+ _body.paramW(W);
+ _body.paramN(N);
+ _body.paramL(L);
+ _body.paramG(G);
+ _body.paramB(B);
+ return true;
+ }
+ std::vector<meow::FeaturePoint<double, double> >
+ detect(meow::Bitmap<RGBf_Space> const& bmp){
+ return _body.detect(bmp);
+ }
+
+ std::string type() const{ return std::string("Harris"); }
+ ObjBase* create() const{ return new Harris(); }
+};
+
+static meow::ObjSelector<FPSD_ID> __(new Harris(), true);