Low priority job in OpenCV

249 views Asked by At

I am trying to call feature detectors from OpenCV in my C++ application written in Visual Studio. I would like to run this operation in the background and do not care about its timing. Actually, I prefer if it is not interfering with the main performance of the application. To this end, I perform the feature detection in a separate thread and tried to lower the priority of the thread with the command SetThreadPriority(). This is however not working, and while the OpenCV function is running, all the CPU cores are maxed out. Is there any way to control the priority of the tasks in OpenCV or even limit the CPU cores involved in its process?

1

There are 1 answers

0
Abtin Rasoulian On BEST ANSWER

Although I didn't find any way to reduce the priority of an OpenCV job, I could reduce the CPU usage by using setNumThreads(int numThreads).