Skip to content

Instantly share code, notes, and snippets.

@iamgroot42
Last active October 18, 2018 22:59
Show Gist options
  • Save iamgroot42/2e3c071a2a9d158491dfd0beb4fc107f to your computer and use it in GitHub Desktop.
Save iamgroot42/2e3c071a2a9d158491dfd0beb4fc107f to your computer and use it in GitHub Desktop.
Download and install openCV 3.0 on Ubuntu 14.04 for Python 2 (no virtualenv) Raw
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get install -y build-essential cmake git pkg-config
sudo apt-get install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install -y libatlas-base-dev gfortran
sudo apt-get install -y python-pip
sudo pip install numpy
cd ~
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.0.0
cd ~
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib
git checkout 3.0.0
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
make -j4
sudo make install
sudo ldconfig
python -c "import cv2; print cv2.__version__"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment