Uploaded August 2014 | Updated November 2026, 2 hours ago
Introduction to connecting a joystick to and Arduino and a Raspberry Pi - both hardware and software are covered.
Introduction to connecting a joystick to and Arduino and a Raspberry Pi - both hardware and software are covered.






![OpenCV Version 4.5.3 Raspberry Pi 4 Installation (Please see the description).
Rapid installation of #OpenCV CV2 onto a #RaspberryPi 4. I hope that it helps. Correct as of today :) Please let me know of any goofs!
First thanks to Rocket Systems for inspiring this video ( https://youtu.be/zmdAVkSFYkQ ).
Also see https://qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html
This installation includes preparation for further development (that you will need) but whilst you are copying and pasting - you may as well grab the lot! As a standard user pi the sequence is as follows and will take over 40 minutes to complete - these instructions reduce the usual time considerably.
NOTES
Debian # Code name Release date
Debian 8 Jessie September 2015
Debian 9 Stretch August 2017
Debian 10 Buster June 2019
Debian 11 Bullseye Not yet released.
Do READ the response to each command, they matter :) good luck:-
UPGRADE FIRMWARE (Highly recommended)
quick (old school) route:
sudo rpi-update
Longer more informative (Pi4) route:
sudo rpi-eeprom-update
sudo apt upgrade
sudo apt full-upgrade
sudo apt install rpi-eeprom
sudo reboot
OTHER UPDATES
sudo apt update
sudo apt upgrade
sudo apt clean -y
sudo apt autoremove -y
END OF HOUSEKEEPING
# Now to work!
sudo apt-get install build-essential cmake unzip pkg-config -y
sudo apt install gcc g++ pkg-config git wget htop -y
sudo apt install gfortran libgtk2.0-dev libgtk-3-dev -y
sudo apt install qt5-default libqtgui4 libqtwebkit4 libqt4-test -y
sudo apt install libtbb-dev libtbb2 libhdf5-dev libhdf5-103 libeigen3-dev liblapacke-dev libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev doxygen -y
sudo apt-get install libtiff-dev -y
sudo apt install libjpeg-dev libjpeg62-turbo-dev libpng-dev libtiff-dev libjasper-dev libwebp-dev libopenexr-dev -y
sudo apt install python-numpy python-scipy -y
sudo apt install python3-dev python3-pip -y
sudo apt install g++-arm-linux-gnueabihf
sudo apt install libgphoto2-dev -y
sudo apt install libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev -y
sudo apt install libmp3lame-dev libvorbis-dev libopencore-amrnb-dev -y
sudo apt install libavformat-dev libavresample-dev x264 libv4l-dev v4l-utils libtheora-dev libxvidcore-dev -y
sudo apt-get install libavcodec-dev libswscale-dev libv4l-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install libcanberra-gtk* -y
sudo apt-get install libatlas-base-dev -y
sudo apt-get install python3-pyqt5 python3-dev -y
and breathe
sudo nano /etc/dphys-swapfile
# keep a note of the size but increase CONF_SWAPSIZE=2048
# save and reboot
sudo python3 -m pip install testresources picamera[array] wget numpy scipy pandas
python3 -m pip install upgrade pip
sudo rm -rf ~/.cache/pip
downloading opencv
# two zipped files are required for the full installation
# the current version is 4.5.3 as shown UPDATE these if required
# see https://opencv.org/releases/ for current releases
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.3.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.3.zip
# unzip the two files
unzip opencv.zip
unzip opencv_contrib.zip
# These expand to two files displaying version number.
# They can be changed note the slashes!!! Ive added unnecessary spaces for clarity
sudo mv opencv-4.5.3/ opencv
sudo mv opencv_contrib-4.5.3/ opencv_contrib
# move into the opencv directory. Make a build directory and move into that
cd opencv
mkdir build
cd build
# Now to make for the two packages cut and paste all of the following in one go
- - - cut just below - - - - - - -
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_EXTRA_MODULES_PATH=homepiopencv_contrib/modules
-D BUILD_NEW_PYTHON_SUPPORT=ON
-D BUILD_opencv_python3=ON
-D HAVE_opencv_python3=ON
-D PYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3
-D OPENCV_PYTHON3_INSTALL_PATH=/usr/lib/python3/dist-packages
-D OPENCV_ENABLE_NONFREE=ON
-D CMAKE_SHARED_LINKER_FLAGS latomic
-D WITH_TBB=ON
-D ENABLE_NEON=ON
-D ENABLE_VFPV3=ON
-D WITH_V4L=ON
-D WITH_QT=ON
-D WITH_OPENGL=ON
-D WITH_TENGINE=ON
-D BUILD_TESTS=OFF
-D INSTALL_C_EXAMPLES=OFF
-D INSTALL_PYTHON_EXAMPLES=OFF
-D BUILD_EXAMPLES=OFF ..
- - - - - - cut above - - - - - - -
# include the two full stops.
# Now the BIG step for all four cores to sing!
make -j4
# go off and get some fresh air - this takes time !!!!
sudo make install
sudo ldconfig
sudo nano /etc/dphys-swapfile # and restore the original swapfile size -
# I did say note the value at the time
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
# Inside Python
import cv2
cv2. version
Good luck! OpenCV Version 4.5.3 Raspberry Pi 4 Installation (Please see the description).](https://i.ytimg.com/vi/UyaMNfN00wg/mqdefault.jpg)



