Search code examples
opencvobject-detectioncascade-classifier

How to train tree of stages classifiers instead of cascade in OpenCV for face detection?


I found in haarcascade_frontalface_alt_tree xml as the xml file is trained with train tree of stages classifiers instead of cascade. I am wondering how to train for tree of stages classifier in OpenCV, which api to use and any example available for that. I searched and no proper information is found so far. Thanks


Solution

  • The opencv documentation is pretty clear about cascade training with weak tree possible tunings. "opencv_traincascade" is the API training function. "Boosted classifer parameters" is what your are looking for, especially "max_depth_of_weak_tree" and "max_weak_tree_count".