0

Whenever I try to create the HAAR Cascade I get the following error.

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   9768 : 9768
Train dataset for temp stage can not be filled. Branch training terminated.
Cascade classifier can't be trained. Check the used training parameters.

I am not sure what I am doing wrong.

This is the command I used:

opencv_traincascade.exe -data F:\TrainingImages\HaarTraining\cascades -vec F:\TrainingImages\HaarTraining\vector\vector.vec -bg F:\TrainingImages\HaarTraining\negative\bg.txt -numPos 9768 -numNeg 18050 -numStages 15 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -w 24 -h 24 -acceptanceRatioBreakValue 10E-05 mode ALL

bg.txt file is in the form

jpgTojpg0.jpg
jpgTojpg1.jpg
jpgTojpg10.jpg
jpgTojpg100.jpg
jpgTojpg1000.jpg
jpgTojpg1001.jpg
jpgTojpg1002.jpg
jpgTojpg1003.jpg

enter image description here

Could someone please help me!!!

Nemi Bhattarai
  • 181
  • 1
  • 4
  • 11
  • is numpos and numneg have to be the number of samples per stage, not the total number available. trx to reduce both values and try again. – Micka Feb 17 '18 at 09:33
  • how much should I reduce? – Nemi Bhattarai Feb 17 '18 at 14:13
  • try numPos 8000 and numNeg 12000 for the beginning. What size are your negative samples? Is there any intermediate console output after "POS count : consumed 8000 : 8000" before training cancels? – Micka Feb 17 '18 at 14:19
  • maybe your background images aren't found: https://stackoverflow.com/questions/11412655/error-train-dataset-for-temp-stage-can-not-be-filled-while-using-traincascade try absolute pathes and/or make sure that the samples are in the right relative path from working directory – Micka Feb 17 '18 at 14:22
  • 1
    thank you my error was with absolute path at bg.txt... – Nemi Bhattarai Feb 17 '18 at 14:28

0 Answers0