Last active
January 24, 2023 19:52
-
-
Save gaborvecsei/ad216f214731441bd66a34ae9a2dc3f3 to your computer and use it in GitHub Desktop.
Install OpenCV easily on your Raspberry Pi 3 B
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
mkdir opencv | |
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" |
make sure you fix line one before install. This works perfect on raspi-3b thanks for an easy way to get Opencv.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
in line 1 : mkdir opencv