Ubuntu 安装 OpenCV3.0, 遇到的问题集合 (Problems encountered in installing OpenCV3.0 on Ubuntu)

Ubuntu 安装 OpenCV3.0, 遇到的问题集合 (Problems encountered in installing OpenCV3.0 on Ubuntu)

(因为程序需要使用OpenCV3.0中的接口,比如cv2.linearPolar,所以需要安装opencv3.0或以上)

安装过程基本按照 OpenCV g官网的步骤来。但要注意考虑是否移除旧版本OpenCV。

另外,安装过程中,如果碰到类似 linking cxx shared library  libopencv_core.so”  这种的问题,首先考虑移除旧版本,然后删除已编译的旧的文件,而后再make。


Problem 1: ippicv, invalid MD5 hash. 参考:http://blog.csdn.net/u013915633/article/details/49886465

注:如果cmake过程中提示:ippicv_linux_20141027.tgz的hash码不对,则将下载的ippicv_linux_20141027.tgz手动复制到 opencv-3.0.0-beta/3rdparty/ippicv/downloads/linux-8b449a536a2157bcad08a2b9f266828b文件夹中,重新cmake即可。

Problem 2: nvcc fatal unsupported gpu architecture

Then, you need to add this "-D CUDA_GENERATION=Kepler" to your cmake configuration. Kepler is a GPU type, generally, you can use another option : Auto for convenience.

Finally, with the compilation of GPU, you may encounter other problems and it takes a lot of time to compile. So, if speed isn't that required, or, GPU acceleration is not highly required, you can avoid several possible problems and save some minutes with following cmake argument:

-D WITH_CUDA=OFF

If you want to use the compiled cv2.so in python, then:

"在release目录下寻找lib目录里的cv2.so,这个是python需要的,将其拷贝到python的库目录里。一般情况下是在“/usr/local/lib/python2.7/dist-packages”里"。reference: http://my.oschina.net/drjones/blog/521664


cd ~/opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CUDA_GENERATION=Kepler  -D WITH_CUDA=OFF -D CMAKE_INSTALL_PREFIX=/usr/local ..
 
 
make
sudo make install




猜你喜欢

转载自blog.csdn.net/yangyangyang20092010/article/details/51722142