summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-26 09:49:57 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-26 11:22:51 +0200
commitbdeeda5bc815dc66eefc1c818213141f92a41e0a (patch)
treec43b18de5b0d125d64a7cbed47688a27a919c283
parentadd1d5d0b01078a3a99167a65e691e2ee647f398 (diff)
tracker/{pt,wii}: cosmetic changes only
-rw-r--r--tracker-pt/module/point_extractor.h4
-rw-r--r--tracker-pt/point_tracker.cpp15
-rw-r--r--tracker-pt/point_tracker.h4
-rw-r--r--tracker-pt/pt-api.cpp1
-rw-r--r--tracker-pt/pt-api.hpp6
-rw-r--r--tracker-wii/wii_frame.hpp2
6 files changed, 19 insertions, 13 deletions
diff --git a/tracker-pt/module/point_extractor.h b/tracker-pt/module/point_extractor.h
index ab906414..124cb110 100644
--- a/tracker-pt/module/point_extractor.h
+++ b/tracker-pt/module/point_extractor.h
@@ -36,7 +36,9 @@ public:
void extract_points(const pt_frame& frame,
pt_preview& preview_frame, bool preview_visible,
std::vector<vec2>& points) override;
- PointExtractor(const QString& module_name);
+
+ explicit PointExtractor(const QString& module_name);
+
private:
static constexpr int max_blobs = 16;
diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp
index e209938f..850a5b46 100644
--- a/tracker-pt/point_tracker.cpp
+++ b/tracker-pt/point_tracker.cpp
@@ -68,7 +68,7 @@ void PointModel::set_model(const pt_settings& s)
}
}
-void PointModel::get_d_order(const vec2* points, unsigned* d_order, const vec2& d) const
+void PointModel::get_d_order(const vec2* points, unsigned* d_order, const vec2& d)
{
constexpr unsigned cnt = PointModel::N_POINTS;
// fit line to orthographically projected points
@@ -78,9 +78,7 @@ void PointModel::get_d_order(const vec2* points, unsigned* d_order, const vec2&
for (unsigned i = 0; i < cnt; ++i)
d_vals[i] = t(d.dot(points[i]), i);
- std::sort(d_vals,
- d_vals + 3,
- [](const t& a, const t& b) { return a.first < b.first; });
+ std::sort(d_vals, d_vals + 3, [](t a, t& b) { return a.first < b.first; });
for (unsigned i = 0; i < cnt; ++i)
d_order[i] = d_vals[i].second;
@@ -94,10 +92,11 @@ PointTracker::PointOrder PointTracker::find_correspondences_previous(const vec2*
const pt_camera_info& info)
{
const f fx = pt_camera_info::get_focal_length(info.fov, info.res_x, info.res_y);
- PointTracker::PointOrder p;
- p[0] = project(vec3(0,0,0), fx);
- p[1] = project(model.M01, fx);
- p[2] = project(model.M02, fx);
+ PointTracker::PointOrder p {
+ project(vec3(0,0,0), fx),
+ project(model.M01, fx),
+ project(model.M02, fx)
+ };
constexpr unsigned sz = PointModel::N_POINTS;
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h
index 70c7a9fc..326fb7df 100644
--- a/tracker-pt/point_tracker.h
+++ b/tracker-pt/point_tracker.h
@@ -46,7 +46,7 @@ struct PointModel final
explicit PointModel(const pt_settings& s);
void set_model(const pt_settings& s);
- void get_d_order(const vec2* points, unsigned* d_order, const vec2& d) const;
+ static void get_d_order(const vec2* points, unsigned* d_order, const vec2& d);
};
// ----------------------------------------------------------------------------
@@ -70,7 +70,7 @@ private:
// the points in model order
using PointOrder = std::array<vec2, 3>;
- PointOrder find_correspondences(const vec2* projected_points, const PointModel &model);
+ static PointOrder find_correspondences(const vec2* projected_points, const PointModel &model);
PointOrder find_correspondences_previous(const vec2* points, const PointModel &model, const pt_camera_info& info);
// The POSIT algorithm, returns the number of iterations
int POSIT(const PointModel& point_model, const PointOrder& order, f focal_length);
diff --git a/tracker-pt/pt-api.cpp b/tracker-pt/pt-api.cpp
index 6aeef7dc..2e83d466 100644
--- a/tracker-pt/pt-api.cpp
+++ b/tracker-pt/pt-api.cpp
@@ -50,5 +50,4 @@ std::tuple<f, f> pt_pixel_pos_mixin::to_screen_pos(f px, f py, int w, int h)
}
pt_frame::pt_frame() = default;
-
pt_frame::~pt_frame() = default;
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp
index 75e880d4..a2f37f6f 100644
--- a/tracker-pt/pt-api.hpp
+++ b/tracker-pt/pt-api.hpp
@@ -86,6 +86,8 @@ struct pt_camera
pt_camera();
virtual ~pt_camera();
+ OTR_DISABLE_MOVE_COPY(pt_point_extractor);
+
[[nodiscard]] virtual bool start(const pt_settings& s) = 0;
virtual void stop() = 0;
@@ -105,6 +107,8 @@ struct pt_point_extractor : pt_pixel_pos_mixin
using vec2 = numeric_types::vec2;
using f = numeric_types::f;
+ OTR_DISABLE_MOVE_COPY(pt_point_extractor);
+
pt_point_extractor();
virtual ~pt_point_extractor();
virtual void extract_points(const pt_frame& image, pt_preview& preview_frame, bool preview_visible, std::vector<vec2>& points) = 0;
@@ -116,6 +120,8 @@ struct pt_runtime_traits
{
template<typename t> using pointer = std::shared_ptr<t>;
+ OTR_DISABLE_MOVE_COPY(pt_runtime_traits);
+
pt_runtime_traits();
virtual ~pt_runtime_traits();
diff --git a/tracker-wii/wii_frame.hpp b/tracker-wii/wii_frame.hpp
index a7688b80..bbb0c469 100644
--- a/tracker-wii/wii_frame.hpp
+++ b/tracker-wii/wii_frame.hpp
@@ -58,7 +58,7 @@ private:
static void ensure_size(cv::Mat& frame, int w, int h, int type);
cv::Mat frame_copy, frame_out;
- wii_camera_status status;
+ wii_camera_status status = wii_cam_wait_for_connect;
};
} // ns pt_module