From e5d2902e11ae6ea2e26e0caa6588384225e018f6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 11 Nov 2016 18:10:42 +0100 Subject: 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 --- tracker-pt/point_tracker.h | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) (limited to 'tracker-pt/point_tracker.h') 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 #include @@ -19,44 +19,17 @@ using namespace pt_types; #include #include -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; -- cgit v1.2.3