Git Product home page Git Product logo

badslam's Introduction

BAD SLAM

Overview

BAD SLAM is a real-time approach for Simultaneous Localization and Mapping (SLAM) for RGB-D cameras. Supported platforms are Linux and Windows. The software requires an NVidia graphics card with CUDA compute capability 5.3 or later (however, it would be easy to lower this requirement).

This repository contains the BAD SLAM application and the library it is based on, libvis. The library is work-in-progress and it is not recommended to use it for other projects at this point.

The application and library code is licensed under the BSD license, but please also notice the licenses of the included or externally used third-party components.

If you use the provided code for research, please cite the paper describing the approach:

Thomas Schöps, Torsten Sattler, Marc Pollefeys, "BAD SLAM: Bundle Adjusted Direct RGB-D SLAM", CVPR 2019.

The Windows port and Kinect-for-Azure (K4A) integration has been contributed by Silvano Galliani (Microsoft AI & Vision Zurich).

Screenshots & Videos

Main window Surfel normals display Keyframe inspection
Main Window Settings Keyframe dialog

Camera requirements

Please keep in mind that BAD SLAM has been designed for high-quality RGB-D videos and is likely to perform badly (no pun intended) on lower-quality RGB-D videos. For more details, see the documentation on camera compatibility.

Pre-built binaries

Binaries are available for download as GitHub releases.

Windows

For Windows, an executable compiled with Visual Studio 2019 is provided. It is also required to download the loop closure resource files as described below in this ReadMe, or loop closures will be disabled. In addition, performing CUDA block-size autotuning as also described below is recommended.

If the executable fails to start due to missing DLLs, try installing the latest Visual C++ redistributable files for Visual Studio 2019.

Linux

For Linux, an AppImage is provided. Please note that it is also required to download the loop closure resource files as described below in this ReadMe, or loop closures will be disabled. In addition, performing CUDA block-size autotuning as also described below is recommended.

In case you encounter an error like

./badslam: relocation error: [...]/libQt5DBus.so.5: symbol dbus_message_get_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libdbus-1.so.3 with link time reference

then your dbus library is too old. This can be fixed by downloading a recent version and setting LD_LIBRARY_PATH to the directory containing these files before starting the AppImage.

Building

Building has been tested on Ubuntu 14.04 and Ubuntu 18.04 (with gcc), and on Windows (with Visual Studio 2019 and 2017).

The following external dependencies are required.

Dependency Version(s) known to work
Boost 1.54.0
CUDA 8, 9.1, 10.1
DLib commit b6c28fb
Eigen 3.3.7
g2o
GLEW
GTest
OpenCV 3.1.0, 3.2.0, 3.4.5, 3.4.6; 4.x does NOT work without changes
OpenGV in Visual Studio 2017 it compiles only in debug mode
Qt 5.12.0; minimum version: 5.8
SuiteSparse
zlib

Notice that OpenCV is only required as a dependency for loop detection by DLib. Also notice that there are (at least) two different libraries with the name DLib, so be sure to install the correct one.

The following external dependencies are optional.

Dependency Purpose
librealsense2 Live input from RealSense D400 series depth cameras (tested with the D435 only).
Structure SDK Live input from Structure Core cameras (tested with the color version only). To use this, set the SCSDK_ROOT CMake variable to the SDK path.
k4a & k4arecord Live input from Azure Kinect cameras.

Build instructions for Linux

Since OpenGV (at the time of writing) always uses the -march=native flag, both BAD SLAM and g2o must use this as well. (For g2o, check that the BUILD_WITH_MARCH_NATIVE CMake option is set to ON.) If there are inconsistencies, the program will likely crash when OpenGV or g2o functionality is used (i.e., at loop closures).

After obtaining all dependencies, the application can be built with CMake, for example as follows:

mkdir build_RelWithDebInfo
cd build_RelWithDebInfo
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CUDA_FLAGS="-arch=sm_61" ..
make -j badslam  # Reduce the number of threads if running out of memory, e.g., -j3

Make sure to specify suitable CUDA architecture(s) in CMAKE_CUDA_FLAGS. Common settings would either be the CUDA architecture of your graphics card only (in case you only intend to run the compiled application on the system it was compiled on), or a range of virtual architectures (in case the compiled application is intended for distribution). See the corresponding CUDA documentation.

Optionally, after building, the unit tests can be run, which test some of the bundle adjustment functionality. To do so, build and run the following executable:

make -j badslam_test
./build_RelWithDebInfo/applications/badslam/badslam_test

All tests should pass. Troubleshooting:

  • If you get a CUDA error like "too many resources requested for launch", probably a default CUDA kernel block size does not work for your GPU. See below for block-size tuning. The application has been tested on GTX 1080 and GTX 1070 GPUs.
  • If the Optimization.PoseGraphOptimizer test crashes, for example with an error message like "Cholesky failure", then please verify that your build of g2o has the BUILD_WITH_MARCH_NATIVE CMake option set to ON, and that BAD SLAM actually uses this install of g2o.

Build instructions for Windows

The application can be built by creating a Visual Studio 2019 solution for it with CMake, then compiling the "badslam" project in this solution.

It seemed that a workaround was required to prevent some unresolved external symbols in g2o_csparse_extension (for example, duplicating the problematic functions into g2o_solver_csparse).

Make sure to specify suitable CUDA architecture(s) in CMAKE_CUDA_FLAGS. Common settings would either be the CUDA architecture of your graphics card only (in case you only intend to run the compiled application on the system it was compiled on), or a range of virtual architectures (in case the compiled application is intended for distribution). See the corresponding CUDA documentation.

Dataset format

For CUDA block-size tuning (see below), at least one dataset should be obtained, even if one intends to run the program with live input.

The program supports datasets in the format of the ETH3D SLAM Benchmark for RGB-D videos. This is an extension of the format introduced by the TUM RGB-D benchmark, containing two small additions:

  • The original format does not specify the intrinsic camera calibration. BAD SLAM thus additionally expects a file calibration.txt in the dataset directory, consisting of a single line of text structured as follows:
    fx fy cx cy
    
    These values specify the parameters for the pinhole projection (fx * x + cx, fy * y + cy). The coordinate system convention for cx and cy is that the origin (0, 0) of pixel coordinates is at the center of the top-left pixel in the image.
  • The associate.py tool from the benchmark must be run as follows to associate the color and depth images:
    python associate.py rgb.txt depth.txt > associated.txt
    

