kylemcdonald / ofxFaceTracker

CLM face tracking addon for openFrameworks based on Jason Saragih's FaceTracker.
http://facetracker.net/
Other
1.39k stars 369 forks source link

reg. compiling ofxFaceTracker #32

Closed tommysky closed 12 years ago

tommysky commented 12 years ago

Hi, dear Kyle,

I tried your work, FaceOSC_win. It is AMAZING! I tried to compile ofxFaceTracker to get FaceOSC_win but met errors and hope get you helps. I use 64-bit windows 7 and VS2010.


The error is: ContourFinder.obj : error LNK2019: unresolved external symbol "float _cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect_ const &)"


  1. I downloaded "openFrameWork 0072 under VS2010" at ttp://www.openframeworks.cc/download/.
  2. I then downloaded "ofxFaceTracker". I modified its file name "kylemcdonald-ofxFaceTracker-15060b2" as "ofxFaceTracker" and copied it into addons of "openFrameWrok at (..\of_v0072_vs2010_release\addons).
  3. I found "ofxFraceTracker" needs "ofxCv" and then downloaded it and copied it into addons (same as above).
  4. I run "projectGenerator.exe" of "openFramework" and added "ofxFraceTracker", "ofxOpenCv" and "ofxCv" as addons. After compiling generated "mySketch" using VS2010, I met the error in the top. Plus, I added codes as what the page of ofxCv said.

I really hope to get your helps, because it is supposed to be helpful to my current project. Sorry to bother you. I'll appreciate for your supports.

kylemcdonald commented 12 years ago

Try switching to the develop branch of ofxCv and ofxFaceTracker. I can merge them to master later but it should fix your problem.

On Oct 21, 2012, at 1:53 PM, yanjia notifications@github.com wrote:

Hi, dear Kyle,

I tried your work, FaceOSC_win. It is AMAZING! I tried to compile ofxFaceTracker to get FaceOSC_win but met errors and hope get you helps. I use 64-bit windows 7 and VS2010.

The error is: ContourFinder.obj : error LNK2019: unresolved external symbol "float _cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect@H@cv@@0@Z) referenced in function "public: virtual class std::vector > & thiscall ofxCv::Tracker::track(class std::vector,class std::allocator > > const &)" (?track@?$Tracker@V?$Rect@H@cv@@@ofxCv@@UAEAAV?$vector@IV?$allocator@I@std@@@std@@ABV?$vector@V?$Rect@H@cv@@V?$allocator@V?$Rect@H@cv@@@std@@@4@@Z)

I downloaded "openFrameWork 0072 under VS2010" at ttp://www.openframeworks.cc/download/. I then downloaded "ofxFaceTracker". I modified its file name "kylemcdonald-ofxFaceTracker-15060b2" as "ofxFaceTracker" and copied it into addons of "openFrameWrok at (..\of_v0072_vs2010_release\addons). I found "ofxFraceTracker" needs "ofxCv" and then downloaded it and copied it into addons (same as above). I run "projectGenerator.exe" of "openFramework" and added "ofxFraceTracker", "ofxOpenCv" and "ofxCv" as addons. After compiling generated "mySketch" using VS2010, I met the error in the top. Plus, I added codes as what the page of ofxCv said. I really hope to get your helps, because it is supposed to be helpful to my current project. Sorry to bother you. I'll appreciate for your supports.

Regards,

Yanjia

— Reply to this email directly or view it on GitHub.

tommysky commented 12 years ago

Hi, kyle, I cannot understand "switching to the develop branch of ofxCv and ofxFaceTracker"... Could you give me deeper guides? Or, I wonder if you could send me your entire project of FaceOSC_win for study? Thank you.

kylemcdonald commented 12 years ago

ok, i merged the changes from the develop branch to the master branch. so don't worry about doing what i said -- just get the latest copy of both ofxCv (be45a2bb88) and ofxFacetrackerd (5263d1ab2).

i think the reason that you were getting a problem was because there is ofxCv/Tracker.h and also FaceTracker/Tracker.h and they were conflicting with each other. but i made some changes that should keep this from happening.

so could you re-download both, and re-generate the project files? please let me know if there is the same error, or a new error, or if it works.

tommysky commented 12 years ago

Hi, Kyle, the error is as below this time, but it seems to be the same error as before.

