Last active
August 29, 2015 14:24
-
-
Save mtngld/028fe995c31fda56b0c7 to your computer and use it in GitHub Desktop.
OpenCV 3.0.0 Installation on Ubuntu
This file contains 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
sudo apt-get update && sudo apt-get -y upgrade | |
sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove | |
sudo apt-get install checkinstall | |
# build developer tools. Some of these are probably non-pertinent | |
sudo apt-get install -y git-core curl zlib1g-dev build-essential \ | |
libssl-dev libreadline-dev libyaml-dev libsqlite3-dev \ | |
libxml2-dev libxslt1-dev libcurl4-openssl-dev \ | |
python-software-properties | |
# numpy is a dependency for OpenCV, so most of these other | |
# packages are probably optional | |
sudo apt-get install -y python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose | |
## Other scientific libraries (obviously not needed for OpenCV) | |
pip install -U scikit-learn | |
pip install -U nltk | |
### opencv from source | |
# first, installing some utilities | |
sudo apt-get install -y qt-sdk unzip | |
export OPENCV_VER=3.0.0 | |
curl "http://fossies.org/linux/misc/opencv-${OPENCV_VER}.zip" -o opencv-${OPENCV_VER}.zip | |
unzip "opencv-${OPENCV_VER}.zip" && cd "opencv-${OPENCV_VER}" | |
mkdir build && cd build | |
# build without ffmpeg | |
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON \ | |
-D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON \ | |
-D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON \ | |
-D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON \ | |
-D WITH_FFMPEG=OFF .. | |
make -j2 | |
sudo checkinstall | |
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' | |
sudo ldconfig | |
echo "OpenCV" ${OPENCV_VER} "ready to be used" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment