Forked from austince/install-opencv3.3.1-ubuntu-16.04.sh
Created
March 31, 2018 05:27
-
-
Save chairco/a3f923f57d736888b9d6b5fe2463453e to your computer and use it in GitHub Desktop.
OpenCV
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
# Open CV 3 | |
sudo apt-get -y install libtiff5-dev | |
sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev | |
sudo apt-get -y install libxine2-dev libv4l-dev | |
sudo apt-get -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev | |
sudo apt-get -y install qt5-default libgtk2.0-dev libtbb-dev | |
sudo apt-get -y install libatlas-base-dev | |
sudo apt-get -y install libfaac-dev libmp3lame-dev libtheora-dev | |
sudo apt-get -y install libvorbis-dev libxvidcore-dev | |
sudo apt-get -y install libopencore-amrnb-dev libopencore-amrwb-dev | |
sudo apt-get -y install x264 v4l-utils | |
sudo apt-get install -y gcc-5 g++-5 | |
## Optional | |
sudo apt-get -y install libprotobuf-dev protobuf-compiler | |
sudo apt-get -y install libgoogle-glog-dev libgflags-dev | |
sudo apt-get -y install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen | |
# download opencv-3.3.1 | |
wget https://github.com/opencv/opencv/archive/3.3.1.zip -O opencv-3.3.1.zip | |
unzip opencv-3.3.1.zip | |
# download opencv_corntib-3.3.1 | |
wget https://github.com/opencv/opencv_contrib/archive/3.3.1.zip -O opencv_contrib-3.3.1.zip | |
unzip opencv_contrib-3.3.1.zip | |
cd opencv-3.3.1 | |
mkdir release | |
cd release | |
# compile and install | |
export CC=/usr/bin/gcc-5 | |
export CXX=/usr/bin/g++-5 | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D INSTALL_C_EXAMPLES=ON \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D WITH_TBB=ON \ | |
-D WITH_V4L=ON \ | |
-D WITH_QT=ON \ | |
-D WITH_OPENGL=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.3.1/modules \ | |
-D BUILD_EXAMPLES=ON .. | |
# Build with half of your cores, still can use computer | |
make "-j$(expr `nproc` / 2 )" | |
# Build with all cores, probablity can't use your computer... | |
# make "-j$(nproc)" | |
sudo make install | |
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf' | |
sudo ldconfig | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment