Skip to main content

3D Volumetric Surface Reconstruction using the VDB data structure

Project description

NOTE: The support for this pip pacakge it is still under develpment and therefore might not be so stable.

VDBFusion

This is a small utility library that implement 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 this step fails is most likely you have an old version of pip. To fix this, just pip install -U pip

Usage

from vdbfusion import VDBVolume

vdb_volume = VDBVolume(voxel_size=0.1, sdf_trunc=0.3, space_carving=False)

# You need to define your own Dataset.
dataset = Dataset(...)

for scan, origin in dataset:
    vdb_volume.integrate(scan, origin)

Visualizing the output

Open3D(pip install open3d)

import open3d as o3d
# Extract a mesh from vdbfusion
vertices, triangles = vdb_volume.extract_triangle_mesh()

# Visualize the results
mesh = o3d.geometry.TriangleMesh(
    o3d.utility.Vector3dVector(vertices),
    o3d.utility.Vector3iVector(triangles),
)
mesh.compute_vertex_normals()
o3d.visualization.draw_geometries([mesh])

trimesh(pip install trimesh)

import trimesh

# Extract your map
vertices, triangles = vdb_volume.extract_triangle_mesh()

mesh = trimesh.Trimesh(vertices=vertices, faces=triangles)
mesh.show()

Dataset snippet

You Dataset class must only define a __len__ and __getitem__ methods, similar to torch.Dataset:

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) -> Tuple[np.ndarray, np.ndarray]:
        # points: np.array (N, 3)
        # origin: np.array(3,), sensor origin on the global coordinate frame.
        return points, origin

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.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (749.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (749.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.4-cp38-cp38-manylinux_2_31_x86_64.whl (820.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

vdbfusion-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (749.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

vdbfusion-0.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (752.2 kB view hashes)

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

vdbfusion-0.1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (752.2 kB view hashes)

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

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