Last active
May 27, 2021 09:59
-
-
Save logtheta/211709a760339c9ef5b379849063d8a8 to your computer and use it in GitHub Desktop.
opencv_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 install build-essential cmake git pkg-config libgtk-3-devsudo | |
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-devsudo | |
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-devsudo | |
sudo apt-get install python3-dev python3-numpy libtbb2 libtbb-dev libdc1394-22-dev | |
mkdir ~/opencv_build && cd ~/opencv_build | |
git clone https://github.com/opencv/opencv.git | |
git clone https://github.com/opencv/opencv_contrib.git | |
cd ~/opencv_build/opencv | |
mkdir build && cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D INSTALL_C_EXAMPLES=ON \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D OPENCV_GENERATE_PKGCONFIG=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \ | |
-D BUILD_EXAMPLES=ON .. | |
make -j8 | |
sudo make install | |
pkg-config --modversion opencv4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirmed working on Ubuntu 18.04 for building OpenCV 4. But there are some mistakes on this script, hope you could fix them.
sudo
are misplaced in line 1,2,3,4.make j8
should bemake -j8
.