OpenCV Multi Core Support

僤鯓⒐⒋嵵緔 提交于 2019-12-04 06:35:54

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.

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!

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).

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