标签:
1/
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev libdc1394 2.x libjpeg-dev libpng-dev libtiff-dev libjasper-dev
其中“libdc1394 2.x”要先search下
2/
sudo apt-get update
sudo apt-get upgrade
3/
unzip opencv-2.4.10 -d ~/mySof
4/
cd ~/opencv-2.4.10
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ~/mySof/opencv-2.4.10
5/
make
sudo make install
在make过程中如果出现类似以下问题:
[ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function ‘(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)‘: /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an ‘asm‘ make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
可以参照网址中的办法,在system.cpp中进行删改:
https://github.com/Itseez/opencv/commit/ea50be0529c248961e1b66293f8a9e4b807294a6
6/
配置openCV参数设置
在/etc/ld.so.conf.d/opencv.conf文件中加入一行:/usr/local/lib ,
可能会没有opencv.conf这个文件,那我们就自己创建一个:
sudo gedit/etc/ld.so.conf.d/opencv.conf
7/
sudo ldconfig
8/
在 /etc/ bash.bashrc(sudo gedit/etc /bash.bashrc以root进入才能修改)中加入:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
标签:
原文地址:http://www.cnblogs.com/lulu147/p/4557240.html