Ask Your Question
0

Opencv2 include problems

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

Oier gravatar image

Hello,

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
0

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

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)
FIND_PACKAGE(OpenCV REQUIRED)
edit flag offensive delete link more
0

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

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

Comments

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 -0500 )edit

I found this http://answers.ros.org/question/34794/maintaining-backwards-compatibility-opencv2-problem/?answer=35329#post-id-35329 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 -0500 )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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 3,123 times

Last updated: Feb 25 '13