From d57def89b50849ca191355a5d2f624e61f5d4e00 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Wed, 24 Jun 2026 22:51:11 +0200 Subject: [PATCH 1/5] Introduce new opencv modules required with OpenCV 5. Closes: #1974 --- modules/core/CMakeLists.txt | 5 ++++- modules/tracker/klt/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 331e3953c6..98d44cbf7e 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -76,10 +76,13 @@ if(USE_OPENCV) set(OpenCV_REQUIRED_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS}) vp_list_filterout(OpenCV_REQUIRED_LIB_COMPONENTS "opencv_*") # We import only required OpenCV libraries - list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_core" "opencv_imgproc" "opencv_highgui" "opencv_calib3d" "opencv_features2d" "opencv_calib" "opencv_3d" ) + list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_core" "opencv_imgproc" "opencv_highgui" "opencv_calib3d" "opencv_features2d" "opencv_calib" "opencv_3d") if(OpenCV_VERSION AND OpenCV_VERSION VERSION_LESS 2.4.8) list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_legacy") endif() + if(OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER_EQUAL 5.0.0) + list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_geometry") + endif() foreach(component_ ${OpenCV_REQUIRED_LIB_COMPONENTS}) string(TOUPPER "${component_}" component_UP) diff --git a/modules/tracker/klt/CMakeLists.txt b/modules/tracker/klt/CMakeLists.txt index 41021355c3..60508332cb 100644 --- a/modules/tracker/klt/CMakeLists.txt +++ b/modules/tracker/klt/CMakeLists.txt @@ -70,6 +70,10 @@ if(USE_OPENCV) # We import only required OpenCV libraries list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_video") + if(OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER_EQUAL 5.0.0) + list(APPEND OpenCV_REQUIRED_LIB_COMPONENTS "opencv_features") + endif() + foreach(component_ ${OpenCV_REQUIRED_LIB_COMPONENTS}) string(TOUPPER "${component_}" component_UP) if(${component_UP}_FOUND) From d7690f4ec9e960a3b8b6ece770d9f559dc28b950 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 25 Jun 2026 16:21:28 +0200 Subject: [PATCH 2/5] Fix message error when opencv calib module is not available --- .../hand-eye/visp-compute-chessboard-poses.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/calibration/hand-eye/visp-compute-chessboard-poses.cpp b/apps/calibration/hand-eye/visp-compute-chessboard-poses.cpp index 5cb89f225c..5db4f0d057 100644 --- a/apps/calibration/hand-eye/visp-compute-chessboard-poses.cpp +++ b/apps/calibration/hand-eye/visp-compute-chessboard-poses.cpp @@ -353,11 +353,11 @@ int main(int argc, const char **argv) #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) if (display) { delete display; + } +#endif } #endif } -#endif -} catch (const vpException &e) { std::cout << "Catch an exception: " << e.getMessage() << std::endl; } @@ -376,8 +376,8 @@ int main() #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x050000) && !defined(HAVE_OPENCV_CALIB3D) std::cerr << "OpenCV calib3d module is requested to compute the pose of the chessboard." << std::endl; #endif -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x050000) && !defined(HAVE_OPENCV_GEOMETRY) - std::cerr << "OpenCV 3d module is requested to compute the pose of the chessboard." << std::endl; +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x050000) && !defined(HAVE_OPENCV_CALIB) + std::cerr << "OpenCV calib module is requested to compute the pose of the chessboard." << std::endl; #endif #if !defined(VISP_HAVE_PUGIXML) std::cout << "pugixml built-in 3rdparty is requested to compute the pose of the chessboard." << std::endl; From 252d530f7eeaf7e9c8fe3f09c12b3cfb01ea2128 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 25 Jun 2026 16:22:19 +0200 Subject: [PATCH 3/5] Group and clean opencv macros defined for doxygen --- doc/config-doxygen.in | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index 06e1c74505..ce5f950bab 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -2448,11 +2448,20 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \ + HAVE_OPENCV_CALIB \ HAVE_OPENCV_CALIB3D \ HAVE_OPENCV_DNN \ + HAVE_OPENCV_FEATURES \ + HAVE_OPENCV_FEATURES2D \ + HAVE_OPENCV_GEOMETRY \ HAVE_OPENCV_HIGHGUI \ + HAVE_OPENCV_IMGCODECS \ HAVE_OPENCV_IMGPROC \ - HAVE_OPENCV_GEOMETRY \ + HAVE_OPENCV_OBJDETECT \ + HAVE_OPENCV_VIDEO \ + HAVE_OPENCV_VIDEOIO \ + HAVE_OPENCV_XFEATURES2D \ + HAVE_OPENCV_XOBJDETECT \ VISP_HAVE_AFMA6 \ VISP_HAVE_AFMA6_DATA \ VISP_HAVE_APRILTAG \ @@ -2506,20 +2515,6 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \ VISP_HAVE_OIS \ VISP_HAVE_OPENCV \ VISP_HAVE_OPENCV_VERSION=0x030403 \ - HAVE_OPENCV_GEOMETRY \ - HAVE_OPENCV_CALIB \ - HAVE_OPENCV_CALIB3D \ - HAVE_OPENCV_DNN \ - HAVE_OPENCV_FEATURES \ - HAVE_OPENCV_FEATURES2D \ - HAVE_OPENCV_HIGHGUI \ - HAVE_OPENCV_IMGCODECS \ - HAVE_OPENCV_IMGPROC \ - HAVE_OPENCV_OBJDETECT \ - HAVE_OPENCV_VIDEO \ - HAVE_OPENCV_VIDEOIO \ - HAVE_OPENCV_XFEATURES2D \ - HAVE_OPENCV_XOBJDETECT \ VISP_HAVE_OPENGL \ VISP_HAVE_PANDA3D \ VISP_HAVE_PARPORT \ From 3713645e7acd180c3081fca6b09e13253ee0b79d Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 25 Jun 2026 16:23:19 +0200 Subject: [PATCH 4/5] Fix message error when opencv geometry module is not available --- .../bridge/opencv/tutorial-bridge-opencv-camera-param.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/bridge/opencv/tutorial-bridge-opencv-camera-param.cpp b/tutorial/bridge/opencv/tutorial-bridge-opencv-camera-param.cpp index 9eccfe2fcf..1680747647 100644 --- a/tutorial/bridge/opencv/tutorial-bridge-opencv-camera-param.cpp +++ b/tutorial/bridge/opencv/tutorial-bridge-opencv-camera-param.cpp @@ -36,8 +36,8 @@ int main() //! [Set OpenCV camera parameters] #if (VISP_HAVE_OPENCV_VERSION >= 0x050000) cv::Mat K = cv::Mat_(3, 3); - K.at(0, 0) = cam.get_px();K.at(0, 1) = 0; K.at(0, 2) = cam.get_u0(); - K.at(1, 0) = 0.;K.at(1, 1) = cam.get_py();K.at(1, 2) = cam.get_v0(); + K.at(0, 0) = cam.get_px(); K.at(0, 1) = 0; K.at(0, 2) = cam.get_u0(); + K.at(1, 0) = 0.; K.at(1, 1) = cam.get_py(); K.at(1, 2) = cam.get_v0(); K.at(2, 0) = 0; K.at(2, 1) = 0; K.at(2, 2) = 1; cv::Mat D = cv::Mat_(4, 1, 0.); D.at(0, 0) = cam.get_kud(); @@ -86,7 +86,7 @@ int main() std::cout << "This tutorial requires OpenCV calib3d module." << std::endl; #endif #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x050000) && !defined(HAVE_OPENCV_GEOMETRY) - std::cout << "This tutorial requires OpenCV 3d module." << std::endl; + std::cout << "This tutorial requires OpenCV geometry module." << std::endl; #endif return EXIT_SUCCESS; } From 53efdf384533713e6f5d41171a8cc18fdf340e88 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 25 Jun 2026 16:29:11 +0200 Subject: [PATCH 5/5] Update changelog file with last fixes and improvements --- ChangeLog.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 94a5c6390a..52cf3ea548 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -24,6 +24,7 @@ ViSP 3.7.1 (current version) - External Installation: Detect an existing installation built from the official repository, - Embedded Build: Fall back to the built-in version available directly in the 3rdparty/catch2 folder. This version was upgraded to Catch2 3.13.0 + . Fix warnings detected on Ubuntu with -Wshadow -Wfloat-equal -Wsign-conversion - Applications . Camera intrinsic calibration app: visp-calibrate-camera.cpp - Add lens distortion displacement map visualization @@ -41,14 +42,11 @@ ViSP 3.7.1 (current version) . [#1909] Fix build failure when apriltag is deactivated . [#1929] Support for the C++98 standard is not properly implemented . [#1930] Build issue in vpMocapVicon.cpp when c++98 enabled -<<<<<<< fix_various_ogre . [#1943] Data race on std::setlocale in vpMbtXmlGenericParserr . [#1946] Joint position exceeds q_l1 threshold in secondaryTaskJointLimitAvoidance() . [#1947] Ogre3D examples are crashing due to a missing robot.mesh resource -======= - . [#1943] Data race on std::setlocale in vpMbtXmlGenericParser - . [#1946] Joint position exceeds q_l1 threshold in secondaryTaskJointLimitAvoidance() ->>>>>>> master + . [#1958] ROS 2 package include path issues + . [#1974] Unable to build with OpenCV 5.0.0 and 5.1.0 ---------------------------------------------- ViSP 3.7.0 (released December 19, 2025) - Contributors: