Upgrade to OpenCV 4.10.0 for Bebop - Fix compiling on Ubuntu 22 and 24 (#3600)

* OpenCV 4.10.0 For Bebop on Ubuntu 22.04 and 24.04
This commit is contained in:
Christophe De Wagter
2026-02-15 20:53:01 +01:00
committed by GitHub
parent 760d17f081
commit 5418f4ff3c
7 changed files with 27 additions and 18 deletions
@@ -61,6 +61,10 @@
<define name="VIDEO_CAPTURE_CAMERA" value="front_camera"/>
<define name="VIDEO_CAPTURE_FPS" value="10"/>
</module>
<!-- module name="cv_opencvdemo">
<define name="OPENCVDEMO_CAMERA" value="front_camera"/>
<define name="OPENCVDEMO_FPS" value="10"/>
</module -->
<module name="cv_detect_color_object">
<define name="COLOR_OBJECT_DETECTOR_CAMERA1" value="front_camera"/>
<define name="COLOR_OBJECT_DETECTOR_FPS1" value="0"/>
+11 -7
View File
@@ -60,18 +60,18 @@ extern "C" {
<file name="cv_opencvdemo.c"/>
<file name="opencv_example.cpp"/>
<file name="opencv_image_functions.cpp"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_arm/include"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_arm/include/opencv4"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_arm/lib"/>
<flag name="LDFLAGS" value="lopencv_world"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_arm/share/OpenCV/3rdparty/lib"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_arm/lib/opencv4/3rdparty"/>
<flag name="LDFLAGS" value="llibprotobuf"/>
<flag name="LDFLAGS" value="llibjpeg-turbo"/>
<flag name="LDFLAGS" value="llibpng"/>
<flag name="LDFLAGS" value="llibtiff"/>
<flag name="LDFLAGS" value="llibopenjp2"/>
<flag name="LDFLAGS" value="lzlib"/>
<flag name="LDFLAGS" value="lquirc"/>
<flag name="LDFLAGS" value="ltegra_hal"/>
<flag name="LDFLAGS" value="lade"/>
<flag name="LDFLAGS" value="ldl"/>
<flag name="LDFLAGS" value="lm"/>
<flag name="LDFLAGS" value="lpthread"/>
@@ -82,19 +82,22 @@ extern "C" {
<file name="opencv_example.cpp"/>
<file name="opencv_image_functions.cpp"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_pc/include"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_pc/include/opencv4"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/lib"/>
<flag name="LDFLAGS" value="lopencv_world"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/share/OpenCV/3rdparty/lib"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/lib/opencv4/3rdparty"/>
<flag name="LDFLAGS" value="llibprotobuf"/>
<flag name="LDFLAGS" value="lquirc"/>
<flag name="LDFLAGS" value="lade"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu"/>
<flag name="LDFLAGS" value="ljpeg"/>
<flag name="LDFLAGS" value="lpng"/>
<flag name="LDFLAGS" value="ltiff"/>
<flag name="LDFLAGS" value="lopenjp2"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu/hdf5/serial"/>
<flag name="LDFLAGS" value="lhdf5"/>
<flag name="LDFLAGS" value="lcrypto"/>
<flag name="LDFLAGS" value="lcurl"/>
<flag name="LDFLAGS" value="lpthread"/>
<flag name="LDFLAGS" value="lsz"/>
<flag name="LDFLAGS" value="lz"/>
@@ -103,5 +106,6 @@ extern "C" {
<flag name="LDFLAGS" value="lfreetype"/>
<flag name="LDFLAGS" value="lharfbuzz"/>
<flag name="LDFLAGS" value="lrt"/>
</makefile>
</module>
@@ -43,7 +43,7 @@ int opencv_example(char *img, int width, int height)
#if OPENCVDEMO_GRAYSCALE
// Grayscale image example
cvtColor(M, image, CV_YUV2GRAY_Y422);
cvtColor(M, image, cv::COLOR_YUV2BGR_YUY2);
// Canny edges, only works with grayscale image
int edgeThresh = 35;
Canny(image, image, edgeThresh, edgeThresh * 3);
@@ -52,7 +52,7 @@ int opencv_example(char *img, int width, int height)
#else // OPENCVDEMO_GRAYSCALE
// Color image example
// Convert the image to an OpenCV Mat
cvtColor(M, image, CV_YUV2BGR_Y422);
cvtColor(M, image, cv::COLOR_YUV2BGR_YUY2);
// Blur it, because we can
blur(image, image, Size(5, 5));
// Convert back to YUV422 and put it in place of the original image
@@ -39,8 +39,8 @@ void coloryuv_opencv_to_yuv422(Mat image, char *img, int width, int height)
CV_Assert(image.depth() == CV_8U);
CV_Assert(image.channels() == 3);
int nRows = image.rows;
int nCols = image.cols;
int nRows = min(image.rows, height);
int nCols = min(image.cols, width);
int byte_index = 0;
for(int r = 0; r < nRows; ++r) {
@@ -70,8 +70,8 @@ void grayscale_opencv_to_yuv422(Mat image, char *img, int width, int height)
CV_Assert(image.depth() == CV_8U);
CV_Assert(image.channels() == 1);
int n_rows = image.rows;
int n_cols = image.cols;
int n_rows = min(image.rows, height);
int n_cols = min(image.cols, width);
// If the image is one block in memory we can iterate over it all at once!
if (image.isContinuous()) {
+4 -3
View File
@@ -97,7 +97,10 @@ class InstallWindow(QWidget):
def cmd_bebopcv(self):
self.execute('git submodule init && git submodule sync && git submodule update ./sw/ext/opencv_bebop')
self.execute('sudo -E apt-get -f -y install cmake libjpeg-turbo8-dev libpng-dev libtiff-dev zlib1g-dev libdc1394-22-dev')
if distro_version < 22.04:
self.execute('sudo -E apt-get -f -y install cmake libjpeg-turbo8-dev libpng-dev libtiff-dev zlib1g-dev libdc1394-22-dev')
else:
self.execute('sudo -E apt-get -f -y install cmake libjpeg-turbo8-dev libpng-dev libtiff-dev zlib1g-dev libdc1394-dev')
def cmd_vlc(self):
self.execute('sudo -E apt-get -f -y install ffmpeg vlc jstest-gtk default-jre')
@@ -183,8 +186,6 @@ class InstallWindow(QWidget):
button8 = QPushButton('8) Bebop Opencv')
button8.clicked.connect(self.cmd_bebopcv)
if distro_version > 20.04:
button8.setDisabled(True)
btn_layout.addWidget(button8)
button9 = QPushButton('9) VLC + Joystick + Natnet')