Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>this issue was answered by creater of the utility on the OpenCV DevZone site <a href="http://code.opencv.org/issues/1834" rel="nofollow noreferrer">in June 2012.</a></p> <p>To quote Maria:</p> <blockquote> <p>The problem is that your vec-file has exactly the same samples count that you passed in command line -numPos 979. Training application used all samples from the vec-file to train 0-stage and it can not get new positive samples for the next stage training because vec-file is over. The bug of traincascade is that it had assert() in such cases, but it has to throw an exception with error message for a user. It was fixed in r8913. -numPose is a samples count that is used to train each stage. Some already used samples can be filtered by each previous stage (ie recognized as background), but no more than (1 - minHitRate) * numPose on each stage. So vec-file has to contain >= (numPose + (numStages-1) * (1 - minHitRate) * numPose) + S, where S is a count of samples from vec-file that can be recognized as background right away. I hope it can help you to create vec-file of correct size and chose right numPos value.</p> </blockquote> <p>It worked for me. I also had same problem, I was following the <a href="http://note.sonots.com/SciSoftware/haartraining.html" rel="nofollow noreferrer">famous tutorial on HAAR training</a> but wanted to try the newer training utility with -npos 7000 -nneg 2973</p> <p>so i did following calcs:</p> <p>vec-file has to contain >= (numPos + (numStages-1) * (1 - minHitRate) * numPos) + S</p> <blockquote> <p>7000 >= (numPos + (20-1) * (1 - 0.999) * numPos) + 2973</p> <p>(7000 - 2973)/(1 + 19*0.001) >= numPos</p> <p>numPos &lt;= 4027/1.019</p> <p>numPos &lt;= 3951 ~~ 3950</p> </blockquote> <p>and used:</p> <blockquote> <p>-npos 3950 -nneg 2973</p> </blockquote> <p>It works. I also noticed that others have also had success with reducing numPos : <a href="https://stackoverflow.com/a/12271213/1201501">here</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload