Skip to content

Instantly share code, notes, and snippets.

@kanokkorn
Last active February 29, 2020 11:59
Show Gist options
  • Save kanokkorn/dc86b4274c4b2ec7e00511d0b3b288b2 to your computer and use it in GitHub Desktop.
Save kanokkorn/dc86b4274c4b2ec7e00511d0b3b288b2 to your computer and use it in GitHub Desktop.
script for build opencv for raspberry pi 3
apt install -y git \
python3-pip \
build-essential \
cmake \
unzip \
pkg-config \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libxvidcore-dev \
libx264-dev
cd ~ && git clone https://github.com/opencv/opencv.git && git clone https://github.com/opencv/opencv_contrib.git
mkdir ~/opencv_build && cd ~/opencv_build
cmake ../opencv -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLE=OFF \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D ENABLE_VFPV3=ON \
-D BUILD_TESTS=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build?opencv_contrib/modules \
-D BUILD_EXAMPLES=OFF ..
make -j4
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment