diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-08-10 16:16:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-08-14 19:19:59 +0200 |
commit | 359da594db4580f7578276d8f1b420a23510f5ac (patch) | |
tree | 131295d50cfe706244a553a71d53f496608c0c87 /tracker-pt | |
parent | 2998dc09288f009e162a0573edd703628f939488 (diff) |
tracker/pt: move Affine class to cv/
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/affine.cpp | 32 | ||||
-rw-r--r-- | tracker-pt/affine.hpp | 29 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 2 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt_settings.cpp | 2 | ||||
-rw-r--r-- | tracker-pt/numeric.hpp | 22 | ||||
-rw-r--r-- | tracker-pt/point_extractor.h | 2 | ||||
-rw-r--r-- | tracker-pt/point_tracker.h | 4 |
7 files changed, 5 insertions, 88 deletions
diff --git a/tracker-pt/affine.cpp b/tracker-pt/affine.cpp deleted file mode 100644 index 9018e107..00000000 --- a/tracker-pt/affine.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2012 Patrick Ruoff - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - */ - -#include "affine.hpp" - -Affine::Affine() : R(mat33::eye()), t(0,0,0) {} - -Affine::Affine(const mat33& R, const vec3& t) : R(R),t(t) {} - -Affine operator*(const Affine& X, const Affine& Y) -{ - return Affine(X.R*Y.R, X.R*Y.t + X.t); -} - -Affine operator*(const mat33& X, const Affine& Y) -{ - return Affine(X*Y.R, X*Y.t); -} - -Affine operator*(const Affine& X, const mat33& Y) -{ - return Affine(X.R*Y, X.t); -} - -vec3 operator*(const Affine& X, const vec3& v) -{ - return X.R*v + X.t; -} diff --git a/tracker-pt/affine.hpp b/tracker-pt/affine.hpp deleted file mode 100644 index aedb0bc8..00000000 --- a/tracker-pt/affine.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2012 Patrick Ruoff - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - */ - -#pragma once - -#include <opencv2/core.hpp> -#include "numeric.hpp" -using namespace types; - - - -class Affine final -{ -public: - Affine(); - Affine(const mat33& R, const vec3& t); - - mat33 R; - vec3 t; -}; - -Affine operator*(const Affine& X, const Affine& Y); -Affine operator*(const mat33& X, const Affine& Y); -Affine operator*(const Affine& X, const mat33& Y); -vec3 operator*(const Affine& X, const vec3& v); diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index 65e367f5..4110c9d9 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -13,7 +13,7 @@ #include <atomic> -#include "numeric.hpp" +#include "cv/numeric.hpp" #include "camera.h" #include "point_extractor.h" diff --git a/tracker-pt/ftnoir_tracker_pt_settings.cpp b/tracker-pt/ftnoir_tracker_pt_settings.cpp index 8a5257d3..234c4d74 100644 --- a/tracker-pt/ftnoir_tracker_pt_settings.cpp +++ b/tracker-pt/ftnoir_tracker_pt_settings.cpp @@ -1,4 +1,4 @@ -#include "numeric.hpp" +#include "cv/numeric.hpp" namespace types { diff --git a/tracker-pt/numeric.hpp b/tracker-pt/numeric.hpp deleted file mode 100644 index 4761af1d..00000000 --- a/tracker-pt/numeric.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include <opencv2/core.hpp> -#include <limits> - -namespace types { - using f = double; - - struct constants final - { - constants() = delete; - static constexpr f eps = f(1e-8); - }; - - 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>; -} diff --git a/tracker-pt/point_extractor.h b/tracker-pt/point_extractor.h index 61e2bc03..5fbe9a45 100644 --- a/tracker-pt/point_extractor.h +++ b/tracker-pt/point_extractor.h @@ -10,7 +10,7 @@ #include "ftnoir_tracker_pt_settings.h" #include "camera.h" -#include "numeric.hpp" +#include "cv/numeric.hpp" #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index a25c1458..ebbbc801 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -9,8 +9,8 @@ #include "compat/timer.hpp" #include "ftnoir_tracker_pt_settings.h" -#include "affine.hpp" -#include "numeric.hpp" +#include "cv/affine.hpp" +#include "cv/numeric.hpp" #include "camera.h" #include <opencv2/core.hpp> |