Initial setup

After building the executable and obtaining a dataset, there are two more steps to be done before running the program.

First, the resource files for loop closure handling should be set up (unless the parameter --no_loop_detection is used to disable loop detection). Download the resource files of the DLoopDetector demo. The two relevant files from this archive, brief_k10L6.voc and brief_pattern.yml, must be extracted into a directory named "resources" in the application executable's directory (or an analogous symlink must be created), for example:

- build_RelWithDebInfo
  - applications
    - badslam
      - badslam (executable file)
      - resources
        - brief_k10L6.voc (notice that this is compressed in the archive and needs to be extracted separately)
        - brief_pattern.yml

Second, the CUDA kernel block size auto-tuning should be run. This is not strictly required in case the default sizes work for your GPU, but strongly recommended. This step serves two purposes:

  • Sometimes, CUDA kernels won't launch with a given thread block size since this would require too many resources. Block size auto-tuning determines and avoids those problematic configurations.
  • The best block sizes to call CUDA kernels may vary between different graphics cards, and the best way to figure them out is to benchmark it, which the tuning does.

To test your GPU, run the badslam executable with the provided tuning script on any dataset in sequential mode:

python scripts/auto_tune_parameters.py <path_to_badslam_executable> <path_to_dataset> --sequential_ba --sequential_loop_detection

The script will run the program multiple times using different parameters and measure the runtime, i.e., do not run another computing task at the same time to not influence the measurements. It should output a file auto_tuning_result.txt and intermediate files auto_tuning_iteration_X.txt. Move the result file into the resources directory used by BAD SLAM (where the loop detector resources are also stored in). The file will be loaded automatically if it exists in this directory. The intermediate files can be deleted.

Since the program runs multiple times, you may want to limit the number of frames it runs on to speed it up with --end_frame. Also, please notice that tuning data will only be gathered for CUDA kernels that run during the tuning. If later other kernels run during the actual program invocation, they will still use the default block size. So, if for example you want to tune the PCG-related kernels instead of those for alternating optimization, then you need to pass the corresponding parameter --use_pcg in the tuning call. Since the tuning result files are simple plain text files, the results of multiple tuning runs with different parameters could be easily merged to create a tuning file that covers all kernels. Doing this automatically would be a possible future addition to the tuning script.

Running

The simplest way to start the program is without any command-line arguments:

./build_RelWithDebInfo/applications/badslam/badslam

It will show a settings window then that allows to select a dataset or live input, and allows to adjust a variety of parameters.

Alternatively, the program can be run without visualization by specifying all parameters on the command line. If parameters are given on the command line, the visualization can be used with the --gui flag (to start showing the settings window) or the --gui_run flag (to start running immediately).

For example, to immediately start running SLAM on a dataset in the GUI, use:

./build_RelWithDebInfo/applications/badslam/badslam <dataset_path> --gui_run

See the documentation on command line parameters for more details.

The first time the program runs on a dataset, the performance might be limited by the time it takes to read the image files from the hard disk (unless the dataset is on an SSD, or is already cached because the files were written recently). Subsequent runs should be faster as long as the files remain cached.