error LNK2019: unresolved external symbol "float _cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect@H@cv@@0@Z) referenced in function "public: virtual class std::vector<unsigned int,class std::allocator > & _thiscall ofxCv::Tracker<class cv::Rect >::track(class std::vector<class cv::Rect,class std::allocator<class cv::Rect > > const &)" (?track@?$Tracker@V?$Rect@H@cv@@@ofxCv@@UAEAAV?$vector@IV?$allocator@I@std@@@std@@ABV?$vector@V?$Rect@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@4@@Z)

tommysky commented 12 years ago

Hi, dear Kyle, do you have any idea?

Dewb commented 12 years ago

Can you try building some of the ofxCV samples and see if you get the same error?

tommysky commented 12 years ago

Hi, Dewb, I'm new and wonder where I can find ofxCV samples for testing? Thank you.

kylemcdonald commented 12 years ago

ah, maybe i misunderstood this issue -- is it possible you haven't downloaded ofxCv? grab it here: https://github.com/kylemcdonald/ofxCv

the examples are all available in the repository, just try running them. if those work, but the ofxFaceTracker example still doesn't, then try using the 0072 projectGenerator to create an ofxOpenCv + ofxCv + ofxFaceTracker project.

tommysky commented 12 years ago

Hi, dear Kyle. Following what you said, I created an ofxOpenCv + ofxCv + ofxFaceTracker project using 0072 projectGenerator but I still met the same error as before. BTW, ofxCV samples work well.

tommysky commented 12 years ago

About ofxFaceTracker examples, I don't know how to run them using VS2010. Please give me the hints. Thanks.

kylemcdonald commented 12 years ago

if ofxCv works but not ofxFaceTracker, i recommend adding the ofxFaceTracker files to an ofxCv project by hand.

also, i'm thinking of combining the ofxCv and ofxFaceTracker repositories, which should simplify this a little.

tommysky commented 12 years ago

Hi, Klye, I manually copied all ofxFaceTracker/ files into the corresponding directory of ofxCV/ without .gitignore file, but errors still exist as bellow.

  1. error LNK2019: unresolved external symbol "public: void __thiscall FACETRACKER::Tracker::Load(char const *)"
  2. error LNK2019: unresolved external symbol "public: int __thiscall FACETRACKER::Tracker::Track(class cv::Mat,class std::vector<int,class std::allocator > &,int,int,double,double,bool)"
tommysky commented 12 years ago

Plus, I don't test ofxFraceTracker samples yet, because I have no idea how to run them using VS2010.

tommysky commented 12 years ago

Hi, Kyle, I searched my errors through Google, but didn't get satisfied solutions. I wonder if you could provide me your entire project of ofxFaceTracker you compiled using VS2010. Let me try if I still have the same errors? Thank you.

kylemcdonald commented 12 years ago

i'm sorry, i didn't use visual studio to build FaceOSC on windows -- i used code::blocks. so i haven't posted a visual studio project before. i'm going to take a look right now.

kylemcdonald commented 12 years ago

i just built vs2010 projects for ofxFaceTracker successfully. i got the same error that you had, but when i googled the error number i found this solution http://stackoverflow.com/a/3731643 which fixed it.

tommysky commented 12 years ago

Hi, dear Kyle, I appreciate for your helps! ofxFaceTracker examples was indeed built successfully, but when they be run they are aborted. Assertion failed: s.is_open() at file ..\libs\facetracker\src\lib\Tracker.cc line 59. I tested example-expression and example-extraction. BTW, ofxCV examples are still run well.

I also met some strange problems on new ofxFaceTracker file and report you. I wonder if you have the same problems.

  1. ofxFaceTracker examples can be built. The premise is that all ofxFaceTracker examples should be in theSUB-directory of ofxFaceTracker (renamed from ofxFaceTracker-master). Errors pop out if use "ofxFaceTracker-master" as root name.
  2. ofxOpenCv + ofxCv + ofxFaceTracker project using 0072 projectGenerator If I want to build the new project like faceOSC-win successfully, ofxFaceTracker examples should be in the SUB-SUB-directory of ofxFaceTracker, otherwise the early error will occur. However, examples cannot be opened successfully in the SUB-SUB-directory. Furthermore, the new project looks like an empty project whose effect is not same as faceOSC-win when I run it. I wonder if I need write some codes by myself? Thank you.
kylemcdonald commented 12 years ago

all the examples (including faceosc) should stay in their current location, and be compiled from their current location. you shouldn't move them, because the paths are all relative and moving them will break the paths.

if you have an s.is_open() error, you haven't copied your model files into data correctly. please see the readme for more info.

tommysky commented 12 years ago

the example faceosc which is not like examples (expression and extraction) does not comtain .sln. I don't know how to build it. Could you give me some hints?

kylemcdonald commented 12 years ago

