Source code

At the bottom of this page, you can find the open source code of the software used as a demo for the 3DV2014 tutorial. (the code is not bug proofed)

This code is for academic research only. Please cite the corresponding papers if you use this code.

Summary:

DemoStep1

This implementation performs online fusion of RGB-D images into local 3D models that are sets of planar patches with bump images. Every few frames (100 frames in the original code) the current local 3D model is streamed out to a temporary folder and reset.

To run the integration with live data from the Microsoft Kinect camera, right click on the screen and select 'Run with Kinect1'.

DemoStep2

This implementation performs the global fusion of multiple local 3D models that are generated from the DemoStep1 software. The local 3D models (sets of planar patches with bump images) are streamed in from the temporary folder and accumulated into a global graph.

At the end of the scanning procedure (i.e. after closing DemoStep1 soft) similar planar patches should be merged to generate the final 3D model.

interaction options

  • mouse and arrows on keyboard for navigation
  • 'm' button: merge all similar planar patches
  • 'k' button: switch on/off visualization of keyframes and constraints on the graph (bottom left of the screen)
  • 'w' button: switch on/off the wireframe mode
  • 'l' button: switch on/off the light
  • 'c' button: switch on/off the color mode
  • right click: switch select/edition mode
  • in select mode:
  • maintain 's' button and click on the part of the scene (in upper left part of the screen) you want to select
  • in edition mode:
  • 'r' button: switch on/off the rubbing mode. When rubbing mode is on click on parts of the scene you want to delete (bottom right of the screen)
  • 'p' button: switch on/off the painting mode. When painting mode is on click on parts of the scene you want to draw (bottom right of the screen)
  • 'e' button: switch on/off the extrude mode. When extrudemode is on click on parts of the scene you want to extrude (bottom right of the screen)
  • 'h' button: switch on/off the hole mode. When hole mode is on click on parts of the scene you want to dig (bottom right of the screen)
  • '+' and '-' buttons: increse/decrease size of brush
  • 'u' button: after edition is done update the 3D model
  • 'd' button: delete the selected planar patch
  • 'i': re-initialise the whole 3D model.

Requirements

The code has been developped on windows with Visual Studio 2012.

A CUDA compatible GPU graphic card is required.

To compile the code you will need some additional libraries:

  • Microsoft Kinect SDK
  • Opencv
  • OpenGl
  • glut
  • g2o
  • glew
  • Cuda
  • CGAL
  • boost
  • eigen
  • flann
  • glext

Instructions to compile

  1. Open Visual Studio 2012 and create a new empty solution
  2. Load all source files into the project
  3. In 'Build customization' (right click on the project in the solution explorer) select CUDA
  4. in Project properties, in VC++ directories, enter directories for the additional include and library files.
  5. In project properties, linker/input add additional dependencies.
  6. In project properties, CUDA C/C++, device set 'code generation' to 'compute_20,sm_20'
  7. For all .cu files, right click select property and set Item type to CUDA C/C++

Instructions to run

In DemoStep1, in the main .cpp file, l. 336 set the path to your own temporary folder.

In DemoStep2, in the main .cpp file, l. 110 set the path to your own temporary folder (same as for DemoStep1).

Prefer running the code from the Visual Studio 'Local Windows Debugger'


Code in GitHub: https://github.com/diegothomas/RGB-D-SLAM