OpenCV 安装依赖 1 2 3 sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
如果提示unable to locate libjasper-dev
,可以执行以下代码:
1 2 3 sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt update sudo apt install libjasper1 libjasper-dev
下载OpenCV和OpenCV-contrib模块
官网地址OpenCV下载地址
git clone下载
1 2 3 cd <working_directory>git clone https://github.com/opencv/opencv.git git clone https://github.com/opencv/opencv_contrib.git
编译
把opencv-contrib模块移入opencv目录下(没有contrib模块就不移入)
在opencv目录下新建一个build目录
1 2 3 cd <opencv_directory>mkdir build //建立一个build目录,把cmake的文件都放着里边 cd build //进入build目录
开始cmake,这一步需要一会儿才能cmake完。
有contrib模块1 cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
无contrib模块1 cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
编译过程中ippicv遇到下载问题,可以参考下面链接:https://blog.csdn.net/orDream/article/details/84311697
build一下,把代码编译成可执行文件
安装库文件
PCL 1.9.1 依赖库 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 sudo apt-get update sudo apt-get install git build-essential linux-libc-dev sudo apt-get install cmake cmake-gui sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev sudo apt-get install mpi-default-dev openmpi-bin openmpi-common sudo apt-get install libflann1.8 libflann-dev sudo apt-get install libeigen3-dev sudo apt-get install libboost-all-dev sudo apt-get install libvtk7.1 libvtk7.1-qt libvtk7-dev sudo apt-get install libqhull* libgtest-dev sudo apt-get install freeglut3-dev pkg-config sudo apt-get install libxmu-dev libxi-dev sudo apt-get install mono-complete sudo apt-get install openjdk-8-jdk openjdk-8-jre sudo apt-get install libopenni-dev sudo apt-get install libopenni2-dev
下载源码 pcl-1.9.1
配置并编译 1 2 3 4 5 6 cd pclmkdir build cd buildcmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=ON-DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr .. make -j7 sudo make install
ROS melodic/Installation/Ubuntu - ROS Wiki
问题1:rosdep command not found
解决方法:sudo apt install python-rosdep
问题2: Unable to Correct Problems ‘You have Held Broken Packages 解决方法:
1 2 sudo apt install aptitude sudo aptitude install ros-melodic-desktop-full
安装ROS出现 Unable to Correct Problems ‘You have Held Broken Packages’ 错误_佚明zj的博客-CSDN博客