what is best way to use different version of opencv?

asked 2021-08-19 10:20:05 -0600

kyubot gravatar image

updated 2022-05-01 13:16:51 -0600

lucasw gravatar image

Hello all,
I am running ROS-melodic on ubuntu 18.04 everything apt installation method. This installation integrates opencv version 3.2 which is quite old and does not support some important features.

For example, I need to include opencv2/dnn.h for image detection but opencv 3.2 does not have these headers. So I searched for installing later version of opencv by cmake method however they all require removing previously installed opencv and as consequences, it removes many important ROS packages and messed up my previous settings.

Even though I catkin install all those packages manually not all problems solved and some of my package does not build properly.

So I am asking if there is a way to integrate different version of opencv simultaneously with existing apt installed opencv? Any suggestions would be much appreciated.

edit retag flag offensive close merge delete


If you install a more updated version of OpenCv, will you use the melodic-opencv at all ? Or just keep so that you won’t mess up other packages by removing that.

Fetullah Atas gravatar image Fetullah Atas  ( 2021-08-19 15:16:09 -0600 )edit

Thanks for reply. Are you talking about http://wiki.ros.org/vision_opencv ? I'm just curious if installing this package will enable parallel installation of opencv.

kyubot gravatar image kyubot  ( 2021-08-19 18:29:20 -0600 )edit

OpenCv is listed as dependency of this package so if you do a rosdep, it should install a version of OpenCv, but you can play with CmakeLists to select a desired version for your own package.

Fetullah Atas gravatar image Fetullah Atas  ( 2021-08-20 01:37:42 -0600 )edit