1. 程式人生 > >centos7 安裝opencv2.4.13

centos7 安裝opencv2.4.13

進入root管理員模式下:

1.安裝依賴包

yum -y install gcc gcc-c++ gtk2-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm

2.cmake安裝參考:http://blog.csdn.net/sz76211822/article/details/74729272

3.官網下載opencv2.4.13.zip到usr/local
cd /usr/local
unzip opencv-2.4.13.zip
cd opencv-2.4.13/
cmake CMakeLists.txt 
make
make install
cp /usr/local/opencv-2.4.13/unix-install/opencv.pc /usr/lib64/pkgconfig/
gedit /etc/ld.so.conf.d/opencv.conf

4.建立並編輯該檔案。填入
/usr/local/lib
儲存關閉

ldconfig
gedit /etc/bash.bashrc

在檔案後新增:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 


export PKG_CONFIG_PATH
儲存關閉

重啟終端