1

I've looked at this answer, that states that this problem might happen when the description files for the negative images is created with tools different from Opencv_createSamples, but this is not the case here.

The break occurs somewhere between the fourth and the seventh stage. In another post, someone suggested that this message means the classifier cannot be improved, but with only 5 stages, it is at least odd.

For training, I´m using numPos=800 while the vec file (60x60 px) contains 1200 positive samples. Moreover, I´m using 1491 negative samples(30x30 px). I´ve made all kinds of changes in the parameters, and none of them worked.

For the last attempt I used the parameters as follows:

cascadeDirName: 15stages
vecFileName: pos.vec    
bgFileName: neg_dir.txt

numPos: 800
numNeg: 1491
numStages: 15

precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024

acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 60
sampleHeight: 60
boostType: GAB
minHitRate: 0.9999
maxFalseAlarmRate: 0.3
weightTrimRate: 0.9
maxDepth: 1
maxWeakCount: 100
mode: ALL
Community
  • 1
  • 1
  • You should post this on another stackexchange website - more ML oriented – Radu Ionescu Mar 18 '16 at 14:24
  • Welcome on Stack Overflow! I edited the formatting of your question to be a bit more readable, it may be helpful to also link that *other post* you've encountered on your search for a solution. – LJᛃ Mar 18 '16 at 14:38
  • What do u mean by "more ML oriented"?!? Sorry, but I´m a bit lost here... – Raphael Santos Mar 21 '16 at 14:03

2 Answers2

0

I had the same problem, after making a big research, I've got the best parameters that should be supplied to the opencv_traincascade.

If you are using a rectangular image, specify -w 24 -h 24, In addition make sure you have more positives than negatives and set -maxFalseAlarmRate 0.5.

That worked for me very well, hope it is useful for you too.

Danaro
  • 61
  • 1
  • 2
  • 11
0

i also have this problem before. but after i reduce the param [maxFalseAlarmRate] ,like set small than 0.1 , it works ok. hope this have some help.

Damon
  • 1
  • 2