Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If I want OpenCV to use all the cores in my computer, do I have to compile it myself or can I do this with apt-get?

I've been using OpenCV on the Raspberry Pi 2 (4 cores). I installed it with apt-get, yet whenever I use OpenCV via Python it only ever uses 25% of my CPU potential (1 core). Is there a way to install OpenCV via apt-get that allows me to utilise threading in the library methods or will I have to compile it myself as apt-get is unable to do this? I get the impression that this isn't occurring because even when I call OpenCV methods like haar cascade, the CPU load never goes beyond utilising a single core.

I understand that Python has the GIL, but I'm I'm I'm curious about whether the methods that I'm calling from OpenCV will be utilising all 4 cores of my machine, even if I haven't compiled it myself with the multithreading flag (as I've installed it with apt-get).