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, see snippet below
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: 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
Built Distribution
File details
Details for the file vdbfusion-0.1.3-cp38-cp38-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: vdbfusion-0.1.3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e6a91d2ff5d70d078d718f0611b8df6f662da9e267e2a6e49403dc4ecc5d5ff |
|
MD5 | 6d2e79f4d3af4007c8ef230c04e61f89 |
|
BLAKE2b-256 | 2e7c6790e7d3958d6ce7badbbc483e112f22824d1fbfbdba7dbab5e753863774 |