[Python] How to limit the number of threads that opencv uses in Python?

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    I am designing a program which will run continuously on a ROC64. It includes the usage of BackgroudsubtractorMOG2 (a background-subtracting algorithm implemented in opencv). Opencv seems to use multithreading optimization in this algorithm and it eats up all the CPU resources. I understand that in C++ we can limit the number of threads by using setNumThreads(). Is there a similar thing in Python or I must find another way to work around it?

    Continue reading...

Compartilhe esta Página