Last active
May 3, 2017 08:44
-
-
Save nitheeshas/2e2b607a87ab5c2142cec94811579613 to your computer and use it in GitHub Desktop.
Install OpenCV 3.x. Contains only main points. Cannot be run as a setup script.
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
sudo apt-get install build-essential cmake git pkg-config libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran python2.7-dev | |
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python get-pip.py | |
sudo pip install virtualenv virtualenvwrapper | |
## Save to bashrc | |
# virtualenv and virtualenvwrapper | |
export WORKON_HOME=$HOME/.virtualenvs | |
source /usr/local/bin/virtualenvwrapper.sh | |
source ~/.bashrc | |
pip install numpy | |
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 -j8 | |
sudo make install | |
sudo ldconfig | |
cd ~/.virtualenvs/cv/lib/python2.7/site-packages/ | |
ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment