From 069c81124e04b9ab86925ee85b6b94120f243de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Camelo=20Neves=20Pereira?= Date: Mon, 30 Mar 2020 23:07:16 +0100 Subject: [PATCH 1/4] Fix import path on camera_calibrator.py (#509) --- camera_calibration/src/camera_calibration/camera_calibrator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera_calibration/src/camera_calibration/camera_calibrator.py b/camera_calibration/src/camera_calibration/camera_calibrator.py index 5065cb831..bc46b9dd8 100755 --- a/camera_calibration/src/camera_calibration/camera_calibrator.py +++ b/camera_calibration/src/camera_calibration/camera_calibrator.py @@ -47,7 +47,7 @@ from queue import Queue except ImportError: from Queue import Queue -from calibrator import CAMERA_MODEL +from camera_calibration.calibrator import CAMERA_MODEL class BufferQueue(Queue): """Slight modification of the standard Queue that discards the oldest item From 60581da17e521c4e0030e5afcffdc8b6015027d0 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Wed, 6 May 2020 15:09:40 +0900 Subject: [PATCH 2/4] clone cv_ptr->image before set queued_image (#526) --- image_view/src/nodelets/image_nodelet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image_view/src/nodelets/image_nodelet.cpp b/image_view/src/nodelets/image_nodelet.cpp index 119b2acdf..b329d9d50 100644 --- a/image_view/src/nodelets/image_nodelet.cpp +++ b/image_view/src/nodelets/image_nodelet.cpp @@ -227,7 +227,7 @@ void ImageNodelet::imageCb(const sensor_msgs::ImageConstPtr& msg) options.max_image_value = max_image_value_; } cv_ptr = cvtColorForDisplay(cv_bridge::toCvShare(msg), "", options); - queued_image_.set(cv_ptr->image); + queued_image_.set(cv_ptr->image.clone()); } catch (cv_bridge::Exception& e) { NODELET_ERROR_THROTTLE(30, "Unable to convert '%s' image for display: '%s'", From 87e87893dbe3600814e138d630faf6071889b43f Mon Sep 17 00:00:00 2001 From: Joshua Whitley Date: Wed, 13 May 2020 15:49:24 -0500 Subject: [PATCH 3/4] Updating OpenCV calls to v4. --- image_publisher/CMakeLists.txt | 12 +++--------- .../src/nodelet/image_publisher_nodelet.cpp | 6 +++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/image_publisher/CMakeLists.txt b/image_publisher/CMakeLists.txt index 4ca222c57..27f2fb093 100644 --- a/image_publisher/CMakeLists.txt +++ b/image_publisher/CMakeLists.txt @@ -1,17 +1,11 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(image_publisher) find_package(catkin REQUIRED COMPONENTS cv_bridge dynamic_reconfigure camera_info_manager sensor_msgs image_transport nodelet roscpp) -set(opencv_2_components core highgui) -set(opencv_3_components core imgcodecs videoio) -find_package(OpenCV REQUIRED COMPONENTS core) +set(opencv_4_components core imgcodecs videoio) +find_package(OpenCV 4 REQUIRED COMPONENTS ${opencv_4_components}) message(STATUS "opencv version ${OpenCV_VERSION}") -if(OpenCV_VERSION VERSION_LESS "3.0.0") - find_package(OpenCV 2 REQUIRED COMPONENTS ${opencv_2_components}) -else() - find_package(OpenCV 3 REQUIRED COMPONENTS ${opencv_3_components}) -endif() # generate the dynamic_reconfigure config file generate_dynamic_reconfigure_options(cfg/ImagePublisher.cfg) diff --git a/image_publisher/src/nodelet/image_publisher_nodelet.cpp b/image_publisher/src/nodelet/image_publisher_nodelet.cpp index 49d9dc6e3..e126f7b6a 100644 --- a/image_publisher/src/nodelet/image_publisher_nodelet.cpp +++ b/image_publisher/src/nodelet/image_publisher_nodelet.cpp @@ -95,7 +95,7 @@ class ImagePublisherNodelet : public nodelet::Nodelet { if ( cap_.isOpened() ) { if ( ! cap_.read(image_) ) { - cap_.set(CV_CAP_PROP_POS_FRAMES, 0); + cap_.set(cv::CAP_PROP_POS_FRAMES, 0); } } if (flip_image_) @@ -136,7 +136,7 @@ class ImagePublisherNodelet : public nodelet::Nodelet nh_.param("filename", filename_, std::string("")); NODELET_INFO("File name for publishing image is : %s", filename_.c_str()); try { - image_ = cv::imread(filename_, CV_LOAD_IMAGE_COLOR); + image_ = cv::imread(filename_, cv::IMREAD_COLOR); if ( image_.empty() ) { // if filename is motion file or device file try { // if filename is number int num = boost::lexical_cast(filename_);//num is 1234798797 @@ -146,7 +146,7 @@ class ImagePublisherNodelet : public nodelet::Nodelet } CV_Assert(cap_.isOpened()); cap_.read(image_); - cap_.set(CV_CAP_PROP_POS_FRAMES, 0); + cap_.set(cv::CAP_PROP_POS_FRAMES, 0); } CV_Assert(!image_.empty()); } From a02067037bcb5ea544463d7aa778a80e723abbd4 Mon Sep 17 00:00:00 2001 From: Joshua Whitley Date: Wed, 13 May 2020 15:49:47 -0500 Subject: [PATCH 4/4] Updating CMake required version to 3.0.2. --- camera_calibration/CMakeLists.txt | 2 +- depth_image_proc/CMakeLists.txt | 2 +- image_pipeline/CMakeLists.txt | 2 +- image_proc/CMakeLists.txt | 2 +- image_rotate/CMakeLists.txt | 2 +- image_view/CMakeLists.txt | 2 +- stereo_image_proc/CMakeLists.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/camera_calibration/CMakeLists.txt b/camera_calibration/CMakeLists.txt index 469d3b844..e382aca9a 100644 --- a/camera_calibration/CMakeLists.txt +++ b/camera_calibration/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(camera_calibration) find_package(catkin REQUIRED) diff --git a/depth_image_proc/CMakeLists.txt b/depth_image_proc/CMakeLists.txt index 58b9a0931..af403b74e 100644 --- a/depth_image_proc/CMakeLists.txt +++ b/depth_image_proc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(depth_image_proc) find_package(catkin REQUIRED cmake_modules cv_bridge eigen_conversions image_geometry image_transport message_filters nodelet sensor_msgs stereo_msgs tf2 tf2_ros) diff --git a/image_pipeline/CMakeLists.txt b/image_pipeline/CMakeLists.txt index 69f713264..28054fa44 100644 --- a/image_pipeline/CMakeLists.txt +++ b/image_pipeline/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0.2) project(image_pipeline) find_package(catkin REQUIRED) catkin_metapackage() diff --git a/image_proc/CMakeLists.txt b/image_proc/CMakeLists.txt index 776d5763b..2e9f0e54a 100644 --- a/image_proc/CMakeLists.txt +++ b/image_proc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(image_proc) find_package(catkin REQUIRED) diff --git a/image_rotate/CMakeLists.txt b/image_rotate/CMakeLists.txt index 21c412730..e5a41e9a9 100644 --- a/image_rotate/CMakeLists.txt +++ b/image_rotate/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(image_rotate) find_package(catkin REQUIRED COMPONENTS cmake_modules cv_bridge dynamic_reconfigure image_transport nodelet roscpp tf2 tf2_geometry_msgs) diff --git a/image_view/CMakeLists.txt b/image_view/CMakeLists.txt index e51fc8c35..4309a7bc1 100644 --- a/image_view/CMakeLists.txt +++ b/image_view/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(image_view) find_package(catkin REQUIRED COMPONENTS camera_calibration_parsers cv_bridge dynamic_reconfigure image_transport message_filters message_generation nodelet rosconsole roscpp std_srvs stereo_msgs) diff --git a/stereo_image_proc/CMakeLists.txt b/stereo_image_proc/CMakeLists.txt index 23d31eed6..126715d46 100644 --- a/stereo_image_proc/CMakeLists.txt +++ b/stereo_image_proc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0.2) project(stereo_image_proc) find_package(catkin REQUIRED cv_bridge dynamic_reconfigure image_geometry image_proc image_transport message_filters nodelet sensor_msgs stereo_msgs)