Welcome to OnePiece

点击这里查看中文说明文档。

Congratulations! You find the One Piece!

OnePiece (libonepiece) is a C++ library for RGB-D based SLAM and 3D vision. This library is mainly a summary of some basic knowledge and is used to satisfy the author's obsessive-compulsive disorder. It tries to be designed to be relatively simple, clear in structure, easy to understand, and friendly to novices, but limited to the level of the author, there may still be many areas where the design is not good enough. Currently this library does not use GPU except for the visualization part. The author hopes that OnePiece can help people who are more interested in this field get started faster. Therefore, the first demand of OnePiece is to be as simple as possible and rely less third libraris. Relatively speaking, OnePiece has no advantage in efficiency and speed. In example, you can see that using OnePiece, you can easily build a simple RGBD SLAM system, and finally extract a three-dimensional model, as shown below:

FBAFusion in example

Get Started

The OnePiece development environment is ubuntu 16.04, but it has very few dependent libraries, so there should be no problem to build with ubuntu 18. The two main dependencies are OpenCV, OpenGL and Eigen. Lightweight 3rd libraries are integrated into 3rdParty. Generally speaking, as long as there are OpenCV and Eigen in the environment, it can be compiled and run with one click.

  • Install OpenCV (3.4):
    1. Download opencv
    2. After decompression, enter the folder and type following commands:
$ mkdir build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_stitching=OFF -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUDA=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF ..
$ make -j
$ sudo make install
$ sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig
  • Install OpenNI2 (optional):
$ apt-cache search openni2
$ sudo apt-get install libopenni2-dev 
  • Install OpenGL:
$ sudo apt-get install build-essential libgl1-mesa-dev
$ sudo apt-get install freeglut3-dev
$ sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev
  • Enter OnePiece, type following commands:
$ mkdir build && cd build && cmake .. && make -j

Why not design it to be less dependent? In addition to the poor level of the author, another point is that some open-source libraries like OpenCV and Eigen, are used widely. If all io interfaces are used at a lower level, it is not convenient for the library to be used in more other projects (the author firstly used Open3D in one project. Because Open3D image reading uses a lower-level library instead of OpenCV, and the project uses OpenCV mat. The format conversion becomes very troublesome. So he decided to implemented the algorithm by hiself. This code became the earliest piece in OnePiece).

Download

The code is released in github: OnePiece. Test data can be downloaded from TestData.

Why 'One Piece'?

  • One Piece is the final secret treasure in One Piece. Congratulations on finding the treasure (I hope it can help you and is a treasure for you)!
  • OnePiece is also just one piece of knowledge in 3D vision and computer graphics. There is a vast ocean for you to explore.