opencv3 ubuntu安装脚本


3.0安装脚本下载地址:

https://github.com/cmayet/docker_python2.7_opencv3.0.0

#!/bin/bash

apt-get update
apt-get install -y --no-install-recommends apt-utils
apt-get install -y --no-install-recommends python python-pip \
libpython2.7 \
build-essential \
gfortran \
libatlas-base-dev \
python-dev \
python2.7-dev \
python-tk \
cmake pkg-config \
libjpeg8-dev \
libtiff5-dev \
libjasper-dev \
libpng12-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libv4l-dev wget \
unzip

pip install --upgrade pip
pip install numpy

wget --no-check-certificate https://codeload.github.com/opencv/opencv/zip/3.0.0
unzip 3.0.0 && rm -rf 3.0.0
cd opencv-3.0.0&& mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE ..
make -j 4
make install

apt-get remove --purge -y gfortran build-essential cmake python-pip
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives

3.1安装地址:

代码地址:https://github.com/willGuimont/Install-OpenCV-3-linux

下面是3.1脚本,另存为sh文件,执行即可

sudo apt-get --assume-yes update
sudo apt-get --assume-yes upgrade
# raspberry pi
sudo rpi-update
 
sudo apt-get --assume-yes install build-essential git cmake pkg-config
sudo apt-get --assume-yes install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get --assume-yes install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get --assume-yes install libgtk2.0-dev
sudo apt-get --assume-yes install libatlas-base-dev gfortran
cd~
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.1.0
 
cd~
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib
git checkout 3.1.0
 
sudo --assume-yes apt-get install python2.7-dev python-pip
sudo --assume-yes apt-get install python3-dev python3-pip
 
 
sudo pip3 install numpy
sudo pip install numpy
# raspberry pi
sudo pip-3.2 install numpy
 
cd~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
 
make -j4
 
sudo make install
sudo ldconfig
 
echo -e"\e[91mIF ERROR"
echo -e"change include to : #include\"/usr/include/hdf5/serial/hdf5.h\"\n"
echo -e "in /opencv_contrib-3.1.0/modules/hdf/include/opencv2/hdf/hdf5.hpp"


这个是3.x安装脚本,分两步执行,感兴趣的可以下载。

https://github.com/ThibaudKieffer/installation-shellscript-opencv-3.x-for-linux-mint-and-ubuntu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值