Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Training cascade classifier- need some clarification

I followed the tutorial in the Link I new in working with cascade classifier. So i tried training with 10 positive and 6 negative images for first time ( I read that it is not enough and for robust detection we need to train minimum of 500 samples).

  1. I put the positive and negative samples in separate folders.
  2. I created two txt files with path and name of file.
  3. I created the .vec file using

    "C:\opencv\build\x86\vc10\bin\opencv_createsamples.exe -info positivenew.txt -vec samples.vec -w 50 -h 35 PAUSE"

image description

4) I verified the samples using

C:\opencv\build\x64\vc10\bin\opencv_createsamples.exe  -vec samples.vec -w 50 -h 35 PAUSE

all works well upto this stage.

5) when i train the classifier using

C:\opencv\build\x64\vc10\bin\opencv_haartraining.exe -data class -vec samples.vec -bg Negativenew.txt -npos 10 -nneg 6 -nstages 7 -nonsym -minhitrate 0.998 -maxfalsealarm 0.5 -mem 1024 -mode ALL -w 50 -h 35

the following process was done image description

The output in the class directory contains many folders with names from 0,1,2,3...6 with files "AdaBoostCARTHaarClassifier.txt " with the content like this

1
1
3
0 0 2 16 0 -1
0 0 1 8 0 2
1 8 1 8 0 2
haar_x2_y2
6.744434e-004 0 -1
1.000000e+000 -1.000000e+000 
1.000000e+000

0
-1

but no *.xml file is found in output directory. Where did i do the mistake? Please help me in this.