filmov
tv
How to Install OpenCV on a Raspberry Pi
Показать описание
Here's how you can install OpenCV on your Raspberry Pi 3, 4, and Zero 2 W. This is straightforward and all it takes is some time and patience. Leave comment with a question if you have one or a request for a future tutorial.
I may earn commission if you purchase from the links below:
TIMESTAMPS and INSTRUCTIONS
0:00 Intro
0:13 Access the terminal of your Pi
0:34 Check if you're using all of your system memory with:
df -h
If you're not using most of it, run
sudo raspi-config
advanced -- expand filesystem
reboot your pi
1:19 Update and upgrade
sudo apt-get update && sudo apt-get upgrade
1:35 Check your python version
python3 -V
sudo apt-get install python3-pip python3-virtualenv
mkdir project
cd project
python3 -m pip install virtualenv
python3 -m virtualenv env
source env/bin/activate
sudo apt install -y build-essential cmake pkg-config libjpeg-dev libtiff5-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran libhdf5-dev libhdf5-serial-dev libhdf5-103 libqt5gui5 libqt5webkit5 libqt5test5 python3-pyqt5 python3-dev
If you're using a PiCamera run:
pip install "picamera[array]"
Users of PiCamera may also have to enable Camera Support:
sudo raspi-config
Inferface Options
Legacy Camera Support -- Enable
4:15 Install OpenCV
pip install opencv-contrib-python
--Takes a long time
5:25 Testing
python
import cv2
cv2.__version__
I may earn commission if you purchase from the links below:
TIMESTAMPS and INSTRUCTIONS
0:00 Intro
0:13 Access the terminal of your Pi
0:34 Check if you're using all of your system memory with:
df -h
If you're not using most of it, run
sudo raspi-config
advanced -- expand filesystem
reboot your pi
1:19 Update and upgrade
sudo apt-get update && sudo apt-get upgrade
1:35 Check your python version
python3 -V
sudo apt-get install python3-pip python3-virtualenv
mkdir project
cd project
python3 -m pip install virtualenv
python3 -m virtualenv env
source env/bin/activate
sudo apt install -y build-essential cmake pkg-config libjpeg-dev libtiff5-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran libhdf5-dev libhdf5-serial-dev libhdf5-103 libqt5gui5 libqt5webkit5 libqt5test5 python3-pyqt5 python3-dev
If you're using a PiCamera run:
pip install "picamera[array]"
Users of PiCamera may also have to enable Camera Support:
sudo raspi-config
Inferface Options
Legacy Camera Support -- Enable
4:15 Install OpenCV
pip install opencv-contrib-python
--Takes a long time
5:25 Testing
python
import cv2
cv2.__version__
Комментарии