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

Revision history [back]

click to hide/show revision 1
initial version

Quote:

Then I copy opencv and opencv2 from usr/local/include to /ros_core_ws/install/include so that ROS can find all the header file of OpenCV(such as highgui.h).

Do not do that!

Add to your CMakeLists.txt:

find_package( OpenCV REQUIRED )

include_directories( ${OpenCV_INCLUDE_DIRS} )

and link your targets against OpenCV_LIBS:

target_link_libraries( your_target ${OpenCV_LIBS} )