diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-03-08 22:10:06 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-03-08 22:10:06 +0000 |
commit | 7dc20f380c80b1b0597e619e66d23921f0309aa0 (patch) | |
tree | c5fb83c3b97b825112433a81ee3dfafe96dba84e /FaceTrackNoIR/tracker.cpp | |
parent | 63ce1b5dc62e5c1a079f8a675c0a4371adb27d29 (diff) |
Start after update 1.5
Begin placing faceAPI in DLL
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@52 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/tracker.cpp')
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 77 |
1 files changed, 55 insertions, 22 deletions
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index 6455f9b6..2571be40 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -55,8 +55,8 @@ #define USE_HEADPOSE_CALLBACK
//#define USE_DEBUG_CLIENT
-using namespace sm::faceapi;
-using namespace sm::faceapi::qt;
+//using namespace sm::faceapi;
+//using namespace sm::faceapi::qt;
// Flags
bool Tracker::confid = false;
@@ -104,27 +104,60 @@ QLibrary *filterLib; Tracker::hTrackMutex = CreateMutexA(NULL, false, "HeadPose_mutex");
+ //
+ // Initialize the headpose-data
+ //
+ Tracker::Yaw.initHeadPoseData();
+ Tracker::Pitch.initHeadPoseData();
+ Tracker::Roll.initHeadPoseData();
+ Tracker::X.initHeadPoseData();
+ Tracker::Y.initHeadPoseData();
+ Tracker::Z.initHeadPoseData();
+
+ //
+ // Start the selected Tracker-engine
+ //
switch (selectedTracker) {
case FT_SM_FACEAPI:
- try {
- // Initialize the faceAPI Qt library
- sm::faceapi::qt::initialize();
- smLoggingSetFileOutputEnable( false );
-
- // Initialize the API
- faceapi_scope = new APIScope;
-
- // Create head-tracking engine v2 using first detected webcam
- CameraInfo::registerType(SM_API_CAMERA_TYPE_WDM);
- _engine = QSharedPointer<HeadTrackerV2>(new HeadTrackerV2());
-
- // starts the faceapi engine
- _engine->start();
- }
- catch (sm::faceapi::Error &e)
- {
- /* ERROR with camera */
- QMessageBox::warning(0,"faceAPI Error",e.what(),QMessageBox::Ok,QMessageBox::NoButton);
+ //try {
+ // // Initialize the faceAPI Qt library
+ // sm::faceapi::qt::initialize();
+ // smLoggingSetFileOutputEnable( false );
+
+ // // Initialize the API
+ // faceapi_scope = new APIScope();
+
+ // //if (APIScope::internalQtGuiIsDisabled()){
+ // // QMessageBox::warning(0,"faceAPI Error","Something Bad",QMessageBox::Ok,QMessageBox::NoButton);
+ // //}
+
+ // // Create head-tracking engine v2 using first detected webcam
+ // CameraInfo::registerType(SM_API_CAMERA_TYPE_WDM);
+ // _engine = QSharedPointer<HeadTrackerV2>(new HeadTrackerV2());
+
+ // // starts the faceapi engine
+ // _engine->start();
+ //}
+ //catch (sm::faceapi::Error &e)
+ //{
+ // /* ERROR with camera */
+ // QMessageBox::warning(0,"faceAPI Error",e.what(),QMessageBox::Ok,QMessageBox::NoButton);
+ //}
+ trackerLib = new QLibrary("FTNoIR_Tracker_SM.dll");
+
+ getIT = (importGetTracker) trackerLib->resolve("GetTracker");
+
+ if (getIT) {
+ ITrackerPtr ptrXyz(getIT());
+ if (ptrXyz)
+ {
+ pTracker = ptrXyz;
+ pTracker->Initialize();
+ qDebug() << "Tracker::setup Function Resolved!";
+ }
+ }
+ else {
+ QMessageBox::warning(0,"FaceTrackNoIR Error", "DLL not loaded",QMessageBox::Ok,QMessageBox::NoButton);
}
break;
@@ -681,7 +714,7 @@ void Tracker::run() { //for lower cpu load
usleep(10000);
- yieldCurrentThread();
+// yieldCurrentThread();
}
}
|