Ask Your Question

FredJiang's profile - activity

2016-05-30 03:00:50 -0500 received badge  Famous Question (source)
2015-06-02 09:41:53 -0500 received badge  Notable Question (source)
2014-08-18 01:45:23 -0500 received badge  Popular Question (source)
2013-07-04 20:36:37 -0500 commented answer Required leaf false alarm rate achieved. Branch training terminated.

I have changed the parameter numStages to 20, but the result is not what I want either. The command and logs are as follows:

command: opencv_traincascade -data haarcascade -vec samples.vec -bg negatives.dat -numPos 10 -numNeg 3000 -numStages 20 -w 20 -h 20 -minHitRate 0.99 -maxFalseAlarmRate 0.5 -mode ALL

logs: maxWeakCount: 100 mode: ALL Stages 0-1 are loaded ===== TRAINING 2-stage ===== <BEGIN POS count : consumed 10 : 17 NEG count : acceptanceRatio 3000 : 1.12322e-06 Required leaf false alarm rate achieved. Branch training terminated.

The frustrating thing is I have not run command opencv_traincascade successfully. Could you give me a runnable example?

2013-05-28 21:30:02 -0500 commented answer Error during training with opencv_traincascade

Thanks for StevenPuttemans's advice. Now I moved my question to http://answers.opencv.org/question/14165/required-leaf-false-alarm-rate-achieved-branch/.

2013-05-28 20:14:52 -0500 asked a question Required leaf false alarm rate achieved. Branch training terminated.

I use these commands:

  1. find ./negatives/ -name '*.jpg' > negatives.dat

  2. opencv_createsamples -img object.png -num 3000 -bg negatives.dat -vec samples.vec -maxxangle 0.3 -maxyangle 0.3 -maxzangle 0.3 -maxidev 100 -bgcolor 0 -bgthresh 0 -w 20 -h 20

  3. opencv_traincascade -data haarcascade -vec samples.vec -bg negatives.dat -numPos 10 -numNeg 3000 -numStages 2 -w 20 -h 20 -minHitRate 0.7 -maxFalseAlarmRate 0.6 -mode ALL

negative images are from http://tutorial-haartraining.googlecode.com/svn/trunk/

object image is image description

the result is

===== TRAINING 1-stage =====

POS count : consumed 10 : 10

NEG count : acceptanceRatio 3000 : 0.000429487

Required leaf false alarm rate achieved. Branch training terminated.

now, I have no idea how to resolve this problem, need help.

answers from stevenputtemans

  1. Next time create your own topic

  2. Try upping your minHitRate and lower the maxFalseAlarmRate, basically values of 0.99 and 0.5 are used.

  3. Try creating negatives without the createsamples tool, the rotation and deviation parameters create unreal samples, which create very bad detector classes.

I follow point 2 and use command "opencv_traincascade -data haarcascade -vec samples.vec -bg negatives.dat -numPos 10 -numNeg 3000 -numStages 2 -w 20 -h 20 -minHitRate 0.99 -maxFalseAlarmRate 0.5 -mode ALL", but the result is "Required leaf false alarm rate achieved. Branch training terminated." too.

As for point 3, without createsamples tool, how should I create sample.vec file?

2013-05-28 01:46:14 -0500 received badge  Editor (source)
2013-05-28 01:38:19 -0500 answered a question Error during training with opencv_traincascade

I have the same problem. I use these commands:

1 find ./negatives/ -name '*.jpg' > negatives.dat

2 opencv_createsamples -img object.png -num 3000 -bg negatives.dat -vec samples.vec -maxxangle 0.3 -maxyangle 0.3 -maxzangle 0.3 -maxidev 100 -bgcolor 0 -bgthresh 0 -w 20 -h 20

3 opencv_traincascade -data haarcascade -vec samples.vec -bg negatives.dat -numPos 10 -numNeg 3000 -numStages 2 -w 20 -h 20 -minHitRate 0.7 -maxFalseAlarmRate 0.6 -mode ALL

negative images are from http://tutorial-haartraining.googlecode.com/svn/trunk/

object image is image description

the result is

===== TRAINING 1-stage =====

POS count : consumed 10 : 10

NEG count : acceptanceRatio 3000 : 0.000429487

Required leaf false alarm rate achieved. Branch training terminated.

now, I have no idea how to resolve this problem, need help too.