From cc3bc1c6d14de535f87e6601ed562b505d902fce Mon Sep 17 00:00:00 2001 From: Patrick Ruoff Date: Mon, 17 Sep 2012 16:32:04 +0000 Subject: added pointtracker created VC9 solution and project files for available projects git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@143 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- .../FTNoIR_Filter_accela_vc9.vcproj | 381 ++++++++ FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2_vc9.vcproj | 376 ++++++++ FTNoIR_Protocol_FG/FTNoIR_Protocol_FG_vc9.vcproj | 377 ++++++++ .../FTNoIR_Protocol_FSUIPC_vc9.vcproj | 374 ++++++++ FTNoIR_Protocol_FT/FTNoIR_Protocol_FT_vc9.vcproj | 377 ++++++++ .../FTNoIR_Protocol_FTIR_vc9.vcproj | 377 ++++++++ FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN_vc9.vcproj | 373 ++++++++ .../FTNoIR_Protocol_MOUSE_vc9.vcproj | 373 ++++++++ .../FTNoIR_Protocol_PPJOY_vc9.vcproj | 377 ++++++++ FTNoIR_Protocol_SC/FTNoIR_Protocol_SC_vc9.vcproj | 374 ++++++++ FTNoIR_Tracker_FD/FTNoIR_Tracker_FD_vc9.vcproj | 365 ++++++++ FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui | 823 +++++++++++++++++ FTNoIR_Tracker_PT/FTNoIR_Tracker_PT.rc | 61 ++ FTNoIR_Tracker_PT/FTNoIR_Tracker_PT_vc9.vcproj | 552 ++++++++++++ FTNoIR_Tracker_PT/Resources/Logo_IR.png | Bin 0 -> 10386 bytes FTNoIR_Tracker_PT/Resources/icon.ico | Bin 0 -> 4286 bytes FTNoIR_Tracker_PT/camera.cpp | 62 ++ FTNoIR_Tracker_PT/camera.h | 46 + FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | 184 ++++ FTNoIR_Tracker_PT/ftnoir_tracker_pt.h | 81 ++ FTNoIR_Tracker_PT/ftnoir_tracker_pt.qrc | 6 + FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp | 208 +++++ FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h | 72 ++ FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp | 40 + FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h | 8 + FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.cpp | 71 ++ FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.h | 40 + FTNoIR_Tracker_PT/point_extractor.cpp | 57 ++ FTNoIR_Tracker_PT/point_extractor.h | 31 + FTNoIR_Tracker_PT/point_tracker.cpp | 231 +++++ FTNoIR_Tracker_PT/point_tracker.h | 91 ++ FTNoIR_Tracker_PT/resource.h | 14 + FTNoIR_Tracker_PT/trans_calib.cpp | 44 + FTNoIR_Tracker_PT/trans_calib.h | 39 + FTNoIR_Tracker_PT/video_widget.cpp | 89 ++ FTNoIR_Tracker_PT/video_widget.h | 40 + FTNoIR_Tracker_SM/FTNoIR_Tracker_SM_vc9.vcproj | 405 +++++++++ FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP_vc9.vcproj | 335 +++++++ FaceTrackNoIR.suo | Bin 587264 -> 0 bytes FaceTrackNoIR/FaceTrackNoIR_vc9.vcproj | 989 +++++++++++++++++++++ FaceTrackNoIR_vc9.sln | 117 +++ faceAPI/FaceAPI2FSX_vc9.vcproj | 232 +++++ 42 files changed, 9092 insertions(+) create mode 100644 FTNoIR_Filter_Accela/FTNoIR_Filter_accela_vc9.vcproj create mode 100644 FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2_vc9.vcproj create mode 100644 FTNoIR_Protocol_FG/FTNoIR_Protocol_FG_vc9.vcproj create mode 100644 FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC_vc9.vcproj create mode 100644 FTNoIR_Protocol_FT/FTNoIR_Protocol_FT_vc9.vcproj create mode 100644 FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR_vc9.vcproj create mode 100644 FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN_vc9.vcproj create mode 100644 FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE_vc9.vcproj create mode 100644 FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY_vc9.vcproj create mode 100644 FTNoIR_Protocol_SC/FTNoIR_Protocol_SC_vc9.vcproj create mode 100644 FTNoIR_Tracker_FD/FTNoIR_Tracker_FD_vc9.vcproj create mode 100644 FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui create mode 100644 FTNoIR_Tracker_PT/FTNoIR_Tracker_PT.rc create mode 100644 FTNoIR_Tracker_PT/FTNoIR_Tracker_PT_vc9.vcproj create mode 100644 FTNoIR_Tracker_PT/Resources/Logo_IR.png create mode 100644 FTNoIR_Tracker_PT/Resources/icon.ico create mode 100644 FTNoIR_Tracker_PT/camera.cpp create mode 100644 FTNoIR_Tracker_PT/camera.h create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt.h create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt.qrc create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.cpp create mode 100644 FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.h create mode 100644 FTNoIR_Tracker_PT/point_extractor.cpp create mode 100644 FTNoIR_Tracker_PT/point_extractor.h create mode 100644 FTNoIR_Tracker_PT/point_tracker.cpp create mode 100644 FTNoIR_Tracker_PT/point_tracker.h create mode 100644 FTNoIR_Tracker_PT/resource.h create mode 100644 FTNoIR_Tracker_PT/trans_calib.cpp create mode 100644 FTNoIR_Tracker_PT/trans_calib.h create mode 100644 FTNoIR_Tracker_PT/video_widget.cpp create mode 100644 FTNoIR_Tracker_PT/video_widget.h create mode 100644 FTNoIR_Tracker_SM/FTNoIR_Tracker_SM_vc9.vcproj create mode 100644 FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP_vc9.vcproj delete mode 100644 FaceTrackNoIR.suo create mode 100644 FaceTrackNoIR/FaceTrackNoIR_vc9.vcproj create mode 100644 FaceTrackNoIR_vc9.sln create mode 100644 faceAPI/FaceAPI2FSX_vc9.vcproj diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela_vc9.vcproj b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela_vc9.vcproj new file mode 100644 index 00000000..0e08c9f1 --- /dev/null +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela_vc9.vcproj @@ -0,0 +1,381 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2_vc9.vcproj b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2_vc9.vcproj new file mode 100644 index 00000000..2ab128f0 --- /dev/null +++ b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2_vc9.vcproj @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG_vc9.vcproj b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG_vc9.vcproj new file mode 100644 index 00000000..ba982efb --- /dev/null +++ b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG_vc9.vcproj @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC_vc9.vcproj b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC_vc9.vcproj new file mode 100644 index 00000000..8e233686 --- /dev/null +++ b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC_vc9.vcproj @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT_vc9.vcproj b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT_vc9.vcproj new file mode 100644 index 00000000..1dd6de7f --- /dev/null +++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT_vc9.vcproj @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR_vc9.vcproj b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR_vc9.vcproj new file mode 100644 index 00000000..6e63fc36 --- /dev/null +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR_vc9.vcproj @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN_vc9.vcproj b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN_vc9.vcproj new file mode 100644 index 00000000..2ce0b7c4 --- /dev/null +++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN_vc9.vcproj @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE_vc9.vcproj b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE_vc9.vcproj new file mode 100644 index 00000000..70d0915f --- /dev/null +++ b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE_vc9.vcproj @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY_vc9.vcproj b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY_vc9.vcproj new file mode 100644 index 00000000..90881ae9 --- /dev/null +++ b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY_vc9.vcproj @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC_vc9.vcproj b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC_vc9.vcproj new file mode 100644 index 00000000..8bae9dac --- /dev/null +++ b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC_vc9.vcproj @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD_vc9.vcproj b/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD_vc9.vcproj new file mode 100644 index 00000000..784999c1 --- /dev/null +++ b/FTNoIR_Tracker_FD/FTNoIR_Tracker_FD_vc9.vcproj @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui new file mode 100644 index 00000000..ca2d9898 --- /dev/null +++ b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui @@ -0,0 +1,823 @@ + + + UICPTClientControls + + + Qt::ApplicationModal + + + + 0 + 0 + 395 + 450 + + + + + 0 + 0 + + + + PointTracker Settings + + + + :/Resources/icon.ico:/Resources/icon.ico + + + Qt::LeftToRight + + + false + + + + QLayout::SetFixedSize + + + + + + 0 + 0 + + + + + 0 + 0 + + + + 0 + + + + General + + + + + + TrackerThread + + + + + + + + Show VideoWidget + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Sleep time + + + sleep_spin + + + + + + + 999 + + + + + + + ms + + + + + + + + + + + + Camera + + + + + + + + Index + + + camindex_spin + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + (Focal length)/(Sensor width) + + + f_dspin + + + + + + + 0.100000000000000 + + + + + + + + + + + + Point Extraction + + + + + + + + Threshold + + + threshold_slider + + + + + + + 255 + + + 127 + + + Qt::Horizontal + + + + + + + + + + + Min Diameter + + + mindiam_spin + + + + + + + + + + px + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Max Diameter + + + maxdiam_spin + + + + + + + + + + px + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Status + + + + + + + + Extracted Points: + + + + + + + + 50 + 0 + + + + + + + + + + + Camera Info: + + + + + + + + 0 + 0 + + + + + 120 + 0 + + + + + + + + + + + + + + + + + + Model + + + + + + Model Dimensions + + + + + + <html><head/><body><p>Location of the two remaining model points<br/>with respect to the reference point in default pose</p></body></html> + + + + + + + + + + + z: + + + + + + + -999 + + + 999 + + + + + + + y: + + + + + + + -999 + + + 999 + + + + + + + mm + + + + + + + M1: + + + + + + + -999 + + + 999 + + + + + + + mm + + + + + + + mm + + + + + + + x: + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + M2: + + + + + + + + + + -999 + + + 999 + + + + + + + mm + + + + + + + -999 + + + 999 + + + + + + + mm + + + + + + + x: + + + + + + + mm + + + + + + + z: + + + + + + + -999 + + + 999 + + + + + + + y: + + + + + + + + + + + + + + Model Translation + + + + + + <html><head/><body><p>Translation from head center to model reference point<br/> in default pose</p></body></html> + + + + + + + + + + + + + + -999 + + + 999 + + + + + + + x: + + + + + + + y: + + + + + + + mm + + + + + + + z: + + + + + + + mm + + + + + + + -999 + + + 999 + + + + + + + mm + + + + + + + -999 + + + 999 + + + + + + + T: + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Calibrate + + + true + + + + + + + + + + + + Camera frame = Model frame in default pose: + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <html><head/><body><p>z axis: Out of camera to you<br/>y axis: Upwards<br/>x axis: To the right</p></body></html> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + About + + + + + 30 + 30 + 131 + 81 + + + + <html><head/><body><p><span style=" font-weight:600;">PointTracker Plugin </span></p><p><span style=" font-weight:600;">Version 0.1</span></p><p><span style=" font-weight:600;">by Patrick Ruoff</span></p></body></html> + + + + + + 170 + 30 + 141 + 141 + + + + + + + :/Resources/Logo_IR.png + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ok + + + + + + + Cancel + + + + + + + + + tabWidget + ok_button + cancel_button + videowidget_check + sleep_spin + camindex_spin + f_dspin + threshold_slider + mindiam_spin + maxdiam_spin + m1x_spin + m1y_spin + m1z_spin + m2x_spin + m2y_spin + m2z_spin + tx_spin + ty_spin + tz_spin + + + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT.rc b/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT.rc new file mode 100644 index 00000000..11c5d52f --- /dev/null +++ b/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT.rc @@ -0,0 +1,61 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT_vc9.vcproj b/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT_vc9.vcproj new file mode 100644 index 00000000..a7989a5e --- /dev/null +++ b/FTNoIR_Tracker_PT/FTNoIR_Tracker_PT_vc9.vcproj @@ -0,0 +1,552 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Tracker_PT/Resources/Logo_IR.png b/FTNoIR_Tracker_PT/Resources/Logo_IR.png new file mode 100644 index 00000000..95032a25 Binary files /dev/null and b/FTNoIR_Tracker_PT/Resources/Logo_IR.png differ diff --git a/FTNoIR_Tracker_PT/Resources/icon.ico b/FTNoIR_Tracker_PT/Resources/icon.ico new file mode 100644 index 00000000..c4b2aedc Binary files /dev/null and b/FTNoIR_Tracker_PT/Resources/icon.ico differ diff --git a/FTNoIR_Tracker_PT/camera.cpp b/FTNoIR_Tracker_PT/camera.cpp new file mode 100644 index 00000000..a0bae694 --- /dev/null +++ b/FTNoIR_Tracker_PT/camera.cpp @@ -0,0 +1,62 @@ +#include "camera.h" + +using namespace cv; + +// ---------------------------------------------------------------------------- +Camera::Camera() + : dt_valid(0), dt_mean(0), cap(NULL) +{} + +Camera::~Camera() +{ + if (cap) cvReleaseCapture(&cap); +} + +void Camera::set_index(int index) +{ + if (cap) cvReleaseCapture(&cap); + + cap = cvCreateCameraCapture(index); + + // extract camera info + if (cap) + { + cam_info.res_x = cvGetCaptureProperty(cap, CV_CAP_PROP_FRAME_WIDTH); + cam_info.res_y = cvGetCaptureProperty(cap, CV_CAP_PROP_FRAME_HEIGHT); + } + + // reset fps calculation + dt_mean = 0; +} + +cv::Mat Camera::get_frame(float dt) +{ + cv::Mat frame; + if (cap && cvGrabFrame(cap) != 0) + { + // retrieve frame + IplImage* _img = cvRetrieveFrame(cap, 0); + if(_img) + { + if(_img->origin == IPL_ORIGIN_TL) + frame = Mat(_img); + else + { + Mat temp(_img); + flip(temp, frame, 0); + } + } + } + + // measure fps of valid frames + const float dt_smoothing_const = 0.9; + dt_valid += dt; + if (!frame.empty()) + { + dt_mean = dt_smoothing_const * dt_mean + (1.0 - dt_smoothing_const) * dt_valid; + cam_info.fps = 1.0 / dt_mean; + dt_valid = 0; + } + + return frame; +} \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/camera.h b/FTNoIR_Tracker_PT/camera.h new file mode 100644 index 00000000..69719fcc --- /dev/null +++ b/FTNoIR_Tracker_PT/camera.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef CAMERA_H +#define CAMERA_H + +#include + +// ---------------------------------------------------------------------------- +struct CamInfo +{ + int res_x; + int res_y; + int fps; + float f; // (focal length) / (sensor width) +}; + +// ---------------------------------------------------------------------------- +class Camera +{ +public: + + Camera(); + ~Camera(); + + void set_index(int index); + void set_f(float f) { cam_info.f = f; } + + // gets a frame from the camera, dt: time since last call in seconds + cv::Mat get_frame(float dt); + + // WARNING: returned reference is valid as long as object + const CamInfo& get_info() const { return cam_info; } + +protected: + CvCapture* cap; + CamInfo cam_info; + float dt_valid; + float dt_mean; +}; + +#endif //CAMERA_H diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp new file mode 100644 index 00000000..2e8430bc --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp @@ -0,0 +1,184 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_tracker_pt.h" +#include +#include +#include + +using namespace std; +using namespace cv; +using namespace boost; + +//----------------------------------------------------------------------------- +Tracker::Tracker() + : frame_count(0), commands(0), video_widget(NULL) +{ + qDebug()<<"Tracker Const"; + TrackerSettings settings; + settings.load_ini(); + apply(settings); + qDebug()<<"Tracker Starting"; + start(); +} + +Tracker::~Tracker() +{ + set_command(ABORT); + wait(); + if (video_widget) delete video_widget; +} + +void Tracker::set_command(Command command) +{ + QMutexLocker lock(&mutex); + commands |= command; +} + +void Tracker::reset_command(Command command) +{ + QMutexLocker lock(&mutex); + commands &= ~command; +} + +void Tracker::run() +{ + qDebug()<<"Tracker Thread started"; + time.start(); + forever + { + { + QMutexLocker lock(&mutex); + + if (commands & ABORT) break; + if (commands & PAUSE) continue; + commands = 0; + + float dt = time.elapsed() / 1000.0; + time.restart(); + + frame = camera.get_frame(dt); + if (!frame.empty()) + { + const std::vector& points = point_extractor.extract_points(frame, dt, draw_frame); + point_tracker.track(points, camera.get_info().f, dt); + frame_count++; + } + } + msleep(sleep_time); + } + qDebug()<<"Tracker Thread stopping"; +} + +void Tracker::apply(const TrackerSettings& settings) +{ + apply_without_camindex(settings); + QMutexLocker lock(&mutex); + qDebug()<<"Tracker: setting cam index "<(new PointModel(settings.M01, settings.M02)); + sleep_time = settings.sleep_time; + draw_frame = settings.video_widget; + t_MH = settings.t_MH; +} + +//----------------------------------------------------------------------------- +// ITracker interface +void Tracker::Initialize(QFrame *videoframe) +{ + const int VIDEO_FRAME_WIDTH = 252; + const int VIDEO_FRAME_HEIGHT = 189; + + qDebug("Tracker::Initialize()"); + // setup video frame + videoframe->setAttribute(Qt::WA_NativeWindow); + videoframe->show(); + video_widget = new VideoWidget(videoframe); + QHBoxLayout* layout = new QHBoxLayout(); + layout->setContentsMargins(0, 0, 0, 0); + layout->addWidget(video_widget); + if (videoframe->layout()) delete videoframe->layout(); + videoframe->setLayout(layout); + video_widget->resize(VIDEO_FRAME_WIDTH, VIDEO_FRAME_HEIGHT); +} + +void Tracker::refreshVideo() +{ + if (video_widget) + { + Mat frame_copy; + shared_ptr< vector > points; + //qDebug("Tracker::refreshVideo()"); + { + QMutexLocker lock(&mutex); + if (!draw_frame || frame.empty()) return; + + // copy the frame and points from the tracker thread + frame_copy = frame.clone(); + points = shared_ptr< vector >(new vector(point_extractor.get_points())); + } + + video_widget->update(frame_copy, points); + } +} + +void Tracker::StartTracker(HWND parent_window) +{ + reset_command(PAUSE); +} + +void Tracker::StopTracker(bool exit) +{ + set_command(PAUSE); +} + +bool Tracker::GiveHeadPoseData(THeadPoseData *data) +{ + const float rad2deg = 180.0/3.14159265; + { + QMutexLocker lock(&mutex); + FrameTrafo pose = point_tracker.get_pose(); + + // get translation + Vec3f p = pose.R * t_MH + pose.t; + data->x = p[0] / 10.0; // convert to cm + data->y = p[1] / 10.0; + data->z = p[2] / 10.0; + + // extract rotation angles from rotation matrix + const Matx33f& R = pose.R; + data->yaw = atan2( -R(2,0), sqrt(R(0,0)*R(0,0) + R(1,0)*R(1,0)) ); + float cos_beta = cos(data->yaw); + if (cos_beta != 0) + { + data->pitch = rad2deg * atan2( R(2,1)/cos_beta, R(2,2)/cos_beta); + data->roll = rad2deg * atan2( R(1,0)/cos_beta, R(0,0)/cos_beta); + } + data->yaw *= rad2deg; + } + refreshVideo(); + return true; +} + +//----------------------------------------------------------------------------- +#pragma comment(linker, "/export:GetTracker=_GetTracker@0") + +FTNOIR_TRACKER_BASE_EXPORT TRACKERHANDLE __stdcall GetTracker() +{ + return new Tracker; +} \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h new file mode 100644 index 00000000..a3390cbf --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef FTNOIR_TRACKER_PT_H +#define FTNOIR_TRACKER_PT_H + +#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" +#include "ftnoir_tracker_pt_settings.h" +#include "camera.h" +#include "point_extractor.h" +#include "point_tracker.h" +#include "video_widget.h" + +#include +#include +#include +#include + +//----------------------------------------------------------------------------- +class Tracker : public ITracker, QThread +{ +public: + Tracker(); + ~Tracker(); + + // ITracker interface + void Initialize(QFrame *videoframe); + void StartTracker(HWND parent_window); + void StopTracker(bool exit); + bool GiveHeadPoseData(THeadPoseData *data); + void refreshVideo(); + + void apply(const TrackerSettings& settings); + void apply_without_camindex(const TrackerSettings& settings); // changing the camindex is expensive and not suitable for realtime editing + void run(); + + void get_pose(FrameTrafo* X_CM) { QMutexLocker lock(&mutex); *X_CM = point_tracker.get_pose(); } + int get_n_points() { QMutexLocker lock(&mutex); return point_extractor.get_points().size(); } + void get_cam_info(CamInfo* info) { QMutexLocker lock(&mutex); *info = camera.get_info(); } + +protected: + QMutex mutex; + cv::Mat frame; // the output frame for display + + enum Command { + ABORT = 1<<0, + PAUSE = 1<<1 + }; + void set_command(Command command); + void reset_command(Command command); + int commands; + + Camera camera; + PointExtractor point_extractor; + PointTracker point_tracker; + cv::Vec3f t_MH; + bool draw_frame; + int sleep_time; + + long frame_count; + + VideoWidget* video_widget; + QTime time; +}; + +//----------------------------------------------------------------------------- +class TrackerDll : public ITrackerDll +{ + // ITrackerDll interface + void Initialize() {} + void getFullName(QString *strToBeFilled); + void getShortName(QString *strToBeFilled); + void getDescription(QString *strToBeFilled); + void getIcon(QIcon *icon); +}; + +#endif // FTNOIR_TRACKER_PT_H diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.qrc b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.qrc new file mode 100644 index 00000000..d1dab18a --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.qrc @@ -0,0 +1,6 @@ + + + Resources/icon.ico + Resources/Logo_IR.png + + diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp new file mode 100644 index 00000000..4b79b892 --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp @@ -0,0 +1,208 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_tracker_pt_dialog.h" + +#include +#include + +//----------------------------------------------------------------------------- +TrackerDialog::TrackerDialog() + : settings_dirty(false), tracker(NULL), timer(this), trans_calib_running(false) +{ + ui.setupUi( this ); + + settings.load_ini(); + + // initialize ui values + ui.videowidget_check->setChecked(settings.video_widget); + ui.sleep_spin->setValue(settings.sleep_time); + ui.camindex_spin->setValue(settings.cam_index); + ui.f_dspin->setValue(settings.cam_f); + ui.threshold_slider->setValue(settings.threshold); + ui.mindiam_spin->setValue(settings.min_point_size); + ui.maxdiam_spin->setValue(settings.max_point_size); + + ui.m1x_spin->setValue(settings.M01[0]); + ui.m1y_spin->setValue(settings.M01[1]); + ui.m1z_spin->setValue(settings.M01[2]); + ui.m2x_spin->setValue(settings.M02[0]); + ui.m2y_spin->setValue(settings.M02[1]); + ui.m2z_spin->setValue(settings.M02[2]); + ui.tx_spin->setValue(settings.t_MH[0]); + ui.ty_spin->setValue(settings.t_MH[1]); + ui.tz_spin->setValue(settings.t_MH[2]); + + ui.tcalib_button->setEnabled(false); + + // connect Qt signals and slots + connect( ui.videowidget_check,SIGNAL(toggled(bool)), this,SLOT(set_video_widget(bool)) ); + connect( ui.sleep_spin,SIGNAL(valueChanged(int)), this,SLOT(set_sleep_time(int)) ); + connect( ui.camindex_spin,SIGNAL(valueChanged(int)), this,SLOT(set_cam_index(int)) ); + connect( ui.f_dspin,SIGNAL(valueChanged(double)), this,SLOT(set_cam_f(double)) ); + connect( ui.threshold_slider,SIGNAL(sliderMoved(int)), this,SLOT(set_threshold(int)) ); + connect( ui.mindiam_spin,SIGNAL(valueChanged(int)), this,SLOT(set_min_point_size(int)) ); + connect( ui.maxdiam_spin,SIGNAL(valueChanged(int)), this,SLOT(set_max_point_size(int)) ); + + connect( ui.m1x_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m1x(int)) ); + connect( ui.m1y_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m1y(int)) ); + connect( ui.m1z_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m1z(int)) ); + connect( ui.m2x_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m2x(int)) ); + connect( ui.m2y_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m2y(int)) ); + connect( ui.m2z_spin,SIGNAL(valueChanged(int)), this,SLOT(set_m2z(int)) ); + connect( ui.tx_spin,SIGNAL(valueChanged(int)), this,SLOT(set_tx(int)) ); + connect( ui.ty_spin,SIGNAL(valueChanged(int)), this,SLOT(set_ty(int)) ); + connect( ui.tz_spin,SIGNAL(valueChanged(int)), this,SLOT(set_tz(int)) ); + + connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) ); + + connect(ui.ok_button, SIGNAL(clicked()), this, SLOT(doOK())); + connect(ui.cancel_button, SIGNAL(clicked()), this, SLOT(doCancel())); + + connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info())); + timer.start(100); +} + +void TrackerDialog::startstop_trans_calib(bool start) +{ + if (start) + { + qDebug()<<"TrackerDialog:: starting translation calibration"; + trans_calib.reset(); + trans_calib_running = true; + } + else + { + qDebug()<<"TrackerDialog:: stoppping translation calibration"; + trans_calib_running = false; + settings.t_MH = trans_calib.get_estimate(); + settings_changed(); + } +} + +void TrackerDialog::trans_calib_step() +{ + if (tracker) + { + FrameTrafo X_CM; + tracker->get_pose(&X_CM); + trans_calib.update(X_CM.R, X_CM.t); + cv::Vec3f t_MH = trans_calib.get_estimate(); + qDebug()<<"TrackerDialog:: current translation estimate: "<setValue(t_MH[0]); + ui.ty_spin->setValue(t_MH[1]); + ui.tz_spin->setValue(t_MH[2]); + } +} + +void TrackerDialog::set_cam_index(int val) +{ + settings.cam_index = val; + settings_dirty = true; + if (tracker) + tracker->apply(settings); +} + +void TrackerDialog::settings_changed() +{ + settings_dirty = true; + if (tracker) + tracker->apply_without_camindex(settings); +} + +void TrackerDialog::doOK() +{ + settings.save_ini(); + close(); +} + +void TrackerDialog::doCancel() +{ + if (settings_dirty) { + int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", + QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard ); + switch (ret) { + case QMessageBox::Save: + settings.save_ini(); + close(); + break; + case QMessageBox::Discard: + close(); + break; + case QMessageBox::Cancel: + // Cancel was clicked + break; + default: + // should never be reached + break; + } + } + else { + close(); + } +} + +void TrackerDialog::poll_tracker_info() +{ + if (tracker) + { + CamInfo info; + tracker->get_cam_info(&info); + ui.caminfo_label->setText(QString::number(info.res_x)+"x"+QString::number(info.res_y)+" @ "+QString::number(info.fps)+" FPS"); + + int n_points = tracker->get_n_points(); + QString to_print = QString::number(n_points); + if (n_points == 3) + to_print += " OK!"; + else + to_print += " BAD!"; + ui.pointinfo_label->setText(to_print); + + if (trans_calib_running) trans_calib_step(); + } + else + { + ui.caminfo_label->setText("Tracker offline"); + ui.pointinfo_label->setText("Tracker offline"); + } +} + + +//----------------------------------------------------------------------------- +// ITrackerDialog interface +void TrackerDialog::Initialize(QWidget *parent) +{ + QPoint offsetpos(200, 200); + if (parent) { + this->move(parent->pos() + offsetpos); + } + show(); +} + +void TrackerDialog::registerTracker(ITracker *t) +{ + qDebug()<<"tracker registerd"; + tracker = static_cast(t); + if (isVisible() && settings_dirty) + tracker->apply(settings); + ui.tcalib_button->setEnabled(true); +} + +void TrackerDialog::unRegisterTracker() +{ + qDebug()<<"tracker un-registerd"; + tracker = NULL; + ui.tcalib_button->setEnabled(true); +} + +//----------------------------------------------------------------------------- +#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") + +FTNOIR_TRACKER_BASE_EXPORT TRACKERDIALOGHANDLE __stdcall GetTrackerDialog( ) +{ + return new TrackerDialog; +} \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h new file mode 100644 index 00000000..95736a8d --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.h @@ -0,0 +1,72 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef FTNOIR_TRACKER_PT_DIALOG_H +#define FTNOIR_TRACKER_PT_DIALOG_H + +#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" +#include "ftnoir_tracker_pt_settings.h" +#include "ftnoir_tracker_pt.h" +#include "ui_FTNoIR_PT_Controls.h" +#include "trans_calib.h" + +#include + +//----------------------------------------------------------------------------- +class TrackerDialog : public QWidget, Ui::UICPTClientControls, public ITrackerDialog +{ + Q_OBJECT +public: + TrackerDialog(); + + // ITrackerDialog interface + void Initialize(QWidget *parent); + void registerTracker(ITracker *tracker); + void unRegisterTracker(); + + void trans_calib_step(); + +protected slots: + void doOK(); + void doCancel(); + + // ugly qt stuff + void set_video_widget(bool val) { settings.video_widget = val; settings_changed(); } + void set_sleep_time(int val) { settings.sleep_time = val; settings_changed(); } + void set_cam_index(int val); + void set_cam_f(double val) { settings.cam_f = val; settings_changed(); } + void set_min_point_size(int val) { settings.min_point_size = val; settings_changed(); } + void set_max_point_size(int val) { settings.max_point_size = val; settings_changed(); } + void set_threshold(int val) { settings.threshold = val; settings_changed(); } + void set_m1x(int val) { settings.M01[0] = val; settings_changed(); } + void set_m1y(int val) { settings.M01[1] = val; settings_changed(); } + void set_m1z(int val) { settings.M01[2] = val; settings_changed(); } + void set_m2x(int val) { settings.M02[0] = val; settings_changed(); } + void set_m2y(int val) { settings.M02[1] = val; settings_changed(); } + void set_m2z(int val) { settings.M02[2] = val; settings_changed(); } + void set_tx(int val) { settings.t_MH[0] = val; settings_changed(); } + void set_ty(int val) { settings.t_MH[1] = val; settings_changed(); } + void set_tz(int val) { settings.t_MH[2] = val; settings_changed(); } + + void startstop_trans_calib(bool start); + + void poll_tracker_info(); + +protected: + void settings_changed(); + + TrackerSettings settings; + bool settings_dirty; + + Tracker* tracker; + TranslationCalibrator trans_calib; + bool trans_calib_running; + QTimer timer; + Ui::UICPTClientControls ui; +}; + +#endif //FTNOIR_TRACKER_PT_DIALOG_H \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp new file mode 100644 index 00000000..a9df65ac --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp @@ -0,0 +1,40 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_tracker_pt.h" + +#include + +//----------------------------------------------------------------------------- +void TrackerDll::getFullName(QString *strToBeFilled) +{ + *strToBeFilled = "PointTracker 0.1"; +} + +void TrackerDll::getShortName(QString *strToBeFilled) +{ + *strToBeFilled = "PointTracker"; +} + +void TrackerDll::getDescription(QString *strToBeFilled) +{ + *strToBeFilled = "Tracks a 3-point model with know geometry like Freetrack / TrackIR"; +} + +void TrackerDll::getIcon(QIcon *icon) +{ + *icon = QIcon(":/Resources/icon.ico"); +} + + +//----------------------------------------------------------------------------- +#pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0") + +FTNOIR_TRACKER_BASE_EXPORT TRACKERDLLHANDLE __stdcall GetTrackerDll() +{ + return new TrackerDll; +} diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h new file mode 100644 index 00000000..34f6801e --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.h @@ -0,0 +1,8 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.cpp new file mode 100644 index 00000000..e540d78f --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.cpp @@ -0,0 +1,71 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_tracker_pt.h" +#include +#include + +//----------------------------------------------------------------------------- +void TrackerSettings::load_ini() +{ + qDebug("TrackerSettings::load_ini()"); + 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) + + iniFile.beginGroup( "PointTracker" ); + + cam_index = iniFile.value("CameraId", 0).toInt(); + cam_f = iniFile.value("CameraF", 1).toFloat(); + threshold = iniFile.value("PointExtractThreshold", 128).toInt(); + min_point_size = iniFile.value("PointExtractMinSize", 2).toInt(); + max_point_size = iniFile.value("PointExtractMaxSize", 50).toInt(); + M01[0] = iniFile.value("PointModelM01x", 0).toFloat(); + M01[1] = iniFile.value("PointModelM01y", 40).toFloat(); + M01[2] = iniFile.value("PointModelM01z", -30).toFloat(); + M02[0] = iniFile.value("PointModelM02x", 0).toFloat(); + M02[1] = iniFile.value("PointModelM02y", -70).toFloat(); + M02[2] = iniFile.value("PointModelM02z", -80).toFloat(); + t_MH[0] = iniFile.value("tMHx", 0).toFloat(); + t_MH[1] = iniFile.value("tMHy", 0).toFloat(); + t_MH[2] = iniFile.value("tMHz", 0).toFloat(); + video_widget = iniFile.value("VideoWidget", true).toBool(); + sleep_time = iniFile.value("SleepTime", 10).toInt(); + + iniFile.endGroup(); +} + +void TrackerSettings::save_ini() const +{ + qDebug("TrackerSettings::save_ini()"); + 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) + + iniFile.beginGroup ( "PointTracker" ); + + iniFile.setValue("CameraId", cam_index); + iniFile.setValue("CameraF", cam_f); + iniFile.setValue("PointExtractThreshold", threshold); + iniFile.setValue("PointExtractMinSize", min_point_size); + iniFile.setValue("PointExtractMaxSize", max_point_size); + iniFile.setValue("PointModelM01x", M01[0]); + iniFile.setValue("PointModelM01y", M01[1]); + iniFile.setValue("PointModelM01z", M01[2]); + iniFile.setValue("PointModelM02x", M02[0]); + iniFile.setValue("PointModelM02y", M02[1]); + iniFile.setValue("PointModelM02z", M02[2]); + iniFile.setValue("tMHx", t_MH[0]); + iniFile.setValue("tMHy", t_MH[1]); + iniFile.setValue("tMHz", t_MH[2]); + iniFile.setValue("VideoWidget", video_widget); + iniFile.setValue("SleepTime", sleep_time); + + iniFile.endGroup(); +} \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.h new file mode 100644 index 00000000..de0366e9 --- /dev/null +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_settings.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef FTNOIR_TRACKER_PT_SETTINGS_H +#define FTNOIR_TRACKER_PT_SETTINGS_H + +#include +#include "point_tracker.h" + +//----------------------------------------------------------------------------- +struct TrackerSettings +{ + // camera + int cam_index; + float cam_f; + + // point extraction + int threshold; + int min_point_size; + int max_point_size; + + // point tracking + cv::Vec3f M01; + cv::Vec3f M02; + + // head to model translation + cv::Vec3f t_MH; + + int sleep_time; + bool video_widget; + + void load_ini(); + void save_ini() const; +}; + +#endif //FTNOIR_TRACKER_PT_SETTINGS_H \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/point_extractor.cpp b/FTNoIR_Tracker_PT/point_extractor.cpp new file mode 100644 index 00000000..956a2834 --- /dev/null +++ b/FTNoIR_Tracker_PT/point_extractor.cpp @@ -0,0 +1,57 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "point_extractor.h" + +#include + +using namespace cv; +using namespace std; + +// ---------------------------------------------------------------------------- +const vector& PointExtractor::extract_points(Mat frame, float dt, bool draw_output) +{ + // convert to grayscale + Mat frame_bw; + cvtColor(frame, frame_bw, CV_RGB2GRAY); + + // convert to binary + threshold(frame_bw, frame_bw, threshold_val, 255, THRESH_BINARY); + erode(frame_bw, frame_bw, Mat(), Point(-1,-1), min_size); + + // find contours + vector< vector > contours; + findContours(frame_bw.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); + + // extract points + // TODO: use proximity to old points for classification + float r; + Vec2f c; + Point2f dummy; + points.clear(); + for (vector< vector >::iterator iter = contours.begin(); + iter!= contours.end(); + ++iter) + { + minEnclosingCircle(*iter, dummy, r); + if (r > max_size - min_size) break; + Moments m = moments(*iter); + if (m.m00 == 0) break; + // convert to centered camera coordinate system with y axis upwards + c[0] = (m.m10/m.m00 - frame.cols/2)/frame.cols; + c[1] = -(m.m01/m.m00 - frame.rows/2)/frame.cols; + points.push_back(c); + } + + // draw output image + if (draw_output) + { + frame.setTo(Scalar(255,0,0), frame_bw); + } + + return points; +} diff --git a/FTNoIR_Tracker_PT/point_extractor.h b/FTNoIR_Tracker_PT/point_extractor.h new file mode 100644 index 00000000..b142d2bb --- /dev/null +++ b/FTNoIR_Tracker_PT/point_extractor.h @@ -0,0 +1,31 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef POINTEXTRACTOR_H +#define POINTEXTRACTOR_H + +#include + +// ---------------------------------------------------------------------------- +// Extracts points from an opencv image +class PointExtractor +{ +public: + // extracts points from frame and draws some processing info into frame, if draw_output is set + // dt: time since last call in seconds + // WARNING: returned reference is valid as long as object + const std::vector& extract_points(cv::Mat frame, float dt, bool draw_output); + const std::vector& get_points() { return points; } + + int threshold_val; + int min_size, max_size; + +protected: + std::vector points; +}; + +#endif //POINTEXTRACTOR_H diff --git a/FTNoIR_Tracker_PT/point_tracker.cpp b/FTNoIR_Tracker_PT/point_tracker.cpp new file mode 100644 index 00000000..8a32326d --- /dev/null +++ b/FTNoIR_Tracker_PT/point_tracker.cpp @@ -0,0 +1,231 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "point_tracker.h" + +#include +#include +#include + +#include + +using namespace cv; +using namespace boost; +using namespace std; + +const float PI = 3.14159265358979323846f; + +// ---------------------------------------------------------------------------- +static void get_row(const Matx33f& m, int i, Vec3f& v) +{ + v[0] = m(i,0); + v[1] = m(i,1); + v[2] = m(i,2); +} + +static void set_row(Matx33f& m, int i, const Vec3f& v) +{ + m(i,0) = v[0]; + m(i,1) = v[1]; + m(i,2) = v[2]; +} + +// ---------------------------------------------------------------------------- +PointModel::PointModel(Vec3f M01, Vec3f M02) + : M01(M01), M02(M02) +{ + // calculate u + u = M01.cross(M02); + u /= norm(u); + + // calculate projection matrix on M01,M02 plane + float s11 = M01.dot(M01); + float s12 = M01.dot(M02); + float s22 = M02.dot(M02); + P = 1.0/(s11*s22-s12*s12) * Matx22f(s22, -s12, + -s12, s11); + + // calculate d and d_order for simple freetrack-like point correspondence + vector points; + points.push_back(Vec2f(0,0)); + points.push_back(Vec2f(M01[0], M01[1])); + points.push_back(Vec2f(M02[0], M02[1])); + // fit line to orthographically projected points + // ERROR: yields wrong results with colinear points?! + /* + Vec4f line; + fitLine(points, line, CV_DIST_L2, 0, 0.01, 0.01); + d[0] = line[0]; d[1] = line[1]; + */ + // TODO: fix this + d = Vec2f(M01[0]-M02[0], M01[1]-M02[1]); + + // sort model points + get_d_order(points, d_order); +} + +void PointModel::get_d_order(const std::vector& points, int d_order[]) const +{ + // get sort indices with respect to d scalar product + vector< pair > d_vals; + for (int i = 0; i(d.dot(points[i]), i)); + + struct + { + bool operator()(const pair& a, const pair& b) { return a.first < b.first; } + } comp; + sort(d_vals.begin(), d_vals.end(), comp); + + for (int i = 0; i& points, float f, float dt) +{ + if (!point_model) return false; + if (!find_correspondences(points)) return false; + POSIT(f); + return true; +} + +bool PointTracker::find_correspondences(const vector& points) +{ + if (points.size() != PointModel::N_POINTS) return false; + + // sort points + int point_d_order[PointModel::N_POINTS]; + point_model->get_d_order(points, point_d_order); + + // set correspondences + for (int i=0; id_order[i]] = points[point_d_order[i]]; + } + return true; +} + +void PointTracker::POSIT(float f) +{ + float old_epsilon_1 = 0; + float old_epsilon_2 = 0; + float epsilon_1 = 1; + float epsilon_2 = 1; + + Vec3f I0, J0; + Vec2f I0_coeff, J0_coeff; + + Vec3f I_1, J_1, I_2, J_2; + Matx33f R_1, R_2; + Matx33f* R_current; + + //TODO: do extrapolation or reinit here! + Vec3f k; + get_row(X_CM.R, 2, k); + float Z0 = X_CM.t[2]; + Matx33f R_expected = Matx33f::eye(); + //Matx33f R_expected = X_CM.R; + + const int MAX_ITER = 100; + const float EPS_THRESHOLD = 1e-3; + + int i=1; + for (; iM01)/Z0; + epsilon_2 = k.dot(point_model->M02)/Z0; + + // vector of scalar products and + Vec2f I0_M0i(p[1][0]*(1.0 + epsilon_1) - p[0][0], + p[2][0]*(1.0 + epsilon_2) - p[0][0]); + Vec2f J0_M0i(p[1][1]*(1.0 + epsilon_1) - p[0][1], + p[2][1]*(1.0 + epsilon_2) - p[0][1]); + + // construct projection of I, J onto M0i plane: I0 and J0 + I0_coeff = point_model->P * I0_M0i; + J0_coeff = point_model->P * J0_M0i; + I0 = I0_coeff[0]*point_model->M01 + I0_coeff[1]*point_model->M02; + J0 = J0_coeff[0]*point_model->M01 + J0_coeff[1]*point_model->M02; + + // calculate u component of I, J + float II0 = I0.dot(I0); + float IJ0 = I0.dot(J0); + float JJ0 = J0.dot(J0); + float rho, theta; + if (JJ0 == II0) { + rho = sqrt(abs(2*IJ0)); + theta = -PI/4; + if (IJ0<0) theta *= -1; + } + else { + rho = sqrt(sqrt( (JJ0-II0)*(JJ0-II0) + 4*IJ0*IJ0 )); + theta = atan( -2*IJ0 / (JJ0-II0) ); + if (JJ0 - II0 < 0) theta += PI; + theta /= 2; + } + + // construct the two solutions + I_1 = I0 + rho*cos(theta)*point_model->u; + I_2 = I0 - rho*cos(theta)*point_model->u; + + J_1 = J0 + rho*sin(theta)*point_model->u; + J_2 = J0 - rho*sin(theta)*point_model->u; + + float norm_const = 1.0/norm(I_1); // all have the same norm + + // create rotation matrices + I_1 *= norm_const; J_1 *= norm_const; + I_2 *= norm_const; J_2 *= norm_const; + + set_row(R_1, 0, I_1); + set_row(R_1, 1, J_1); + set_row(R_1, 2, I_1.cross(J_1)); + + set_row(R_2, 0, I_2); + set_row(R_2, 1, J_2); + set_row(R_2, 2, I_2.cross(J_2)); + + // the single translation solution + Z0 = norm_const * f; + + // pick the rotation solution closer to the expected one + // in simple metric d(A,B) = || I - A * B^T || + float R_1_deviation = norm(Matx33f::eye() - R_expected * R_1.t()); + float R_2_deviation = norm(Matx33f::eye() - R_expected * R_2.t()); + + if (R_1_deviation < R_2_deviation) + R_current = &R_1; + else + R_current = &R_2; + + get_row(*R_current, 2, k); + + // check for convergence condition + if (abs(epsilon_1 - old_epsilon_1) + abs(epsilon_2 - old_epsilon_2) < EPS_THRESHOLD) + break; + old_epsilon_1 = epsilon_1; + old_epsilon_2 = epsilon_2; + } + + X_CM.R = *R_current; + X_CM.t[0] = p[0][0] * Z0/f; + X_CM.t[1] = p[0][1] * Z0/f; + X_CM.t[2] = Z0; + + //qDebug()<<"iter: "< +#include +#include + +// ---------------------------------------------------------------------------- +// Afine frame trafo +class FrameTrafo +{ +public: + FrameTrafo() : R(cv::Matx33f::eye()), t(0,0,0) {} + FrameTrafo(const cv::Matx33f& R, const cv::Vec3f& t) : R(R),t(t) {} + + cv::Matx33f R; + cv::Vec3f t; +}; + +inline FrameTrafo operator*(const FrameTrafo& X, const FrameTrafo& Y) +{ + return FrameTrafo(X.R*Y.R, X.R*Y.t + X.t); +} + +inline cv::Vec3f operator*(const FrameTrafo& X, const cv::Vec3f& v) +{ + return X.R*v + X.t; +} + +// ---------------------------------------------------------------------------- +// Describes a 3-point model +// nomenclature as in +// [Denis Oberkampf, Daniel F. DeMenthon, Larry S. Davis: "Iterative Pose Estimation Using Coplanar Feature Points"] +class PointModel +{ + friend class PointTracker; +public: + static const int N_POINTS = 3; + + PointModel(cv::Vec3f M01, cv::Vec3f M02); + + const cv::Vec3f& get_M01() const { return M01; }; + const cv::Vec3f& get_M02() const { return M02; }; + +protected: + cv::Vec3f M01; // M01 in model frame + cv::Vec3f M02; // M02 in model frame + + cv::Vec3f u; // unit vector perpendicular to M01,M02-plane + + cv::Matx22f P; + + cv::Vec2f d; // discrimant vector for point correspondence + int d_order[3]; // sorting of projected model points with respect to d scalar product + + void get_d_order(const std::vector& points, int d_order[]) const; +}; + +// ---------------------------------------------------------------------------- +// Tracks a 3-point model +// implementing the POSIT algorithm for coplanar points as presented in +// [Denis Oberkampf, Daniel F. DeMenthon, Larry S. Davis: "Iterative Pose Estimation Using Coplanar Feature Points"] +class PointTracker +{ +public: + PointTracker(); + + // track the pose using the set of normalized point coordinates (x pos in range -0.5:0.5) + // f : (focal length)/(sensor width) + bool track(const std::vector& points, float f, float dt); + boost::shared_ptr point_model; + + FrameTrafo get_pose() const { return X_CM; } + +protected: + bool find_correspondences(const std::vector& points); + cv::Vec2f p[PointModel::N_POINTS]; // the points in model order + + void POSIT(float f); + + FrameTrafo X_CM; // trafo from model to camera +}; + +#endif //POINTTRACKER_H diff --git a/FTNoIR_Tracker_PT/resource.h b/FTNoIR_Tracker_PT/resource.h new file mode 100644 index 00000000..c14e94ad --- /dev/null +++ b/FTNoIR_Tracker_PT/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by FTNoIR_Tracker_PT.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/FTNoIR_Tracker_PT/trans_calib.cpp b/FTNoIR_Tracker_PT/trans_calib.cpp new file mode 100644 index 00000000..260d24b1 --- /dev/null +++ b/FTNoIR_Tracker_PT/trans_calib.cpp @@ -0,0 +1,44 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "trans_calib.h" + +using namespace cv; + +//----------------------------------------------------------------------------- +TranslationCalibrator::TranslationCalibrator() +{ + reset(); +} + +void TranslationCalibrator::reset() +{ + P = Matx66f::zeros(); + y = Vec6f(0,0,0, 0,0,0); +} + +void TranslationCalibrator::update(const Matx33f& R_CM_k, const Vec3f& t_CM_k) +{ + Matx H_k_T = Matx::zeros(); + for (int i=0; i<3; ++i) { + for (int j=0; j<3; ++j) { + H_k_T(i,j) = R_CM_k(j,i); + } + } + for (int i=0; i<3; ++i) + { + H_k_T(3+i,i) = 1.0; + } + P += H_k_T * H_k_T.t(); + y += H_k_T * t_CM_k; +} + +Vec3f TranslationCalibrator::get_estimate() +{ + Vec6f x = P.inv() * y; + return Vec3f(x[0], x[1], x[2]); +} \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/trans_calib.h b/FTNoIR_Tracker_PT/trans_calib.h new file mode 100644 index 00000000..57b9496c --- /dev/null +++ b/FTNoIR_Tracker_PT/trans_calib.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef TRANSCALIB_H +#define TRANSCALIB_H + +#include + +//----------------------------------------------------------------------------- +// calibrates the translation from head to model = t_MH +// by recursive least squares / +// kalman filter in information form with identity noise covariance +// measurement equation when head position = t_CH is fixed: +// (R_CM_k , Id)*(t_MH, -t_CH) = t_CM_k + +class TranslationCalibrator +{ +public: + TranslationCalibrator(); + + // reset the calibration process + void reset(); + + // update the current estimate + void update(const cv::Matx33f& R_CM_k, const cv::Vec3f& t_CM_k); + + // get the current estimate for t_MH + cv::Vec3f get_estimate(); + +protected: + cv::Matx66f P; // normalized precision matrix = inverse covariance + cv::Vec6f y; // P*(t_MH, -c) +}; + +#endif //TRANSCALIB_H \ No newline at end of file diff --git a/FTNoIR_Tracker_PT/video_widget.cpp b/FTNoIR_Tracker_PT/video_widget.cpp new file mode 100644 index 00000000..598766b4 --- /dev/null +++ b/FTNoIR_Tracker_PT/video_widget.cpp @@ -0,0 +1,89 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "video_widget.h" + +#include + +using namespace cv; +using namespace std; +using namespace boost; + +// ---------------------------------------------------------------------------- +void VideoWidget::initializeGL() +{ + glClearColor(0.0, 0.0, 0.0, 0.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +void VideoWidget::resizeGL(int w, int h) +{ + // setup 1 to 1 projection + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, w, 0, h, -1, 1); + resize_frame(); +} + +void VideoWidget::paintGL() +{ + glClear(GL_COLOR_BUFFER_BIT); + if (!resized_qframe.isNull()) + { + glDrawPixels(resized_qframe.width(), resized_qframe.height(), GL_RGBA, GL_UNSIGNED_BYTE, resized_qframe.bits()); + + const int crosshair_radius = 10; + const int crosshair_thickness = 1; + + glColor3f(1.0, 0.0, 0.0); + glLineWidth(crosshair_thickness); + int x,y; + for (vector::iterator iter = points->begin(); + iter != points->end(); + ++iter) + { + x = (*iter)[0] * resized_qframe.width() + resized_qframe.width()/2.0 + 0.5; + y = (*iter)[1] * resized_qframe.width() + resized_qframe.height()/2.0 + 0.5; + + glBegin(GL_LINES); + glVertex2i(x-crosshair_radius, y); + glVertex2i(x+crosshair_radius, y); + glEnd(); + glBegin(GL_LINES); + glVertex2i(x, y-crosshair_radius); + glVertex2i(x, y+crosshair_radius); + glEnd(); + } + } + glFlush(); +} + + +void VideoWidget::resize_frame() +{ + if (!qframe.isNull()) + resized_qframe = qframe.scaled(this->size(), Qt::KeepAspectRatio); +} + + +void VideoWidget::update(Mat frame, shared_ptr< vector > points) +{ + this->frame = frame; + this->points = points; + + // convert to QImage + if (frame.channels() == 3) + qframe = QImage((const unsigned char*)(frame.data), frame.cols, frame.rows, frame.step, QImage::Format_RGB888).rgbSwapped(); + else if (frame.channels() == 1) + qframe = QImage((const unsigned char*)(frame.data), frame.cols, frame.rows, frame.step, QImage::Format_Indexed8); + qframe = QGLWidget::convertToGLFormat(qframe); + + resize_frame(); + updateGL(); +} diff --git a/FTNoIR_Tracker_PT/video_widget.h b/FTNoIR_Tracker_PT/video_widget.h new file mode 100644 index 00000000..f49fef18 --- /dev/null +++ b/FTNoIR_Tracker_PT/video_widget.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef VIDEOWIDGET_H +#define VIDEOWIDGET_H + +#include +#include +#include +#include + +// ---------------------------------------------------------------------------- +class VideoWidget : public QGLWidget +{ + Q_OBJECT + +public: + VideoWidget(QWidget *parent) : QGLWidget(parent) {} + + void initializeGL(); + void resizeGL(int w, int h); + void paintGL(); + + void update(cv::Mat frame, boost::shared_ptr< std::vector > points); + +private: + void resize_frame(); + + cv::Mat frame; + QImage qframe; + QImage resized_qframe; + + boost::shared_ptr< std::vector > points; +}; + +#endif // VIDEOWIDGET_H diff --git a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM_vc9.vcproj b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM_vc9.vcproj new file mode 100644 index 00000000..6904e8c0 --- /dev/null +++ b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM_vc9.vcproj @@ -0,0 +1,405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP_vc9.vcproj b/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP_vc9.vcproj new file mode 100644 index 00000000..88a6f16f --- /dev/null +++ b/FTNoIR_Tracker_UDP/FTNoIR_Tracker_UDP_vc9.vcproj @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FaceTrackNoIR.suo b/FaceTrackNoIR.suo deleted file mode 100644 index 0e5e4c30..00000000 Binary files a/FaceTrackNoIR.suo and /dev/null differ diff --git a/FaceTrackNoIR/FaceTrackNoIR_vc9.vcproj b/FaceTrackNoIR/FaceTrackNoIR_vc9.vcproj new file mode 100644 index 00000000..e7e9ce81 --- /dev/null +++ b/FaceTrackNoIR/FaceTrackNoIR_vc9.vcproj @@ -0,0 +1,989 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FaceTrackNoIR_vc9.sln b/FaceTrackNoIR_vc9.sln new file mode 100644 index 00000000..7a567f6d --- /dev/null +++ b/FaceTrackNoIR_vc9.sln @@ -0,0 +1,117 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "SetupFaceTrackNoIR", "SetupFaceTrackNoIR\SetupFaceTrackNoIR.vdproj", "{95D54F4D-F5E2-4DEC-B517-E32F34312C07}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Tracker_UDP", "FTNoIR_Tracker_UDP\FTNoIR_Tracker_UDP_vc9.vcproj", "{A42E7DE9-C1C5-48A2-8FEA-86D31CE3DA31}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Filter_EWMA2", "FTNoIR_Filter_EWMA2\FTNoIR_Filter_EWMA2_vc9.vcproj", "{7DD9F1AA-B7C0-4056-AC4A-1501840E6438}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Tracker_SM", "FTNoIR_Tracker_SM\FTNoIR_Tracker_SM_vc9.vcproj", "{26346BCF-92A5-47A7-B4CF-73C402F7C3AD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_FaceAPI_EXE", "faceAPI\FaceAPI2FSX_vc9.vcproj", "{EF743D32-0980-44D9-BA9E-B9D2456251AC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_FG", "FTNoIR_Protocol_FG\FTNoIR_Protocol_FG_vc9.vcproj", "{7C77C833-5687-4A35-B219-4CF4D3D8E626}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_FTIR", "FTNoIR_Protocol_FTIR\FTNoIR_Protocol_FTIR_vc9.vcproj", "{BC5B8583-036A-4A9B-84AE-01158EE6F5A4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_FT", "FTNoIR_Protocol_FT\FTNoIR_Protocol_FT_vc9.vcproj", "{FE2FF09B-207D-468C-9763-23861956F388}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_PPJOY", "FTNoIR_Protocol_PPJOY\FTNoIR_Protocol_PPJOY_vc9.vcproj", "{8751C6A1-A504-49C6-9D82-A66CDCBFA2AB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_SC", "FTNoIR_Protocol_SC\FTNoIR_Protocol_SC_vc9.vcproj", "{B8F3B67B-6C25-4E06-8076-0513D2368A1F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_FSUIPC", "FTNoIR_Protocol_FSUIPC\FTNoIR_Protocol_FSUIPC_vc9.vcproj", "{46E66901-0212-410A-99B6-793F7ACD2ED0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_FTN", "FTNoIR_Protocol_FTN\FTNoIR_Protocol_FTN_vc9.vcproj", "{166A9AF8-90E0-4889-ADAA-5E6E3DD20194}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Protocol_MOUSE", "FTNoIR_Protocol_MOUSE\FTNoIR_Protocol_MOUSE_vc9.vcproj", "{BD90CC3A-965C-4DAF-8D3D-8AABA455BA9E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FaceTrackNoIR", "FaceTrackNoIR\FaceTrackNoIR_vc9.vcproj", "{9DCDB5B9-941E-42F7-AF76-DF794AA3C013}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Tracker_FD", "FTNoIR_Tracker_FD\FTNoIR_Tracker_FD_vc9.vcproj", "{0FE16301-240D-42B9-9141-12294BA08AC4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Filter_Accela", "FTNoIR_Filter_Accela\FTNoIR_Filter_accela_vc9.vcproj", "{2212857A-7634-4E30-BA83-539EC70176E6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTNoIR_Tracker_PT", "FTNoIR_Tracker_PT\FTNoIR_Tracker_PT_vc9.vcproj", "{7A2A2560-9253-4CC8-A9D5-4B9D9C224D9D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {95D54F4D-F5E2-4DEC-B517-E32F34312C07}.Debug|Win32.ActiveCfg = Debug + {95D54F4D-F5E2-4DEC-B517-E32F34312C07}.Release|Win32.ActiveCfg = Release + {A42E7DE9-C1C5-48A2-8FEA-86D31CE3DA31}.Debug|Win32.ActiveCfg = Debug|Win32 + {A42E7DE9-C1C5-48A2-8FEA-86D31CE3DA31}.Debug|Win32.Build.0 = Debug|Win32 + {A42E7DE9-C1C5-48A2-8FEA-86D31CE3DA31}.Release|Win32.ActiveCfg = Release|Win32 + {A42E7DE9-C1C5-48A2-8FEA-86D31CE3DA31}.Release|Win32.Build.0 = Release|Win32 + {7DD9F1AA-B7C0-4056-AC4A-1501840E6438}.Debug|Win32.ActiveCfg = Debug|Win32 + {7DD9F1AA-B7C0-4056-AC4A-1501840E6438}.Debug|Win32.Build.0 = Debug|Win32 + {7DD9F1AA-B7C0-4056-AC4A-1501840E6438}.Release|Win32.ActiveCfg = Release|Win32 + {7DD9F1AA-B7C0-4056-AC4A-1501840E6438}.Release|Win32.Build.0 = Release|Win32 + {26346BCF-92A5-47A7-B4CF-73C402F7C3AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {26346BCF-92A5-47A7-B4CF-73C402F7C3AD}.Debug|Win32.Build.0 = Debug|Win32 + {26346BCF-92A5-47A7-B4CF-73C402F7C3AD}.Release|Win32.ActiveCfg = Release|Win32 + {26346BCF-92A5-47A7-B4CF-73C402F7C3AD}.Release|Win32.Build.0 = Release|Win32 + {EF743D32-0980-44D9-BA9E-B9D2456251AC}.Debug|Win32.ActiveCfg = Debug|Win32 + {EF743D32-0980-44D9-BA9E-B9D2456251AC}.Debug|Win32.Build.0 = Debug|Win32 + {EF743D32-0980-44D9-BA9E-B9D2456251AC}.Release|Win32.ActiveCfg = Release|Win32 + {EF743D32-0980-44D9-BA9E-B9D2456251AC}.Release|Win32.Build.0 = Release|Win32 + {7C77C833-5687-4A35-B219-4CF4D3D8E626}.Debug|Win32.ActiveCfg = Debug|Win32 + {7C77C833-5687-4A35-B219-4CF4D3D8E626}.Debug|Win32.Build.0 = Debug|Win32 + {7C77C833-5687-4A35-B219-4CF4D3D8E626}.Release|Win32.ActiveCfg = Release|Win32 + {7C77C833-5687-4A35-B219-4CF4D3D8E626}.Release|Win32.Build.0 = Release|Win32 + {BC5B8583-036A-4A9B-84AE-01158EE6F5A4}.Debug|Win32.ActiveCfg = Debug|Win32 + {BC5B8583-036A-4A9B-84AE-01158EE6F5A4}.Debug|Win32.Build.0 = Debug|Win32 + {BC5B8583-036A-4A9B-84AE-01158EE6F5A4}.Release|Win32.ActiveCfg = Release|Win32 + {BC5B8583-036A-4A9B-84AE-01158EE6F5A4}.Release|Win32.Build.0 = Release|Win32 + {FE2FF09B-207D-468C-9763-23861956F388}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE2FF09B-207D-468C-9763-23861956F388}.Debug|Win32.Build.0 = Debug|Win32 + {FE2FF09B-207D-468C-9763-23861956F388}.Release|Win32.ActiveCfg = Release|Win32 + {FE2FF09B-207D-468C-9763-23861956F388}.Release|Win32.Build.0 = Release|Win32 + {8751C6A1-A504-49C6-9D82-A66CDCBFA2AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {8751C6A1-A504-49C6-9D82-A66CDCBFA2AB}.Debug|Win32.Build.0 = Debug|Win32 + {8751C6A1-A504-49C6-9D82-A66CDCBFA2AB}.Release|Win32.ActiveCfg = Release|Win32 + {8751C6A1-A504-49C6-9D82-A66CDCBFA2AB}.Release|Win32.Build.0 = Release|Win32 + {B8F3B67B-6C25-4E06-8076-0513D2368A1F}.Debug|Win32.ActiveCfg = Debug|Win32 + {B8F3B67B-6C25-4E06-8076-0513D2368A1F}.Debug|Win32.Build.0 = Debug|Win32 + {B8F3B67B-6C25-4E06-8076-0513D2368A1F}.Release|Win32.ActiveCfg = Release|Win32 + {B8F3B67B-6C25-4E06-8076-0513D2368A1F}.Release|Win32.Build.0 = Release|Win32 + {46E66901-0212-410A-99B6-793F7ACD2ED0}.Debug|Win32.ActiveCfg = Debug|Win32 + {46E66901-0212-410A-99B6-793F7ACD2ED0}.Debug|Win32.Build.0 = Debug|Win32 + {46E66901-0212-410A-99B6-793F7ACD2ED0}.Release|Win32.ActiveCfg = Release|Win32 + {46E66901-0212-410A-99B6-793F7ACD2ED0}.Release|Win32.Build.0 = Release|Win32 + {166A9AF8-90E0-4889-ADAA-5E6E3DD20194}.Debug|Win32.ActiveCfg = Debug|Win32 + {166A9AF8-90E0-4889-ADAA-5E6E3DD20194}.Debug|Win32.Build.0 = Debug|Win32 + {166A9AF8-90E0-4889-ADAA-5E6E3DD20194}.Release|Win32.ActiveCfg = Release|Win32 + {166A9AF8-90E0-4889-ADAA-5E6E3DD20194}.Release|Win32.Build.0 = Release|Win32 + {BD90CC3A-965C-4DAF-8D3D-8AABA455BA9E}.Debug|Win32.ActiveCfg = Debug|Win32 + {BD90CC3A-965C-4DAF-8D3D-8AABA455BA9E}.Debug|Win32.Build.0 = Debug|Win32 + {BD90CC3A-965C-4DAF-8D3D-8AABA455BA9E}.Release|Win32.ActiveCfg = Release|Win32 + {BD90CC3A-965C-4DAF-8D3D-8AABA455BA9E}.Release|Win32.Build.0 = Release|Win32 + {9DCDB5B9-941E-42F7-AF76-DF794AA3C013}.Debug|Win32.ActiveCfg = Debug|Win32 + {9DCDB5B9-941E-42F7-AF76-DF794AA3C013}.Debug|Win32.Build.0 = Debug|Win32 + {9DCDB5B9-941E-42F7-AF76-DF794AA3C013}.Release|Win32.ActiveCfg = Release|Win32 + {9DCDB5B9-941E-42F7-AF76-DF794AA3C013}.Release|Win32.Build.0 = Release|Win32 + {0FE16301-240D-42B9-9141-12294BA08AC4}.Debug|Win32.ActiveCfg = Debug|Win32 + {0FE16301-240D-42B9-9141-12294BA08AC4}.Debug|Win32.Build.0 = Debug|Win32 + {0FE16301-240D-42B9-9141-12294BA08AC4}.Release|Win32.ActiveCfg = Release|Win32 + {0FE16301-240D-42B9-9141-12294BA08AC4}.Release|Win32.Build.0 = Release|Win32 + {2212857A-7634-4E30-BA83-539EC70176E6}.Debug|Win32.ActiveCfg = Debug|Win32 + {2212857A-7634-4E30-BA83-539EC70176E6}.Debug|Win32.Build.0 = Debug|Win32 + {2212857A-7634-4E30-BA83-539EC70176E6}.Release|Win32.ActiveCfg = Release|Win32 + {2212857A-7634-4E30-BA83-539EC70176E6}.Release|Win32.Build.0 = Release|Win32 + {7A2A2560-9253-4CC8-A9D5-4B9D9C224D9D}.Debug|Win32.ActiveCfg = Debug|Win32 + {7A2A2560-9253-4CC8-A9D5-4B9D9C224D9D}.Debug|Win32.Build.0 = Debug|Win32 + {7A2A2560-9253-4CC8-A9D5-4B9D9C224D9D}.Release|Win32.ActiveCfg = Release|Win32 + {7A2A2560-9253-4CC8-A9D5-4B9D9C224D9D}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + QtVersion = QT114 + EndGlobalSection +EndGlobal diff --git a/faceAPI/FaceAPI2FSX_vc9.vcproj b/faceAPI/FaceAPI2FSX_vc9.vcproj new file mode 100644 index 00000000..227d872d --- /dev/null +++ b/faceAPI/FaceAPI2FSX_vc9.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3