Ask Your Question

Revision history [back]

These problems are generated by using the old haartraining. The newer cascade training doesn't have this problematic need of a lower positive number than actually given to the algorithm in your input vector. http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html?highlight=train%20cascade

Basicly the creator of the haartrainingalgorithm posted this function for calculating the correct amount of numPos.

vec-file has to contain >= (numPos) + (numStages-1)(1-minHitRate)numPos- + S where S is the number of samples that can be directly as background :)

However, I find it confusing to use this formula.

Going to the traincascade algorithm, just use the amount of images in your vec file as numPos and define numNeg as large as possible. This just takes randomn samples of your negative image set. The better you model the background, the better your detection results will be.