ubuntu 14.04 编译opencv + python
作者:
jjkke88 | 来源:发表于
2017-03-23 14:31 被阅读0次
编译opencv与python
- 从github上下载opencv对应版本代码, 假设位于/home/opencv
<pre>
cd /home/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
make -j8
sudo make install
</pre>
- 到这一步为止,opencv的python库被安装在/usr/lib/python2.7/dist-packgages
在virtualenv中使用cv2
- 将/usr/local/lib/python2.7/site-packages中的cv2.so和cv.py复制到对应的virtualenv的python目录的sites-packages中
<pre>
cp /usr/loal/lib/python2.7/site-packages/cv2.so ~/tensorflow0.12/lib/python2.7/site-packages
cp /usr/lib/python2.7/dist-packages/cv.py ~/tensorflow0.12/lib/python2.7/site-packages
</pre>
本文标题:ubuntu 14.04 编译opencv + python
本文链接:https://www.haomeiwen.com/subject/dzwznttx.html
网友评论