Fork me on GitHub

centos6安装opencv2

环境

centos6.5

opencv2.4

python2.6(centos自带的)

下载

opencv可从GitHub下载https://github.com/opencv/opencv/tree/2.4可自行选择版本

 

安装opencv

安装依赖包
yum install cmake gcc-c++ git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
yum install ant -y(如果安装目录下需要java,则需要安装ant依赖)

unzip opencv-2.4.zip
cd opencv-2.4
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/opt/opencv ..

make

make install

对应的jar包和库文件全部都有了,jar包和windows下面的jar包是通用的,只需要将 libopencv_java2413.so 拷贝到linux系统下的java.library.path下面去即可

export $LD_LIBRARY_PATH可以查看java.library.path的位置

或在环境变量中添加

LD_LIBRARY_PATH=/usr/local/tradeapi/os

export LD_LIBRARY_PATH

 

posted @ 2018-10-31 23:27  时间行人  阅读(758)  评论(0编辑  收藏  举报