diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
commit | a8ffbb76f3e3bbca547fccf5135323e06cae9d2a (patch) | |
tree | cd77a5302cb4ead5995a2a86d5b5b6324ebf43ff /ftnoir_tracker_pt | |
parent | 0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff) |
update modules to refactored API
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 8 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.h | 6 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp | 6 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h | 6 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp | 22 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h | 6 | ||||
-rw-r--r-- | ftnoir_tracker_pt/point_tracker.h | 2 |
7 files changed, 16 insertions, 40 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index cb4a6e21..9b3795b9 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -147,12 +147,12 @@ void Tracker::center() { point_tracker.reset(); // we also do a reset here since there is no reset shortkey yet QMutexLocker lock(&mutex); - FrameTrafo X_CM_0 = point_tracker.get_pose(); + FrameTrafo X_CM_0 = point_tracker.pose(); FrameTrafo X_MH(Matx33f::eye(), t_MH); X_GH_0 = R_GC * X_CM_0 * X_MH; } -void Tracker::StartTracker(QFrame *parent_window) +void Tracker::start_tracker(QFrame *parent_window) { this->video_frame = parent_window; video_frame->setAttribute(Qt::WA_NativeWindow); @@ -180,12 +180,12 @@ void Tracker::StopTracker(bool exit) #define THeadPoseData double #endif -void Tracker::GetHeadPoseData(THeadPoseData *data) +void Tracker::data(THeadPoseData *data) { { QMutexLocker lock(&mutex); - FrameTrafo X_CM = point_tracker.get_pose(); + FrameTrafo X_CM = point_tracker.pose(); FrameTrafo X_MH(Matx33f::eye(), t_MH); FrameTrafo X_GH = R_GC * X_CM * X_MH; Matx33f R = X_GH.R * X_GH_0.R.t(); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h index fff8d4ab..4295b6f9 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h @@ -38,15 +38,15 @@ class Tracker : public ITracker, protected QThread public: Tracker(); ~Tracker() override; - void StartTracker(QFrame* parent_window) override; - void GetHeadPoseData(double* data) override; + void start_tracker(QFrame* parent_window) override; + void data(double* data) override; void apply(settings& s); void apply_inner(); void center(); void reset(); // reset the trackers internal state variables - void get_pose(FrameTrafo* X_CM) { QMutexLocker lock(&mutex); *X_CM = point_tracker.get_pose(); } + void pose(FrameTrafo* X_CM) { QMutexLocker lock(&mutex); *X_CM = 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(); } protected: diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp index 981cbea0..a15e97b9 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp @@ -180,7 +180,7 @@ void TrackerDialog::trans_calib_step() if (tracker) { FrameTrafo X_CM; - tracker->get_pose(&X_CM); + tracker->pose(&X_CM); trans_calib.update(X_CM.R, X_CM.t); cv::Vec3f t_MH = trans_calib.get_estimate(); s.t_MH_x = t_MH[0]; @@ -234,7 +234,7 @@ void TrackerDialog::doCancel() close(); } -void TrackerDialog::registerTracker(ITracker *t) +void TrackerDialog::register_tracker(ITracker *t) { qDebug()<<"TrackerDialog:: Tracker registered"; tracker = static_cast<Tracker*>(t); @@ -244,7 +244,7 @@ void TrackerDialog::registerTracker(ITracker *t) //ui.center_button->setEnabled(true); } -void TrackerDialog::unRegisterTracker() +void TrackerDialog::unregister_tracker() { qDebug()<<"TrackerDialog:: Tracker un-registered"; tracker = NULL; diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h index bff12dd0..8b6309da 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h @@ -23,13 +23,13 @@ //----------------------------------------------------------------------------- // The dialog that shows up when the user presses "Settings" -class TrackerDialog : public QWidget, public ITrackerDialog +class TrackerDialog : public ITrackerDialog { Q_OBJECT public: TrackerDialog(); - void registerTracker(ITracker *tracker) override; - void unRegisterTracker() override; + void register_tracker(ITracker *tracker) override; + void unregister_tracker() override; void save(); void trans_calib_step(); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp index fb756a86..9b73ee37 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp @@ -8,28 +8,6 @@ #include "ftnoir_tracker_pt_dll.h" #include <QIcon> -//----------------------------------------------------------------------------- -void TrackerDll::getFullName(QString *strToBeFilled) -{ - *strToBeFilled = "PointTracker 1.1"; -} - -void TrackerDll::getShortName(QString *strToBeFilled) -{ - *strToBeFilled = "PointTracker"; -} - -void TrackerDll::getDescription(QString *strToBeFilled) -{ - *strToBeFilled = "Tracks a 3-point model with know geometry like Freetrack / TrackIR"; -} - -void TrackerDll::getIcon(QIcon *icon) -{ - *icon = QIcon(":/Resources/Logo_IR.png"); -} - - #ifdef OPENTRACK_API # include "facetracknoir/plugin-support.h" extern "C" OPENTRACK_EXPORT Metadata* GetMetadata() diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h index 50f66a35..d9b9adf6 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h @@ -19,8 +19,6 @@ class TrackerDll : public ITrackerDll #endif { - void getFullName(QString *strToBeFilled); - void getShortName(QString *strToBeFilled); - void getDescription(QString *strToBeFilled); - void getIcon(QIcon *icon); + QString name() { return QString("PointTracker 1.1"); } + QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); } }; diff --git a/ftnoir_tracker_pt/point_tracker.h b/ftnoir_tracker_pt/point_tracker.h index d65494a4..dac99b87 100644 --- a/ftnoir_tracker_pt/point_tracker.h +++ b/ftnoir_tracker_pt/point_tracker.h @@ -91,7 +91,7 @@ public: // f : (focal length)/(sensor width) // dt : time since last call void track(const std::vector<cv::Vec2f>& projected_points, const PointModel& model); - FrameTrafo get_pose() const { return X_CM; } + FrameTrafo pose() const { return X_CM; } void reset(); private: |