https://github.com/qengineering/install-opencv-raspberry-pi-32-bits
OpenCV 4.11 installation scripts for Raspberry Pi with 32-bit OS
https://github.com/qengineering/install-opencv-raspberry-pi-32-bits
opencv opencv-45 raspberry-pi rpi
Last synced: 10 months ago
JSON representation
OpenCV 4.11 installation scripts for Raspberry Pi with 32-bit OS
- Host: GitHub
- URL: https://github.com/qengineering/install-opencv-raspberry-pi-32-bits
- Owner: Qengineering
- License: bsd-3-clause
- Created: 2021-06-14T08:19:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-24T16:56:16.000Z (about 1 year ago)
- Last Synced: 2025-03-27T09:22:59.001Z (10 months ago)
- Topics: opencv, opencv-45, raspberry-pi, rpi
- Language: Shell
- Homepage: https://qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html
- Size: 116 KB
- Stars: 24
- Watchers: 1
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Install-OpenCV-Raspberry-Pi-32-bits

## OpenCV installation script for a Raspberry Pi with 32-bits OS
[](https://opensource.org/licenses/BSD-3-Clause)
This is the full setup of OpenCV for the Raspberry Pi 32-bits.
For more information see [Q-engineering - Install OpenCV Raspberry Pi](https://qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html)
------------
## Installing OpenCV.
You must have allocated enough memory, otherwise the compilation, unfortunately, crashes after 2 hours at 100%
```
# check your total memory (RAM + swap) first. You need at least a total of:
# OpenCV 4.10.0 -> 6.5 GB!
# OpenCV 4.9.0 -> 6.5 GB!
# OpenCV 4.8.0 -> 6.5 GB!
# OpenCV 4.7.0 -> 6.5 GB!
# OpenCV 4.6.0 -> 6.5 GB!
# OpenCV 4.5.5 -> 6.5 GB!
# OpenCV 4.5.0 -> 5.5 GB
# if not, enlarge your swap space as explained in the guide
$ free -m
$ wget https://github.com/Qengineering/Install-OpenCV-Raspberry-Pi-32-bits/raw/main/OpenCV-4-10-0.sh
$ sudo chmod 755 ./OpenCV-4-10-0.sh
$ ./OpenCV-4-10-0.sh
```
:point_right: Don't forget to reset your swap memory afterwards.
------------
If you want to beautify OpenCV with the Qt5 GUI you need to
```
# Bookworm
- $ sudo apt-get install qtbase5-dev
# Other OS
- $ sudo apt-get install qt5-default
# in the cmake list
- Set the -D WITH_QT=**ON** \ (± line 54) in the script
```
before running the script on your RPi
------------
OpenCV will be installed to the `/usr/local` directory, all files will be copied to following locations:
- `/usr/local/bin` - executable files
- `/usr/local/lib` - libraries (.so)
- `/usr/local/lib/cmake/opencv4` - cmake package
- `/usr/local/include/opencv4` - headers
- `/usr/local/share/opencv4` - other files (e.g. trained cascades in XML format)
------------
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZTM5BB3FCYL)