OpenCV Multi Core Support

霸气de小男生 提交于 2019-12-21 12:58:25

问题


I was wondering if there is multi core support for the OpenCV library. I am experimenting with Haar cascading and it's pretty slow on my Raspberry 2 which would have four cores, but my application is currently running only on a single one.

Any ideas?


回答1:


CascadedDetect has multi core support.

Recompile OpenCV with the WITH_TBB or WITH_OPENMP (or any other threading framework supported by OpenCV) flag on to enable it.




回答2:


I've had a brief look at the class CascadeClassifier in modules\objdetect\src\cascadedetect.cpp, and there seems to be a reasonable amount of implementation done with parallel_for_, the built-in OpenCV multithreading facility.

Your mileage may vary, though. At least for the training phase there seems to be a lot of sequential code, as this thread in the OpenCV support forums suggests.

So if you can get OpenCV to compile with OpenMP (might be easiest to set up), TBB, or similar, you should be good to go.

Hope that helps!




回答3:


Recently I had found a Simd Library, which has an implementation of HAAR and LBP cascade classifiers. It can use standard HAAR and LBP casscades from OpenCV. This implementation has SIMD optimizations with using of SSE4.1, AVX2 and NEON(ARM).

I haven't checked it for Raspberry 2, but I have checked it for Raspberry 3 (it works in ~2 times faster than original OpenCV implementation).



来源:https://stackoverflow.com/questions/28938644/opencv-multi-core-support

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