summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/FaceTrackNoIR.cpp
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-02-12 16:13:30 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-02-12 16:13:30 +0000
commit63ce1b5dc62e5c1a079f8a675c0a4371adb27d29 (patch)
tree0a8ac58de927502c9f33d97a2c82966ae980e54a /FaceTrackNoIR/FaceTrackNoIR.cpp
parenta8a619f078f543b56e8ae785d92844b806444195 (diff)
Displaying headpose-data seemed to cause crashes.
Update is now done in FaceTrackNoIR.cpp, using a timer. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@51 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/FaceTrackNoIR.cpp')
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index e9a0c8be..7197a5f7 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -147,6 +147,11 @@ void FaceTrackNoIR::setupFaceTrackNoIR() {
//Setup the timer for automatically minimizing after StartTracker.
timMinimizeFTN = new QTimer(this);
connect(timMinimizeFTN, SIGNAL(timeout()), this, SLOT(showMinimized()));
+
+ //Setup the timer for showing the headpose.
+ timUpdateHeadPose = new QTimer(this);
+ connect(timUpdateHeadPose, SIGNAL(timeout()), this, SLOT(showHeadPose()));
+ timUpdateHeadPose->start(10);
}
/** destructor stops the engine and quits the faceapi **/
@@ -654,6 +659,20 @@ void FaceTrackNoIR::setUseFilter( int set ) {
settingsDirty = true;
}
+/** Show the headpose in the widget (triggered by timer) **/
+void FaceTrackNoIR::showHeadPose() {
+THeadPoseData newdata;
+
+ Tracker::getHeadPose(&newdata);
+ ui.lcdNumX->display((double) (((int)(newdata.x * 10.0f))/10.0f));
+ ui.lcdNumY->display((double) (((int)(newdata.y * 10.0f))/10.0f));
+ ui.lcdNumZ->display((double) (((int)(newdata.z * 10.0f))/10.0f));
+
+ ui.lcdNumRotX->display((double) (((int)(newdata.yaw * 10.0f))/10.0f));
+ ui.lcdNumRotY->display((double) (((int)(newdata.pitch * 10.0f))/10.0f));
+ ui.lcdNumRotZ->display((double) (((int)(newdata.roll * 10.0f))/10.0f));
+}
+
/** set the redhold from the slider **/
void FaceTrackNoIR::setMinSmooth( int redh ) {
Tracker::setMinSmooth ( redh );