sorry, i forgot that the .sln was not copied over.

try to take a .sln + other files (vcxproj, user files) from another example and then add ofxOsc by hand.

tommysky commented 12 years ago

Hi, Kyle, Following what you said, I met the following errors. I'm not clear how to fix them and wonder if I need to do more? Thank you.

main.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscBundle::~ofxOscBundle(void)" (??1ofxOscBundle@@QAE@XZ) referenced in function unwindfunclet$??0testApp@@QAE@XZ$0 1>testApp.obj : error LNK2001: unresolved external symbol "public: thiscall ofxOscBundle::~ofxOscBundle(void)" (??1ofxOscBundle@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscSender::~ofxOscSender(void)" (??1ofxOscSender@@QAE@XZ) referenced in function unwindfunclet$??0testApp@@QAE@XZ$0 1>main.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscBundle::ofxOscBundle(void)" (??0ofxOscBundle@@QAE@XZ) referenced in function "public: thiscall testApp::testApp(void)" (??0testApp@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscSender::ofxOscSender(void)" (??0ofxOscSender@@QAE@XZ) referenced in function "public: thiscall testApp::testApp(void)" (??0testApp@@QAE@XZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: thiscall ofxXmlSettings::~ofxXmlSettings(void)" (??1ofxXmlSettings@@QAE@XZ) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: void thiscall ofxOscSender::setup(class std::basic_string<char,struct std::char_traits,class std::allocator >,int)" (?setup@ofxOscSender@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: double thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,double,int)" (?getValue@ofxXmlSettings@@QAENABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@NH@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits,class std::allocator > thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?getValue@ofxXmlSettings@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@0H@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: int thiscall ofxXmlSettings::popTag(void)" (?popTag@ofxXmlSettings@@QAEHXZ) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: int thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int,int)" (?getValue@ofxXmlSettings@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HH@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: int thiscall ofxXmlSettings::getNumTags(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?getNumTags@ofxXmlSettings@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: bool thiscall ofxXmlSettings::pushTag(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?pushTag@ofxXmlSettings@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: bool thiscall ofxXmlSettings::loadFile(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?loadFile@ofxXmlSettings@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: thiscall ofxXmlSettings::ofxXmlSettings(void)" (??0ofxXmlSettings@@QAE@XZ) referenced in function "public: void thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscMessage::~ofxOscMessage(void)" (??1ofxOscMessage@@QAE@XZ) referenced in function "public: void thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VofVec3f@@@Z) 1>testApp.obj : error LNK2019: unresolved external symbol "public: void thiscall ofxOscBundle::addMessage(class ofxOscMessage const &)" (?addMessage@ofxOscBundle@@QAEXABVofxOscMessage@@@Z) referenced in function "public: void thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VofVec3f@@@Z) 1>testApp.obj : error LNK2019: unresolved external symbol "public: void thiscall ofxOscMessage::addFloatArg(float)" (?addFloatArg@ofxOscMessage@@QAEXM@Z) referenced in function "public: void thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VofVec3f@@@Z) 1>testApp.obj : error LNK2019: unresolved external symbol "public: thiscall ofxOscMessage::ofxOscMessage(void)" (??0ofxOscMessage@@QAE@XZ) referenced in function "public: void thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VofVec3f@@@Z) 1>testApp.obj : error LNK2019: unresolved external symbol "public: void thiscall ofxOscMessage::addIntArg(int)" (?addIntArg@ofxOscMessage@@QAEXH@Z) referenced in function "public: void thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,int)" (??$addMessage@H@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) 1>testApp.obj : error LNK2019: unresolved external symbol "public: void thiscall ofxOscSender::sendBundle(class ofxOscBundle &)" (?sendBundle@ofxOscSender@@QAEXAAVofxOscBundle@@@Z) referenced in function "public: void thiscall testApp::sendBundle(void)" (?sendBundle@testApp@@QAEXXZ) 1>testApp.obj : error LNK2019: unresolved external symbol "public: class ofxOscMessage & thiscall ofxOscMessage::copy(class ofxOscMessage const &)" (?copy@ofxOscMessage@@QAEAAV1@ABV1@@Z) referenced in function "public: class ofxOscMessage & __thiscall ofxOscMessage::operator=(class ofxOscMessage const &)" (??4ofxOscMessage@@QAEAAV0@ABV0@@Z)

tommysky commented 12 years ago

Sorry for my posting so many. I'm supposed to select part of them to post.

tommysky commented 12 years ago

Hi, Kyle, I also met the familiar errors when I compiled blink example. I wonder if you have same errors.

