I found this tutorial on creating your own haar-classifier cascades.
This raised the question with me: what are the advantages, if any, of running HaarTraining, and creating your own classifier (as opposed to using the cascades provided by OpenCv)?
Haar or LBP cascades classifiers are common technique used for detection or rigid objects. So here are two major points for training your own cascade:
Cascades coming with OpenCV do not cover all possible object types. So you can use one of OpenCV cascades if you are going to create a face-detection application but there no ready to use cascades if you need to detect for example dogs.
And cascades from OpenCV are good but they are not the best possible. It is a challenging task but it is possible to train a cascade that will have higher detection rate and produce less false-positives and false-negatives.
And one major remark: haartraining application used in your tutorial is now considered as deprecated by OpenCV team. opencv_traincascade
is a newer version and it has 2 important features: it supports LBP features and it supports multi-threading (TBB). Typical difference looks like this
haartraining + singlecore > 3 weeks for one classifier.
traincascades + multicore < 30 minutes for one classifier.
But the worst of all I don't know any good tutorials explaining usage of opencv_traincascade
. See this thread for details.