Ubuntu 20.04 配置 Realsense2 + PCL + libfacedetection

Installation Guide

1. Configurate software source (Improve download speed)

See https://blog.csdn.net/luodong1501/article/details/106177355

2. Install OpenCV

Reference: https://blog.csdn.net/qq_34256375/article/details/107836051

  1. Install dependencies
sudo apt-get install git build-essential
sudo apt-get install cmake 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
  1. Clone repo
git clone https://github.com/opencv/opencv.git
  1. Build OpenCV
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j16
  1. Install
sudo make install

3. Install PCL

  1. Install dependencies
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 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libvtk7-dev
sudo apt-get install 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
  1. Clone repo
git clone https://github.com/PointCloudLibrary/pcl.git
  1. Build PCL
cd pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
    -DCMAKE_INSTALL_PREFIX=/usr ..

make -j16
  1. Install PCL
sudo make install

4. Install OpenGL

Reference: https://blog.csdn.net/csp123258/article/details/82626042

sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install freeglut3-dev

5. Install glfw

Reference: https://blog.csdn.net/dddxxxx/article/details/80411498

  1. Download glfw and unzip
wget https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip
unzip glfw-3.3.2.zip -d glfw-3.3.2

  1. Install dependencies
sudo apt install libxrandr-dev
sudo apt install libxinerama-dev
sudo apt install libxcursor-dev
  1. Build and install glfw
cd glfw-3.3.2
mkdir glfw-build
cd glfw-build
sudo cmake ../
make -j16
sudo make install

6. Install Realsense2

sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u

sudo apt-get install librealsense2-dkms 
sudo apt-get install librealsense2-utils  
sudo apt-get install librealsense2-dev 
sudo apt-get install librealsense2-dbg  

7. Install libfacedetection

  1. Clone repo
git clone https://github.com/ShiqiYu/libfacedetection.git
  1. Build libfacedetection
cd libfacedetection
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/libfacedetection -G "Unix Makefiles" ..
make
sudo make install
  1. You may need copy files below to registration/src
src/facedetectcnn.cpp
src/facedetectcnn.h
src/facedetectcnn-int8data.cpp
src/facedetectcnn-model.cpp
facedetection_export.h

8. Build Project

mkdir build
cmake build
cd build
make

你可能感兴趣的:(笔记)