Turn on/off multithreading?
I just noticed that GridAdaptedFeatureDetector::detectImpl (in modules/features2d/src/detectors.cpp) uses cv::parallel_for_ in its implementation. I'm assuming that means that it uses multithreading to speed up the feature detection process. My question is: is there a way I can force this to run in serial? The motivation to turn off multithreading is to do performance testing, to see how my code runs faster or slower, serially, based on different code changes. Is there a compile flag or function call I need to do?
it's all done in the cmake stage, when building the libs. if you don't enable anything (like openmp or similar) there, it will run single-threaded anyway.
How about if I didn't compile OpenCV from source?
see setNumThreads()