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

Usage

from vdbfusion import VDBVolume

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

# You need to define your own Dataset, see snippet below
dataset = Dataset(...)

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

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

Visualizing the output

Open3D(pip install open3d)

import open3d as o3d
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
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: list of np.array points (N, 3)
        # origin: sensor origin on the global coordinate frame (np.ndarray(3))
        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 Distribution

If you're not sure about the file name format, learn more about wheel file names.

vdbfusion-0.1.2-cp38-cp38-manylinux_2_31_x86_64.whl (820.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.31+ x86-64

File details

Details for the file vdbfusion-0.1.2-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: vdbfusion-0.1.2-cp38-cp38-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 820.3 kB
  • Tags: CPython 3.8, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.10

File hashes

Hashes for vdbfusion-0.1.2-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b291ac1a980876634f7d7c9835e9f06ae2b24f96daaab47b6a9e1db77816bab2
MD5 59bec1c70909db90e976cea608ea226d
BLAKE2b-256 b15e83a220e003d1aa66b35118b90d6c83f6008caf315b4196d3ba4d02ca4af1

See more details on using hashes here.

Supported by

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