What are the recommended parameters for opencv_traincascade?

筅森魡賤 提交于 2019-12-25 06:32:54

问题


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, however numPos 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 maybe 0.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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!