For ROS Diamondback and C Turtle, OpenCV was provided inside of a ROS package. The opencv2 package contains OpenCV 2.2 (Diamondback) or OpenCV 2.0 (C Turtle).
Starting in ROS Electric, OpenCV can now be used with ROS as a rosdep system dependency. The opencv2 ROS package is still provided for backwards compatibility, but will be removed in future releases.
The instructions below will guide you through configuring your ROS packages to use the OpenCV rosdep system dependency.
Migrating from Diamondback
Please transition away from using <depend package="opencv2" /> to link against OpenCV in your packages. Standard CMake mechanisms (e.g. find_package()) are now the preferred way of linking against OpenCV.
CMakeLists.txt
For convenience, the system install includes CMake config files for easily finding and configuring OpenCV in your CMakeLists.txt using the normal find_package() macro:
find_package(OpenCV REQUIRED)
#define some target ...
target_link_libraries(my_target ${OpenCV_LIBRARIES})
Package/stack dependencies
When on Fuerte releasing for Electric
You just need the following:
manifest.xml
<rosdep name="opencv2"/>
When on Electric releasing for Electric
The OpenCV rosdep is defined in the vision_opencv stack. You may depend on OpenCV by adding the following:
For convenience, the system install includes CMake config files for easily finding and configuring OpenCV in your CMakeLists.txt using the normal find_package() macro:
find_package(OpenCV REQUIRED)
#define some target ...
target_link_libraries(my_target ${OpenCV_LIBS})
Package/stack dependencies
OpenCV only dependency
You just need the following:
manifest.xml
<rosdep name="opencv2"/>
vision-opencv dependency
The OpenCV rosdep is defined in the vision_opencv stack. You may depend on OpenCV by adding the following:
If your issue is related to the OpenCV packaged in ROS (it is too old, you would like to see a backport in there ...), please file a bug using the link at vision_opencv.
Ubuntu .deb of OpenCV2 is released into ROS as a Third Party package using source code from its upstream repository, which means it works independently from its standalone version (libopencv*).
You can check its version number by:
$ rosversion opencv2
Since Indigo, OpenCV is not released from ROS infrastructure. Its ROS-interface package vision_opencv depends on standalone libopencv* packages.