Combining multiple Haar classifiers with OpenCV

I was wandering if there is a way to combine Haar classifiers from different trained cascades? I have a scenario where I am detecting one object that differs depending on the angle of the object. Therefore, I have separated my training samples to train multiple classifiers. They work fine for their activities. Right now I'm running them sequentially, which is costing me a lot.

I realized that OpenCV is probably calculating all the functions every time, repeating every time every time. I thought that if I could combine my classifiers using the OR operation, then OpenCV could just use one cascade, thus only once and only calculating the required functions once, etc. This can greatly increase my productivity. However, I'm not sure what (and how) this can be done. Maybe someone else has tried something similar before?

Hooray! - artur

+3


source to share


3 answers


I am running each of them as a separate parallel task.



0


source


I am not expecting everyone except to handle each one as they end up raising an event.



0


source


Well, when you train a specific classifier, the AdaBoost algorithm (at each step) chooses different features to minimize the training error. This procedure is performed for each stage of the cascade.

Unfortunately, for each object, these functions are not the same (different sizes, although you have a fixed number of function forms), so the function space is not the same either. Thus, even if there is a way to combine these classifiers, the benefit will be negligible, because you probably don't have the same functions for different objects, so you will need to evaluate almost every function again.

0


source







All Articles