Ask Your Question

Revision history [back]

c++, calling opencv from multiple threads

Hi,

i have a highly parallel problem: run solvePnP() on several thousand independent input datasets.

Using a single c++ pthread to call the lib is only using a small part of the CPU cores available. IPP / TBB / whatever else opencv uses seem to be limited in the number of CPU cores used per dataset for this problem and input datasets.

Using #CPU pthreads is faster overall, but also hits a limit at around 3 threads: something in the lib seems to lock a global critical section.

Is it possible to get around this critical section without running multiple processes? Which compile time options are relevant here?

I'm currently using the OpenCV 3.4.1 Windows Pack, but i'm flexible.

Thanks