Ask Your Question

A way to ensure Canny runs in serial?

asked 2014-11-19 14:56:23 -0500

updated 2020-10-24 13:59:24 -0500

If I'm running version 2.4.9 on a Mac as part of a C++ project, is there a way to ensure the Canny function runs in serial, for benchmarking purposes?

I've looked around on this, and from what I've seen so far, it looks like you'd need to specifically make/build OpenCV such that no parallel libraries (like OpenMP or TBB) are used.

But I (a) want to make sure that's a correct understanding, and (b) want to make sure there isn't an easier way.

Thanks for any help!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-11-22 09:38:16 -0500


Indeed, you have to make sure you build OpenCV without TEGRA_OPTIMIZATION or IPP (you have to install such library so by default, this is not enabled). Then, you have to disable opencl using cv::ocl::setUseOpenCL(false) to prevent OpenCV to use your graphic card.

After a brief investigation of the source code (2.4.9), it seems Canny (as well as Sobel) was not optimized using TTB... It should then run using only one processor. Please tell us if it's not the case!

edit flag offensive delete link more

Question Tools


Asked: 2014-11-19 14:56:23 -0500

Seen: 209 times

Last updated: Nov 22 '14