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

Opencv2 include problems

asked 2013-02-24 23:37:11 -0600

Oier gravatar image


I am using fuerte an Ubuntu 12.04 and have an include <opencv2/core/core.hpp> which can't be resolved (fatal error: opencv2/core/core.hpp: No such file or directory ). Iin the manifest I have <depend package="opencv2"/> and the file is at /opt/ros/fuerte/include/opencv2/core. Running rospack export --lang=cpp --attrib=cflags opencv2 shows following output

[rospack] Warning: ignoring duplicate cpp tag in export block
-I/opt/ros/fuerte/include/opencv -I/opt/ros/fuerte/include

Any idea why it doesn't finde the file?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-02-25 04:59:56 -0600

Oier gravatar image

I got it working with this:

 if(NOT OpenCV_DIR)
 find_path(OpenCV_DIR "OpenCVConfig.cmake" DOC "Root directory of OpenCV" HINTS    "/opt/ros/fuerte/share/OpenCV/")
endif(NOT OpenCV_DIR)
edit flag offensive delete link more

answered 2013-02-24 23:54:06 -0600

K Chen gravatar image

Using OpenCV through depend package... is obsolete, you can use find_package(OpenCV REQUIRED) in CMakeLists.txt to include the dependencies.

edit flag offensive delete link more


I get a CMake Error at CMakeModules/FindOpenCV.cmake:139 (message): OpenCV required but some headers or libs not found. Please specify OpenCV directory using OpenCV_DIR env. variable. To which directory should OpenCV_DIR point in fuerte?

Oier gravatar image Oier  ( 2013-02-25 01:11:55 -0600 )edit

I found this but /opt/ros/fuerte/stacks/vision_opencv/opencv2/ I have just a Makefile, ROS_NOBUILD and a manifest.xml file. So where should OpenCV_DIR point?

Oier gravatar image Oier  ( 2013-02-25 01:18:59 -0600 )edit

Hi, from ROS Fuerte opencv package is deprecated and will be removed in Groovy. You can find opencv include directories in /opt/ros/fuerte/include/opencv(or opencv2). Typically you dont need to set OpenCV_DIR and CMake will find them. Check your ROS configuration to see where you went wrong.

K Chen gravatar image K Chen  ( 2013-03-14 03:12:16 -0600 )edit

Question Tools


Asked: 2013-02-24 23:37:11 -0600

Seen: 3,564 times

Last updated: Feb 25 '13