Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 'cv_bridge' can not find opencv #345

Open
cnpcshangbo opened this issue Jul 6, 2020 · 19 comments
Open

Project 'cv_bridge' can not find opencv #345

cnpcshangbo opened this issue Jul 6, 2020 · 19 comments

Comments

@cnpcshangbo
Copy link

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

@asasine
Copy link

asasine commented Jul 7, 2020

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

@sh0w
Copy link

sh0w commented Jul 24, 2020

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")

@gaotao19890725
Copy link

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.

@cnpcshangbo
Copy link
Author

It seems this error is related to OpenCV on Jetson.

@yyyll
Copy link

yyyll commented Nov 24, 2020

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

@cnpcshangbo
Copy link
Author

@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.

@yyyll
Copy link

yyyll commented Nov 25, 2020

ok,I understand

@OfficialOwlElder
Copy link

OfficialOwlElder commented Jan 1, 2021

@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 :)!

@XinnWang
Copy link

XinnWang commented Jan 7, 2021

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.

@Captain299792458
Copy link

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

@lovesuiyue
Copy link

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

@itaouil
Copy link

itaouil commented Apr 21, 2022

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 :)

@Dhruti1994
Copy link

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 ?

@sh0w
Copy link

sh0w commented Nov 7, 2022 via email

@AhmedARadwan
Copy link

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

@lisichen123
Copy link

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

@Sitthinan2001
Copy link

THX.

@Jawaheru
Copy link

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

@ijnek
Copy link
Member

ijnek commented Mar 15, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests