ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

At an impasse using OpenCV

asked 2015-07-03 14:46:01 -0600

chilypepper gravatar image

updated 2015-09-16 00:30:03 -0600

130s gravatar image

Hi all,

I have this snippet of code that was copied from one of the tutorials on cv_bridge:

  ROS_INFO("Trying to convert");
  cv_ptr = toCvCopy(msg, sensor_msgs::image_encodings::BAYER_BGGR8);
catch (cv_bridge::Exception& e)
  ROS_INFO("Not Converted");

  ROS_ERROR("cv_bridge exception: %s", e.what());

And when I run it using a topic published by my camera I run into this error:

[ INFO] [1435952032.594731416]: Trying to convert
OpenCV Error: The function/feature is not implemented (Unknown/unsupported array type) in type, file /tmp/buildd/ros-indigo-opencv3-3.0.0-0trusty-20150607-1913/modules/core/src/matrix.cpp, line 1837
terminate called after throwing an instance of 'cv::Exception'
  what():  /tmp/buildd/ros-indigo-opencv3-3.0.0-0trusty-20150607-1913/modules/core/src/matrix.cpp:1837: error: (-213) Unknown/unsupported array type in function type

Aborted (core dumped)

(The ROS_INFO's are there to show steps and when there program breaks)

Now I know the error is in that line so I tried a few other things to get it to work. When I change the encoding type to something else, in this case bayer_grbg8, I get this error:

 [ INFO] [1435952475.576702858]: Step2
[ INFO] [1435952475.576715724]: Trying to convert
[ INFO] [1435952475.576814017]: Not Converted
[ERROR] [1435952475.576841782]: cv_bridge exception: Unsupported conversion from [bayer_bggr8] to [bayer_grbg8]

What are some possible solutions? I don't know how to change the encoding of the camera (Point Grey Blackfly3)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2016-03-25 09:38:26 -0600

Dragon Qu gravatar image

It caused by conflict between opencv2 and opencv2. You should find the following script in your package CMakeFile.txt:

find_package(OpenCV REQUIRED)

Replace it with

find_package(OpenCV 2 REQUIRED)

I worked whole day to find the solution

edit flag offensive delete link more

answered 2016-03-16 01:11:07 -0600

try to remove your old cv_Bridge and go to down the new cv_bridge

I fixed the problem by this way

PS. in your cmakeList you'd better using find_package(OpenCV) instead of set(OpenCV_DIR /usr/local/share/OpenCV) cuz ROS already have an OpenCV2.4 in build

edit flag offensive delete link more

answered 2015-08-06 14:49:15 -0600 gravatar image

I am getting this too. I was wondering if it might be an OpenCV version issue, I'm running OpenCV 3 and ROS Indigo and getting compile warnings about possible OpenCV version conflicts?

Do we know if Indigo is offically usinig OpenCV3 so we're OK with these setups?

edit flag offensive delete link more

Question Tools


Asked: 2015-07-03 14:46:01 -0600

Seen: 3,280 times

Last updated: Mar 25 '16