Please also notice that the real-time mode with parallel odometry and bundle adjustment, despite being the default, was added late in the development process and should be considered potentially unstable (in particular when optimizing the depth camera's deformation, which lacks synchronization for the access to a GPU buffer). Thus, to possibly increase robustness, use the --sequential_ba parameter. Live operation may still be simulated by also specifying --target_frame_rate <desired_fps>.

Docker

To build the image, do:

$ docker build  --build-arg CUDA_ARCH="DESIRED_ARCH" -t eth3d/badslam .

where DESIRED_ARCH corresponds to the CUDA architecture you wish to build with (for example: sm_61).

To run the image using an example dataset, download & unzip the dataset, then invoke:

$ docker run  --gpus all -it -e DISPLAY  -v /tmp/.X11-unix:/tmp/.X11-unix:ro  --mount type=bind,source=ABSOLUTE_PATH_TO_DATASET,target=/datasets eth3d/badslam  /bin/bash

Using the "einstein" dataset as an example, you could run

$ ./applications/badslam/badslam /datasets/einstein_1 --export_reconstruction einstein.ply && meshlab einstein.ply

Note: if you observe something like:

qt.qpa.xcb: could not connect to display :0.0  

Make sure to:

$ xhost + 

in your terminal before running the container.

Extending BAD SLAM

Contributions to this open source project are very welcome. Please try to follow the existing coding style (which is loosely inspired by the Google C++ coding style, but somewhat relaxed in some aspects).

If you are interested in using the direct bundle adjustment component without SLAM, then the intrinsics optimization unit test might be a good starting point, showing how to set up keyframes and perform optimization. It is at applications/badslam/src/badslam/test/test_intrinsics_optimization_[photometric/geometric]_residual.cc.

If you plan to change the cost function used for bundle adjustment, you may want to have a look at scripts/jacobians_derivation.py. This script automatically computes the Jacobians required for optimization from a specification of the residuals in Python. It also outputs somewhat optimized C++ functions to compute the residual, the Jacobian, and both the residual and Jacobian at the same time. The script requires sympy to run. Its main limitation is that it operates on a symbolic representation of the residual (instead of on the algorithm for residual computation, as an autodiff tool would do), which means that its internal residual term may become huge. This may cause excessive runtimes of the script for more complex residuals. You can try removing the simplify() calls in jacobian_functions.py to speed it up, while applying less simplification to the resulting expressions.

Differences to the paper

The open source version of the code has undergone strong refactoring compared to the version used to produce the results in the paper, many new features have been added, and many fixes were done. The photometric residual used for global optimization is slightly different: Instead of using the gradient magnitude as the photometric descriptor, the two components of the gradient are used separately. For these reasons, it should not be expected that the code reproduces the results in the paper exactly, however the results should be similar.

badslam's People

Contributors

blgene avatar iabaldwin avatar kysucix avatar puzzlepaint avatar zellx3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

badslam's Issues

Privide example auto_tuning_result.txt

It would be great if example auto_tuning_result.txt will be included in the repository.
For now, it is hard to guess what to do if badslam crashes with Cuda Error: out of memory under the auto_tune_parameters.py

Many thanks!

cuda_image_processing.c:192

Thank you very much. I was suspecting the compute capability as well but I thought I had a 5.3. I will try doing that.

Question about surfel position optimization

Hello, thank you for sharing this great work !

I have a question about the surfel position optimization.

During the optimization, the surfels are only allowed to move along their normal directions and a parametrization P_new = P_old + t * normal is used. In the code, I believe the update is done here (without the descriptor residual).

The thing that is bothering me is that the jacobian used for this optimization is the one w.r.t. the depth (in this function) and not w.r.t to the parameter "t".

Could you help me understand the reason why the increment to the depth is directly applied to the parameter "t" ?

"CUDA error: invalid device function" while auto_tunning

Hi guys,

I am trying to run BAD_SLAM on my laptop with GTX 850M (Compute Capability 5.0) in Ubuntu 1804.

I have passed "make -j badslam" and "make -j badslam_test".

However, I met an error while running Auto_tunning as shown below
image

I tried to solve this with this method, but it was not working: #34

Please help me with this and I can provide more logs if needed. Thanks in advance!

FATAL_ERROR "CMake did not find CUDA, which is required to build this program."

hi, friends. Today, i build it on a server, named aaaa, my personal account name is yjs. As is shown below. The aaaa is already installed CUDA. in aaaa run "env | grep "cuda" " has shown. But the CMakeLists.txt indicate FATAL_ERROR "CMake did not find CUDA, which is required to build this program.". As is shown below. can you give me some help? thanks!!!
Screenshot from 2020-02-21 18-02-05

DUtils/DUtils.h: No such file or directory

Hi, I followed the steps in the readme. However, it encounters error as follows:

/home/B0229/Desktop/study/badslam-master/applications/badslam/third_party/DBoW2/src/FBrief.cpp:14:29: fatal error: DVision/DVision.h: No such file or directory
 #include <DVision/DVision.h>
                             ^
compilation terminated.
[ 31%] Built target png
/home/B0229/Desktop/study/badslam-master/applications/badslam/third_party/DBoW2/src/FORB.cpp:16:27: fatal error: DUtils/DUtils.h: No such file or directory
 #include <DUtils/DUtils.h>
                           ^
compilation terminated.
[ 31%] Automatic MOC for target libvis
applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/build.make:101: recipe for target 'applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/src/FORB.cpp.o' failed
make[3]: *** [applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/src/FORB.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/build.make:88: recipe for target 'applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/src/FBrief.cpp.o' failed
make[3]: *** [applications/badslam/third_party/DBoW2/CMakeFiles/DBoW2.dir/src/FBrief.cpp.o] Error 1

It seems DUtils/DUtils.h and DVision/DVision.h are missing

Any suggestion to fix it?

Thanks~

DLib is manually installed to /usr/local/lib ...

Hi, I actually have manually installed DLib to /usr/local/lib, how should I define DLib_DIR ?

I don't have
DLibConfig.cmake
dlib-config.cmake

but with the following dlib.pc

% cat /usr/local/lib/pkgconfig/dlib.pc 
libdir=/usr/local/lib
includedir=/usr/local/include

Name: dlib
Description: Numerical and networking C++ library
Version: 19.17.0
Libs: -L${libdir} -ldlib
Cflags: -I${includedir}
Requires: libpng

The current ERROR is:

 CMake Error at applications/badslam/CMakeLists.txt:7 (find_package):
   By not providing "FindDLib.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "DLib", but
   CMake did not find one.

   Could not find a package configuration file provided by "DLib" with any of
   the following names:

     DLibConfig.cmake
     dlib-config.cmake

   Add the installation prefix of "DLib" to CMAKE_PREFIX_PATH or set
   "DLib_DIR" to a directory containing one of the above files.  If "DLib"
   provides a separate development package or SDK, be sure it has been
   installed.

Can anybody help to fix this issue?

Thank you
Pei

dataset category

I notices the paper has partitioned the benchmark datasets into 3 categories (easy, medium, hard), but where can I find which dataset belongs to which category?

Continuous integration

It would be good to set up a continuous integration service which verifies that the code compiles both on Linux and on Windows.

Question: Usage with Azure Kinect

Can the software in the current state somehow be used together with the Azure Kinect (k4a) device?
I have tried it with release 1.0.1 under Ubuntu 18.04 with no success. Or is that only possible when building from source? I am also struggling with compiling it or rather getting all the dependencies installed. More detailed instructions on how to install and configure everything would be tremendously helpful.
Edit: It seams the release build 1.0.1 is not compatible with the K4A:
input_azurekinect.h:144 FATL| Azure Kinect input requested, but the program was compiled without Azure Kinect support.

Compiler errors

When I compile this slam, I was confronted with the following errors:
[ 94%] Building CXX object CMakeFiles/libvis_test.dir/libvis/src/libvis/test/lm_optimizer.cc.o
In file included from /home/manifold/badslam/./libvis/src/libvis/lm_optimizer.h:35:0,
from /home/manifold/badslam/libvis/src/libvis/test/lm_optimizer.cc:34:
/usr/include/cublasXt.h:57:10: fatal error: driver_types.h: no this file or directory
#include "driver_types.h"
^~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/libvis_test.dir/build.make:182: recipe for target 'CMakeFiles/libvis_test.dir/libvis/src/libvis/test/lm_optimizer.cc.o' failed
make[2]: *** [CMakeFiles/libvis_test.dir/libvis/src/libvis/test/lm_optimizer.cc.o] Error 1
Could anyone know why?
Thank you very much

BadSlam with Kinect Sensor V2 ?

Hi guys,

I have a Kinect Sensor v2 and I can read RGB-D which from sensor coming data with OPENNI library. Is that enough for use in BadSlam?

Release with support Azure Kinect

Currently pre-built binary for Windows do not include Azure Kinect option. I would really appreciate if you can release a version which includes Azure Kinect input option since I'm having problem with compiling currently.

Segment error (core dumped)

Hi guys,nice job!
I'm trying to run BADSLAM on one of the cable_1 datasets and run into the following error:
Do you have any idea what I can do ? Any help is appreciated, thanks.
bruce@bruce-desktop:~/slam/badslam-master/build$ ./applications/badslam/badslam /home/bruce/slam/badslam-master/dataset/cables_1/ --gui_run
time file:line v|
15:26:48.718 loguru.cpp:587 INFO| arguments: ./applications/badslam/badslam /home/bruce/slam/badslam-master/dataset/cables_1/ --gui_run
15:26:48.718 loguru.cpp:590 INFO| Current dir: /home/bruce/slam/badslam-master/build
15:26:48.718 loguru.cpp:592 INFO| stderr verbosity: 2
15:26:48.718 loguru.cpp:593 INFO| -----------------------------------
Segment error (core dumped)

Integrate surface reconstruction approach(es)

It is often desirable to obtain a surface (mesh) reconstruction rather than only a point cloud, which is the current reconstruction output of BAD SLAM. Some possible options might be:

  • Integrate Poisson Surface Reconstruction as a post-processing step (such that it can be conveniently invoked with a single click from the GUI)

  • Integrate SurfelMeshing for live meshing during the reconstruction. A good integration might not be straightforward however, since:

    • BAD SLAM is constantly creating new surfels and merging surfels in existing areas, which SurfelMeshing might have trouble keeping up with.
    • For SLAM, one wants to sparsify the surfels a bit to keep it fast, while for reconstruction, the surfels should be as dense as possible.

Auto-tuning fails

I am trying to use the application with Azure Kinect through live input. After hassling with dependencies I am stuck at a point which I think not far from the the successful end. Here is the current state:

  • Building & compiling is OK without an error. All necessary packages are found. Optional packages realsense and structure are not found which I don't intend to use.
  • k4aviewer succesfully shows depth and RGB inputs.
  • When I run ./badslam and select Azure K4A Live Input this is the error message
time                            file:line     v| 
15:02:22.304              loguru.cpp:587   INFO| arguments: ./badslam
15:02:22.304              loguru.cpp:590   INFO| Current dir: /home/omer/projects/badslam/build_RelWithDebInfo/applications/badslam
15:02:22.304              loguru.cpp:592   INFO| stderr verbosity: 2
15:02:22.304              loguru.cpp:593   INFO| -----------------------------------
15:02:22.304                 main.cc:439   WARN| No auto-tuning file found -> using default parameters. GPU performance is thus probably slightly worse than it could be.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[2019-12-02 15:02:28.858] [error] [t=7833] /home/vsts/work/1/s/extern/Azure-Kinect-Sensor-SDK/src/calibration/calibration.c (391): get_camera_calibration(). cJSON_Parse error .50256603956222534,0.5046575665473938,0.49263244867324829,0.492673397064209,4.5602192878723145,3.1884105205535889,0.17583206295967102,4.8896327018737793,4.7015571594238281,0.89637881517410278,0,0,3.2404401281382889E-5,-0.0001623422431293875],"ModelType":"CALIBRATION_LensDistortionModelBrownConrady"},"Location":"CALIBRATION_CameraLocationD0","Purpose":"CALIBRATION_CameraPurposeDepth","MetricRadius":1.7399997711181641,"Rt":{"Rotation":[1,0,0,0,1,0,0,0,1],"Translation":[0,0,0]},"SensorHeight":1024,"SensorWidth":1024,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}},{"Intrinsics":{"ModelParameterCount":14,"ModelParameters":[0.50009459257125854,0.50738322734832764,0.46948739886283875,0.62577122449874878,0.75097411870956421,-2.8726491928100586,1.6259859800338745,0.62961763143539429,-2.710111141204834,1.5602593421936035,0,0,-0.000392389134503901,0.0010423335479572415],"ModelType":"CALIBRATION_LensDistortionModelBr
[2019-12-02 15:02:28.858] [error] [t=7833] /home/vsts/work/1/s/extern/Azure-Kinect-Sensor-SDK/src/sdk/k4a.c (154): calibration_create(device->depthmcu, &device->calibration) returned failure in k4a_device_open()
Stack trace:
5       0x7f3704ef188f clone + 63
4       0x7f370760e6db /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f370760e6db]
3       0x7f370583466f /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd66f) [0x7f370583466f]
2       0x560aff517d68 ./badslam(+0x74d68) [0x560aff517d68]
1       0x560aff530ce9 ./badslam(+0x8dce9) [0x560aff530ce9]
0       0x7f370783cf52 loguru::StreamLogger::~StreamLogger() + 162
15:02:28.859    input_azurekinect.cc:283   FATL| WARNING: Failed to open K4A device!
Aborted
  • Result of badslam_test can be seen in this link. (Since it was too long, I've linked the file)
  • Since it says Cuda Error: too many resources requested for launch I've followed the instructions in the README. Auto tuning CUDA block size.
    To do that I need a dataset, live input would not work as it is stated in the README. I've downloaded Cable1 from ETH3D SLAM benchmark. The autotune asks for associated.txt calibration.txt depth(folder) rgb(folder). So I downloaded all of cables_1_mono.zip, cables_1_stereo.zip, cables_1_rgbd.zip, cables_1_imu.zip, cables_1_raw.zip and combine the data in them to get associated.txt calibration.txt depth(folder) rgb(folder).

Then I run this command to auto tune.
python3 scripts/auto_tune_parameters.py ~/projects/badslam/build_RelWithDebInfo/applications/badslam/badslam ~/projects/cables_1 --sequential_ba --sequential_loop_detection

Output is

Running: /home/omer/projects/badslam/build_RelWithDebInfo/applications/badslam/badslam /home/omer/projects/cables_1 --sequential_ba --sequential_loop_detection --auto_tuning_iteration 0
time                            file:line     v| 
14:45:06.990              loguru.cpp:587   INFO| arguments: /home/omer/projects/badslam/build_RelWithDebInfo/applications/badslam/badslam /home/omer/projects/cables_1 --sequential_ba --sequential_loop_detection --auto_tuning_iteration 0
14:45:06.990              loguru.cpp:590   INFO| Current dir: /home/omer/projects/badslam/applications/badslam
14:45:06.990              loguru.cpp:592   INFO| stderr verbosity: 2
14:45:06.990              loguru.cpp:593   INFO| -----------------------------------
14:45:07.049 rgbd_video_io_tum_datas:146    ERR| Cannot read calibration file at /home/omer/projects/cables_1/calibration.txt
14:45:07.049                 main.cc:515    ERR| Could not read dataset at /home/omer/projects/cables_1
14:45:07.056              loguru.cpp:467   INFO| atexit
Program call failed (return code: 1)

It says it cannot read calibration file and dataset. I am not sure if there is a problem in calibration file. I've also checked permissions of file, it's fine. Here is the content of calibration.txt

726.28741455078 726.28741455078 354.6496887207 186.46566772461

I can provide more logs if needed. Thanks in advance!

Question: Run badslam on dataset obtained with k4arecorder

After getting badslam running with the K4A (it runs in real time on my notebook which is impressive!) I was wondering if it is possible to replay a recording (.mkv file) generated with the k4arecorder command line tool. While replay works with the k4aviewer I am not sure if it can be replayed with the SDK. Another approach would be to extract image sequences from the mkv and process them to match the ETH3D SLAM dataset format. Has this been done before?

Shipped DBoW2 package compilation error

Hi,

Thanks for your great work!
I'm trying to compile badslam, however some errors that may relate to the shipped DBoW2 package, appear as follows:
/home/qin/Documents/codes/3rdparty/bin_3rdparty/DLib/include/DLib/../DVision/BRIEF256.h: In member function ‘void DVision::BRIEF_t<Bits>::compute(const cv::Mat&, const std::vector<cv::KeyPoint>&, std::vector<std::bitset<Bits> >&, bool) const’: /home/qin/Documents/codes/3rdparty/bin_3rdparty/DLib/include/DLib/../DVision/BRIEF256.h:207:11: error: ‘cvtColor’ is not a member of ‘cv’ cv::cvtColor(image, aux, cv::COLOR_RGB2GRAY);

Note:

  1. I have pre-compiled DLib and installed the compiled stuff to the directory '/home/qin/Documents/codes/3rdparty/bin_3rdparty/DLib' using '-DCMAKE_INSTALL_PREFIX';
  2. My opencv version is 3.2.0 as shown below:
    $ apt list -a libopencv-dev Listing... Done libopencv-dev/bionic-updates,bionic-security,now 3.2.0+dfsg-4ubuntu0.1 amd64 [installed,automatic] libopencv-dev/bionic 3.2.0+dfsg-4build2 amd64

Another way to reproduce the error:

  1. Copy the shipped directory DBoW2 to other place, e.g., /home/DoW2;
  2. $ cd /home/DoW2 && mkdir build && cd build && cmake .. && make -j8

The same errors will occur.

Is there any solution to solve this compilation problem? Many thanks!

Best regards,
Qin Shi

Try fusing depth data from non-keyframes into keyframes

Currently, non-keyframes almost do not contribute to the final result (other than helping initialize the pose estimation for their follow-up keyframe). It might be worth trying to fuse their depth data with the closest keyframe to possibly obtain denser and less noisy depth in keyframes (while however also introducing possible occlusion issues with this reprojection, if something is projected into a keyframe which is actually not visible from its viewpoint).

Error with Boost library when compiling in windows

Hi,

we are trying to run your project on windows 10, but face the following issue: When we try to build the solution in Visual Studio, we get an error in file facade_iterator_category.h of the Boost library. It says
2>Unknown compiler version - please run the configure tests and report the results
2>D:\xyz\projects\xyz\BADSLAM\dependencies\boost_1_54_0\boost/iterator/detail/facade_iterator_category.hpp(166): error C2039: 'assert_not_arg': is not a member of 'boost::mpl'

We use Visual Studio 2012 to build the Boost library (version 1.54.0) and then build the whole Badslam project in Visual Studio 2017.
Do you have an idea what could be the reason for this? Any help would be appreciated. Thanks a lot!

read distortion parameter

I am trying to run badslam on TUM rgbd dataset. In the readme I found that the calibration.txt only has pinhole camera model without any distortion parameter.
Will the code work if I simply add some distortion parameter after camera intrinsics? Like

fx fy cx cy d1 d2 d3 d4 d5

In rgbd_video_io_tum_dataset.h I didn't find any piece of code that can read distortion parameter.
Also in the readme seems for tum rgbd I don't need to input depth calibration file?
I really appreciate your answer!

Runtime error:

Hi,

I'm trying to run BADSLAM on one of the mannequin datasets and run into the following error:
Do you have any idea what I can do ? Any help is appreciated, thanks.

Stack trace:
31 0x559502adb54a ./applications/badslam/badslam(+0x3054a) [0x559502adb54a]
30 0x7f4ee0b96b97 __libc_start_main + 231
29 0x559502ad3ed1 ./applications/badslam/badslam(+0x28ed1) [0x559502ad3ed1]
28 0x559502add471 ./applications/badslam/badslam(+0x32471) [0x559502add471]
27 0x559502b30052 ./applications/badslam/badslam(+0x85052) [0x559502b30052]
26 0x7f4ee2dffe95 QWidget::setVisible(bool) + 405
25 0x7f4ee2dfcd5f QWidgetPrivate::show_helper() + 63
24 0x7f4ee2dfccf0 QWidgetPrivate::showChildren(bool) + 240
23 0x7f4ee2dffe95 QWidget::setVisible(bool) + 405
22 0x7f4ee2dfcd5f QWidgetPrivate::show_helper() + 63
21 0x7f4ee2dfccf0 QWidgetPrivate::showChildren(bool) + 240
20 0x7f4ee2dffe95 QWidget::setVisible(bool) + 405
19 0x7f4ee2dfcd5f QWidgetPrivate::show_helper() + 63
18 0x7f4ee2dfccf0 QWidgetPrivate::showChildren(bool) + 240
17 0x7f4ee2dffe95 QWidget::setVisible(bool) + 405
16 0x7f4ee2dfcd43 QWidgetPrivate::show_helper() + 35
15 0x7f4ee2df91cd QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) + 445
14 0x7f4ee1f1ec18 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 264
13 0x7f4ee2dc99f0 QApplication::notify(QObject*, QEvent*) + 688
12 0x7f4ee2dc285c QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
11 0x7f4ee2e009c2 QWidget::event(QEvent*) + 2162
10 0x7f4ee2e1efc1 QOpenGLWidget::resizeEvent(QResizeEvent*) + 177
9 0x7f4ee2df9215 QWidgetPrivate::sendPaintEvent(QRegion const&) + 37
8 0x7f4ee1f1ec18 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 264
7 0x7f4ee2dc99f0 QApplication::notify(QObject*, QEvent*) + 688
6 0x7f4ee2dc285c QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156
5 0x7f4ee2e00348 QWidget::event(QEvent*) + 504
4 0x7f4ee2e1f145 /home/towerman/Qt/5.12.0/gcc_64/lib/libQt5Widgets.so.5(+0x1bc145) [0x7f4ee2e1f145]
3 0x7f4ee3984ef9 vis::RenderWidgetOpenGL::paintGL() + 889
2 0x559502ca0313 ./applications/badslam/badslam(+0x1f5313) [0x559502ca0313]
1 0x559502c9cfae ./applications/badslam/badslam(+0x1f1fae) [0x559502c9cfae]
0 0x7f4ee36e4163 loguru::StreamLogger::~StreamLogger() + 163
14:39:46.997 render_window.cc:963 FATL| Cuda Error: unknown error

