Ubuntu 20.04 配置 OpenCV + Realsense2 + PCL + libfacedetection (转)

本文转自该博客

  • 电脑系统:Ubuntu 20.04

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

2)Clone repo

git clone https://github.com/opencv/opencv.git

3)Build OpenCV

cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j16

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

2)Clone repo

git clone https://github.com/PointCloudLibrary/pcl.git

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

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

2)Install dependencies

sudo apt install libxrandr-dev
sudo apt install libxinerama-dev
sudo apt install libxcursor-dev

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

2)Build libfacedetection

cd libfacedetection
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/libfacedetection -G "Unix Makefiles" ..
make
sudo make install

3)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
  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值