summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point_tracker.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-10 11:43:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-10 11:43:05 +0200
commit692de4664b1aea87e634c541c00d77cb3f42006a (patch)
tree0a7bcc3d476b426602ff5d7478c7354e2d54cbee /tracker-pt/point_tracker.h
parent9bf8a1ca15d5982c15832656343df4b49baff299 (diff)
tracker/pt: get rid of heap allocation
Use stack arrays rather than vectors. std::array may be a better choice though.
Diffstat (limited to 'tracker-pt/point_tracker.h')
-rw-r--r--tracker-pt/point_tracker.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h
index 5576b41b..9530c338 100644
--- a/tracker-pt/point_tracker.h
+++ b/tracker-pt/point_tracker.h
@@ -70,7 +70,7 @@ public:
PointModel(settings_pt& s);
void set_model(settings_pt& s);
- void get_d_order(const std::vector<vec2>& points, int* d_order, const vec2& d) const;
+ void get_d_order(const vec2* points, unsigned* d_order, const vec2& d) const;
};
// ----------------------------------------------------------------------------
@@ -87,13 +87,14 @@ public:
void track(const std::vector<vec2>& projected_points, const PointModel& model, f focal_length, bool dynamic_pose, int init_phase_timeout, int w, int h);
Affine pose() { return X_CM; }
vec2 project(const vec3& v_M, f focal_length);
+ vec2 project(const vec3& v_M, f focal_length, const Affine& X_CM);
private:
// the points in model order
using PointOrder = std::array<vec2, 3>;
- PointOrder find_correspondences(const std::vector<vec2>& projected_points, const PointModel &model);
- PointOrder find_correspondences_previous(const std::vector<vec2>& points, const PointModel &model, f focal_length, int w, int h);
+ PointOrder find_correspondences(const vec2* projected_points, const PointModel &model);
+ PointOrder find_correspondences_previous(const vec2* points, const PointModel &model, f focal_length, int w, int h);
int POSIT(const PointModel& point_model, const PointOrder& order, f focal_length); // The POSIT algorithm, returns the number of iterations
Affine X_CM; // trafo from model to camera