diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-01-05 21:50:42 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-01-05 21:50:42 +0100 |
commit | 33bc85bbcdcc08da6c722614ad2f1493771351dc (patch) | |
tree | 0961d313c6c6b7cd8ead82863edb2c2a7d5812c6 | |
parent | d72be0dbb5b0278e40476dd4fa967eaa22f48ca3 (diff) |
pt: change pose() prototype
Return a pose, don't copy it to passed param
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 3 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.h | 2 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index f6017ee0..26550bad 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -80,9 +80,8 @@ void Tracker::run() point_tracker.track(points, PointModel(s), get_focal_length()); { - Affine CM; - pose(&CM); cv::Vec3f MH(s.t_MH_x, s.t_MH_y, s.t_MH_z); + Affine CM = pose(); cv::Vec3f p = CM.t - MH; float fx = get_focal_length(); cv::Vec2f p_(p[0] / p[2] * fx, p[1] / p[2] * fx); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h index 8e4d58ee..14be5c7f 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h @@ -42,7 +42,7 @@ public: void start_tracker(QFrame* parent_window) override; void data(double* data) override; - void pose(Affine* X_CM) { QMutexLocker lock(&mutex); *X_CM = point_tracker.pose(); } + Affine pose() { QMutexLocker lock(&mutex); return point_tracker.pose(); } int get_n_points() { QMutexLocker lock(&mutex); return point_extractor.get_points().size(); } void get_cam_info(CamInfo* info) { QMutexLocker lock(&mutex); *info = camera.get_info(); } public slots: diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp index 635e21c5..8c896203 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp @@ -136,8 +136,7 @@ void TrackerDialog::trans_calib_step() { if (tracker) { - Affine X_CM; - tracker->pose(&X_CM); + Affine X_CM = tracker->pose(); trans_calib.update(X_CM.R, X_CM.t); } } |