summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/numeric.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-11-11 18:10:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-11-12 12:04:27 +0100
commite5d2902e11ae6ea2e26e0caa6588384225e018f6 (patch)
tree6b9660910daf250290c339780d5b2ef062646130 /tracker-pt/numeric.hpp
parent049044f181414991a103ace961214c78171c284d (diff)
tracker/pt: refactor
- separate .{cpp,hpp} for few classes - don't include namespaces globally; harmless but looks bad anyway - class with all public members to struct
Diffstat (limited to 'tracker-pt/numeric.hpp')
-rw-r--r--tracker-pt/numeric.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tracker-pt/numeric.hpp b/tracker-pt/numeric.hpp
new file mode 100644
index 00000000..9d37086d
--- /dev/null
+++ b/tracker-pt/numeric.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <opencv2/core.hpp>
+#include <limits>
+
+namespace types {
+ using f = double;
+
+ struct constants final
+ {
+ constants() = delete;
+ static constexpr f eps = std::numeric_limits<f>::epsilon();
+ };
+
+ template<int n> using vec = cv::Vec<f, n>;
+ using vec2 = vec<2>;
+ using vec3 = vec<3>;
+
+ template<int y, int x> using mat = cv::Matx<f, y, x>;
+ using mat33 = mat<3, 3>;
+ using mat22 = mat<2, 2>;
+}