diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-03-21 21:32:13 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-03-21 21:32:13 +0000 |
commit | 7eeb8dfaede7bb54b37b8ea538135914a43ab011 (patch) | |
tree | 890f04508697583a3d3e1b849181122278096701 /FTNoIR_Tracker_SM | |
parent | 09b4c95b8036b9466ca89acbe0b1f3d810499863 (diff) |
New effort to embrace faceAPI 3.2.6
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@54 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_SM')
-rw-r--r-- | FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.h | 11 | ||||
-rw-r--r-- | FTNoIR_Tracker_SM/FTNoIR_Tracker_SM.vcproj | 99 | ||||
-rw-r--r-- | FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp | 42 |
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;"$(QTDIR)\include";".\GeneratedFiles\$(ConfigurationName)";"$(QTDIR)\include\qtmain";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtGui";.\;"$(SM_API_PATH)\include";"$(SM_API_CPP_WRAPPERS)\include";"$(SM_API_WIDGETS)\include";"$(SM_API_QTLIB)\include""
+ AdditionalIncludeDirectories=".\GeneratedFiles;"$(QTDIR)\include";".\GeneratedFiles\$(ConfigurationName)";"$(QTDIR)\include\qtmain";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtGui";.\;"$(SM_API_PATH)\include";"$(SM_API_CPP_WRAPPERS)\include";"$(SM_API_WIDGETS)\include";"$(SM_API_QTDIR)\include""
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=""$(QTDIR)\lib";"$(SM_API_PATH)\bin";"$(SM_API_CPP_WRAPPERS)\lib";"$(SM_API_WIDGETS)\lib";"$(SM_API_QTDIR)\lib""
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'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\moc.exe" "$(InputPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp" -D_WINDLL -DFTNOIR_TRACKER_BASE_LIB -DNDEBUG -DQT_CORE_LIB -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I"$(QTDIR)\include\." -I"$(QTDIR)\include\QtCore\." -I"$(QTDIR)\include\QtGui\." -I"$(QTDIR)\include\qtmain\." -I"$(QTDIR)\include\QtNetwork\." -I"$(SM_API_CPP_WRAPPERS)\include\." -I"$(SM_API_PATH)\include\." -I"$(SM_API_QTDIR)\include\." -I"$(SM_API_WIDGETS)\include\." -I".\." -I".\GeneratedFiles\$(ConfigurationName)\." -I".\GeneratedFiles\."
"
+ AdditionalDependencies=""$(QTDIR)\bin\moc.exe";$(InputPath)"
+ Outputs="".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\moc.exe" "$(InputPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp" -D_WINDLL -DFTNOIR_TRACKER_SM_LIB -DQT_CORE_LIB -DQT_LARGEFILE_SUPPORT -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -I"$(QTDIR)\include\." -I"$(QTDIR)\include\QtCore\." -I"$(QTDIR)\include\qtmain\." -I".\." -I".\GeneratedFiles\$(ConfigurationName)\." -I".\GeneratedFiles\."
"
+ AdditionalDependencies=""$(QTDIR)\bin\moc.exe";$(InputPath)"
+ Outputs="".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp""
+ />
+ </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'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_$(InputName).h" "$(InputPath)"
"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="".\GeneratedFiles\ui_$(InputName).h""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic'ing $(InputFileName)..."
+ CommandLine=""$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_$(InputName).h" "$(InputPath)"
"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="".\GeneratedFiles\ui_$(InputName).h""
+ />
+ </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;
|