Skip to main content

3D Volumetric Surface Reconstruction using the VDB data structure

Project description

VDBFusion: Flexible and Efficient TSDF Integration

C++ Python Linux PyPI version shields.io PRs Welcome Paper MIT license Open In Colab

example

This is a small utility library that implements the VDBFusion algorithm, similar to TSDF-based reconstruction pipelines but using a different data-structure (VDB).

Installation

Take a seat and relax, you only need to:

pip install vdbfusion

If you plan to use our C++ API then you should build this project from source. More details in the Installation instructions.

Usage

The code shown below is not intended to be copy pasted but rather be a spiritual guide for developers. If you really want to give this library a try you should consider checking the standalone Python, Notebooks, and C++ examples.

Data loading

NOTE: This step is not mandatory. Our API only expects points and poses but this is the easiest way to deal with 3D data.

Python C++
class Dataset:
    def __init__(self, *args, **kwargs):
        # Initialize your dataset here ..

    def __len__(self) -> int:
        return len(self.n_scans)

    def __getitem__(self, idx: int):
        # Returns a PointCloud(np.array(N, 3))
        # and sensor origin(Eigen::Vector3d)
        # in the global coordinate frame.
        return points, origin
class Dataset {
  // Initialize your dataset here ..
  Dataset(...);

  // Return length of the dataset
  std::size_t size() const { return n_scans_; }

  // Returns a Cloud(std::vector<Eigen::Vector3d>)
  // and the sensor origin(Eigen::Vector3d) in the
  // global coordinate frame.
  std::tuple<Cloud, Point> operator[](int idx) const;
};

TSDF Fusion pipeline

Python C++
import vdbfusion

vdb_volume = vdbfusion.VDBVolume(voxel_size,
                                 sdf_trunc,
                                 space_carving
dataset = Dataset(...)

for scan, origin in dataset:
    vdb_volume.integrate(scan, origin)
#include "vdbfusion/VDBVolume.h"

vdb_fusion::VDBVolume vdb_volume(voxel_size,
                                 sdf_trunc,
                                 space_carving);
const auto dataset = Dataset(...);

for (const auto& [scan, origin] : iterable(dataset)) {
  vdb_volume.Integrate(scan, origin);
}

Visualization

For visualization you can use any 3D library you like. For this example we are going to be using Open3D. If you are using the Python API make sure to pip install open3d before trying this snippet.

Python C++
import open3d as o3d

# Extract triangle mesh (numpy arrays)
vert, tri = vdb_volume.extract_triangle_mesh()

# Visualize the results
mesh = o3d.geometry.TriangleMesh(
    o3d.utility.Vector3dVector(vert),
    o3d.utility.Vector3iVector(tri),
)

mesh.compute_vertex_normals()
o3d.visualization.draw_geometries([mesh])
#include <open3d/Open3D.h>

// Extract triangle mesh (Eigen).
auto [verts, tris] = vdb_volume.ExtractTriangleMesh();

// Visualize the results
auto mesh = o3d::geometry::TriangleMesh(
    verts,
    tris,
)

mesh.ComputeVertexNormals()
o3d::visualization::DrawGeometries({&mesh})

LICENSE

The LICENSE can be found at the root of this repository. It only applies to the code of VDBFusion but not to its 3rdparty dependencies. Please make sure to check the licenses in there before using any form of this code.

Credits

I would like to thank the Open3D and OpenVDB authors and contributors for making their implementations open source which inspired, helped and guided the implementation of the VDBFusion library.

Citation

If you use this library for any academic work, please cite the original paper.

@article{vizzo2022sensors,
  author         = {Vizzo, Ignacio and Guadagnino, Tiziano and Behley, Jens and Stachniss, Cyrill},
  title          = {VDBFusion: Flexible and Efficient TSDF Integration of Range Sensor Data},
  journal        = {Sensors},
  volume         = {22},
  year           = {2022},
  number         = {3},
  article-number = {1296},
  url            = {https://www.mdpi.com/1424-8220/22/3/1296},
  issn           = {1424-8220},
  doi            = {10.3390/s22031296}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

vdbfusion-0.1.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (769.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (769.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (769.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (771.3 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (771.3 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file vdbfusion-0.1.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: PyPy, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a818efc283d88e048340784b59b4d2e756002dba019f170744ec594b8f034514
MD5 8d39a0c2bd064182f519ad6fccb7ad0f
BLAKE2b-256 5877e4ae775b9d3361848897399fcfc5b07e404cec81d412724d93034f1aa561

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: PyPy, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2b53cb3e52ad55e2ec0ec8918f10f652de460ceee6b2c1503c249b61288a385
MD5 426c0f213c348ebabf79bb7bdd6d1974
BLAKE2b-256 1a4f0f01d2910b5aa36d25579b7e6a34eebc3481ed438a562e5368e5fcd4b976

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: PyPy, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25de614af49cea9f5a697801fe0e24de12dbb26b91bcb7d337ee83ecec5635b8
MD5 0bd745092cc6b5ab283d694e1affaa22
BLAKE2b-256 5b39fd3551b3218c96e84d7e503b6af45c0dbbeec181cb395e746f7afbcdfb20

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 769.6 kB
  • Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01d5858fdd2dd1eb9a019345c0fe89ab5059dda0c853b729cb6e23d8dfd18d62
MD5 b7f5f146807d6b7cce835a5aa04cb997
BLAKE2b-256 c845276d6d554b5bb900af56f2f82f0b4a4753a780fa3f439395baa8ee472ec6

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 769.9 kB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d7574cd1c035f40eed90dbf774b39a06ea08a051712480721fa1e01003299cd
MD5 f3978206f7a25fbbd7a39eb8aa0adb16
BLAKE2b-256 d47bbddb188d71eca22e71ecec261d4f56c8c43da7f93b637a1726b5bbd2f519

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 769.4 kB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35ad3068f5db1a6125eedf14cd1674c40d2ea31c46722c5b80226b728b4d776b
MD5 2c4fecb07bdd3a761f06e25012424f0c
BLAKE2b-256 8ed23aebbb6b122e4985bad9efba02396e246ffe5cbf3af3fbe4f6d94ab6d1c9

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 771.3 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b2d4cd37b8726a189af77a3a00dfeb5d1f365287e64173760a02690a2441dae
MD5 f0d7089023f656728f1a304b582b6842
BLAKE2b-256 3685de05cae55e10f9791c20417fe25d07f710e51f2b2c863a5a85dd3c591d9d

See more details on using hashes here.

File details

Details for the file vdbfusion-0.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 771.3 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b76885c9e43e350d367407947eaa34ee00848a58210ae0fc8d354a66d0659a0f
MD5 b83d304dfd72cee4ea2c35adc3587176
BLAKE2b-256 79380183ad144962012b078018596d2587bd6f198fe189f8748f284f1a8586d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page