简体   繁体   中英

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 detect one object that differs depending on the angle of the object. So I separated my training samples to train multiple classifiers. They work OK for their classes. Right now I run them sequentially which is costing me a lot of calculation time.

I figured that OpenCV is probably calculating all the features every time thus iterating newly every time. I thought, if I could combine my classifiers by an OR operation, then OpenCV might be able to just use one cascade thus only iterating once and only calculating the needed features once and so on. This might increase my performance dramatically. However I am not sure if (and how) this could be done. Maybe someone else has tried something similar before?

Cheers! -- artur

我将每个人作为一个单独的并行任务运行。

我不是等待所有人,而是通过举办活动来处理每个人。

Well, when you train a specific classifier, AdaBoost algorithm (at every stage) picks different features to minimize training error. That procedure is done for every stage of an cascade.

Unfortunately for every object those features are not the same (different size although you have fixed number of feature shapes), thus a feature space is not the same either. So even that there is a way to combine those classifiers, the benefit would be marginal because you probably do not have the same features for different objects so you would need evaluate almost every feature again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM