From c4a43c7ebacca6de419640e5cf683cc959520cd8 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Sun, 5 Aug 2012 11:59:00 +0000 Subject: Busy adapting changes from Stan. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@119 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FaceTrackNoIR/FTNoIR_Curves.ui | 71 +++++++++++++++++++++++++++----------- FaceTrackNoIR/FaceTrackNoIR.cpp | 59 ++++++++++++++++++------------- FaceTrackNoIR/FaceTrackNoIR.h | 4 +-- FaceTrackNoIR/FaceTrackNoIR.ui | 3 -- FaceTrackNoIR/FaceTrackNoIR.vcproj | 4 +-- FaceTrackNoIR/tracker.cpp | 44 +++++++---------------- FaceTrackNoIR/tracker.h | 16 +++++---- 7 files changed, 113 insertions(+), 88 deletions(-) diff --git a/FaceTrackNoIR/FTNoIR_Curves.ui b/FaceTrackNoIR/FTNoIR_Curves.ui index d7ed1fe5..c241cc42 100644 --- a/FaceTrackNoIR/FTNoIR_Curves.ui +++ b/FaceTrackNoIR/FTNoIR_Curves.ui @@ -6,8 +6,8 @@ 0 0 - 858 - 605 + 901 + 824 @@ -97,7 +97,7 @@ color: rgb(255, 255, 255); - 1 + 0 @@ -119,6 +119,12 @@ color: rgb(255, 255, 255); + + + 0 + 0 + + 260 @@ -128,9 +134,15 @@ color: rgb(255, 255, 255); 260 - 240 + 500 + + 90 + + + 2 + 0 @@ -155,6 +167,12 @@ color: rgb(255, 255, 255); + + + 0 + 0 + + 260 @@ -164,9 +182,12 @@ color: rgb(255, 255, 255); 260 - 240 + 500 + + 1 + 0 @@ -191,6 +212,12 @@ color: rgb(255, 255, 255); + + + 0 + 0 + + 260 @@ -199,10 +226,13 @@ color: rgb(255, 255, 255); - 260 - 240 + 400 + 500 + + 1 + 255 @@ -227,6 +257,12 @@ color: rgb(255, 255, 255); + + + 0 + 0 + + 260 @@ -236,9 +272,15 @@ color: rgb(255, 255, 255); 260 - 240 + 500 + + 90 + + + 2 + 0 @@ -307,7 +349,7 @@ color: rgb(255, 255, 255); 30 10 794 - 388 + 390 @@ -446,17 +488,6 @@ color: rgb(255, 255, 255); image: url(:/images/translation_DOFs.png); - - - - -40 - 0 - 260 - 140 - - - - diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index 3e0d6628..da70816c 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -772,6 +772,7 @@ void FaceTrackNoIR::stopTracker( ) { // Enable/disable Protocol-server Settings ui.btnShowServerControls->setEnabled ( true ); + ui.video_frame->hide(); //// Engine controls //switch (ui.iconcomboTrackerSource->currentIndex()) { @@ -1000,19 +1001,20 @@ QString libName; void FaceTrackNoIR::showFilterControls() { importGetFilterDialog getIT; QLibrary *filterLib; +QString libName; - QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) + //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) + //QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); + //QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - // - // Read the currently selected Filter from the INI-file. - // - iniFile.beginGroup ( "Filter" ); - QString selectedFilterName = iniFile.value ( "Selection", "FTNoIR_Filter_EWMA2.dll" ).toString(); - qDebug() << "createIconGroupBox says: selectedFilterName = " << selectedFilterName; - iniFile.endGroup (); + //// + //// Read the currently selected Filter from the INI-file. + //// + //iniFile.beginGroup ( "Filter" ); + //QString selectedFilterName = iniFile.value ( "Selection", "FTNoIR_Filter_EWMA2.dll" ).toString(); + //qDebug() << "createIconGroupBox says: selectedFilterName = " << selectedFilterName; + //iniFile.endGroup (); // // Delete the existing QDialog @@ -1021,23 +1023,32 @@ QLibrary *filterLib; pFilterDialog.Release(); } - filterLib = new QLibrary(selectedFilterName); + // Show the appropriate Protocol-server Settings + libName.clear(); + libName = getCurrentFilterName(); + + // + // Load the Server-settings dialog (if any) and show it. + // + if (!libName.isEmpty()) { + filterLib = new QLibrary(libName); - getIT = (importGetFilterDialog) filterLib->resolve("GetFilterDialog"); - if (getIT) { - IFilterDialogPtr ptrXyz(getIT()); - if (ptrXyz) - { - pFilterDialog = ptrXyz; - pFilterDialog->Initialize( this, Tracker::getFilterPtr() ); - qDebug() << "FaceTrackNoIR::showFilterControls GetFilterDialog Function Resolved!"; + getIT = (importGetFilterDialog) filterLib->resolve("GetFilterDialog"); + if (getIT) { + IFilterDialogPtr ptrXyz(getIT()); + if (ptrXyz) + { + pFilterDialog = ptrXyz; + pFilterDialog->Initialize( this, Tracker::getFilterPtr() ); + qDebug() << "FaceTrackNoIR::showFilterControls GetFilterDialog Function Resolved!"; + } + else { + qDebug() << "FaceTrackNoIR::showFilterControls Function NOT Resolved!"; + } } else { - qDebug() << "FaceTrackNoIR::showFilterControls Function NOT Resolved!"; - } - } - else { - QMessageBox::warning(0,"FaceTrackNoIR Error", "DLL not loaded",QMessageBox::Ok,QMessageBox::NoButton); + QMessageBox::warning(0,"FaceTrackNoIR Error", "DLL not loaded",QMessageBox::Ok,QMessageBox::NoButton); + } } } diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index ace9c666..ff64bc96 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -63,8 +63,8 @@ typedef IFilterDialog *(WINAPI *importGetFilterDialog)(void); class Tracker; // pre-define class to avoid circular includes -void getCurvePoints(QSettings *iniFile, QString prefix, QPointF *one, QPointF *two, QPointF *three, QPointF *four, - int NeutralZone, int Sensitivity, int MaxInput, int MaxOutput); +//void getCurvePoints(QSettings *iniFile, QString prefix, QPointF *one, QPointF *two, QPointF *three, QPointF *four, +// int NeutralZone, int Sensitivity, int MaxInput, int MaxOutput); class FaceTrackNoIR : public QMainWindow { diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index d670efea..e1bd7c15 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -188,9 +188,6 @@ QGroupBox { 500 - - - QFrame::StyledPanel diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj index c6732a93..010b8afd 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.vcproj +++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj @@ -25,7 +25,7 @@ > StartTracker( mainApp->winId() ); } else { diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index c1eb61c6..56fe51fd 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -100,17 +100,18 @@ class FaceTrackNoIR; // pre-define parent-class to avoid circular includes class THeadPoseDOF { public: - THeadPoseDOF(QString primary, QString secondary = "") { - QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) + THeadPoseDOF(QString primary, QString secondary = "", int maxInput = 50, int maxOutput = 180) { + 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) + QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - curvePtr = new FunctionConfig(primary); // Create the Function-config for input-output translation - curvePtr->loadSettings(iniFile); // Load the settings from the INI-file + curvePtr = new FunctionConfig(primary, maxInput, maxOutput); // Create the Function-config for input-output translation + curvePtr->loadSettings(iniFile); // Load the settings from the INI-file if (secondary != "") { - curvePtrAlt = new FunctionConfig(secondary); + curvePtrAlt = new FunctionConfig(secondary, maxInput, maxOutput); curvePtrAlt->loadSettings(iniFile); } + } void initHeadPoseData(){ @@ -126,6 +127,9 @@ public: MaxInput = 0; confidence = 0.0f; newSample = FALSE; + + qDebug() << "initHeadPoseData: " << curvePtr->getTitle(); + } float headPos; // Current position (from faceTracker, radials or meters) float offset_headPos; // Offset for centering -- cgit v1.2.3