Package: vdbfusion
VDBFusion: Flexible and Efficient TSDF IntegrationThis is a small utility library that implements the VDBFusion algorithm, similar to TSDF-based
reconstruction pipelines but using a different data-structure (VDB).InstallationTake a seat and relax, you only need to:pipinstallvdbfusionIf you plan to use our C++ API then you should build this project from source. More details in theInstallation instructions.UsageThe 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 standalonePython,Notebooks, andC++examples.Data loadingNOTE: This step is notmandatory. Our API only expectspointsandposesbut this is the easiest way to deal with 3D data.PythonC++classDataset:def__init__(self,*args,**kwargs):# Initialize your dataset here ..def__len__(self)->int:returnlen(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.returnpoints,originclassDataset{// Initialize your dataset here ..Dataset(...);// Return length of the datasetstd::size_tsize()const{returnn_scans_;}// Returns a Cloud(std::vector<Eigen::Vector3d>)// and the sensor origin(Eigen::Vector3d) in the// global coordinate frame.std::tuple<Cloud,Point>operator[](intidx)const;};TSDF Fusion pipelinePythonC++importvdbfusionvdb_volume=vdbfusion.VDBVolume(voxel_size,sdf_trunc,space_carvingdataset=Dataset(...)forscan,originindataset:vdb_volume.integrate(scan,origin)#include"vdbfusion/VDBVolume.h"vdb_fusion::VDBVolumevdb_volume(voxel_size,sdf_trunc,space_carving);constautodataset=Dataset(...);for(constauto&[scan,origin]:iterable(dataset)){vdb_volume.Integrate(scan,origin);}VisualizationFor visualization you can use any 3D library you like. For this example we are going to be usingOpen3D. If you are using the Python API make sure topip install open3dbefore trying this snippet.PythonC++importopen3daso3d# Extract triangle mesh (numpy arrays)vert,tri=vdb_volume.extract_triangle_mesh()# Visualize the resultsmesh=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 resultsautomesh=o3d::geometry::TriangleMesh(verts,tris,)mesh.ComputeVertexNormals()o3d::visualization::DrawGeometries({&mesh})LICENSETheLICENSEcan be found at the root of this repository. It only applies to the code ofVDBFusionbut not to its3rdparty dependencies. Please make sure to check the licenses in there before using any form of this code.CreditsI would like to thank theOpen3DandOpenVDBauthors and contributors for making their implementations open source which inspired, helped and guided the implementation of the VDBFusion library.CitationIf you use this library for any academic work, please cite the originalpaper.@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}}