0
$\begingroup$

Rosanswers logo

Hello, I have OpenCV 2.4.8 which was installed along with ROS Indigo on an Ubuntu 14.04. My project requires use of OpenCV 2.4.9. I have limited understanding of how this installation works. I have seen a few questions and answers related to this. But it is still not clear to me. So, I have a few questions:

  1. Can I install OpenCV 2.4.9 by following the normal installation method? If I do so will it break the version (2.4.8) linked with ROS Indigo?

  2. If I get OpenCV 2.4.9 installed, how can I get it to work with ROS Indigo? Also, once linked how to get it back in standalone mode?


Originally posted by skr_robo on ROS Answers with karma: 178 on 2016-06-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It is possible to work with both versions of the library parallel, but it would not be recomendable because you have to pay some extra attention to possible issues related with it.

You can do it in many ways. One of them would be to download the code of the exact version you want, compile it and deploy/install it for instance in /usr/local. Then you will be able to link your code to this version of opencv (using cmake and the CMakeList.txt file), while you are linked at the same time to other indigo libraries that may depend to the original 2.4.8 version of opencv.


Originally posted by Pablo Iñigo Blasco with karma: 2982 on 2016-06-07

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by skr_robo on 2016-06-09:
Thank you for the reply. Can you pls tell me how to edit CMakeLists.txt so that ROS uses OpenCV 2.4.9

Comment by Pablo Iñigo Blasco on 2016-06-10:
The ROS libraries and executable come already linked to a specific (and not changeable opencv library). However, for your custom code you can select the version of opencv in cmake. One thing you have todo is: FIND_PACKAGE(OpenCV 2.4.8 EXACT REQUIRED)

Comment by Pablo Iñigo Blasco on 2016-06-10:
Additionally you have to enable cmake reach the development libraries you are going to use. It can be done in many ways, for instance you can set the OPENCV_DIR cmake variable (through the CMakeFileLists.txt or using the cmake -DOPENCV_DIR or configuring the build with ccmake)

Comment by Pablo Iñigo Blasco on 2016-06-10:
All this is possible but you should study how Cmake works here and how the operative system works in terms of library loading and how C++ libraries are linked... otherwise you may find problems or situations that you may not understand

Comment by Pablo Iñigo Blasco on 2016-06-10:
To make ROS work directly with one specific version you will have to compile ROS from sources or find a precompiled version (hydro, indigo, jade, etc.) that is linked with the version of opencv you want.

Comment by skr_robo on 2016-06-10:
Thank You for the guidance. I will start developing an understanding of cmake.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.