支付宝赞助帐号:service@kuitao8.com 

centos7安装opencv 4.0.1的方法【原创请勿转载】

Created2019-05-16   Views 1177    Author 懒人程序

第一步

yum install epel-release git gcc gcc-c++ cmake3 qt5-qtbase-devel python python-devel python-pip cmake
yum install python-devel numpy python34-numpy gtk2-devel libpng-devel jasper-devel openexr-devel libwebp-devel
yum install libjpeg-turbo-devel libtiff-devel  libdc1394-devel tbb-devel eigen3-devel gstreamer-plugins-base-devel
yum install freeglut-devel mesa-libGL mesa-libGL-devel  boost boost-thread boost-devel libv4l-devel

第二步

mkdir ~/opencv_build && cd ~/opencv_build
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git

第三步

cd ~/opencv_build/opencv && mkdir build && cd build

第四步

cmake3 -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_C_EXAMPLES=ON \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_GENERATE_PKGCONFIG=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
    -D BUILD_EXAMPLES=ON ..

第五步

make -j8

第六步

make install

第七步

ln -s /usr/local/lib64/pkgconfig/opencv4.pc /usr/share/pkgconfig/

第八步

pkg-config --modversion opencv4
#Output
4.0.1
上一篇: 系统基线-CentOS Linux 7安全基线检查
下一篇:没有了
支持键盘 ← →

邮件订阅

订阅我们的精彩内容