I was following the Converting between ROS images and OpenCV images (Python) tutorial and i came across the following problem while running catkin_make. I am new to ros and i am still finding my way around it. I have installed opencv and have tried out the solutions suggested in other threads, but none of them seem to work. This is the error i get while executing catkin_make.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "opencv2" with any
of the following names:
opencv2Config.cmake
opencv2-config.cmake
Add the installation prefix of "opencv2" to CMAKE_PREFIX_PATH or set
"opencv2_DIR" to a directory containing one of the above files. If
"opencv2" provides a separate development package or SDK, be sure it has
been installed.
my CMakeLists file has the following content
cmake_minimum_required(VERSION 2.8.3)
project(opencv_test)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
opencv2
rospy
sensor_msgs
std_msgs
)
find_package(OpenCV)
include_directories(
${catkin_INCLUDE_DIRS}
)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(opencv_test ${OpenCV_LIBRARIES})
Originally posted by spkulgod on ROS Answers with karma: 23 on 2016-05-27
Post score: 2
Original comments
Comment by ROSkinect on 2016-05-27:
Could you share the CMakeLists?
Comment by gvdhoorn on 2016-05-27:
Please add a link to any tutorials you are following and / or pages you are referring to. It's hard to figure out what you are doing otherwise.
Comment by spkulgod on 2016-05-27:
This is the link for the tutorial
http://wiki.ros.org/cv_bridge/Tutorials/ConvertingBetweenROSImagesAndOpenCVImagesPython
Comment by gvdhoorn on 2016-05-28:
That page only tells you to update your manifest, which is not CMakeLists.txt
, but package.xml
.
Comment by spkulgod on 2016-05-28:
yeah but the vision_opencv page asks me to edit the CMakeLists.txt
the link for the isvision_opencv
Comment by gvdhoorn on 2016-05-28:
Again: that is for C++ only. Python programs/scripts/nodes are never linked against C++ libraries, nor do you setup an include path for them (or at least, not in the way that CMake snippet is doing).