HOWTO: Install OpenCV in Raspberry Pi OS (Buster)

This page summarizes the projects mentioned and recommended in the original post on /r/raspberry_pi

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • NumPy

    The fundamental package for scientific computing with Python.

  • Many opencv-python distributions and builds rely on numpy. However, numpy is currently broken with Python 3.10+. In fact, numpy installs fine via pip - apparently, whatever precompiled binary for numpy is served by pip is compatible with Python 3.10. But rebuilding opencv-python requires rebuilding numpy, and the numpy rebuild itself fails under Python 3.10. The solution is to install Python 3.9.7 instead.

  • OpenCV

    Open Source Computer Vision Library

  • sudo nano /etc/dphys-swapfile In the nano file editor, replace CONF_SWAPSIZE=100 with CONF_SWAPSIZE=2048. Once the file has been edited, press Ctrl + X on your keyboard, then hit the Y + Enter keys to confirm and save. git clone https://github.com/opencv/opencv.git sudo systemctl restart dphys-swapfile Swapfile Mod Did Not Work!

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • opencv_contrib

    Repository for OpenCV's extra modules

  • git clone https://github.com/opencv/opencv.git git clone https://github.com/opencv/opencv_contrib.git mkdir ~/opencv/build cd ~/opencv/build

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts