Forked from gaborvecsei/install_opencv_raspberry_pi_3b.sh
Created
May 20, 2019 21:50
-
-
Save AnoRebel/396f45d574fe73e1b57acfdef5f0d13b to your computer and use it in GitHub Desktop.
Install OpenCV easily on your Raspberry Pi 3 B
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
mkdir opecv | |
cd opencv | |
sudo apt-get update -y && sudo apt-get upgrade -y | |
sudo apt-get install build-essential cmake pkg-config -y | |
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev -y | |
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y | |
sudo apt-get install libxvidcore-dev libx264-dev -y | |
sudo apt-get install libgtk2.0-dev libgtk-3-dev -y | |
sudo apt-get install libatlas-base-dev gfortran -y | |
sudo apt-get install python2.7-dev python3-dev -y | |
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.1.zip | |
unzip opencv.zip | |
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python get-pip.py | |
sudo python3 get-pip.py | |
sudo pip install numpy | |
cd opencv-3.3.1 | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. | |
make -j2 | |
sudo make install | |
sudo ldconfig | |
sudo find /usr/local/lib -type f -name "cv2.*.so" -exec sh -c 'x="{}"; echo mv "$x" "$(dirname ${x})/cv2.so"' \; | |
echo "OpenCV is successfully installed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment