diff options
Diffstat (limited to 'FaceTrackNoIR/tracker.cpp')
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index ab2f3b86..c054873d 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -53,7 +53,7 @@ // Definitions for testing purposes
//
#define USE_HEADPOSE_CALLBACK
-#define USE_DEBUG_CLIENT
+//#define USE_DEBUG_CLIENT
using namespace sm::faceapi;
using namespace sm::faceapi::qt;
@@ -80,6 +80,10 @@ TShortKey Tracker::CenterKey; // ShortKey to Center headposition TShortKey Tracker::StartStopKey; // ShortKey to Start/stop tracking
TShortKey Tracker::InhibitKey; // ShortKey to inhibit axis while tracking
+ITrackerPtr Tracker::pTracker; // Pointer to Tracker instance (in DLL)
+IFilterPtr Tracker::pFilter; // Pointer to Filter instance (in DLL)
+
+
/** constructor **/
Tracker::Tracker( int clientID, int facetrackerID ) {
importGetTracker getIT;
@@ -552,7 +556,6 @@ void Tracker::run() { if (Tracker::do_tracking && Tracker::confid) {
// Pitch
- current_camera_position = new_camera_position; // Remember the latest position
target_camera_position.x = X.headPos - X.offset_headPos - X.initial_headPos;
target_camera_position.y = Y.headPos - Y.offset_headPos - Y.initial_headPos;
target_camera_position.z = Z.headPos - Z.offset_headPos - Z.initial_headPos;
@@ -607,11 +610,11 @@ void Tracker::run() { // All Protocol server(s)
if (server_Game) {
server_Game->setVirtRotX ( new_camera_position.pitch ); // degrees
- //server_Game->setVirtRotY ( new_camera_position.yaw );
- //server_Game->setVirtRotZ ( new_camera_position.roll );
- //server_Game->setVirtPosX ( new_camera_position.x ); // centimeters
- //server_Game->setVirtPosY ( new_camera_position.y );
- //server_Game->setVirtPosZ ( new_camera_position.z );
+ server_Game->setVirtRotY ( new_camera_position.yaw );
+ server_Game->setVirtRotZ ( new_camera_position.roll );
+ server_Game->setVirtPosX ( new_camera_position.x ); // centimeters
+ server_Game->setVirtPosY ( new_camera_position.y );
+ server_Game->setVirtPosZ ( new_camera_position.z );
}
# ifdef USE_DEBUG_CLIENT
@@ -806,6 +809,36 @@ void Tracker::addRaw2List ( QList<float> *rawList, float maxIndex, float raw ) { }
//
+// Set the filter-value from the GUI.
+//
+void Tracker::setMinSmooth ( int x ) {
+ if (Tracker::pFilter) {
+ Tracker::pFilter->setParameterValue(0, x);
+ qDebug() << "Tracker::setMinSmooth Min Smooting frames set to: " << x;
+ }
+}
+
+//
+// Set the filter-value from the GUI.
+//
+void Tracker::setMaxSmooth ( int x ) {
+ if (Tracker::pFilter) {
+ Tracker::pFilter->setParameterValue(1, x);
+ qDebug() << "Tracker::setMaxSmooth Max Smooting frames set to: " << x;
+ }
+}
+
+//
+// Set the filter-value from the GUI.
+//
+void Tracker::setPowCurve( int x ) {
+ if (Tracker::pFilter) {
+ Tracker::pFilter->setParameterValue(2, x);
+ qDebug() << "Tracker::setPowCurve Pow Curve set to: " << x;
+ }
+}
+
+//
// Get the Smoothed value from the QList.
//
float Tracker::getSmoothFromList ( QList<float> *rawList ) {
|