summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2012-03-17 16:15:51 +0000
committerWim Vriend <facetracknoir@gmail.com>2012-03-17 16:15:51 +0000
commit9184ea73941814b95c2768d8bcca8bdb77655891 (patch)
tree9cf5977e95abb7e42a719730560c145c1b33c9ba /FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h
parent9ae8a2212d0c85cfa904ea3bf03c0631f6c1369a (diff)
Changed Tracker code, so the DLL's are true plug-ins.
FaceTrackNoIR will scan the bin folder for FTNoIR_Tracker*.dll and put the names in the combobox. All Trackers have 3 new member-functions (like the filters). git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@104 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h')
-rw-r--r--FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h b/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h
new file mode 100644
index 00000000..ddb9afde
--- /dev/null
+++ b/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD.h
@@ -0,0 +1,108 @@
+#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h"
+#include "face-detect.h"
+#include "ui_FTNoIR_FD_controls.h"
+
+#include <Qt>
+#include <QtCore/QEvent>
+#include <Qt/qt_windows.h>
+
+#include <QMessageBox>
+#include <QSettings>
+#include <QProcess>
+#include "math.h"
+#include <Windows.h>
+
+using namespace std;
+
+static LPTSTR prog_cmdline = (LPTSTR) TEXT("face-detect.exe");
+static LPTSTR fd_shm_name = (LPTSTR) TEXT("face-detect-shm");
+static LPTSTR fd_mutex_name = (LPTSTR) TEXT("face-detect-mutex");
+
+class VideoWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ VideoWidget(HANDLE hMutex, unsigned char* data, struct face_detect_shm* shm);
+protected:
+ void paintEvent(QPaintEvent*);
+private:
+ HANDLE hMutex;
+ unsigned char* data;
+ struct face_detect_shm* shm;
+};
+
+class FTNoIR_Tracker : public ITracker
+{
+public:
+ FTNoIR_Tracker();
+ ~FTNoIR_Tracker();
+
+ void Release();
+ void Initialize( QFrame *videoframe );
+ void StartTracker( HWND parent_window );
+ void StopTracker( bool exit );
+ bool GiveHeadPoseData(THeadPoseData *data); // Returns true if confidence is good
+ void loadSettings();
+// bool setParameterValue(const int index, const float newvalue);
+ bool notifyZeroed();
+ void refreshVideo();
+
+ void getFullName(QString *strToBeFilled);
+ void getShortName(QString *strToBeFilled);
+ void getDescription(QString *strToBeFilled);
+
+private:
+ bool activep;
+ //QList<std::pair<float,float>> parameterRange;
+ //QList<float> parameterValueAsFloat;
+ void TerminateTracker();
+ HANDLE hMutex, hMapFile;
+ struct face_detect_shm* shm;
+ PROCESS_INFORMATION procInfo;
+ VideoWidget* ctrl;
+ QFrame* qframe;
+
+ QString trackerFullName; // Trackers' name and description
+ QString trackerShortName;
+ QString trackerDescription;
+
+};
+
+class TrackerControls: public QWidget, Ui::UICFDClientControls, public ITrackerDialog
+{
+ Q_OBJECT
+public:
+
+ explicit TrackerControls();
+ virtual ~TrackerControls();
+ void Release(); // Member functions which are accessible from outside the DLL
+ void Initialize(QWidget *parent);
+ void NotifyZeroing();
+
+ void getFullName(QString *strToBeFilled);
+ void getShortName(QString *strToBeFilled);
+ void getDescription(QString *strToBeFilled);
+ void getIcon(QIcon *icon);
+
+private:
+ Ui::UICFDClientControls ui;
+ void loadSettings();
+ void save();
+
+ bool settingsDirty;
+ HANDLE hMapFile, hMutex;
+ struct face_detect_shm* shm;
+
+ QString trackerFullName; // Trackers' name and description
+ QString trackerShortName;
+ QString trackerDescription;
+
+private slots:
+ void doOK();
+ void doCancel();
+ void settingChanged() { settingsDirty = true; };
+ void doSetRedetectMs(int val);
+ void doSetCameraId(int val);
+ void doSetVideoWidget(bool val);
+signals:
+}; \ No newline at end of file