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

opencv3.0 ros indigo

asked 2015-07-16 12:55:49 -0600

pmarinplaza gravatar image


I want to use opencv 3.0.0 in ros but I have troubles linking my code. When install ros-indigo-desktop-full there are dependencies to opencv2.4 for some pkg like cv_bridge or image_pipeline.

When linking my program seems to find opencv 3 but there are conflicts with opencv 2.4:

/usr/bin/ld: warning:, needed by /usr/local/lib/, may conflict with
Built target disparity_node

Once I run the program there are seg fault without any reason.

Every pkg which depends on opencv2.4 in ros/opt/share/<pkg> are like

$ grep -r '' /opt/ros/indigo/*


  /opt/ros/indigo/lib/pkgconfig/cv_bridge.pc:Libs: -L/opt/ros/indigo/lib -lcv_bridge -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/ -l:/usr/lib/x86_64-linux-gnu/

I want to know if there is an option to change every dependency from opencv2.4 to opencv3.0. and if it is autogenerated code, where and how can I change the config file.

Or if it is possible to include some statement in my CMakeLists.txt to use opencv3.0 instead of use opencv2.4

Best regards.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-07-16 13:20:27 -0600

lucasw gravatar image

I'm mostly certain you would have to recompile image_pipeline and cv_bridge against 3.0 also.

If possible you can exclude build dependencies on image_pipeline and cv_bridge from your opencv 3.0 dependent node. There is no problem with two different nodes being linked to different versions of opencv since they are different executables, but I'm guessing you want cv_bridge to do image conversions (though those aren't too hard to duplicate with your own code, even cut and paste right out of cv_bridge source).

Another thing is you want your system to default to the standard opencv libraries that ros is built against, but in the cmake for the 3.0 node have it do some extra steps to go find 3.0 installed into a non standard location.

edit flag offensive delete link more


I've uninstalled both pkg and try to compile but other error appear related with boost libraries. Once I fix this problem I update the answer if works or not. Thanks!

pmarinplaza gravatar image pmarinplaza  ( 2015-07-20 02:12:25 -0600 )edit

I mark this post as answered because it works. Compile good with the last source of cv_bridge (is already prepared for opencv3) and other pkg compiled from source. I still have problems with rviz and cuda libraries linking while compiling :( but this is other problem. Thank you a lot.

pmarinplaza gravatar image pmarinplaza  ( 2015-07-20 09:46:58 -0600 )edit

same warning and VS 3.0 version. So I want to link only opencv3 with your solution, but I do not understand how to. The solution is recompile image_pipeline and cv_bridge? How can I do that?

marilia15 gravatar image marilia15  ( 2015-10-06 15:13:40 -0600 )edit

Hi Guys, I am following Marilia15 request. Can you please be more specific on how can we recompile image_pipeline and cv_bridge? Thank you for your assistance

chartersCruz gravatar image chartersCruz  ( 2016-01-18 16:38:15 -0600 )edit

Hi, you can clone cv_bridge and image_pipeline source code from the following git hub. Clone them in your src directory, then you can recompile them. I hope this helps.

Jangwon gravatar image Jangwon  ( 2016-03-10 12:02:10 -0600 )edit

how do I unistall opencv. It seems that the turtlebot people install opencv 3.0 as default making my packages crash cause I use opencv 2.4

Pototo gravatar image Pototo  ( 2016-11-03 19:58:32 -0600 )edit

answered 2015-10-06 15:11:44 -0600

marilia15 gravatar image

updated 2015-10-07 03:13:02 -0600

gvdhoorn gravatar image

I have ubuntu 14.04, ros indigo, and opencv3 and I am following the tutorial UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages but I get this warnings:

/usr/bin/ld: warning:, needed by /opt/ros/indigo/lib/, may conflict with
/usr/bin/ld: warning:, needed by /opt/ros/indigo/lib/, may conflict with

If I use the executable I get some errors. So I want to link only opencv3, but I do not understand your solution because I am new on this. The solution is recompile image_pipeline and cv_bridge? How can I do that?

Thanks in advance

edit flag offensive delete link more

Question Tools



Asked: 2015-07-16 12:55:49 -0600

Seen: 6,159 times

Last updated: Oct 07 '15