CentOS7.4 部署opencv3.4.1环境

安装依赖

[root@VM-0-143-centos data1]# yum install cmake gcc gcc-c++ gtk+-devel ant java-11-openjdk
[root@VM-0-143-centos data1]# yum groupinstall "Development Tools"

编译安装

[root@VM-0-143-centos data1]# unzip opencv-3.4.1.zip  
[root@VM-0-143-centos data1]# cd opencv-3.4.1/
[root@VM-0-143-centos opencv-3.4.1]# mkdir build
[root@VM-0-143-centos opencv-3.4.1]# cd build/
[root@VM-0-143-centos build]# cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTS=OFF ..
[root@VM-0-143-centos build]# make -j8
[root@VM-0-143-centos build]# make install

检查确认

[root@VM-0-143-centos build]# ls lib/|grep java
libopencv_java341.so
[root@VM-0-143-centos build]# ls bin/|grep jar
opencv-341.jar

环境变量

[root@VM-0-143-centos build]# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig/
[root@VM-0-143-centos build]# echo '/usr/local/lib64/' >> /etc/ld.so.conf.d/opencv.conf
[root@VM-0-143-centos build]# ldconfig

测试效果

点击数:52