summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2012-08-05 11:59:00 +0000
committerWim Vriend <facetracknoir@gmail.com>2012-08-05 11:59:00 +0000
commitc4a43c7ebacca6de419640e5cf683cc959520cd8 (patch)
treecba42513097ff3fdb16d2f53cb6ffaacbad8d03a
parent83cb0e5dad57e7e38214a1f75d6893ec2b570165 (diff)
Busy adapting changes from Stan.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@119 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r--FaceTrackNoIR/FTNoIR_Curves.ui71
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp59
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.h4
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.ui3
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.vcproj4
-rw-r--r--FaceTrackNoIR/tracker.cpp44
-rw-r--r--FaceTrackNoIR/tracker.h16
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>858</width>
- <height>605</height>
+ <width>901</width>
+ <height>824</height>
</rect>
</property>
<property name="windowTitle">
@@ -97,7 +97,7 @@ color: rgb(255, 255, 255);
<string notr="true"/>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="rotation_tab">
<attribute name="icon">
@@ -119,6 +119,12 @@ color: rgb(255, 255, 255);
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QFunctionConfigurator" name="qFunctionPitch">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>260</width>
@@ -128,9 +134,15 @@ color: rgb(255, 255, 255);
<property name="maximumSize">
<size>
<width>260</width>
- <height>240</height>
+ <height>500</height>
</size>
</property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
<property name="colorBezier">
<color>
<red>0</red>
@@ -155,6 +167,12 @@ color: rgb(255, 255, 255);
</item>
<item row="0" column="2">
<widget class="QFunctionConfigurator" name="qFunctionRoll">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>260</width>
@@ -164,9 +182,12 @@ color: rgb(255, 255, 255);
<property name="maximumSize">
<size>
<width>260</width>
- <height>240</height>
+ <height>500</height>
</size>
</property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
<property name="colorBezier">
<color>
<red>0</red>
@@ -191,6 +212,12 @@ color: rgb(255, 255, 255);
</item>
<item row="0" column="0">
<widget class="QFunctionConfigurator" name="qFunctionYaw">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>260</width>
@@ -199,10 +226,13 @@ color: rgb(255, 255, 255);
</property>
<property name="maximumSize">
<size>
- <width>260</width>
- <height>240</height>
+ <width>400</width>
+ <height>500</height>
</size>
</property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
<property name="colorBezier">
<color>
<red>255</red>
@@ -227,6 +257,12 @@ color: rgb(255, 255, 255);
</item>
<item row="1" column="1">
<widget class="QFunctionConfigurator" name="qFunctionPitchDown">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>260</width>
@@ -236,9 +272,15 @@ color: rgb(255, 255, 255);
<property name="maximumSize">
<size>
<width>260</width>
- <height>240</height>
+ <height>500</height>
</size>
</property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
<property name="colorBezier">
<color>
<red>0</red>
@@ -307,7 +349,7 @@ color: rgb(255, 255, 255);
<x>30</x>
<y>10</y>
<width>794</width>
- <height>388</height>
+ <height>390</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@@ -446,17 +488,6 @@ color: rgb(255, 255, 255);
<property name="styleSheet">
<string notr="true">image: url(:/images/translation_DOFs.png);</string>
</property>
- <widget class="QWidget" name="layoutWidget">
- <property name="geometry">
- <rect>
- <x>-40</x>
- <y>0</y>
- <width>260</width>
- <height>140</height>
- </rect>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_5"/>
- </widget>
</widget>
</item>
</layout>
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 {
<height>500</height>
</size>
</property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
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 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="postbuild.bat &quot;$(QTDIR)\plugins\designer\QBezierConfigurator.dll&quot; &quot;$(OutDir)&quot; $(ConfigurationName)"
+ CommandLine="postbuild.bat &quot;$(QTDIR)\plugins\designer\QFunctionConfigurator.dll&quot; &quot;$(OutDir)&quot; $(ConfigurationName)"
/>
<Tool
Name="VCCustomBuildTool"
@@ -70,7 +70,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib qtmain.lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtNetwork4.lib Strmiids.lib Ws2_32.lib QBezierConfigurator.lib QFunctionConfigurator.lib"
+ AdditionalDependencies="opengl32.lib qtmain.lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtNetwork4.lib Strmiids.lib Ws2_32.lib QFunctionConfigurator.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
AdditionalLibraryDirectories=""
GenerateManifest="true"
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp
index 2d4c5917..31fcff04 100644
--- a/FaceTrackNoIR/tracker.cpp
+++ b/FaceTrackNoIR/tracker.cpp
@@ -23,6 +23,9 @@
*********************************************************************************/
/*
Modifications (last one on top):
+ 20120805 - WVR: The FunctionConfig-widget is used to configure the Curves. It was tweaked some more, because the Accela filter now also
+ uses the Curve(s). ToDo: make the ranges configurable by the user. Development on the Toradex IMU makes us realize, that
+ a fixed input-range may not be so handy after all..
20120427 - WVR: The Protocol-code was already in separate DLLs, but the ListBox was still filled ´statically´. Now, a Dir() of the
EXE-folder is done, to locate Protocol-DLLs. The Icons were also moved to the DLLs
20120317 - WVR: The Filter and Tracker-code was moved to separate DLLs. The calling-method
@@ -80,23 +83,23 @@ bool Tracker::setZero = true;
bool Tracker::setEngineStop = true;
HANDLE Tracker::hTrackMutex = 0;
-bool Tracker::useAxisReverse = false; // Use Axis Reverse
-float Tracker::YawAngle4ReverseAxis = 40.0f; // Axis Reverse settings
+bool Tracker::useAxisReverse = false; // Use Axis Reverse
+float Tracker::YawAngle4ReverseAxis = 40.0f; // Axis Reverse settings
float Tracker::Z_Pos4ReverseAxis = -20.0f;
float Tracker::Z_PosWhenReverseAxis = 50.0f;
-T6DOF Tracker::current_camera(0,0,0,0,0,0); // Used for filtering
+T6DOF Tracker::current_camera(0,0,0,0,0,0); // Used for filtering
T6DOF Tracker::target_camera(0,0,0,0,0,0);
T6DOF Tracker::new_camera(0,0,0,0,0,0);
-T6DOF Tracker::output_camera(0,0,0,0,0,0); // Position sent to game protocol
+T6DOF Tracker::output_camera(0,0,0,0,0,0); // Position sent to game protocol
-THeadPoseDOF Tracker::Pitch("PitchUp", "PitchDown"); // One structure for each of 6DOF's
-THeadPoseDOF Tracker::Yaw("Yaw", "");
-THeadPoseDOF Tracker::Roll("Roll", "");
-THeadPoseDOF Tracker::X("X","");
-THeadPoseDOF Tracker::Y("Y","");
-THeadPoseDOF Tracker::Z("Z","");
+THeadPoseDOF Tracker::Pitch("PitchUp", "PitchDown", 50, 90); // One structure for each of 6DOF's
+THeadPoseDOF Tracker::Yaw("Yaw", "", 50, 180);
+THeadPoseDOF Tracker::Roll("Roll", "", 50, 180);
+THeadPoseDOF Tracker::X("X","", 50, 180);
+THeadPoseDOF Tracker::Y("Y","", 50, 180);
+THeadPoseDOF Tracker::Z("Z","", 50, 180);
TShortKey Tracker::CenterKey; // ShortKey to Center headposition
TShortKey Tracker::StartStopKey; // ShortKey to Start/stop tracking
@@ -384,28 +387,7 @@ T6DOF gameoutput_camera(0,0,0,0,0,0);
// To start tracking again and to be at '0', execute Center command too
//
if (Tracker::do_tracking) {
- Tracker::do_center = true;
-
Tracker::confid = false;
-
- Pitch.rawList.clear();
- Pitch.prevPos = 0.0f;
- Yaw.rawList.clear();
- Yaw.prevPos = 0.0f;
- Roll.rawList.clear();
- Roll.prevPos = 0.0f;
- X.rawList.clear();
- X.prevPos = 0.0f;
- Y.rawList.clear();
- Y.prevPos = 0.0f;
- Z.rawList.clear();
- Z.prevPos = 0.0f;
-
- current_camera.initHeadPoseData();
- target_camera.initHeadPoseData();
- new_camera.initHeadPoseData();
- offset_camera.initHeadPoseData();
-
pTracker->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