Loading multiple datasets into the same reconstruction

Currently, the program can only load a single dataset, which may limit the ability to create large reconstructions. It would be nice to be able to load multiple datasets. At first, this could be limited to datasets from the same camera, such that still only a single set of camera intrinsics needs to be considered.

Provide slightly more elaborate keyframe selection strategies

Currently, a keyframe is simply created for every Nth frame. It would be nice to be able to choose from multiple keyframe selection strategies. For example, a very simple addition to the current scheme would be to not select a keyframe in case the current camera pose is very similar to the latest created keyframe. This would prevent constantly creating new keyframes when the camera pose stays nearly constant.

Change the storage of keyframes from a std::vector to std::unordered_map

Currently, the keyframes are stored in a std::vector, and removing keyframes leaves nullptr entries in that vector. This is likely not to be handled correctly in all parts of the codebase, leading to crashes. It would most likely be preferable to store the keyframes in an unordered_map instead (mapping keyframe_id -> keyframe_pointer) and delete removed keyframes from it entirely.

FATL| Cuda Error: invalid pitch argument

I'm exploring the Dataset Playback. It works fine with ETH cables_1 dataset. I've mimicked the structure of dataset with the recording I get from Azure Kinect but I get the following error. Since it works on other dataset I've a feeling that I made a mistake while constructing the dataset rather than having a CUDA issue. At the very bottom you can find more info about the dataset folder I use.

