summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/ftnoir_tracker_pt.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-02 18:41:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-02 18:41:01 +0200
commit8303597a865400a363ae574ccde819302495f498 (patch)
treec83b383b3ec818f610cc6137f2b72ee7b4173b09 /ftnoir_tracker_pt/ftnoir_tracker_pt.h
parent8adf6b1650af6027f28db12ca2b4de92a3fac11d (diff)
Just put everything new in. Conflict resolution will be later
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.h')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
index 2533a39b..49881b69 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
@@ -8,7 +8,7 @@
#ifndef FTNOIR_TRACKER_PT_H
#define FTNOIR_TRACKER_PT_H
-#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h"
+#include "ftnoir_tracker_base/ftnoir_tracker_base.h"
#include "ftnoir_tracker_pt_settings.h"
#include "camera.h"
#include "point_extractor.h"
@@ -20,18 +20,19 @@
#include <QMutex>
#include <QTime>
#include <opencv2/opencv.hpp>
+#include <QFrame>
+#include <QTimer>
//-----------------------------------------------------------------------------
-class Tracker : public ITracker, QThread
+class Tracker : public QThread, public ITracker
{
+ Q_OBJECT
public:
Tracker();
~Tracker();
// ITracker interface
- void Initialize(QFrame *videoframe);
- void StartTracker(HWND parent_window);
- void StopTracker(bool exit);
+ void StartTracker(QFrame* videoFrame);
bool GiveHeadPoseData(THeadPoseData *data);
void refreshVideo();
@@ -40,6 +41,10 @@ public:
void center();
void reset(); // reset the trackers internal state variables
void run();
+ void WaitForExit() {
+ should_quit = true;
+ wait();
+ }
void get_pose(FrameTrafo* X_CM) { QMutexLocker lock(&mutex); *X_CM = point_tracker.get_pose(); }
int get_n_points() { QMutexLocker lock(&mutex); return point_extractor.get_points().size(); }
@@ -47,8 +52,6 @@ public:
protected:
FrameTrafo X_CH_0; // for centering
-
- QMutex mutex;
cv::Mat frame; // the output frame for display
enum Command {
@@ -57,9 +60,8 @@ protected:
};
void set_command(Command command);
void reset_command(Command command);
- int commands;
- VICamera camera;
+ CVCamera camera;
PointExtractor point_extractor;
PointTracker point_tracker;
bool tracking_valid;
@@ -78,9 +80,17 @@ protected:
bool bEnableZ;
long frame_count;
+ int commands;
VideoWidget* video_widget;
Timer time;
+ QMutex mutex;
+ volatile bool should_quit;
+ volatile bool fresh;
+ QTimer timer;
+
+protected slots:
+ void paint_widget();
};
#endif // FTNOIR_TRACKER_PT_H