Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I build OpenCV with TBB?

Tags:

opencv

tbb

I'm trying and failing to make opencv_traincascade use multiple threads. The only documentation I can find says to "build OpenCV with TBB". I'm not sure if I'm failing to successfully build OpenCV with TBB, or whether there's some flag I need to set for opencv_traincascade.

I've downloaded the OpenCV version 2.3.1 windows superpack and tbb40_20111003oss_win.zip, which I extracted to C:\tbb40_20111003oss. I then generated VC8 .sln and .proj files using CMake, setting

WITH_TBB: ON

TBB_INCLUDE_DIR:PATH=C:\tbb40_20111003oss\include

TBB_LIB_DIR:PATH=C:/tbb40_20111003oss/lib/intel64/vc8

OpenCV then builds without errors, but when I run opencv_traincascade it's singlethreaded. Does anyone know what I'm doing wrong?

like image 386
theotherphil Avatar asked Nov 03 '11 11:11

theotherphil


People also ask

What is TBB in OpenCV?

Threading Building Blocks (TBB) is a C++ template library developed by Intel for writing software programs that take advantage of multi-core processors. OpenCV has a provided a simple API to take advantage of TBB.


1 Answers

For linux, do:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON BUILD_TBB=ON ..
like image 81
ozgeneral Avatar answered Oct 12 '22 21:10

ozgeneral