| Author |
Message |
< extend ~ ofxCvHaarFinder: OpenCV face/eye/mouth tracking |
|
RooTShell
|
Posted: Mon Nov 30, 2009 9:34 pm |
|
|
| Joined: Mon Nov 30, 2009 4:40 pmPosts: 4 |
kylemcdonald wrote: Hmm, there is no difference between ofxOpenCv.h and ofxCvMain.h right now (though notice the warning in ofxCvMain.h that it is deprecated -- maybe your ofxOpenCv is out of date?) Can you try compiling one of the ofxOpenCv examples first, then compiling the haar finding example? edit: I just posted ofxCvHaarFinder as a single .zip addon here: http://kyle.googlecode.com/, no changes from the last revision except that I've put the example next to the addon source. Hi Kyle... Thanks for the reply... I'm using the ofxOpenCv that comes with oF 0.6 in the addons folder... Is there a newer version? I changed my code a bit and now I'm facing the following error Code: "ofxCvHaarFinder::setup(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)", referenced from: testApp::setup() in testApp.o "ofxCvHaarFinder::findHaarObjects(ofxCvGrayscaleImage&, int, int)", referenced from: testApp::update() in testApp.o "ofxCvHaarFinder::ofxCvHaarFinder()", referenced from: testApp::testApp()in main.o "ofxCvHaarFinder::~ofxCvHaarFinder()", referenced from: testApp::~testApp()in testApp.o testApp::~testApp()in testApp.o ld: symbol(s) not found collect2: ld returned 1 exit status
I think it refers to this line of code Code: haarFinder.setup("haarcascade_frontalface_default.xml"); I have the file haarcascade_frontalface_default.xml in my data folder... Any suggestions? Thanks!
|
|
Top
|
|
|
kylemcdonald
|
Posted: Mon Nov 30, 2009 9:39 pm |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
There might be a newer version of ofxOpenCv on the forums, I'm not sure where my version is from right now... sorry :/
Could you try downloading and compiling my example, and seeing if that works? It will help me troubleshoot better -- I'm not sure right now what the problem is with your code.
|
|
Top
|
|
|
RooTShell
|
Posted: Mon Nov 30, 2009 11:51 pm |
|
|
| Joined: Mon Nov 30, 2009 4:40 pmPosts: 4 |
kylemcdonald wrote: There might be a newer version of ofxOpenCv on the forums, I'm not sure where my version is from right now... sorry :/
Could you try downloading and compiling my example, and seeing if that works? It will help me troubleshoot better -- I'm not sure right now what the problem is with your code. Hi... I downloaded you example and compiled it in Code Blocks under Windows 7... All compiles fine but in the end I get this error Code: Linking console executable: bin\haarTester.exe mingw32-g++.exe: obj\release\addons\ofxCvHaarFinder\src\ofxCvHaarFinder.o: No such file or directory Process terminated with status 1 (0 minutes, 43 seconds) 0 errors, 0 warnings There is no obj\release\addons\ofxCvHaarFinder\src\ofxCvHaarFinder.o created and no bin\haarTester.exe after compilation... Sorry for all the trouble
|
|
Top
|
|
|
kylemcdonald
|
Posted: Tue Dec 01, 2009 12:16 am |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
Hmm, that's really strange. Can you try hitting the "rebuild" button?
I might have to ask someone why the .o isn't created, it's kind of a mystery to me...
|
|
Top
|
|
|
RooTShell
|
Posted: Tue Dec 01, 2009 12:18 am |
|
|
| Joined: Mon Nov 30, 2009 4:40 pmPosts: 4 |
kylemcdonald wrote: Hmm, that's really strange. Can you try hitting the "rebuild" button?
I might have to ask someone why the .o isn't created, it's kind of a mystery to me... Rebuild does the same thing
|
|
Top
|
|
|
kylemcdonald
|
Posted: Tue Dec 01, 2009 4:28 am |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
The only thing I can think of is that ofxCvHaarFinder.o isn't actually being compiled because of errors. Sometimes C::B displays only the linking errors, and you have to go to "build messages" to see the compile errors (i.e., sometimes it tries to link even when it can't compile). If you see anything else suspicious before the linker error, could you paste that?
Otherwise, I'm not sure -- and would really appreciate anyone else's help!
|
|
Top
|
|
|
faisal1911
|
Posted: Mon Dec 07, 2009 10:29 am |
|
|
| Joined: Sat Oct 17, 2009 9:55 amPosts: 4Location: Indonesia |
dear all.... i'm new to oF,and i find it interesting, so i decide i want to make my project for my graduate with oF. What i make is some face-detection application for surveillance camera with this ofxcvHaarFinder,and it's working. But unfortunately when i tell my professor that i using this library, she doesnt agree, and suggest i re-code all the Viola-Jones and Haar-classifier algorithm myself,and its really daunting tasks... so,can anyone give me advice, where i must start?thx before
|
|
Top
|
|
|
kylemcdonald
|
Posted: Mon Dec 07, 2009 4:36 pm |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
What kind of degree is it? That's kind of a crazy expectation! I'd start here: http://www.cmucam.org/wiki/viola-jonesThere's a reference implementation as well as a number of papers describing how it works.
|
|
Top
|
|
|
faisal1911
|
Posted: Tue Dec 08, 2009 11:24 am |
|
|
| Joined: Sat Oct 17, 2009 9:55 amPosts: 4Location: Indonesia |
yeah...it's my undergraduate degree,lol.. thx for the reference,kyle! i'll try to figure it more... what i wanna know is,how to use the xml settings (haarcascade_frontal_alt.xml), and implement it directly without making the training application,you have a suggestion?
|
|
Top
|
|
|
kylemcdonald
|
Posted: Tue Dec 08, 2009 4:48 pm |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
Ok, that's not as bad. The hard part really is generating the haar files, the finding isn't as complicated. I would recommend looking for a description of how the CV haar XML files are structured, and then implementing the algorithm described in the papers in the site I posted above. This might be a better question to ask the OpenCV list, as it's not very OF-related.
|
|
Top
|
|
|
faisal1911
|
Posted: Wed Dec 09, 2009 11:27 am |
|
|
| Joined: Sat Oct 17, 2009 9:55 amPosts: 4Location: Indonesia |
my bad,my bad  ....ok,later i'll post it in openCV topics.thx a lot kyle!
|
|
Top
|
|
|
JacksonM
|
Posted: Sun Jan 17, 2010 1:58 am |
|
|
Joined: Fri Jan 15, 2010 4:47 amPosts: 27 |
Q1:I don't there any way to train a finder with this API right? I need to create the xml from openCV and then use it here. Is there any interest in extending the APT to do training? Q2: I'm not very familiar with the concept of haar-like features, but does anyone know if it works just as well for other objects (i.e. cars, cats etc...) or is it designed for human features? Thanks -Jackson
|
|
Top
|
|
|
kylemcdonald
|
Posted: Sun Jan 17, 2010 5:03 am |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
JacksonM, there is no training built into this addon -- that would make it really powerful, though. Todd Vanderlin has some work with training haar classifiers. Yes, they can be constructed to identify arbitrary objects. Depending on your application, another approach might be smarter though. Check out Todd's thread here: http://www.openframeworks.cc/forum/viewtopic.php?f=10&t=1415
|
|
Top
|
|
|
JacksonM
|
Posted: Tue Jan 19, 2010 4:29 am |
|
|
Joined: Fri Jan 15, 2010 4:47 amPosts: 27 |
kylemcdonald wrote: JacksonM, there is no training built into this addon -- that would make it really powerful, though. Todd Vanderlin has some work with training haar classifiers. Yes, they can be constructed to identify arbitrary objects. Depending on your application, another approach might be smarter though. Check out Todd's thread here: http://www.openframeworks.cc/forum/viewtopic.php?f=10&t=1415As far as I can tell building the classifier xml is really time consuming and I was hoping to do it in soft real time, so I may delay that. Do you know if haar classifiers report a score with each detected object (i.e. the probability that this is a face etc...) If so, is there a way to tell the detector I only want the top one? I see a lot of projects that do face or eye detection and always know how many should be in the image, can this additional knowledge be leveraged?
_________________ -Jackson |
|
|
Top
|
|
|
kylemcdonald
|
Posted: Tue Jan 19, 2010 5:24 am |
|
|
| Joined: Fri Jun 27, 2008 4:49 amPosts: 453Location: Brooklyn |
You can't get a score from a haar classifier directly. But a good way to approximate it is to run the classifier multiple times with slightly modified or rotated images, and don't let OpenCV do any automatic grouping. Then the likelihood is related to how many matches intersect with a given region. Like this:
|
|
Top
|
|
|
|