本文介绍了尝试安装vision_opencv时,将问题与opencv和ros indigo链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题有两个方面.首先,我很困惑为什么在/opt/ros/indigo/share中有opencv3和OpenCV-3.1.0-dev软件包,因为我已经读过opencv 2.4.8是ROS indigo的默认版本.

Hi my question is of two folds.First, I am confused as why there are opencv3 and OpenCV-3.1.0-dev packages is in /opt/ros/indigo/share as i have read that opencv 2.4.8 is the default version of ROS indigo.

此外,我在ubuntu 14.04上安装了带有ROS Indigo的opencv 2.4.13版本,我想将opencv用于我的项目的视觉部分,为此,我尝试从源代码安装vision_opencv软件包.但是,当我尝试使用catkin_make构建软件包时,会发生以下错误

Also, I have opencv 2.4.13 version installed on ubuntu 14.04 with ROS Indigo, I want to use opencv for vision part for my project and for that i tried to install vision_opencv package from source. However when I try to build the package using catkin_make following error occurs

在这里提出类似的问题 ROS,opencv3和CMake-无法删除该库

similar question is asked here ROS, opencv3 and CMake - unable to remove the library

-- ==> add_subdirectory(vision_opencv/image_geometry)

在/opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake中的CMake错误:183(消息): 导入的目标"opencv_xobjdetect"引用了文件

CMake Error at /opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake:183 (message): The imported target "opencv_xobjdetect" references the file

 "/opt/ros/indigo/lib/libopencv_xobjdetect3.so.3.1.0"

,但是此文件不存在.可能的原因包括:

but this file does not exist. Possible reasons include:

  • 该文件已被删除,重命名或移动到另一个位置.

  • The file was deleted, renamed, or moved to another location.

安装或卸载过程未成功完成.

An install or uninstall procedure did not complete successfully.

安装软件包有缺陷并且包含

The installation package was faulty and contained

"/opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake"

"/opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake"

但不是它引用的所有文件.

but not all the files it references.

呼叫堆栈(最近的呼叫优先): /opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVConfig.cmake:86(包括) vision_opencv/image_geometry/CMakeLists.txt:5(查找包)

Call Stack (most recent call first): /opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVConfig.cmake:86 (include) vision_opencv/image_geometry/CMakeLists.txt:5 (find_package)

-配置不完整,发生了错误!另请参见"/home/hemang/catkin_ws/build/CMakeFiles/CMakeOutput.log".另请参见"/home/hemang/catkin_ws/build/CMakeFiles/CMakeError.log".

-- Configuring incomplete, errors occurred!See also "/home/hemang/catkin_ws/build/CMakeFiles/CMakeOutput.log".See also "/home/hemang/catkin_ws/build/CMakeFiles/CMakeError.log".

我不明白的是为什么当系统未安装opencv3或ros indigo随opencv3一起提供时,为什么尝试与Opencv3链接?

What I dont understand is why is it trying to link with Opencv3 when system does not have opencv3 installed or ROS indigo comes with opencv3 now ??

推荐答案

所以我弄清楚了,所以在cv_bridge和image_geometry的CMakeLists.txt文件中,find package(OpenCV REQUIRED)应该是find package (OpenCV 2.4.13 REQUIRED).就我而言,这是因为我已经安装了OpenCV 2.4.13,可以将其替换为正在使用的任何版本.

so I figured it out so in the CMakeLists.txt files of both cv_bridge and image_geometry, find package(OpenCV REQUIRED) should be find package (OpenCV 2.4.13 REQUIRED) . This is in my case as I have OpenCV 2.4.13 installed, one can replace it with any version one is using.

这篇关于尝试安装vision_opencv时,将问题与opencv和ros indigo链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 22:35