在线安装opencv
##OpenCv安装脚本
#OpenCV.sh
echo "安装gcc和c++编译器"
yum install gcc gcc-c++
echo "安装cmake"
yum yum install cmake*
echo "gtk+2.10.1.tar.bz2的安装"
yum install gtk2-devel
echo "安装ant"
yum install ant
echo "查询系统基础命令是否安装 如wget"
check_wget_results=`rpm -qa wget`
if [ "$check_wget_results" = "" ];then
echo "您的系统中没有wget,首先安装wget"
echo "现在开始安装wget"
yum -y install wget
else
echo "wget已经安装 版本为 $check_wget_results"
fi
echo "yum源存储在/usr/local/ 目录下"
#mkdir -p /usr/local/opencv_make
#将opencv发那个如此目录下
cd /usr/local/opencv_make
mkdir release
echo "解压OpenCV源码"
#在线下载
#wget https://github.com/opencv/opencv/archive/3.4.3.tar.gz
#离线使用
tar -zvxf opencv-3.4.1.tar.gz
cd opencv-3.4.1
mkdir build
cd build
echo "进行CMake"
yum -y install cmake gcc gcc-c++ gtk+-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 build-essential ant
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv_make/release -DBUILD_TESTS=OFF ..
make -j8
make
cd /usr/local/opencv_make/opencv-3.4.1/build/lib
echo "下面是你想要的文件了"
ll
脚本下载地址:https://download.csdn.net/download/qq_37296212/13200065
win:opencv3.1.4下载地址https://download.csdn.net/download/qq_37296212/13200074
linux:opencv3.1.4-zip下载地址https://download.csdn.net/download/qq_37296212/13200102