summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point_tracker.h
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/point_tracker.h
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/point_tracker.h')
-rw-r--r--tracker-pt/point_tracker.h46
1 files changed, 12 insertions, 34 deletions
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h
index 79344076..0bac05ab 100644
--- a/tracker-pt/point_tracker.h
+++ b/tracker-pt/point_tracker.h
@@ -8,9 +8,9 @@
#pragma once
#include "compat/timer.hpp"
-
#include "ftnoir_tracker_pt_settings.h"
-using namespace pt_types;
+#include "affine.hpp"
+#include "numeric.hpp"
#include <opencv2/core.hpp>
#include <cstddef>
@@ -19,44 +19,17 @@ using namespace pt_types;
#include <array>
#include <QObject>
-class Affine final
-{
-public:
- Affine() : R(mat33::eye()), t(0,0,0) {}
- Affine(const mat33& R, const vec3& t) : R(R),t(t) {}
-
- mat33 R;
- vec3 t;
-};
-
-inline Affine operator*(const Affine& X, const Affine& Y)
-{
- return Affine(X.R*Y.R, X.R*Y.t + X.t);
-}
-
-inline Affine operator*(const mat33& X, const Affine& Y)
-{
- return Affine(X*Y.R, X*Y.t);
-}
-
-inline Affine operator*(const Affine& X, const mat33& Y)
-{
- return Affine(X.R*Y, X.t);
-}
-
-inline vec3 operator*(const Affine& X, const vec3& v)
-{
- return X.R*v + X.t;
-}
+namespace impl {
// ----------------------------------------------------------------------------
// Describes a 3-point model
// nomenclature as in
// [Denis Oberkampf, Daniel F. DeMenthon, Larry S. Davis: "Iterative Pose Estimation Using Coplanar Feature Points"]
-class PointModel final
+
+using namespace types;
+
+struct PointModel final
{
- friend class PointTracker;
-public:
static constexpr unsigned N_POINTS = 3;
vec3 M01; // M01 in model frame
@@ -102,3 +75,8 @@ private:
Timer t;
bool init_phase;
};
+
+} // ns types
+
+using impl::PointTracker;
+using impl::PointModel;