Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Beginners • Installing OpenCV C++ on RPI Zero 2

$
0
0
Since I struggled to install OpenCV on the RPI Zero 2, I want to give some instructions here. Maybe its helpful.

1. You can basically follow https://docs.opencv.org/4.x/d7/d9f/tuto ... stall.html for instructions regarding configuring and building. However, the GitHub Link

Code:

https://github.com/opencv/opencv/archive/4.x.zip
is not working. I used this one: https://codeload.github.com/opencv/open ... ags/4.13.0

Execute cmake for configuring.

2. You need at least 2GB ZRAM.

Code:

# Install zram toolssudo apt install zram-tools# Disable the current swapsudo swapoff /dev/zram0# Reset the devicesudo zramctl --reset /dev/zram0# Set the new size and re-initialize as swapsudo zramctl --find --size 1G --algorithm zstdsudo mkswap /dev/zram0sudo swapon /dev/zram0
Note: This is not setting the ZRAM permanently.

3. After that you can build with

Code:

 make -j4
.

Statistics: Posted by NMO13 — Wed Jan 14, 2026 4:02 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles