如何在Ubuntu(或者通常在
Linux中)安装OpenCV(正好2.3.*,而不是2.1.*)?我已经看到Windows上安装的手册很少,但对于Linux来说没有.
@H_403_1@我已经阅读并使用了
instructions from willow garage site:
wget downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2 tar -xvf OpenCV-2.3.1a.tar.bz2 cd OpenCV-2.3.1/ mkdir release cd release cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=OFF -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON .. make sudo make install
所有似乎都可以,除了make install输出没有提到python.@H_403_1@之后,我试图在python REPL中导入opencv模块:
~$python Python 2.6.6 (r266:84292,Sep 15 2010,15:52:39) [GCC 4.4.5] on linux2 Type "help","copyright","credits" or "license" for more information. >>> import numpy # so numpy is installed >>> import cv Traceback (most recent call last): File "<stdin>",line 1,in <module> ImportError: No module named cv >>> import cv2 Traceback (most recent call last): File "<stdin>",in <module> ImportError: No module named cv2
我究竟做错了什么?
你安装了Python开发头吗?
原文链接:https://www.f2er.com/ubuntu/348876.htmlsudo apt-get install python-dev
重新编译与安装的那些.