Last active
June 22, 2023 05:51
-
-
Save eungbean/0880de7604472219c7e3f6ddb7cebde5 to your computer and use it in GitHub Desktop.
Opencv 3.4.0 One-click Install Script
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 purge libopencv* python-opencv | |
sudo apt-get autoremove | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install -y -y build-essential cmake | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libxvidcore-dev libx264-dev libxine2-dev | |
sudo apt-get install -y libv4l-dev v4l-utils | |
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | |
sudo apt-get install -y libqt4-dev | |
sudo apt-get install -y mesa-utils libgl1-mesa-dri libqt4-opengl-dev | |
sudo apt-get install -y libatlas-base-dev gfortran libeigen3-dev | |
sudo apt-get install -y python2.7-dev python3-dev python-numpy python3-numpy | |
cd ~ | |
mkdir opencv | |
cd opencv | |
wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.0.zip | |
unzip opencv.zip | |
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.0.zip | |
unzip opencv_contrib.zip | |
cd opencv-3.4.0/ | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D WITH_TBB=OFF \ | |
-D WITH_IPP=OFF \ | |
-D WITH_1394=OFF \ | |
-D BUILD_WITH_DEBUG_INFO=OFF \ | |
-D BUILD_DOCS=OFF \ | |
-D INSTALL_C_EXAMPLES=ON \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D BUILD_EXAMPLES=OFF \ | |
-D BUILD_TESTS=OFF \ | |
-D BUILD_PERF_TESTS=OFF \ | |
-D WITH_QT=ON \ | |
-D WITH_CUDA=OFF \ | |
-D WITH_OPENGL=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \ | |
-D WITH_V4L=ON \ | |
-D WITH_FFMPEG=ON \ | |
-D WITH_XINE=ON \ | |
-D BUILD_NEW_PYTHON_SUPPORT=ON \ | |
../ | |
make -j4 | |
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