summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_SM
diff options
context:
space:
mode:
Diffstat (limited to 'FTNoIR_Tracker_SM')
-rw-r--r--FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h11
-rw-r--r--FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj99
-rw-r--r--FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp42
3 files changed, 142 insertions, 10 deletions
diff --git a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
index 12bfbe80..9af25800 100644
--- a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
+++ b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h
@@ -1,5 +1,6 @@
#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h"
#include "ui_FTNoIR_SMClientcontrols.h"
+#include "mainwindow.h"
#include "sm_api_qt.h"
#include <QMessageBox>
@@ -11,6 +12,7 @@ using namespace std;
//using namespace sm::faceapi::samplecode;
using namespace sm::faceapi;
using namespace sm::faceapi::qt;
+using namespace sm::faceapi::samplecode;
class FTNoIR_Tracker_SM : public ITracker
{
@@ -19,8 +21,8 @@ public:
~FTNoIR_Tracker_SM();
void Release();
- void Initialize();
- void StartTracker();
+ void Initialize( QFrame *videoframe );
+ void StartTracker( HWND parent_window );
void StopTracker();
bool GiveHeadPoseData(THeadPoseData *data); // Returns true if confidence is good
void loadSettings();
@@ -31,8 +33,9 @@ private:
/** face api variables **/
APIScope *faceapi_scope;
QSharedPointer<EngineBase> _engine;
- smEngineHandle _engine_handle;
-
+ VideoDisplayWidget *_display;
+ QVBoxLayout *l;
+ MainWindow *main_window;
//parameter list for the filter-function(s)
enum
{
diff --git a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj
index cf0cd64f..b15c259b 100644
--- a/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj
+++ b/FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj
@@ -38,7 +38,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".\GeneratedFiles;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\qtmain&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtGui&quot;;.\;&quot;$(SM_API_PATH)\include&quot;;&quot;$(SM_API_CPP_WRAPPERS)\include&quot;;&quot;$(SM_API_WIDGETS)\include&quot;;&quot;$(SM_API_QTLIB)\include&quot;"
+ AdditionalIncludeDirectories=".\GeneratedFiles;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\qtmain&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtGui&quot;;.\;&quot;$(SM_API_PATH)\include&quot;;&quot;$(SM_API_CPP_WRAPPERS)\include&quot;;&quot;$(SM_API_WIDGETS)\include&quot;;&quot;$(SM_API_QTDIR)\include&quot;"
PreprocessorDefinitions="UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;FTNOIR_TRACKER_BASE_LIB"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="false"
@@ -57,7 +57,7 @@
Name="VCLinkerTool"
AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib QtNetwork4.lib smft32.lib smftcpp.lib smftqt.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
- AdditionalLibraryDirectories="$(QTDIR)\lib"
+ AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;&quot;$(SM_API_PATH)\bin&quot;;&quot;$(SM_API_CPP_WRAPPERS)\lib&quot;;&quot;$(SM_API_WIDGETS)\lib&quot;;&quot;$(SM_API_QTDIR)\lib&quot;"
GenerateDebugInformation="false"
SubSystem="2"
/>
@@ -171,6 +171,10 @@
RelativePath=".\ftnoir_tracker_faceapi.cpp"
>
</File>
+ <File
+ RelativePath=".\mainwindow.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -203,12 +207,64 @@
/>
</FileConfiguration>
</File>
+ <File
+ RelativePath=".\mainwindow.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -D_WINDLL -DFTNOIR_TRACKER_BASE_LIB -DNDEBUG -DQT_CORE_LIB -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I&quot;$(QTDIR)\include\.&quot; -I&quot;$(QTDIR)\include\QtCore\.&quot; -I&quot;$(QTDIR)\include\QtGui\.&quot; -I&quot;$(QTDIR)\include\qtmain\.&quot; -I&quot;$(QTDIR)\include\QtNetwork\.&quot; -I&quot;$(SM_API_CPP_WRAPPERS)\include\.&quot; -I&quot;$(SM_API_PATH)\include\.&quot; -I&quot;$(SM_API_QTDIR)\include\.&quot; -I&quot;$(SM_API_WIDGETS)\include\.&quot; -I&quot;.\.&quot; -I&quot;.\GeneratedFiles\$(ConfigurationName)\.&quot; -I&quot;.\GeneratedFiles\.&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -D_WINDLL -DFTNOIR_TRACKER_SM_LIB -DQT_CORE_LIB -DQT_LARGEFILE_SUPPORT -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I&quot;$(QTDIR)\include\.&quot; -I&quot;$(QTDIR)\include\QtCore\.&quot; -I&quot;$(QTDIR)\include\qtmain\.&quot; -I&quot;.\.&quot; -I&quot;.\GeneratedFiles\$(ConfigurationName)\.&quot; -I&quot;.\GeneratedFiles\.&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ </File>
</Filter>
<Filter
Name="Form Files"
Filter="ui"
UniqueIdentifier="{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"
>
+ <File
+ RelativePath=".\mainwindow.ui"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;.\GeneratedFiles\ui_$(InputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="&quot;.\GeneratedFiles\ui_$(InputName).h&quot;"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;.\GeneratedFiles\ui_$(InputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="&quot;.\GeneratedFiles\ui_$(InputName).h&quot;"
+ />
+ </FileConfiguration>
+ </File>
</Filter>
<Filter
Name="Resource Files"
@@ -223,17 +279,56 @@
UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"
SourceControlFiles="false"
>
+ <File
+ RelativePath=".\GeneratedFiles\ui_mainwindow.h"
+ >
+ </File>
<Filter
Name="Release"
Filter="cpp;moc"
SourceControlFiles="false"
>
+ <File
+ RelativePath=".\GeneratedFiles\release\moc_mainwindow.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
</Filter>
<Filter
Name="Debug"
Filter="cpp;moc"
SourceControlFiles="false"
>
+ <File
+ RelativePath=".\GeneratedFiles\Debug\moc_mainwindow.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ </File>
</Filter>
</Filter>
</Files>
diff --git a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
index ee1b049d..f2f18877 100644
--- a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
+++ b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
@@ -1,6 +1,9 @@
#include "ftnoir_tracker_sm.h"
+#include "mainwindow.h"
using namespace sm::faceapi;
+using namespace sm::faceapi::qt;
+using namespace sm::faceapi::samplecode;
//using namespace sm::faceapi::qt;
FTNoIR_Tracker_SM::FTNoIR_Tracker_SM()
@@ -17,16 +20,29 @@ FTNoIR_Tracker_SM::FTNoIR_Tracker_SM()
FTNoIR_Tracker_SM::~FTNoIR_Tracker_SM()
{
- _engine->stop();
- smAPIQuit();
+ qDebug() << "stopTracker says: terminating";
+ //if ( _display ) {
+ // _display->disconnect();
+ // qDebug() << "stopTracker says: display disconnected";
+ // delete _display;
+ // qDebug() << "stopTracker says: display deleted";
+ // _display = 0;
+ // delete l;
+ // l = 0;
+ // qDebug() << "stopTracker says: l deleted";
+ //}
+
+ _engine->stop();
+ smAPIQuit();
}
void FTNoIR_Tracker_SM::Release()
{
+ qDebug() << "FTNoIR_Tracker_SM::Release says: Starting ";
delete this;
}
-void FTNoIR_Tracker_SM::Initialize()
+void FTNoIR_Tracker_SM::Initialize( QFrame *videoframe )
{
qDebug() << "FTNoIR_Tracker_SM::Initialize says: Starting ";
loadSettings();
@@ -54,10 +70,27 @@ void FTNoIR_Tracker_SM::Initialize()
QMessageBox::warning(0,"faceAPI Error",e.what(),QMessageBox::Ok,QMessageBox::NoButton);
}
+
+
+ // Show the video widget
+ qDebug() << "FTNoIR_Tracker_SM::Initialize says: videoframe = " << videoframe;
+
+ // QMainWindow derived class. See mainwindow.h
+ QSharedPointer<CameraBase> camera;
+ main_window = new MainWindow(camera,_engine,0);
+ main_window->show();
+
+ //videoframe->show();
+ //_display = new VideoDisplayWidget( _engine, videoframe, 0 );
+ //l = new QVBoxLayout(videoframe);
+ //l->setMargin(0);
+ //l->setSpacing(0);
+ //l->addWidget(_display);
+
return;
}
-void FTNoIR_Tracker_SM::StartTracker()
+void FTNoIR_Tracker_SM::StartTracker( HWND parent_window )
{
// starts the faceapi engine
@@ -75,6 +108,7 @@ void FTNoIR_Tracker_SM::StartTracker()
void FTNoIR_Tracker_SM::StopTracker()
{
+ qDebug() << "FTNoIR_Tracker_SM::StopTracker says: Starting ";
// stops the faceapi engine
_engine->stop();
return;