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

opencv3.0 ros indigo

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

pmarinplaza gravatar image

Hi,

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: libopencv_imgproc.so.3.0, needed by /usr/local/lib/libopencv_calib3d.so.3.0.0, may conflict with libopencv_imgproc.so.2.4
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 'libopencv_videostab.so.2.4.8' /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/libopencv_videostab.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_video.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_superres.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_stitching.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_photo.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_ocl.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_ml.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_legacy.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_gpu.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_flann.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_features2d.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_contrib.so.2.4.8 -l:/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.2.4.8

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
3

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

Comments

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
1

same warning libopencv_imgproc.so.2.4 and libopencv_core.so.2.4 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. https://github.com/ros-perception/ima...https://github.com/ros-perception/vis... 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
0

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: libopencv_imgproc.so.2.4, needed by /opt/ros/indigo/lib/libcv_bridge.so, may conflict with libopencv_imgproc.so.3.0
/usr/bin/ld: warning: libopencv_core.so.2.4, needed by /opt/ros/indigo/lib/libcv_bridge.so, may conflict with libopencv_core.so.3.0

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

2 followers

Stats

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

Seen: 6,447 times

Last updated: Oct 07 '15