OpenCV
安装依赖
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
,可以执行以下代码:
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev #libjasper1是libjasper-dev的依赖包
下载OpenCV和OpenCV-contrib模块
- 官网地址
OpenCV下载地址 - git clone下载
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目录
cd <opencv_directory>
mkdir build //建立一个build目录,把cmake的文件都放着里边
cd build //进入build目录
- 开始cmake,这一步需要一会儿才能cmake完。
- 有contrib模块
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
2. 无contrib模块
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
编译过程中ippicv遇到下载问题,可以参考下面链接:https://blog.csdn.net/orDream/article/details/84311697
- build一下,把代码编译成可执行文件
make -j7 # 运行7个并行作业
- 安装库文件
sudo make install
PCL 1.9.1
依赖库
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
下载源码
配置并编译
cd pcl
mkdir build
cd build
cmake -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
解决方法:
sudo apt install aptitude
sudo aptitude install ros-melodic-desktop-full
安装ROS出现 Unable to Correct Problems ‘You have Held Broken Packages’ 错误_佚明zj的博客-CSDN博客