time                            file:line     v| 
12:25:06.568              loguru.cpp:587   INFO| arguments: ./applications/badslam/badslam
12:25:06.568              loguru.cpp:590   INFO| Current dir: /home/omer/projects/badslam/build_RelWithDebInfo
12:25:06.568              loguru.cpp:592   INFO| stderr verbosity: 2
12:25:06.568              loguru.cpp:593   INFO| -----------------------------------
Gtk-Message: 12:25:08.444: GtkDialog mapped without a transient parent. This is discouraged.
12:25:14.757      gui_main_window.cc:1600  INFO| Read dataset with 601 frames
12:25:15.605        loop_detector.cc:170   INFO| Loop detector: Loading vocabulary (from ./applications/badslam/resources/brief_k10L6.voc) ...
Stack trace:
7       0x7f0be9de188f clone + 63
6       0x7f0bec4fe6db /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f0bec4fe6db]
5       0x7f0bea72466f /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd66f) [0x7f0bea72466f]
4       0x5649af370f19 ./applications/badslam/badslam(+0x75f19) [0x5649af370f19]
3       0x5649af33c8db ./applications/badslam/badslam(+0x418db) [0x5649af33c8db]
2       0x5649af33c164 ./applications/badslam/badslam(+0x41164) [0x5649af33c164]
1       0x5649af33e696 ./applications/badslam/badslam(+0x43696) [0x5649af33e696]
0       0x7f0bec72cf52 loguru::StreamLogger::~StreamLogger() + 162
12:25:20.197       cuda_buffer_inl.h:85    FATL| Cuda Error: invalid pitch argument
Aborted (core dumped)

