vision_opencv icon indicating copy to clipboard operation
vision_opencv copied to clipboard

Project 'cv_bridge' can not find opencv

Open cnpcshangbo opened this issue 4 years ago • 20 comments

Hi, I am compiling https://github.com/thien94/vision_to_mavros. I have installed mavros and vision_opencv from apt command. However, Project 'cv_bridge' can not find opencv.

CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
  Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir,
  which is not found.  It does neither exist as an absolute directory nor in
  '${{prefix}}//usr/include/opencv'.  Check the issue tracker
  'https://github.com/ros-perception/vision_opencv/issues' and consider
  creating a ticket if the problem has not been reported yet.
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  vision_to_mavros/CMakeLists.txt:10 (find_package)

Do you know which environment variable should I set to let Project 'cv_bridge' find opencv? Thanks, Bo

cnpcshangbo avatar Jul 06 '20 22:07 cnpcshangbo

I am getting this same error when compiling https://github.com/IntelRealSense/realsense-ros

asasine avatar Jul 07 '20 18:07 asasine

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

sh0w avatar Jul 24 '20 08:07 sh0w

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

Thank you.

gaotao19890725 avatar Aug 09 '20 13:08 gaotao19890725

It seems this error is related to OpenCV on Jetson.

cnpcshangbo avatar Aug 25 '20 16:08 cnpcshangbo

i had the same problem,but I don‘t solve it. so can you tell me how to resolve ir.

yyyll avatar Nov 24 '20 15:11 yyyll

@yyyll I didn't solve this. I commented the cv_bridge related stuff from https://github.com/thien94/vision_to_mavros since I don't need that.

cnpcshangbo avatar Nov 24 '20 15:11 cnpcshangbo

ok,I understand

yyyll avatar Nov 25 '20 00:11 yyyll

@sh0w

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

This fix worked for me as well on: Nvidia Jetson TX2 with Jetpack 4.4.1 (Ubuntu 18.04) and ROS Melodic.

Thanks :)!

OfficialOwlElder avatar Jan 01 '21 23:01 OfficialOwlElder

Opencv4 is installed by Nvidia's jetson repo, which replaced the original opencv3. The most simple way to solve this is to comment out all the repo inside /etc/apt/sources.list.d/nvidia-l4t-apt-source.list , then apt update and reinstall libopencv-dev. Check this link for help.

XinnWang avatar Jan 07 '21 13:01 XinnWang

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

This works! Thanks a lot

Captain299792458 avatar Feb 11 '22 11:02 Captain299792458

Project 'image_geometry' specifies '/usr/include/opencv' as an include dir, which is not found. It does neither exist as an absolute directory nor in '${{prefix}}//usr/include/opencv'. Check the website 'http://www.ros.org/wiki/image_geometry' for information and consider reporting the problem.

so , how do i solve this problem

lovesuiyue avatar Mar 02 '22 12:03 lovesuiyue

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

Worked :)

Thanks :)

itaouil avatar Apr 21 '22 11:04 itaouil

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic) we fixed it like this: change the file: /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line: set(_include_dirs "include;/usr/include;/usr/include/opencv") to set(_include_dirs "include;/usr/include;/usr/include/opencv4")

Thank you.

But this file not allowing to edit, can you tell us how did you change ?

Dhruti1994 avatar Nov 07 '22 17:11 Dhruti1994

you can change the file permissions to make the file editable using "chmod". you can find lots of resources for this online, just google something like "change file permissions linux chmod"

On Mon, Nov 7, 2022 at 6:54 PM Dhruti1994 @.***> wrote:

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic) we fixed it like this: change the file: /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line: set(_include_dirs "include;/usr/include;/usr/include/opencv") to set(_include_dirs "include;/usr/include;/usr/include/opencv4")

Thank you.

But this file not allowing to edit, can you tell us how did you change ?

— Reply to this email directly, view it on GitHub https://github.com/ros-perception/vision_opencv/issues/345#issuecomment-1305978269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIVQXSELSQXHNEV2F6WTJLWHE64XANCNFSM4OSAONJQ . You are receiving this because you were mentioned.Message ID: @.***>

sh0w avatar Nov 07 '22 20:11 sh0w

I faced the same issue on Jetson Xavier AGX. Thanks to @sh0w the problem is now solved. If you want to quickly fix it in a dockerfile, add the following command before building the workspace:

sed -i 's/set(_include_dirs "include;\/usr\/include;\/usr\/include\/opencv")/set(_include_dirs "include;\/usr\/include;\/usr\/include\/opencv4")/g' /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake

AhmedARadwan avatar Dec 21 '22 07:12 AhmedARadwan

Project 'image_geometry' specifies '/usr/include/opencv' as an include dir, which is not found. It does neither exist as an absolute directory nor in '${{prefix}}//usr/include/opencv'. Check the website 'http://www.ros.org/wiki/image_geometry' for information and consider reporting the problem.

so , how do i solve this problem

i had same problem, how to fix it ? any help will be appreciate

lisichen123 avatar May 16 '23 06:05 lisichen123

THX.

Sitthinan2001 avatar Feb 03 '24 07:02 Sitthinan2001

i had the same problem (jetson xavier + ubuntu 18.04 + ros melodic)

we fixed it like this:

change the file:

/opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake change this line:

set(_include_dirs "include;/usr/include;/usr/include/opencv") to

set(_include_dirs "include;/usr/include;/usr/include/opencv4")

I changed it but still now working, this error shows Screenshot from 2024-03-13 15-22-55

Jawaheru avatar Mar 13 '24 12:03 Jawaheru

Maintainer here. Could we leave a thumbs up on this comment if this issue still persists for active distros on ubuntu 20.04 and ubuntu22.04?

ijnek avatar Mar 15 '24 03:03 ijnek