Ask Your Question

Revision history [back]

It would be helpful if you gave more information ... operating system, version of ROS, etc.

OpenCV is an external library in Electric (which I am guessing you are using). Try installing the library. On the Mac using homebrew do: brew install opencv.

In my CMakeLists.txt file to build a fictional program called test, I have the following:

find_package(OpenCV 2.3.1 REQUIRED)
rosbuild_add_executable(test src/test.cpp )
target_link_libraries(test ${OpenCV_LIBS})

If you are not sure which opencv cmake is finding, you can do something like this to the CMakeLists.txt:

if(OpenCV_FOUND)
     message("Found OpenCV ${OpenCV_INCLUDE_DIR}")
endif(OpenCV_FOUND)

Hope that helps!

It would be helpful if you gave more information ... operating system, version of ROS, etc.

OpenCV is an external library in Electric (which I am guessing you are using). Try installing the library. On the Mac using homebrew do: brew install opencv.

In my CMakeLists.txt file to build a fictional program called test, I have the following:

find_package(OpenCV 2.3.1 REQUIRED)
rosbuild_add_executable(test src/test.cpp )
target_link_libraries(test ${OpenCV_LIBS})

If you are not sure which opencv cmake is finding, you can do something like this to the CMakeLists.txt:

if(OpenCV_FOUND)
     message("Found OpenCV ${OpenCV_INCLUDE_DIR}")
message("====== Found ${OpenCV_VERSION} =======")
endif(OpenCV_FOUND)

Hope that helps!