The structure of dataset folder

.
├── associated.txt
├── calibration.txt
├── depth
            ├── color0001.png
             ...
|── rgb
            ├── color0001.png
             ...

Content of associated.txt

0001 rgb/color0001.png 0001 depth/depth0001.png
0002 rgb/color0002.png 0002 depth/depth0002.png
...

I've filled calibration.txt with the values printed in here, Line 236-239.

600.9438476562 600.7403564453 639.6210937500 366.5878906250

Question about Evaluation

Hello there,

I met a question while I was evaluating my result.

I ran the test datasets from this website "https://www.eth3d.net/slam_datasets" and got my results.

Then I used "evaluate_ate.py" to evaluate my result. I added the addresses of my result file and imu file in the command. However, the ATE RMSE is about 0.98 m which is obviously incorrect.
Screenshot from 2020-05-10 22-37-21

I have two questions:

  1. There are 4 files named imu.txt in each dataset, what is the difference?

  2. I found an option named offset in "evaluate_ate.py", but I do not understand how to use it, I think probably this is what I should use to correct my evaluation.

Sorry for bothering you if there is some relative information I missed.

Thanks for your time, I am looking forward to your response.

Best regards,
Arete

Detect tracking failures, build multiple models, and re-localize

Currently, the program will not detect when it fails to track the camera pose, giving wrong results. It would be good if it could determine failure and state something like "tracking lost" instead.

If tracking continues after a failure, the program should start building a new model, while trying to merge the new model with the old one by re-localizing against it, if possible.

pose graph optimization does not work!

