my classifier using haar cascade can not detect anything
I create my own classifier using 90 positives samples and 299 negatives to detect doctor's tool.
I run this command createsamples.exe -info positive/info.txt -vec data/vector.vec -num 90 -w 25 -h 15
to create my samples and that haartraining.exe -data data/cascade -vec data/vector.vec -bg negative/infofile.txt -npos 90 -nneg 299 -nstages 25 -mem 1000 -mode ALL -w 25 -h 15 -nonsym
to train my classifier.
When the clasifier trained I get the xml file and use it in my program. I notice that it can not detect anything...
Do anyone know what I am doing wrong?:/
Second problem
When I run my command opencv_traincascade -data data/cascade -vec data/vector.vec -bg neg.txt -numPos 2200 -numNeg 1000 -numStages 25 –featureType LBP -mem 2000 -mode ALL -w 25 -h 15
after the first stage it returned the follow
<BEGIN
OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
) in get, file /home/mcn/opencv-2.4.5/apps/traincascade/imagestorage.cpp, line 159
terminate called after throwing an instance of 'cv::Exception'
what(): /home/mcn/opencv-2.4.5/apps/traincascade/imagestorage.cpp:159: error: (-5) Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
in function get
Aborted
As I read from http://answers.opencv.org/question/776/error-in-parameter-of-traincascade/ I redude the numPos but the problem is still exist in later stages...
Switch to the newer train cascade algorithm software, which works way better than the haartraining tool. Use LBP features for faster calculation.
@ioanna unless you are detecting a extremely rigid object on a invariable background, you'll need to gather more data to train a classifier. Think thousands, not hundreds.
ok thanks you both I will follow the advises:)