Last active
February 18, 2017 17:11
-
-
Save adgon92/cc81e731a379afd3fc1745c102955a25 to your computer and use it in GitHub Desktop.
OpenCV 3.1 installation on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# KEEP UBUNTU OR DEBIAN UP TO DATE | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y dist-upgrade | |
sudo apt-get -y autoremove | |
#INSTALL THE DEPENDENCIES | |
# Build tools: | |
sudo apt-get install -y build-essential cmake | |
# GUI: | |
sudo apt-get install -y qt5-default libvtk6-dev libgtk2.0-dev | |
# Media I/O: | |
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev | |
# Video I/O: | |
sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev | |
# Parallelism and linear algebra libraries: | |
sudo apt-get install -y libtbb-dev libeigen3-dev | |
# Optimize various functions inside OpenCV, such as matrix operations | |
sudo apt-get install libatlas-base-dev gfortran | |
# Python: | |
sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpy | |
# Java: | |
sudo apt-get install -y ant default-jdk | |
# Documentation: | |
sudo apt-get install -y doxygen | |
# CLONE REPOS | |
cd ~/gitrepos | |
git clone [email protected]:opencv/opencv.git | |
cd opencv | |
git checkout 3.1.0 | |
git clone [email protected]:opencv/opencv_contrib.git | |
cd opencv_contrib | |
git checkout 3.1.0 | |
# INSTALL THE LIBRARY | |
cd ~/gitrepos/opencv | |
rm -rf build/ | |
mkdir build | |
cd build | |
cmake \ | |
-D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D INSTALL_C_EXAMPLES=OFF \ | |
-D BUILD_DOCS=ON \ | |
-D PYTHON_INCLUDE_DIR=/usr/include/python3.5 \ | |
-D PYTHON_INCLUDE_DIR2=/usr/include/x86_64-linux-gnu/python3.5m/ \ | |
-D PYTHON_EXECUTABLE=/home/adam/VEnvs/cv/bin/python \ | |
-D OPENCV_EXTRA_MODULES_PATH=/home/adam/gitrepos/opencv_contrib/modules \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D WITH_QT=ON \ | |
-D WITH_OPENGL=ON \ | |
-D FORCE_VTK=ON \ | |
-D WITH_TBB=ON \ | |
-D WITH_GDAL=ON \ | |
-D WITH_XINE=ON \ | |
-D BUILD_EXAMPLES=ON \ | |
-D BUILD_opencv_java=OFF \ | |
.. | |
make -j7 | |
sudo make install | |
sudo ldconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case of not detected hdf5.h file:
Append
find_package(HDF5)
include_directories(${HDF5_INCLUDE_DIRS})
to modules/python/common.cmake