Hi, guys. nice job!
But I have some problem to run it. I need your help.
Thx.
environment: Ubuntu18.04 with cuda 9.2 gtx1070.
g2o from https://github.com/RainerKuemmerle/g2o master branch.
I make the badslam and badslam_test with no problem. I tested on the latest master branch and 1.01.
The problem is:

  1. badslam_test run ended with Aborted (core dumped), which outputs:

########################################################
[ RUN ] Optimization.PoseGraphOptimizer
2019-07-23 16:43:44.619 ( 46.584s) [ 2A579F80]pose_graph_optimizer.cc:127 INFO| - Performing pose graph optimization ...
int g2o::csparse_extension::cs_cholsolsymb(const cs_di*, number_t*, const cs_dis*, number_t*, int*): cholesky failed!
Cholesky failure, writing debug.txt (Hessian loadable by Octave)
2019-07-23 16:43:44.621 ( 46.586s) [ 2A579F80]pose_graph_optimizer.cc:131 INFO| - Pose graph optimization done
double free or corruption (out)
Aborted (core dumped)
########################################################

I look into it, I find it is related with g2o csparse_extension.cpp function cs_cholsolsymb.
with this lines:
########################################################
N = cs_chol_workspace (A, S, work, x) ; /* numeric Cholesky factorization */
if (!N) {
cerr << PRETTY_FUNCTION << ": cholesky failed!" << endl;
/assert(0);/
}
########################################################

I am not familiar with g2o, and just start learning. I think it is not the cuda core problem which writed in the document. But I cant solve the csparse_solver problem, maybe another solver(Cholmod solver) will resolve it.

  1. The badslam with realsense live frame work properly at the first few frames, the following frames come with incorrect results. I think it is caused by the failure of Pose graph optimization. output warning:16:37:41.236 direct_ba_alternating.c:249 WARN| Pose estimation not converged (not_converged_count: 37, call_counter: 204239)

This problem may relate with
#18

Windows compiled binaries

I'd like to point out that you really have a great project!
Unfortunaltely I am unable to find the Windows binaries.
From the Readme:

For Windows, an executable compiled with Visual Studio 2019 is provided

Could you please provide the link for the binary?

Best

QXcbConnection: Could not connect to display

hello,friends. i have successfully compiled "badslam&&badslam_test". But when i run "./applications/badslam/badslam_test". some error occurs,as shown below. can you give me some advice? thank you!! it is tested on CUDA10.0 &&&& GTX 1070 !!
Screenshot from 2020-02-24 13-46-14

Manually-specified variables were not used by the project: CMAKE_CUDA_FLAGS

I've tried to set the CMAKE_CUDA_FLAGS using "-DCMAKE_CUDA_FLAGS="-arch=sm_61" or other versions and I've had the CUDA10.1 installed with Ubuntu 14.04, yet I still couldn't get my cuda properly set.

I've also tried adding
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_61,code=sm_61")
message("CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}")

to my CMakelist and it shows:
CMAKE_CUDA_FLAGS: -arch=sm_61 -gencode arch=compute_61,code=sm_61

badslam_test failed with "Cuda Error: invalid device function"

Hello guys, good job! I faced the following problem:

When I launch ./applications/badslam/badslam_test, I get this message:

[==========] Running 14 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 14 tests from Optimization
[ RUN ] Optimization.AlternatingGeometryOptimizationWithGeometricResidual
Stack trace:
15 0x7f98ad9fa41d clone + 109
14 0x7f98ae9716ba /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f98ae9716ba]
13 0x7f98ae294c80 /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80) [0x7f98ae294c80]
12 0x7f98aff42dae /home/me/Documents/bosch_projects/BAD_SLAM/BAD_SLAM_full/build/liblibvis.so(+0x86dae) [0x7f98aff42dae]
11 0x428e8f ./applications/badslam/badslam_test() [0x428e8f]
10 0x7f98b5bdafa0 testing::UnitTest::Run() + 64
9 0x7f98b5be2b43 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const) + 67
8 0x7f98b5bdac7f testing::internal::UnitTestImpl::RunAllTests() + 575
7 0x7f98b5bda9b5 testing::TestCase::Run() + 181
6 0x7f98b5bda8d8 testing::TestInfo::Run() + 280
5 0x7f98b5bda78a testing::Test::Run() + 186
4 0x7f98b5be2663 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const) + 67
3 0x4297b2 ./applications/badslam/badslam_test() [0x4297b2]
2 0x5650c5 ./applications/badslam/badslam_test() [0x5650c5]
1 0x44e9e1 ./applications/badslam/badslam_test() [0x44e9e1]
0 0x7f98afc9ed73 loguru::StreamLogger::~StreamLogger() + 163
11:15:59.004 cuda_image_processing.c:192 FATL| Cuda Error: invalid device function
Aborted (core dumped)

It is probably related to the fact that I use an Nvidia GeForce 950M graphic card with 5.0 compute capability. I also use CUDA 8.0. What can be done to get through this issue?

Option to perform local bundle adjustment

Currently, the program always does global bundle adjustment, which means that it becomes slow after some time. It would be good to be able to do local bundle adjustment, affecting only the keyframes and surfels close to the current camera pose, such that it can remain fast.

There is already some code to support disabling surfels and keyframes, but it has not been used for a while, so it might not work properly.

Integrate support for IMUs

Recent depth cameras such as the Microsoft Azure Kinect, the Occipital Structure Core, and the Intel RealSense D435i all contain an IMU. It would be very helpful for robust pose tracking to integrate an IMU term into the cost function.

Build issues: std::atomic and Qt::AA_DontCheckOpenGLContextThreadAffinity not defined

Originally posted by @Young532042725 in #2 (comment):

@puzzlepaint hi, there are some problem occur, when building(make). would you please give me some advice? thank you very much! There are cmake and make

cmake -DCMAKE_CUDA_FLAGS="-arch=sm_61" ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- serialization
-- filesystem
-- system
-- Symbol prefix:
-- Boost version: 1.58.0
DLib library found, using it from the system
CMake Warning at applications/badslam/CMakeLists.txt:21 (find_package):
By not providing "Findrealsense2.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"realsense2", but CMake did not find one.

Could not find a package configuration file provided by "realsense2" with
any of the following names:

