Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Parameter -numPos is positive samples count that is used to train each stage in detector cascade. But some already used samples can be filtered by each previous stage (i.e. recognized as background), but no more than (1 - minHitRate) * numPos on each stage. So vec-file has to contain

= (numPos + (numStages-1) * (1 - minHitRate) * numPos) + S, where S is a count of samples from vec-file that can be recognized as background right away.

See this: [http://stackoverflow.com/questions/10863560/haar-training-opencv-assertion-failed]

Hope it helps!

Parameter -numPos is positive samples count that is used to train each stage in detector cascade. But some already used samples can be filtered by each previous stage (i.e. recognized as background), but no more than (1 - minHitRate) * numPos on each stage. So vec-file has to contain

= (numPos + (numStages-1) * (1 - minHitRate) * numPos) + S, where S is a count of samples from vec-file that can be recognized as background right away.

See this: You have to calculate numPos for your training set, an example is given here: [http://stackoverflow.com/questions/10863560/haar-training-opencv-assertion-failed]

Hope it helps!