From d6086d8203ae4f4b45f3d97960788d603fc78e16 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Mon, 9 Jan 2012 17:01:44 +0000 Subject: Implemented filter-settings changeably while Tracker is active. Should also be handy to have a IFilterPtr, for logging... git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@99 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Filter_Base/ftnoir_filter_base.h | 6 +- FTNoIR_Filter_EWMA2/FTNoIR_FilterControls.ui | 124 +- FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h | 4 +- FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp | 28 +- FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp | 21 +- FaceTrackNoIR/FaceApp.h | 1 + FaceTrackNoIR/FaceTrackNoIR.cpp | 29 +- FaceTrackNoIR/FaceTrackNoIR.h | 5 - FaceTrackNoIR/FaceTrackNoIR.ui | 1329 +++++++------------- FaceTrackNoIR/tracker.cpp | 32 +- FaceTrackNoIR/tracker.h | 13 +- 11 files changed, 624 insertions(+), 968 deletions(-) diff --git a/FTNoIR_Filter_Base/ftnoir_filter_base.h b/FTNoIR_Filter_Base/ftnoir_filter_base.h index 0262b4eb..8e949553 100644 --- a/FTNoIR_Filter_Base/ftnoir_filter_base.h +++ b/FTNoIR_Filter_Base/ftnoir_filter_base.h @@ -10,6 +10,8 @@ #include #include +#include "..\FaceTrackNoIR\AutoClosePtr.h" + // COM-Like abstract interface. // This interface doesn't require __declspec(dllexport/dllimport) specifier. // Method calls are dispatched via virtual table. @@ -31,6 +33,8 @@ struct IFilter // Handle type. In C++ language the interface type is used. typedef IFilter* FILTERHANDLE; +typedef AutoClosePtr IFilterPtr; +typedef IFilter *(__stdcall *importGetFilter)(void); //////////////////////////////////////////////////////////////////////////////// // @@ -56,7 +60,7 @@ GetFilter( struct IFilterDialog { virtual void Release() = 0; // Member required to enable Auto-remove - virtual void Initialize(QWidget *parent) = 0; + virtual void Initialize(QWidget *parent, IFilterPtr ptr) = 0; virtual void getFilterFullName(QString *strToBeFilled) = 0; virtual void getFilterShortName(QString *strToBeFilled) = 0; diff --git a/FTNoIR_Filter_EWMA2/FTNoIR_FilterControls.ui b/FTNoIR_Filter_EWMA2/FTNoIR_FilterControls.ui index fbc56447..cbd61d53 100644 --- a/FTNoIR_Filter_EWMA2/FTNoIR_FilterControls.ui +++ b/FTNoIR_Filter_EWMA2/FTNoIR_FilterControls.ui @@ -23,6 +23,9 @@ false + + + @@ -41,8 +44,7 @@ - color:#ccc; -background:none; + Min. @@ -64,8 +66,7 @@ background:none; - color:#ccc; -background:none; + Max. @@ -87,8 +88,7 @@ background:none; - color:#ccc; -background:none; + Curve @@ -163,8 +163,7 @@ background:none; - color:#ccc; -background:none; + frames @@ -239,8 +238,7 @@ background:none; - color:#ccc; -background:none; + frames @@ -312,8 +310,7 @@ background:none; - color:#ccc; -background:none; + pow @@ -393,7 +390,7 @@ background:none; - 100 + 52 0 @@ -418,7 +415,7 @@ background:none; - 100 + 52 0 @@ -460,7 +457,104 @@ background:none; btnCancel - + + + minSmooth + valueChanged(int) + spinMinSmooth + setValue(int) + + + 199 + 22 + + + 337 + 23 + + + + + spinMinSmooth + valueChanged(int) + minSmooth + setValue(int) + + + 330 + 12 + + + 185 + 17 + + + + + maxSmooth + valueChanged(int) + spinMaxSmooth + setValue(int) + + + 181 + 48 + + + 335 + 54 + + + + + spinMaxSmooth + valueChanged(int) + maxSmooth + setValue(int) + + + 324 + 42 + + + 259 + 43 + + + + + powCurve + valueChanged(int) + spinPowCurve + setValue(int) + + + 145 + 74 + + + 339 + 78 + + + + + spinPowCurve + valueChanged(int) + powCurve + setValue(int) + + + 330 + 69 + + + 176 + 76 + + + + startEngineClicked() stopEngineClicked() diff --git a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h index 398f5e75..feec6f1f 100644 --- a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h +++ b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h @@ -52,6 +52,7 @@ public: bool setParameterValue(const int index, const float newvalue); private: + void loadSettings(); // Load the settings from the INI-file THeadPoseData newHeadPose; // Structure with new headpose bool first_run; @@ -97,7 +98,7 @@ public: void showEvent ( QShowEvent * event ); void Release(); // Member functions which are accessible from outside the DLL - void Initialize(QWidget *parent); + void Initialize(QWidget *parent, IFilterPtr ptr); void getFilterFullName(QString *strToBeFilled); void getFilterShortName(QString *strToBeFilled); void getFilterDescription(QString *strToBeFilled); @@ -113,6 +114,7 @@ private: QString filterFullName; // Filters' name and description QString filterShortName; QString filterDescription; + IFilterPtr pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance private slots: void doOK(); diff --git a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp index b119df27..7034a152 100644 --- a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp +++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp @@ -75,7 +75,8 @@ FTNoIR_Filter_EWMA2::FTNoIR_Filter_EWMA2() setParameterValue(kSmoothingScaleCurve,10.0f); first_run = true; - alpha_smoothing = 0.02f; //this is a constant for now, might be a parameter later + alpha_smoothing = 0.02f; // this is a constant for now, might be a parameter later + loadSettings(); // Load the Settings } @@ -91,9 +92,34 @@ void FTNoIR_Filter_EWMA2::Release() void FTNoIR_Filter_EWMA2::Initialize() { + qDebug() << "FTNoIR_Filter_EWMA2::Initialize says: Starting "; + loadSettings(); return; } +// +// Load the current Settings from the currently 'active' INI-file. +// +void FTNoIR_Filter_EWMA2::loadSettings() { + qDebug() << "FTNoIR_Filter_EWMA2::loadSettings says: Starting "; + QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) + + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + + qDebug() << "FTNoIR_Filter_EWMA2::loadSettings says: iniFile = " << currentFile; + + // + // The EWMA2-filter-settings are in the Tracking group: this is because they used to be on the Main Form of FaceTrackNoIR + // + iniFile.beginGroup ( "Tracking" ); + setParameterValue(0, iniFile.value ( "minSmooth", 15 ).toInt()); + setParameterValue(1, iniFile.value ( "maxSmooth", 50 ).toInt()); + setParameterValue(2, iniFile.value ( "powCurve", 10 ).toInt()); + iniFile.endGroup (); + +} + void FTNoIR_Filter_EWMA2::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) { //non-optimised version for clarity diff --git a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp index 130bf47b..f2523145 100644 --- a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp +++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp @@ -56,6 +56,8 @@ QWidget() connect(ui.maxSmooth, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int))); connect(ui.powCurve, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int))); + qDebug() << "FilterControls() says: started"; + // Load the settings from the current .INI-file loadSettings(); } @@ -75,8 +77,18 @@ void FilterControls::Release() // // Initialize tracker-client-dialog // -void FilterControls::Initialize(QWidget *parent) { +void FilterControls::Initialize(QWidget *parent, IFilterPtr ptr) { + // + // The dialog can be opened, while the Tracker is running. + // In that case, ptr will point to the active Filter-instance. + // This can be used to update settings, while Tracking and may also be handy to display logging-data and such... + // + pFilter = ptr; + + // + // + // QPoint offsetpos(100, 100); if (parent) { this->move(parent->pos() + offsetpos); @@ -89,6 +101,9 @@ void FilterControls::Initialize(QWidget *parent) { // void FilterControls::doOK() { save(); + if (pFilter) { + pFilter->Initialize(); + } this->close(); } @@ -134,13 +149,13 @@ void FilterControls::doCancel() { // Load the current Settings from the currently 'active' INI-file. // void FilterControls::loadSettings() { -// qDebug() << "loadSettings says: Starting "; + qDebug() << "FilterControls::loadSettings says: Starting "; QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) -// qDebug() << "loadSettings says: iniFile = " << currentFile; + qDebug() << "FilterControls::loadSettings says: iniFile = " << currentFile; // // The EWMA2-filter-settings are in the Tracking group: this is because they used to be on the Main Form of FaceTrackNoIR diff --git a/FaceTrackNoIR/FaceApp.h b/FaceTrackNoIR/FaceApp.h index 75eb6df2..39fd4b2f 100644 --- a/FaceTrackNoIR/FaceApp.h +++ b/FaceTrackNoIR/FaceApp.h @@ -21,6 +21,7 @@ private: int msgID_FTClient; int msgID_FTIR_Register; int msgID_FTIR_UnRegister; + int msgID_FilterSettingChanged; }; #endif // FACEAPP_H diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index 58c60362..73d201c3 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -133,11 +133,6 @@ void FaceTrackNoIR::setupFaceTrackNoIR() { connect(ui.chkUseEWMA, SIGNAL(stateChanged(int)), this, SLOT(setUseFilter(int))); - // Connect sliders for reduction factor - connect(ui.minSmooth, SIGNAL(valueChanged(int)), this, SLOT(setMinSmooth(int))); - connect(ui.maxSmooth, SIGNAL(valueChanged(int)), this, SLOT(setMaxSmooth(int))); - connect(ui.powCurve, SIGNAL(valueChanged(int)), this, SLOT(setPowCurve(int))); - // Connect slider for smoothing connect(ui.slideSmoothing, SIGNAL(valueChanged(int)), this, SLOT(setSmoothing(int))); @@ -528,10 +523,6 @@ void FaceTrackNoIR::startTracker( ) { tracker->setInvertY (ui.chkInvertY->isChecked() ); tracker->setInvertZ (ui.chkInvertZ->isChecked() ); - tracker->setMinSmooth (ui.minSmooth->value() ); - tracker->setPowCurve (ui.powCurve->value() ); - tracker->setMaxSmooth (ui.maxSmooth->value() ); - tracker->start( QThread::TimeCriticalPriority ); ui.headPoseWidget->show(); @@ -745,24 +736,6 @@ THeadPoseData newdata; } } -/** set the redhold from the slider **/ -void FaceTrackNoIR::setMinSmooth( int redh ) { - Tracker::setMinSmooth ( redh ); - settingsDirty = true; -} - -/** set the redhold from the slider **/ -void FaceTrackNoIR::setPowCurve( int redh ) { - Tracker::setPowCurve ( redh ); - settingsDirty = true; -} - -/** set the redhold from the slider **/ -void FaceTrackNoIR::setMaxSmooth( int redh ) { - Tracker::setMaxSmooth ( redh ); - settingsDirty = true; -} - /** set the smoothing from the slider **/ void FaceTrackNoIR::setSmoothing( int smooth ) { @@ -959,7 +932,7 @@ QLibrary *filterLib; if (ptrXyz) { pFilterDialog = ptrXyz; - pFilterDialog->Initialize( this ); + pFilterDialog->Initialize( this, Tracker::getFilterPtr() ); qDebug() << "FaceTrackNoIR::showFilterControls GetFilterDialog Function Resolved!"; } else { diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index c17d21d7..93403be7 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -162,11 +162,6 @@ private: void setUseFilter( int set ); void showHeadPose(); - // EWMA filter sliders - void setMinSmooth( int redh ); - void setMaxSmooth( int redh ); - void setPowCurve( int redh ); - //smoothing slider void setSmoothing( int smooth ); diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index 7cb74b0a..7fa1f42c 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -11,7 +11,7 @@ 0 0 925 - 528 + 428 @@ -1073,6 +1073,18 @@ color: rgb(0, 255, 0); + + + 206 + 120 + + + + + 210 + 120 + + Profile @@ -1160,793 +1172,429 @@ color: rgb(0, 255, 0); - - - - - - - 620 - 115 - - - - - 667 - 115 - - - - true - - - background: url("UIElements/bubble_2_big.png") no-repeat; -opacity:100; - - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - color:#ccc; -background:none; - - - Global settings - - - - - - - - 95 - 0 - - - - - 150 - 16777215 - - - - color:#ccc; -background:none; - - - Use EWMA filtering: - - - - - - - background:none; - - - - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - color:#ccc; -background:none; - - - Smoothing: - - - - - - - - 50 - 15 - - - - 1 - - - 50 - - - 5 - - - 10 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - - 35 - 22 - - - - background:none; - - - 1 - - - 50 - - - 10 - - - - - - - color:#ccc; -background:none; - - - (samples) - - - - - - - - - false - - - - - - QFrame::Sunken - - - Qt::Vertical + + + + + 206 + 120 + + + + + 16777215 + 120 + + + + Global Settings + + + + + 9 + 20 + 171 + 80 + - - - - - - - - Qt::RightToLeft - - - color:#ccc; -background:none; - - - EWMA - - - - - - - - 45 - 15 - - - - 1 - - - 100 - - - 10 - - - 2 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - - 45 - 15 - - - - 1 - - - 100 - - - 10 - - - 10 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - - 45 - 15 - - - - 1 - - - 100 - - - 10 - - - 10 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - - 40 - 22 - - - - background:none; - - - 1 - - - 100 - - - 5 - - - 2 - - - - - - - - 40 - 22 - - - - background:none; - - - 1 - - - 100 - - - 5 - - - 10 - - - - - - - - 40 - 22 - - - - background:none; - - - 100 - - - 5 - - - 10 - - - - - - - - 35 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; -background:none; - - - frames - - - - - - - - 35 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; -background:none; - - - frames - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; -background:none; - - - pow - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; + + + + + + 95 + 0 + + + + + 150 + 16777215 + + + + color:#ccc; background:none; - - - Min. - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; + + + Use advanced filtering: + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + color:#ccc; background:none; - - - Max. - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; + + + Smoothing: + + + + + + + color:#ccc; background:none; - - - Curve - - - - - - - - - Qt::Vertical - + + + (samples) + + + + + + + + 50 + 15 + + + + 1 + + + 50 + + + 5 + + + 10 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + 35 + 22 + + + + background:none; + + + 1 + + + 50 + + + 10 + + + + - - - - - - - background:none; - - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; + + + + 200 + 20 + 211 + 81 + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - Invert - - - - - - - background:none; - - - - - - - - - - background:none; - - - - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + Roll + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - X - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + Z + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - Y - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + Pitch + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - Z - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + Y + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - Yaw - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + Yaw + + + + + + + background:none; + + + + + + + + + + + 25 + 0 + + + + + 150 + 16777215 + + + + Qt::RightToLeft + + + color:#ccc; background:none; - - - Pitch - - - - - - - - 25 - 0 - - - - - 150 - 16777215 - - - - Qt::RightToLeft - - - color:#ccc; + + + X + + + + + + + background:none; + + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + color:#ccc; background:none; - - - Roll - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - background:none; - - - - - - - - - - background:none; - - - - - - - - - - background:none; - - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - color:#ccc; + + + Invert + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + color:#ccc; background:none; - - - Invert - - - - - - - + + + Invert + + + + + + + + @@ -2110,6 +1758,12 @@ background:none; 120 + + + 16777215 + 120 + + @@ -2205,7 +1859,13 @@ background:none; 190 - 100 + 120 + + + + + 16777215 + 120 @@ -2262,7 +1922,13 @@ background:none; 190 - 100 + 120 + + + + + 16777215 + 120 @@ -2316,6 +1982,19 @@ background:none; + + + + Qt::Vertical + + + + 20 + 30 + + + + @@ -2580,101 +2259,5 @@ background:none; - - minSmooth - valueChanged(int) - spinMinSmooth - setValue(int) - - - 643 - 333 - - - 691 - 335 - - - - - spinMinSmooth - valueChanged(int) - minSmooth - setValue(int) - - - 691 - 335 - - - 643 - 333 - - - - - maxSmooth - valueChanged(int) - spinMaxSmooth - setValue(int) - - - 643 - 360 - - - 691 - 362 - - - - - spinMaxSmooth - valueChanged(int) - maxSmooth - setValue(int) - - - 691 - 362 - - - 643 - 360 - - - - - powCurve - valueChanged(int) - spinPowCurve - setValue(int) - - - 643 - 387 - - - 691 - 389 - - - - - spinPowCurve - valueChanged(int) - powCurve - setValue(int) - - - 691 - 389 - - - 643 - 387 - - - diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index 59f6680b..70754a1c 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -507,7 +507,7 @@ T6DOF gameoutput_camera(0,0,0,0,0,0); // // Reset the 'wait' flag. Moving above 90 with the key pressed, will (de-)activate Axis Reverse. // - qDebug() << "Tracker::run() says actualZ = " << actualZ << ", terwijl Z_Pos4 = " << Z_Pos4ReverseAxis; +// qDebug() << "Tracker::run() says actualZ = " << actualZ << ", terwijl Z_Pos4 = " << Z_Pos4ReverseAxis; if (useAxisReverse) { Tracker::do_axis_reverse = ((fabs(actualYaw) > YawAngle4ReverseAxis) && (actualZ < Z_Pos4ReverseAxis)); } @@ -743,36 +743,6 @@ void Tracker::addRaw2List ( QList *rawList, float maxIndex, float raw ) { rawList->prepend ( 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 raw headpose, so it can be displayed. // diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index dd8a961b..b9a39eba 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -41,7 +41,7 @@ #include "..\ftnoir_tracker_base\FTNoIR_Tracker_base.h" #include "..\ftnoir_protocol_base\FTNoIR_Protocol_base.h" #include "..\ftnoir_filter_base\FTNoIR_Filter_base.h" -#include "AutoClosePtr.h" +//#include "AutoClosePtr.h" // 1a. COM-Like usage with smart pointer. // No need to call `ITracker::Release'; the instance will @@ -50,8 +50,7 @@ typedef AutoClosePtr ITrackerPtr; typedef ITracker *(WINAPI *importGetTracker)(void); typedef AutoClosePtr IProtocolPtr; typedef IProtocol *(WINAPI *importGetProtocol)(void); -typedef AutoClosePtr IFilterPtr; -typedef IFilter *(WINAPI *importGetFilter)(void); + // include the DirectX Library files #pragma comment (lib, "dinput8.lib") @@ -162,9 +161,6 @@ private: static void addHeadPose( THeadPoseData head_pose ); static void addRaw2List ( QList *rawList, float maxIndex, float raw ); -// static float lowPassFilter ( float newvalue, float *oldvalue, float dt, float coeff); -// static float rateLimiter ( float newvalue, float *oldvalue, float dt, float max_rate); -// static float getCorrectedNewRaw ( float NewRaw, float rotNeutral ); /** static member variables for saving the head pose **/ static THeadPoseDOF Pitch; // Head-rotation X-direction (Up/Down) @@ -232,12 +228,9 @@ public: static void setInvertZ(bool invert) { Z.invert = invert?-1.0f:+1.0f; } static void setUseFilter(bool set) { useFilter = set; } - static void setMinSmooth(int x); - static void setMaxSmooth(int x); - static void setPowCurve(int x); - static void getHeadPose(THeadPoseData *data); // Return the current headpose data static void getOutputHeadPose(THeadPoseData *data); // Return the current (processed) headpose data + static IFilterPtr getFilterPtr() { return pFilter; } static float getSmoothFromList ( QList *rawList ); static float getDegreesFromRads ( float rads ) { return (rads * 57.295781f); } -- cgit v1.2.3