realsense2Config.cmake
realsense2-config.cmake

Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set
"realsense2_DIR" to a directory containing one of the above files. If
"realsense2" provides a separate development package or SDK, be sure it has
been installed.

CMake Warning at applications/badslam/CMakeLists.txt:24 (find_package):
By not providing "Findk4a.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "k4a", but
CMake did not find one.

Could not find a package configuration file provided by "k4a" with any of
the following names:

k4aConfig.cmake
k4a-config.cmake

Add the installation prefix of "k4a" to CMAKE_PREFIX_PATH or set "k4a_DIR"
to a directory containing one of the above files. If "k4a" provides a
separate development package or SDK, be sure it has been installed.

CMake Warning at applications/badslam/CMakeLists.txt:25 (find_package):
By not providing "Findk4arecord.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"k4arecord", but CMake did not find one.

Could not find a package configuration file provided by "k4arecord" with
any of the following names:

k4arecordConfig.cmake
k4arecord-config.cmake

Add the installation prefix of "k4arecord" to CMAKE_PREFIX_PATH or set
"k4arecord_DIR" to a directory containing one of the above files. If
"k4arecord" provides a separate development package or SDK, be sure it has
been installed.

-- The following OPTIONAL packages have been found:

  • PythonInterp

-- The following REQUIRED packages have been found:

  • ZLIB
  • GLEW
  • Qt5Core
  • Qt5Gui (required version >= 5.5.1)
  • Qt5OpenGL
  • Qt5Widgets
  • Qt5
  • Qt5X11Extras
  • SuiteSparse
  • Eigen3
  • g2o
  • OpenGL
  • Threads
  • X11
  • OpenCV
  • Boost
  • DLib
  • opengv

-- The following OPTIONAL packages have not been found:

  • realsense2
  • k4a
  • k4arecord

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gp/BAD-SLAM/badslam/build
Screenshot from 2019-06-19 17-02-51

Originally posted by @Young532042725 in #2 (comment)

Reconstruction configuration for custom dataset

Thanks for this great project! I have no problem running with the eth3D dataset and get results. However, when I was trying another dataset (Stanford copyroom), used by Open3D, I am having some troubles to get the results.

Here is the structure of my files:

\copyroom
---\rgb
------000001.png
        ....
---\depth
------000001.png
        ....
---associated.txt
---calibration.txt

The format of depth image is 16 bit unsigned char, and the format of the color image is 8 bit unsigned char 3-channel. Since the unit of depth is in millimeter, I used the raw to metric depth scale of 0.001. The timestamp for the images are simply ordered as 1, 2, 3, 4...
I have tried disabling and enabling the motion model choice, but none of the options work.

Here is a screen shot of the reconstruction interface. Would appreciated any help or advice on what configuration I should use instead. Thanks!

bad_slam

After testing with some other dataset I found that the system shows that

u16 is not supported by the Qt image IO.

Is uint16 not the right format for Qt?

Pose estimation not converged ?

When I use Kinect for Azure run badslam, I got the following message:
6:03:53.713 direct_ba_alternating.c:249 WARN| Pose estimation not converged (not_converged_count: 253, call_counter: 35820)
16:03:53.756 direct_ba_alternating.c:249 WARN| Pose estimation not converged (not_converged_count: 254, call_counter: 36157)
16:03:54.082 direct_ba_alternating.c:249 WARN| Pose estimation not converged (not_converged_count: 255, call_counter: 36821)

could you anyone know why?

Dataset rosbag

Thanks for your dataset SLAM Benchmark. I wonder if you have the ROS bag version of your dataset?

More robust pose tracking

Given that pairwise frame tracking seems to be very fast, in the odometry part, one could try to always track wrt. multiple previous keyframes (separately) instead of only wrt. the latest keyframe. This would allow to average the results, and also enable detecting tracking issues (when the results of tracking wrt. different keyframes differ too much).

This perhaps only applies to the case of not using an IMU, since using an IMU might robustify the local tracking to the point where such measures would not really help anymore.

Allow creating reconstructions for which the keyframe data does not fit into the GPU memory

Right now, keyframes take up a lot of GPU memory, which limits the size of the reconstructions that can be made. It might be helpful to introduce the possibility to store keyframe data on the CPU while it is not used to be able to make larger reconstructions. This would likely also make the process very slow as soon as this is used, however, due to the frequent memory transfers between the CPU and GPU which will be needed then.

Reduce noise for surfaces with densified surfels

If using surfel densification, especially if setting the minimum observation count to 1, there can be quite some noise in surfaces. This is likely because of surfels with roughly correct position but a wrong normal vector, which won't be affected by the free-space outlier removal.

If they were included in that outlier removal, then it might possibly cause issues for the reconstruction of thin surfaces, or generally object edges, however, since in these cases, surfels with strongly differing normals are close together but should not cancel each other out.

An alternative way to reduce the apparent noise might be to store the surfel normal in the vertex data used for rendering, and hide a surfel if its normal points away from the camera (i.e., backface culling for surfels).

Question about CUDABuffer_<T>

Hi,
I am new to CUDA programming and learning this open-source project.
Recently I was reading the source code of this project. I have a question about it. I will appreciate it if you can read this issue and answer my question.

In libvis/cuda/, the basic data structures are defined in the files under this directory.

For /applications/badslam/src/badslam/cuda_depth_processing.cu, the function ComputeNormalsCUDA has a argument CUDABuffer_<T>* out_normals. I can understand this step: the pointer of out_normals is passed into this function.

When this function launches the kernel function ComputeNormalsCUDAKernel(), it pass *out_normals as an object into the kernel function. However, the kernel function receives an object as input in its argument list, instead of a reference. My question is: how could the modifications on *out_normals in the kernel function affect the out_normals?

In other words, in the kernel function, it computes the normals and modifies the corresponding element of out_normals by using out_normals(y, x) = xxx, but it is not the reference of the object. It is a copy of the object.

Is it because when the object out_normals is passed into the kernel function, the copy of *out_normals copied its data head address, instead of allocating new memory space in GPU? So that when the copy of *out_normals use the operator out_normals(y, x), it modified the corresponding data with respect to the original data head pointer address?

Thank you very much for your time to read this question!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.