Ask Your Question

Revision history [back]

If your OpenCV version was compiled with TBB, then the answer is no way, I suppose. Because in that case, there is some where in the compiled code, the task_scheduler_init initialized the number of threads based on your hardware configuration (it is usually with more than 1 core) and due to the information from this link, other calls will be ignored, this means you can not change that number. In case your OpenCV was compiled with OpenMP, the code below may be a try:

int num_threads = 1;