diff options
Diffstat (limited to 'FaceTrackNoIR')
-rw-r--r-- | FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui | 721 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.cpp | 7 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.h | 1 | ||||
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 10 | ||||
-rw-r--r-- | FaceTrackNoIR/tracker.h | 1 |
5 files changed, 447 insertions, 293 deletions
diff --git a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui index cbd0514d..3a8b98a8 100644 --- a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui +++ b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui @@ -6,8 +6,8 @@ <rect>
<x>0</x>
<y>0</y>
- <width>638</width>
- <height>165</height>
+ <width>558</width>
+ <height>270</height>
</rect>
</property>
<property name="windowTitle">
@@ -25,295 +25,434 @@ </property>
<layout class="QVBoxLayout" name="_vertical_layout">
<item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="textLabel2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Center</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="chkCenterShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QCheckBox" name="chkCenterCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QCheckBox" name="chkCenterAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="0" column="4">
- <widget class="QComboBox" name="cbxCenterKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Start/stop</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="chkStartStopShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QCheckBox" name="chkStartStopCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="chkStartStopAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="1" column="4">
- <widget class="QComboBox" name="cbxStartStopKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Axis Inhibitor</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkInhibitShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QCheckBox" name="chkInhibitCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QCheckBox" name="chkInhibitAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="2" column="4">
- <widget class="QComboBox" name="cbxInhibitKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="6">
- <widget class="QCheckBox" name="chkInhibitPitch">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Pitch</string>
- </property>
- </widget>
- </item>
- <item row="2" column="7">
- <widget class="QCheckBox" name="chkInhibitYaw">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Yaw</string>
- </property>
- </widget>
- </item>
- <item row="2" column="8">
- <widget class="QCheckBox" name="chkInhibitRoll">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Roll</string>
- </property>
- </widget>
- </item>
- <item row="2" column="9">
- <widget class="QCheckBox" name="chkInhibitX">
- <property name="maximumSize">
- <size>
- <width>30</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>X</string>
- </property>
- </widget>
- </item>
- <item row="2" column="10">
- <widget class="QCheckBox" name="chkInhibitY">
- <property name="maximumSize">
- <size>
- <width>30</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Y</string>
- </property>
- </widget>
- </item>
- <item row="2" column="11">
- <widget class="QCheckBox" name="chkInhibitZ">
- <property name="maximumSize">
- <size>
- <width>30</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Z</string>
- </property>
- </widget>
- </item>
- <item row="2" column="5">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Disables:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="6">
- <widget class="QRadioButton" name="radioSetZero">
- <property name="text">
- <string>Zero</string>
- </property>
- </widget>
- </item>
- <item row="1" column="7">
- <widget class="QRadioButton" name="radioSetFreeze">
- <property name="text">
- <string>Stay</string>
- </property>
- </widget>
- </item>
- <item row="1" column="5">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>When OFF:</string>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="2" column="6">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Disables:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="6">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>When OFF:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="textLabel2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Axis Inhibitor</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="chkCenterShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Shift</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkStartStopShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Shift</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkInhibitShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Shift</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QCheckBox" name="chkCenterCtrl">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Ctrl</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QCheckBox" name="chkStartStopCtrl">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Ctrl</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QCheckBox" name="chkInhibitCtrl">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Ctrl</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QCheckBox" name="chkCenterAlt">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Alt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QCheckBox" name="chkStartStopAlt">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Alt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QCheckBox" name="chkInhibitAlt">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Alt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QComboBox" name="cbxCenterKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Select Number</string>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::InsertAlphabetically</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4">
+ <widget class="QComboBox" name="cbxStartStopKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QComboBox" name="cbxInhibitKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="7">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>80</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color: rgb(0, 0, 0);</string>
+ </property>
+ <property name="title">
+ <string>Rotations</string>
+ </property>
+ <widget class="QCheckBox" name="chkInhibitYaw">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>50</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Yaw</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="chkInhibitPitch">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>46</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Pitch</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="chkInhibitRoll">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>60</y>
+ <width>50</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Roll</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="7">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>60</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color: rgb(0, 0, 0);</string>
+ </property>
+ <property name="title">
+ <string>View</string>
+ </property>
+ <widget class="QRadioButton" name="radioSetZero">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>46</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Zero</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" name="radioSetFreeze">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>45</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Stay</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Start/stop</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="8">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(0, 0, 0);</string>
+ </property>
+ <property name="title">
+ <string>Translations</string>
+ </property>
+ <widget class="QCheckBox" name="chkInhibitX">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>30</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>X</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="chkInhibitY">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>30</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Y</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="chkInhibitZ">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>60</y>
+ <width>30</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Z</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="8">
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">color: rgb(0, 0, 0);</string>
+ </property>
+ <property name="title">
+ <string>Engine tracker</string>
+ </property>
+ <widget class="QRadioButton" name="radioSetEngineStop">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>81</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Stop Engine</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" name="radioSetKeepTracking">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>91</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Keep tracking</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index eda9b51b..3502d3c4 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -23,6 +23,7 @@ *********************************************************************************/
/*
Modifications (last one on top):
+ 20110207 - WVR: RadioButtons for 'Stop engine' added. It is now possible to choose Stop or Keep tracking.
20110109 - WVR: Added minimizeTaskBar option added. It is now possible to choose minimized or tray.
*/
#include "FaceTrackNoIR.h"
@@ -1122,6 +1123,8 @@ QWidget( parent , f) connect(ui.chkStartStopShift, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
connect(ui.chkStartStopCtrl, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
connect(ui.chkStartStopAlt, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
+ connect(ui.radioSetZero, SIGNAL(toggled(bool)), this, SLOT(keyChanged(bool)));
+ connect(ui.radioSetEngineStop, SIGNAL(toggled(bool)), this, SLOT(keyChanged(bool)));
connect(ui.cbxInhibitKey, SIGNAL(currentIndexChanged(int)), this, SLOT(keyChanged( int )));
connect(ui.chkInhibitShift, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
@@ -1374,6 +1377,9 @@ int keyindex; ui.chkStartStopCtrl->setChecked (iniFile.value ( "Ctrl_StartStop", 0 ).toBool());
ui.chkStartStopAlt->setChecked (iniFile.value ( "Alt_StartStop", 0 ).toBool());
ui.radioSetZero->setChecked (iniFile.value ( "SetZero", 1 ).toBool());
+ ui.radioSetFreeze->setChecked(!ui.radioSetZero->isChecked());
+ ui.radioSetEngineStop->setChecked (iniFile.value ( "SetEngineStop", 1 ).toBool());
+ ui.radioSetKeepTracking->setChecked(!ui.radioSetEngineStop->isChecked());
// Axis-inhibitor key
keyindex = keyList.indexOf ( iniFile.value ( "Keycode_Inhibit", 1 ).toInt() );
@@ -1423,6 +1429,7 @@ void KeyboardShortcutDialog::save() { iniFile.setValue ( "Ctrl_StartStop", ui.chkStartStopCtrl->isChecked() );
iniFile.setValue ( "Alt_StartStop", ui.chkStartStopAlt->isChecked() );
iniFile.setValue ( "SetZero", ui.radioSetZero->isChecked() );
+ iniFile.setValue ( "SetEngineStop", ui.radioSetEngineStop->isChecked() );
iniFile.setValue ( "Keycode_Inhibit", keyList.at( ui.cbxInhibitKey->currentIndex() ) );
iniFile.setValue ( "Shift_Inhibit", ui.chkInhibitShift->isChecked() );
diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index c1d48a4b..af0df504 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -197,6 +197,7 @@ private slots: void doOK();
void doCancel();
void keyChanged( int index ) { settingsDirty = true; };
+ void keyChanged( bool index ) { settingsDirty = true; };
};
// Widget that has controls for Keyboard shortcuts.
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index 90efc9d6..91c386c0 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -66,6 +66,7 @@ bool Tracker::do_center = false; bool Tracker::do_inhibit = false;
bool Tracker::useFilter = false;
bool Tracker::setZero = true;
+bool Tracker::setEngineStop = true;
HANDLE Tracker::hTrackMutex = 0;
long Tracker::prevHeadPoseTime = 0;
@@ -440,10 +441,14 @@ void Tracker::run() { current_camera_position.pitch = 0.0f;
current_camera_position.roll = 0.0f;
- _engine->start();
+ if (_engine->state() != SM_API_ENGINE_STATE_HT_TRACKING) {
+ _engine->start();
+ }
}
else {
- _engine->stop();
+ if (setEngineStop) { // Only stop engine when option is checked
+ _engine->stop();
+ }
}
qDebug() << "Tracker::run() says StartStop pressed, do_tracking =" << Tracker::do_tracking;
}
@@ -1082,6 +1087,7 @@ QPointF point1, point2, point3, point4; StartStopKey.ctrl = iniFile.value ( "Ctrl_StartStop", 0 ).toBool();
StartStopKey.alt = iniFile.value ( "Alt_StartStop", 0 ).toBool();
setZero = iniFile.value ( "SetZero", 1 ).toBool();
+ setEngineStop = iniFile.value ( "SetEngineStop", 1 ).toBool();
// Inhibit key
InhibitKey.keycode = iniFile.value ( "Keycode_Inhibit", 0 ).toInt();
diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index 6c436ff8..56be4771 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -178,6 +178,7 @@ private: static bool useFilter; // Use EWMA-filtering
static bool setZero; // Set to zero's, when OFF (one-shot)
+ static bool setEngineStop; // Stop tracker->engine, when OFF
static long prevHeadPoseTime; // Time from previous sample
/** QT objects **/
|