问题
I am using OpenCv 2.4.10
.
I have recently tried to create my own cascade classifier to detect robotino; I have 240 negative samples and 650 positive samples. But I am getting confused in the values I should give to the opencv_traincascade
.
numNeg
: states the number of negative samples used in each stage. How should I calculate this parameter?numStage
: How should I tell the number of stages wanted ?
回答1:
A few points to consider:
numNeg
can be all the negative samples you have, howevernumPos
will have to be slightly less than all the positives you have (maybe have a quick read about how the classifier is being trained). The exact number will depend on how many samples you have and the stages you train however you can start with maybe0.9 * numPos
and work down. It will fail if it runs out of samples.You'll have to evaluate the performance of various stages trained. Keep in mind more stages doesn't always lead to better performance due to overfitting.
You might also want more samples both positive and negative; generic negative sets can be found online with a bit of looking. It is a bit fiddly to get working well but stick with it!
来源:https://stackoverflow.com/questions/36352206/what-are-the-recommended-parameters-for-opencv-traincascade