centos7下java使用opencv

按照编译依赖
yum -y install epel-release
yum install gcc gcc-c++  
yum install cmake 
yum install python-devel numpy 
yum install ffmpeg-devel
yum install -y unzip zip
下载opencv 并解压
unzip opencv-3.4.7.zip 
cd  opencv-3.4.7
mkdir build
cd build/
编译
cmake -D WITH_TBB=ON -D WITH_EIGEN=ON ..    
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 
make 
make install 
编译opencv的java版本
yum install ant
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTS=OFF ..
make -j8
make install
使用

此时可以找到 /data/software/opencv-3.4.7/build/lib/libopencv_java347.so

推荐阅读更多精彩内容