get an error when i switch haar xml files?

Hi i am using the face tracking example and haarFinder.setup(“haarXML/haarcascade_frontalface_default.xml”); which works great!
but when i change the xml file in this line to another one in the same folder like “mouth.xml”
i get an error:

GDB: Error could not locate source file: cxerror.cpp(line: 359)

and in the debugger this is the line that is highlighted:

cvHaarDetectObjects(hack.getCvImage(), cascade, storage, scaleHaar, 2, CV_HAAR_DO_CANNY_PRUNING);

does anyone have any clue why this error is happening i thought you could just replace the xml
in the haar finder setup and it will detect different things? is there another step i have to follow?
thanks!

hi if this is not the right place for this topic please advise on where to post i have already posted in the xcode forum with no responses and need to know for an installation im putting up soon. or is it not a resolvable issue? thanks

hi,

openCv’s error message is telling you that it can’t find the file. are you using the ofToDataPath() function? please post the line of code when your load the first xml file, and the line where you do the switch.

hi thanks for the reply. here is where i first load the xml:
#include “testApp.h”

//--------------------------------------------------------------
void testApp::setup(){
vidGrabber.setVerbose(true);
vidGrabber.initGrabber(320,240);

colorImg.allocate(320,240);
grayImage.allocate(320,240);
grayBg.allocate(320,240);
grayDiff.allocate(320,240);
bLearnBakground = true;
threshold = 80;

//lets load in our face xml file
haarFinder.setup(“mouth.xml”);

}

i dont believe im using the ofToDataPath().
when i run the program it says its successful but then a few seconds later i get the error message.

I downloaded the example in day 3 of the of goldsmiths workshop i attended and I got it working for faces but when i try mouths or anything else i get the error.

I do the switch where it says (“mouth.xml”) this is in the same folder as the working face XML file. in the workshop they said I could freely change the xml in order to track different things.

the whole code is available in day 3 of the ofgoldsmiths site. found here under face tracking: http://wiki.openframeworks.cc/index.php-…-Goldsmiths
i hope this is enough info?

thank you so much for your help! :smiley:

hi

this:

  
haarFinder.setup("mouth.xml");  

should be:

  
haarFinder.setup("haarXML/mouth.xml");  

as every file is in a haarXML folder inside bin/data that is the folder where of searchs for every file. the original example had that as well:

  
haarFinder.setup("haarXML/haarcascade_frontalface_default.xml");  

hey Arturo thanks a bunch, shit i should have caught that one… and thanks again for an awesome workshop! I cant wait to install this thing… cheers! Daniel :smiley: