summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--bin/tracker-ht/headtracker-ftnoir.exebin4486144 -> 4482560 bytes
-rw-r--r--cmake/FindQxt.cmake (renamed from cmake/findqxt.cmake)0
-rw-r--r--facetracknoir/facetracknoir.cpp8
-rw-r--r--facetracknoir/tracker.cpp13
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.cpp34
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp2
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp2
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.cpp32
-rw-r--r--ftnoir_tracker_ht/ht-api.h1
-rw-r--r--ftnoir_tracker_ht/ht-trackercontrols.ui308
-rw-r--r--ftnoir_tracker_pt/camera.cpp4
-rw-r--r--ftnoir_tracker_pt/camera.h1
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp15
-rw-r--r--qfunctionconfigurator/functionconfig.h2
15 files changed, 80 insertions, 352 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54bb79fd..31f6f6b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,11 @@
project(facetracknoir)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake/")
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+SET(CMAKE_SKIP_INSTALL_RPATH FALSE)
SET(CMAKE_SKIP_RPATH FALSE)
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
SET(SDK_FACEAPI_ONLY FALSE CACHE BOOL "FaceAPI only (MSVC 2005)")
@@ -203,7 +205,6 @@ if(NOT SDK_FACEAPI_ONLY)
QT4_WRAP_UI(ftnoir-proto-win32-mouse-uih ${ftnoir-proto-win32-mouse-ui})
QT4_ADD_RESOURCES(ftnoir-proto-win32-mouse-rcc ${ftnoir-proto-win32-mouse-rc})
-# TODO manifest problems :(
file(GLOB ftnoir-proto-simconnect-c "ftnoir_protocol_sc/*.cpp")
file(GLOB ftnoir-proto-simconnect-h "ftnoir_protocol_sc/*.h")
QT4_WRAP_CPP(ftnoir-proto-simconnect-moc ${ftnoir-proto-simconnect-h})
@@ -344,6 +345,9 @@ endif()
if(SDK_FSUIPC)
add_library(ftnoir-proto-fsuipc SHARED ${ftnoir-proto-fsuipc-c} ${ftnoir-proto-fsuipc-moc} ${ftnoir-proto-fsuipc-uih} ${ftnoir-proto-fsuipc-rcc})
target_link_libraries(ftnoir-proto-fsuipc ${MY_QT_LIBS} "${SDK_FSUIPC}/FSUIPC_User.lib")
+ if(MSVC)
+ set_target_properties(ftnoir-proto-fsuipc PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc")
+ endif()
endif()
if(SDK_SIMCONNECT)
diff --git a/bin/tracker-ht/headtracker-ftnoir.exe b/bin/tracker-ht/headtracker-ftnoir.exe
index 4ed54a58..c1d9d3a7 100644
--- a/bin/tracker-ht/headtracker-ftnoir.exe
+++ b/bin/tracker-ht/headtracker-ftnoir.exe
Binary files differ
diff --git a/cmake/findqxt.cmake b/cmake/FindQxt.cmake
index 1ddfa0dd..1ddfa0dd 100644
--- a/cmake/findqxt.cmake
+++ b/cmake/FindQxt.cmake
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp
index 8940588e..2fb07baa 100644
--- a/facetracknoir/facetracknoir.cpp
+++ b/facetracknoir/facetracknoir.cpp
@@ -376,9 +376,7 @@ QFrame *FaceTrackNoIR::get_video_widget() {
/** read the name of the first video-capturing device at start up **/
/** FaceAPI can only use this first one... **/
void FaceTrackNoIR::GetCameraNameDX() {
-#if 1
-//// ui.widget->setCameraName("No video-capturing device was found in your system: check if it's connected!");
-
+#if defined(_WIN32)
ui.cameraName->setText("No video-capturing device was found in your system: check if it's connected!");
// Create the System Device Enumerator.
@@ -568,8 +566,6 @@ void FaceTrackNoIR::saveAs()
// Load the current Settings from the currently 'active' INI-file.
//
void FaceTrackNoIR::loadSettings() {
- if (looping)
- return;
looping = true;
qDebug() << "loadSettings says: Starting ";
QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
@@ -1323,6 +1319,8 @@ void FaceTrackNoIR::trackingSourceSelected(int index)
//
void FaceTrackNoIR::profileSelected(int index)
{
+ if (looping)
+ return;
//
// Read the current INI-file setting, to get the folder in which it's located...
//
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index 15b36f69..f624d6a1 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -143,15 +143,14 @@ void Tracker::run() {
bool bTracker2Confid = false;
THeadPoseData last;
+ THeadPoseData newpose;
+ THeadPoseData last_post_filter;
forever
{
if (should_quit)
break;
- // Check event for stop thread
-
- THeadPoseData newpose;
newpose.pitch = 0.0f;
newpose.roll = 0.0f;
newpose.yaw = 0.0f;
@@ -199,7 +198,7 @@ void Tracker::run() {
//
// Only copy valid values
//
- if (Tracker::confid) {
+ if (confid) {
offset_camera.x = GlobalPose->X.headPos;
offset_camera.y = GlobalPose->Y.headPos;
offset_camera.z = GlobalPose->Z.headPos;
@@ -222,7 +221,7 @@ void Tracker::run() {
do_game_zero = false;
}
- if (Tracker::do_tracking && Tracker::confid) {
+ if (do_tracking && confid) {
// get values
target_camera.x = GlobalPose->X.headPos;
target_camera.y = GlobalPose->Y.headPos;
@@ -238,7 +237,7 @@ void Tracker::run() {
// Use advanced filtering, when a filter was selected.
//
if (Libraries->pFilter) {
- THeadPoseData last_post_filter = gameoutput_camera;
+ last_post_filter = gameoutput_camera;
Libraries->pFilter->FilterHeadPoseData(&current_camera, &target_camera, &new_camera, &last_post_filter, newp);
}
else {
@@ -261,7 +260,7 @@ void Tracker::run() {
//
// Reverse Axis.
//
- if (Tracker::do_axis_reverse) {
+ if (do_axis_reverse) {
output_camera.z = Z_PosWhenReverseAxis; // Set the desired Z-position
}
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
index c01096bf..90ca3dba 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
@@ -153,13 +153,13 @@ PDWORD_PTR MsgResult = 0;
//
bool FTNoIR_Protocol::checkServerInstallationOK()
{
- QString aFileName; // File Path and Name
-
- // Code to activate the context for the SimConnect DLL
- ACTCTX act = { 0 };
+ // Code to activate the context for the SimConnect DLL
+ ACTCTXA act;
HANDLE hctx;
ULONG_PTR ulCookie;
+ memset(&act, 0, sizeof(act));
+
qDebug() << "SCCheckClientDLL says: Starting Function";
try {
@@ -167,8 +167,9 @@ bool FTNoIR_Protocol::checkServerInstallationOK()
act.cbSize = sizeof(act);
act.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
char full_path[2048];
- strcpy(full_path, QCoreApplication::applicationDirPath().toLatin1().constData());
- strcat(full_path, "\\libftnoir-proto-simconnect.dll");
+ QByteArray foo = QCoreApplication::applicationDirPath().toLatin1();
+ strcpy(full_path, foo.constData());
+ strcat(full_path, "/ftnoir-proto-simconnect.dll");
act.lpSource = full_path;
act.lpResourceName = MAKEINTRESOURCEA(101);
@@ -199,10 +200,23 @@ bool FTNoIR_Protocol::checkServerInstallationOK()
return false;
}
- SCClientLib.setFileName(SC_CLIENT_FILENAME);
- if (SCClientLib.load() != true) {
- qDebug() << "SCCheckClientDLL says: Error loading SimConnect DLL";
- return false;
+ const char* simconnect_paths[] = {
+ "SimConnect.DLL",
+ "C:\\Windows\\WinSxS\\x86_microsoft.flightsimulator.simconnect_67c7c14424d61b5b_10.0.60905.0_none_dd92b94d8a196297\\SimConnect.DLL",
+ "C:\\Windows\\WinSxS\\x86_microsoft.flightsimulator.simconnect_67c7c14424d61b5b_10.0.61242.0_none_e079b46b85043c20\\SimConnect.DLL",
+ "C:\\Windows\\WinSxS\\x86_microsoft.flightsimulator.simconnect_67c7c14424d61b5b_10.0.61259.0_none_55f5ecdc14f60568\\SimConnect.DLL",
+ NULL
+ };
+
+ for (int i = 0; simconnect_paths[i]; i++)
+ {
+ SCClientLib.setFileName(simconnect_paths[i]);
+ if (!SCClientLib.load()) {
+ qDebug() << "SCCheckClientDLL says: Error loading SimConnect DLL";
+ qDebug() << SCClientLib.errorString();
+ continue;
+ }
+ break;
}
//
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
index 32abf64a..ef9dd924 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
@@ -150,7 +150,7 @@ void SCControls::save() {
// GetProtocolDialog - Undecorated name, which can be easily used with GetProcAddress
// Win32 API function.
// _GetProtocolDialog@0 - Common name decoration for __stdcall functions in C language.
-#pragma comment(linker, "/export:GetProtocolDialog=_GetProtocolDialog@0")
+//#pragma comment(linker, "/export:GetProtocolDialog=_GetProtocolDialog@0")
extern "C" FTNOIR_PROTOCOL_BASE_EXPORT void* CALLING_CONVENTION GetDialog( )
{
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
index 3d59ef48..72d63c5e 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
@@ -49,7 +49,7 @@ FTNoIR_ProtocolDll::~FTNoIR_ProtocolDll()
// GetProtocolDll - Undecorated name, which can be easily used with GetProcAddress
// Win32 API function.
// _GetProtocolDll@0 - Common name decoration for __stdcall functions in C language.
-#pragma comment(linker, "/export:GetProtocolDll=_GetProtocolDll@0")
+//#pragma comment(linker, "/export:GetProtocolDll=_GetProtocolDll@0")
extern "C" FTNOIR_PROTOCOL_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata()
{
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
index c5e860ee..59af6991 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
@@ -109,28 +109,30 @@ static void load_settings(ht_config_t* config, Tracker* tracker)
config->field_of_view = iniFile.value("fov", 52).toFloat();
config->pyrlk_pyramids = 3;
config->pyrlk_win_size_w = config->pyrlk_win_size_h = 21;
- config->max_keypoints = 100;
- config->keypoint_quality = 7;
- config->keypoint_distance = 1.5;
- config->keypoint_3distance = 5.0;
+ config->max_keypoints = 200;
+ config->keypoint_quality = 2;
+ config->keypoint_distance = 1;
+ config->keypoint_3distance = 4;
//config->force_width = 640;
//config->force_height = 480;
config->force_fps = iniFile.value("fps", 0).toInt();
config->camera_index = iniFile.value("camera-index", -1).toInt();
config->ransac_num_iters = 100;
- config->ransac_max_reprojection_error = 3.75;
- config->ransac_max_inlier_error = 3.8;
- config->ransac_max_mean_error = 4;
- config->ransac_abs_max_mean_error = 10;
- config->debug = 0;
- config->ransac_min_features = 0.85;
+ config->ransac_max_reprojection_error = 3.05;
+ config->ransac_max_inlier_error = 3.14;
+ config->ransac_max_mean_error = 3;
+ config->ransac_abs_max_mean_error = 12;
+ config->debug = 1;
+ config->ransac_min_features = 0.86;
int res = iniFile.value("resolution", 0).toInt();
if (res < 0 || res >= (int)(sizeof(*resolution_choices) / sizeof(resolution_tuple)))
res = 0;
resolution_tuple r = resolution_choices[res];
config->force_width = r.width;
config->force_height = r.height;
- config->user_landmarks = iniFile.value("use-bashed-coords").toBool();
+ config->user_landmarks = false; //iniFile.value("use-bashed-coords").toBool();
+ config->flandmark_delay = 150;
+#if 0
if (config->user_landmarks)
{
config->user_landmark_locations[0][0] = iniFile.value("b1").toDouble();
@@ -146,6 +148,7 @@ static void load_settings(ht_config_t* config, Tracker* tracker)
config->user_landmark_locations[1][3] = iniFile.value("b11").toDouble();
config->user_landmark_locations[2][3] = iniFile.value("b12").toDouble();
}
+#endif
qDebug() << "width" << r.width << "height" << r.height;
if (tracker)
{
@@ -225,6 +228,7 @@ bool Tracker::GiveHeadPoseData(THeadPoseData* data)
videoWidget->updateImage(shm->frame.frame, shm->frame.width, shm->frame.height);
//memcpy(foo, shm->frame.frame, shm->frame.width * shm->frame.height * 3);
fresh = true;
+ shm->frame.width = 0;
}
if (shm->result.filled) {
if (enableRX)
@@ -330,7 +334,7 @@ TrackerControls::TrackerControls()
connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK()));
- connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings()));
+ //connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings()));
loadSettings();
settingsDirty = false;
}
@@ -386,6 +390,7 @@ void TrackerControls::loadSettings()
ui.ty->setCheckState(iniFile.value("enable-ty", true).toBool() ? Qt::Checked : Qt::Unchecked);
ui.tz->setCheckState(iniFile.value("enable-tz", true).toBool() ? Qt::Checked : Qt::Unchecked);
ui.resolution->setCurrentIndex(iniFile.value("resolution", 0).toInt());
+#if 0
ui.groupBox_2->setChecked(iniFile.value("use-bashed-coords").toBool());
ui.doubleSpinBox_1->setValue(iniFile.value("b1", 0).toDouble());
ui.doubleSpinBox_2->setValue(iniFile.value("b2", 0).toDouble());
@@ -399,6 +404,7 @@ void TrackerControls::loadSettings()
ui.doubleSpinBox_10->setValue(iniFile.value("b10", 0).toDouble());
ui.doubleSpinBox_11->setValue(iniFile.value("b11", 0).toDouble());
ui.doubleSpinBox_12->setValue(iniFile.value("b12", 0).toDouble());
+#endif
iniFile.endGroup();
settingsDirty = false;
}
@@ -437,6 +443,7 @@ void TrackerControls::save()
iniFile.setValue("enable-ty", ui.ty->checkState() != Qt::Unchecked ? true : false);
iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false);
iniFile.setValue("resolution", ui.resolution->currentIndex());
+#if 0
iniFile.setValue("b1", ui.doubleSpinBox_1->value());
iniFile.setValue("b2", ui.doubleSpinBox_2->value());
iniFile.setValue("b3", ui.doubleSpinBox_3->value());
@@ -450,6 +457,7 @@ void TrackerControls::save()
iniFile.setValue("b11", ui.doubleSpinBox_11->value());
iniFile.setValue("b12", ui.doubleSpinBox_12->value());
iniFile.setValue("use-bashed-coords", ui.groupBox_2->isChecked());
+#endif
iniFile.endGroup();
settingsDirty = false;
}
diff --git a/ftnoir_tracker_ht/ht-api.h b/ftnoir_tracker_ht/ht-api.h
index 81caf16f..c09dbf55 100644
--- a/ftnoir_tracker_ht/ht-api.h
+++ b/ftnoir_tracker_ht/ht-api.h
@@ -41,6 +41,7 @@ typedef struct ht_config {
float ransac_abs_max_mean_error;
bool user_landmarks;
float user_landmark_locations[3][4];
+ float flandmark_delay;
} ht_config_t;
typedef struct {
diff --git a/ftnoir_tracker_ht/ht-trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui
index 968b7dc7..5f414fc2 100644
--- a/ftnoir_tracker_ht/ht-trackercontrols.ui
+++ b/ftnoir_tracker_ht/ht-trackercontrols.ui
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>724</width>
- <height>160</height>
+ <width>549</width>
+ <height>131</height>
</rect>
</property>
<property name="sizePolicy">
@@ -122,8 +122,8 @@
<widget class="QPushButton" name="buttonOK">
<property name="geometry">
<rect>
- <x>220</x>
- <y>130</y>
+ <x>390</x>
+ <y>100</y>
<width>75</width>
<height>23</height>
</rect>
@@ -135,8 +135,8 @@
<widget class="QPushButton" name="buttonCancel">
<property name="geometry">
<rect>
- <x>300</x>
- <y>130</y>
+ <x>470</x>
+ <y>100</y>
<width>75</width>
<height>23</height>
</rect>
@@ -289,302 +289,6 @@
</property>
</item>
</widget>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="geometry">
- <rect>
- <x>500</x>
- <y>10</y>
- <width>221</width>
- <height>141</height>
- </rect>
- </property>
- <property name="title">
- <string>Bashed coordinates</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_1">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_2">
- <property name="geometry">
- <rect>
- <x>80</x>
- <y>20</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_3">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>20</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_6">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>50</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_4">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_5">
- <property name="geometry">
- <rect>
- <x>80</x>
- <y>50</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_9">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>80</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_7">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>80</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_8">
- <property name="geometry">
- <rect>
- <x>80</x>
- <y>80</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_12">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>110</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_11">
- <property name="geometry">
- <rect>
- <x>80</x>
- <y>110</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="doubleSpinBox_10">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>110</y>
- <width>61</width>
- <height>22</height>
- </rect>
- </property>
- <property name="frame">
- <bool>true</bool>
- </property>
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::NoButtons</enum>
- </property>
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-99.000000000000000</double>
- </property>
- </widget>
- </widget>
- <widget class="QPushButton" name="buttonSettings">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>130</y>
- <width>101</width>
- <height>23</height>
- </rect>
- </property>
- <property name="text">
- <string>Camera settings</string>
- </property>
- </widget>
</widget>
<resources/>
<connections/>
diff --git a/ftnoir_tracker_pt/camera.cpp b/ftnoir_tracker_pt/camera.cpp
index 96ba3b89..90fcfaaf 100644
--- a/ftnoir_tracker_pt/camera.cpp
+++ b/ftnoir_tracker_pt/camera.cpp
@@ -92,8 +92,8 @@ bool CVCamera::_get_frame(Mat* frame)
{
Mat tmp;
bool ret = cap->read(tmp);
- if (ret)
- flip(tmp, *frame, 0);
+ //if (ret)
+ // flip(tmp, *frame, 0);
return ret;
}
diff --git a/ftnoir_tracker_pt/camera.h b/ftnoir_tracker_pt/camera.h
index 9977431b..6fec12da 100644
--- a/ftnoir_tracker_pt/camera.h
+++ b/ftnoir_tracker_pt/camera.h
@@ -9,6 +9,7 @@
#define CAMERA_H
#include <opencv2/opencv.hpp>
+#include <opencv/highgui.h>
//#include "videoInput/videoInput.h"
// ----------------------------------------------------------------------------
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index b4cb613b..96017d52 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -66,7 +66,6 @@ void Tracker::run()
{
{
- refreshVideo();
QMutexLocker lock(&mutex);
if (should_quit)
break;
@@ -84,14 +83,16 @@ void Tracker::run()
const std::vector<cv::Vec2f>& points = point_extractor.extract_points(frame, dt, draw_frame);
tracking_valid = point_tracker.track(points, camera.get_info().f, dt);
frame_count++;
+ fresh = true;
}
#ifdef PT_PERF_LOG
log_stream<<"dt: "<<dt;
if (!frame.empty()) log_stream<<" fps: "<<camera.get_info().fps;
log_stream<<"\n";
#endif
+ refreshVideo();
}
- msleep(sleep_time);
+ msleep(sleep_time);
}
qDebug()<<"Tracker:: Thread stopping";
@@ -143,12 +144,12 @@ void Tracker::center()
void Tracker::refreshVideo()
{
- if (video_widget)
+ if (video_widget && fresh)
{
Mat frame_copy;
std::auto_ptr< vector<Vec2f> > points;
{
- QMutexLocker lock(&mutex);
+//QMutexLocker lock(&mutex);
if (!draw_frame || frame.empty()) return;
// copy the frame and points from the tracker thread
@@ -157,8 +158,7 @@ void Tracker::refreshVideo()
}
video_widget->update_image(frame_copy, points);
- fresh = true;
- }
+ }
}
void Tracker::StartTracker(QFrame* videoframe)
@@ -194,7 +194,6 @@ void Tracker::paint_widget() {
bool Tracker::GiveHeadPoseData(THeadPoseData *data)
{
- refreshVideo();
const float rad2deg = 180.0/3.14159265;
const float deg2rad = 1.0/rad2deg;
{
@@ -245,7 +244,7 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
data->yaw = rad2deg * alpha;
}
if (bEnablePitch) {
- data->pitch = -rad2deg * beta;
+ data->pitch = rad2deg * beta;
}
if (bEnableRoll) {
data->roll = rad2deg * gamma;
diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h
index d81711a7..9f380000 100644
--- a/qfunctionconfigurator/functionconfig.h
+++ b/qfunctionconfigurator/functionconfig.h
@@ -28,7 +28,7 @@ private:
QString _title;
float getValueInternal(int x);
QPointF lastValueTracked; // The last input value requested by the Tracker, with it's output-value.
- bool _tracking_active;
+ volatile bool _tracking_active;
int _max_Input;
int _max_Output;