如何使用TBB构建OpenCV? [英] How do I build OpenCV with TBB?

查看:471
本文介绍了如何使用TBB构建OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试并且未能使opencv_traincascade使用多个线程.我能找到的唯一文档说用TBB构建OpenCV".我不确定是否无法使用TBB成功构建OpenCV,或者是否需要为opencv_traincascade设置一些标志.

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.

我已经下载了OpenCV版本2.3.1 Windows superpack和tbb40_20111003oss_win.zip,并将其解压缩到C:\tbb40_20111003oss.然后,我使用CMake设置

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生成时没有错误,但是当我运行opencv_traincascade时,它是单线程的.有人知道我在做什么错吗?

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

推荐答案

如果您使用的是Mac,则可以使用自制软件进行此操作:

If you are on Mac you can do this with homebrew:

brew tap homebrew/science
brew install opencv --with-tbb

或者如果您已经安装了自制软件:

Or if you have already installed with homebrew:

brew uninstall opencv
brew install opencv --with-tbb

此外,info命令还会告诉您有关您可能感兴趣的其他标志的信息,例如--with-java

Also, the info command tells you about other flags you might be interested in, e.g. --with-java

brew info opencv 

这篇关于如何使用TBB构建OpenCV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