How to build OpenCV 4 debian .deb packages properly?

asked 2021-01-08 07:12:50 -0600

Ilya Petrov gravatar image

I use ROS Noetic built from source on Raspberry PI 4 armhf debian buster platform.
When I install ROS dependencies - it installs OpenCV debian packages libopencv-* , available on , which are compiled OpenCV version 3.2.0
(for example - , etc)
But I need to run newer OpenCV version, 4.1, or latest 4.5
I'd like to build my own .deb repository with 4th OpenCV version - and take packages from it as I install ROS, not from

I have tried this script
It has downloaded source code from opencv github, and compiled me the following files:

But this packages are not sutable to resolve ROS dependencies - I need to have .deb names like libopencv-calib3d4.1 , etc.

I tried to clone this repositoryinstead of
But it fails to cmake the source folder:
-- Configuring incomplete, errors occurred! See also "/home/pi/opencv-build/opencv/build/CMakeFiles/CMakeOutput.log". See also "/home/pi/opencv-build/opencv/build/CMakeFiles/CMakeError.log".

How to build opencv debian packages for Raspberry Pi debian buster armhf properly?

edit retag flag offensive close merge delete