error LNK2019: unresolved external symbol "public: thiscall ofxOscSender:: error LNK2019: unresolved external symbol "public: thiscall ofxOscMessage:

kylemcdonald commented 12 years ago

these errors occur when you haven't added ofxOsc to your project correctly. for more information you could try posting on the openFrameworks forum, but i don't have the time right now to craft a compiling example for you. sorry!

tommysky commented 12 years ago

I see, Kyle. Thank you for your helps recently.

tommysky commented 12 years ago

Hi, Kyle, checking many times, I still cannot add ofxOsc into blink and faceOSC example correctly. openFrameworks forum suggests me get someone knowledgeable. I hope you could help me when you are available. advanced example tracks eyebrows and mouth well but eyes, so I want to try blink example. Thank you.

BinaryBrother commented 11 years ago

After killing myself for a week, I've managed to get it compiled on Windows, but all I see is a grey window. No compile errors. Dependency walker looks good. etc.

Any ideas? ^.^

kylemcdonald commented 11 years ago

oh man, congratulations... if there's just a grey window the first thing i'd check is that the video grabber is actually working. can you try running one of the OF video grabber examples?

if that works, then maybe try going into debug mode and walking through the update() in the OF app, all the way into the face tracker update() to see if things are working correctly, or if something is getting skipped.

BinaryBrother commented 11 years ago

Hey, Kyle. I've actually came a long way since I left that last message. Thanks for your response!

I've got some interesting news. I've managed to get it functional on Windows without the ofxFaceTrackerThreaded module and just used the ofxFaceTracker, directly. Running through the ofxFaceTrackerThreaded module causes face detection to be very sporadic and rarely ever actually detects the face. However, without multi-threading this project is unfeasible due to the performance requirements. Frame-rates become very unstable and drop to something less than 1FPS.

What information should I provide, to aid in diagnostics?

kylemcdonald commented 11 years ago

if you're not using the threaded tracker, is the face detected continuously, or does it lose track as well?

does the tracking consistency vary with respect to how quickly you are moving? if the tracking framerate is poor, then any small movements are amplified.

i can't imagine a situation where the tracker would run at 1fps, unless you're using an embedded system / mobile device? can you describe more about the system you're using, your lighting situation, and more precisely describe what happens with the standard tracker vs the threaded tracker (e.g., what framerate you're running at in both cases, how often the tracking fails, what framerate the camera is running at, etc)

also it might make sense to open this as a new issue like "ofxFaceTrackerThreaded poor performance on windows" or similar.

Shaderboy commented 7 years ago

Hi all, I just tried compiling for windows with 0.9.7 and am running into the same issue. The empty example from ofxCv compiles with no problem, but the empty example for ofxFaceTracker gives me this output:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol "float __cdecl ofxCv::trackingDistance(class cv::Rect_<int> const &,class cv::Rect_<int> const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z) referenced in function "public: virtual class std::vector<unsigned int,class std::allocator<unsigned int> > const & __thiscall ofxCv::Tracker<class cv::Rect_<int> >::track(class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > const &)" (?track@?$Tracker@V?$Rect_@H@cv@@@ofxCv@@UAEABV?$vector@IV?$allocator@I@std@@@std@@ABV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@4@@Z)  example-empty   C:\Users\chris\Documents\Projects\of_v0.9.7_vs_release\addons\ofxFaceTracker\example-empty\ContourFinder.obj    1   
Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol "float __cdecl ofxCv::trackingDistance(class cv::Rect_<int> const &,class cv::Rect_<int> const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z)    example-empty   C:\Users\chris\Documents\Projects\of_v0.9.7_vs_release\addons\ofxFaceTracker\example-empty\ObjectFinder.obj 1

This is in visual studio 2015

Edit: I finally got it to compile by changing the Tracker class and all references/filenames to ofxCvTracker. @kylemcdonald, I know you had specifically tried to avoid that, but it seems to be the simplest solution here.

ch3gr commented 7 years ago

I am having the same issue as well on VS2015.

Renaming the class as @Shaderboy said does work indeed, just a little adventurous for my novice skills though. =]

Curious to why this is not a problem for other users.

krisrok commented 7 years ago

as @kylemcdonald already said 5 years ago, this should fix the issue without the renaming adventure:

http://stackoverflow.com/a/3731643

i just wanted to make this tip more visible again

reedjones commented 4 years ago

as @kylemcdonald already said 5 years ago, this should fix the issue without the renaming adventure:

http://stackoverflow.com/a/3731643

i just wanted to make this tip more visible again

This worked for me