srv / srv_tools

ROS-Stack with some tools
63 stars 56 forks source link

Regression in Kinetic with OpenCV 3.3 #17

Open tfoote opened 6 years ago

tfoote commented 6 years ago

Re: ros-infrastructure/rep#140 @vrabaud @mikaelarguedas FYI

http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__bag_tools__ubuntu_xenial_amd64__binary/25/console

00:04:39.904 In file included from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core.hpp:59:0,
00:04:39.904                  from /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/core.hpp:48,
00:04:39.904                  from /opt/ros/kinetic/include/image_proc/processor.h:37,
00:04:39.904                  from /opt/ros/kinetic/include/stereo_image_proc/processor.h:37,
00:04:39.904                  from /tmp/binarydeb/ros-kinetic-bag-tools-0.0.3/src/process_stereo.cpp:34:
00:04:39.904 /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp: In instantiation of ‘class cv::Mat_<unsigned int>’:
00:04:39.904 /opt/ros/kinetic/include/stereo_image_proc/processor.h:180:30:   required from here
00:04:39.904 /opt/ros/kinetic/include/opencv-3.3.1/opencv2/core/mat.hpp:2150:50: error: no type named ‘channel_type’ in ‘class cv::DataType<unsigned int>’
00:04:39.904      typedef typename DataType<_Tp>::channel_type channel_type;
00:04:39.904     
miquelmassot commented 6 years ago

Thanks for reporting, I'll take a look into it.

miquelmassot commented 6 years ago

@tfoote I can't see the issue here. In case you know, please shed some light.

tfoote commented 6 years ago

I think that the underlying issue is that it does not have a channel type unsigned int defined https://github.com/ros-gbp/opencv3-release/blob/debian/kinetic/xenial/opencv3/modules/core/include/opencv2/core/traits.hpp

There appears to be an option OPENCV_TRAITS_ENABLE_DEPRECATED to enable deprecated functionality to do most datatypes: https://github.com/ros-gbp/opencv3-release/blob/debian/kinetic/xenial/opencv3/modules/core/include/opencv2/core/traits.hpp#L115

This flag looks new. Perhaps we need to turn it back on for Kinetic. @vrabaud

miquelmassot commented 6 years ago

Looks like there is no cv::Mat_, from here: http://docs.ros.org/kinetic/api/stereo_image_proc/html/c++/processor_8h_source.html#l00180 There are 8bit and 16bit unsigned int, but no 32bit.

miquelmassot commented 6 years ago

Issue here: https://github.com/opencv/opencv/issues/7599 Is it possible to change stereo_image_proc speckle removal to use signed 32bit integers instead?

MyNameIsCosmo commented 6 years ago

Is there any update to this?

jj-tetraquark commented 6 years ago

I am also experiencing this in ROS kinetic. The problem, as others have noted, is due to image_proc and stereo_image_proc packages using deprecated cv matrix types. However I did find a workaround.

Adding #define OPENCV_TRAITS_ENABLE_DEPRECATED

to the top of extract_images.cpp, extract_stereo_images.cpp and process_stereo.cpp will allow bag_tools to build.

It's a little bit hacky but this might be an acceptable solution for ROS Kinetic. I don't know if this reliance on deprecated OpenCV types for image_proc stereo_image_proc is present in ROS Hydro and beyond.

ziyanghong commented 6 years ago

@jonnydark Thanks!