Support for Open Core Multi Core

I was wondering if there is kernel support for OpenCV. I am experimenting with the Haar cascade, and it is pretty slow on my raspberry 2, which will have four cores, but my application currently only works on one.

Any ideas?

+5
source share
3 answers

CascadedDetect supports multi-core support.

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

+4
source

I briefly looked at the CascadeClassifier class in modules\objdetect\src\cascadedetect.cpp , and there seems to be a reasonable implementation made using parallel_for_ , the built-in multithreading tool OpenCV.

However, your mileage may vary. At least during the training phase, there seems to be a lot of consistent code, as this thread offers on OpenCV support forums.

So, if you can get OpenCV to compile using OpenMP (maybe the easiest way to configure it), TBB or similar, you should be good to go.

Hope this helps!

+1
source

I recently found a Simd Library in which the implementation of HAAR and LBP cascade classifiers. It can use standard HAAR and LBP cascades from OpenCV. This implementation has SIMD optimization using SSE4.1, AVX2, and NEON (ARM).

I did not test it for raspberries 2, but I checked it for raspberries 3 (it works ~ 2 times faster than the original OpenCV implementation).

+1
source

Source: https://habr.com/ru/post/1214963/


All Articles