opencv2/opencv.hpp no such file or directory [closed]
Hi, I am on jetson using ROS melodic version. I am receiving no such file or directory for opencv2/opencv.hpp. I know I am not linking it properly but not sure how to fix it.
cmake_minimum_required(VERSION 2.8.3)
project(camera)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
image_transport
roscpp
rospy
sensor_msgs
std_msgs
message_generation
message_runtime
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
CATKIN_DEPENDS cv_bridge image_transport roscpp rospy sensor_msgs std_msgs message_generation
message_runtime
)
include_directories(
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
link_directories(
/opt/ros/melodic/lib
)
set(CATKIN_LIBS cv_bridge.so image_transport.so message_filters.so class_loader.so dl.so roslib.so rospack.so python2.7.so boost_program_options.so tinyxml2.so roscpp.so boost_filesystem.so rosconsole.so rosconsole_log4cxx.so rosconsole_backend_interface.so log4cxx.so boost_regex.so xmlrpcpp.so roscpp_serialization.so rostime.so cpp_common.so boost_system.so boost_thread.so boost_chrono.so boost_date_time.so boost_atomic.so pthread.so console_bridge.so)
find_package(OpenCV REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(PKG_OPENCV REQUIRED opencv)
add_executable(capture src/camera_node.cpp )
add_dependencies(capture ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(capture ${CATKIN_LIBS} ${PKG_OPENCV_LDFLAGS} ${V4l2_LIBRARIES})
add_executable(detect src/person_detection_node.cpp )
add_dependencies(detect ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(detect ${CATKIN_LIBS} ${PKG_OPENCV_LDFLAGS} ${V4l2_LIBRARIES})
add_executable(sample_detection_sub src/sample_detection_sub.cpp )
add_dependencies(sample_detection_sub ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(sample_detection_sub ${CATKIN_LIBS} ${PKG_OPENCV_LDFLAGS} ${V4l2_LIBRARIES})
Above is my Cmakelist.txt Below is my opencv Installation procedure
Please show us the command you used to install the opencv development package.
Hi Mike, I had attached the image for OpenCV installation.