MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / dmap2tsdf

Function dmap2tsdf

scripts/python/MvsDMAP2TSDF.py:105–119  ·  view source on GitHub ↗
(input_dir, output_file, voxel_size=0.0, truncation_mult=4.0)

Source from the content-addressed store, hash-verified

103
104
105def dmap2tsdf(input_dir, output_file, voxel_size=0.0, truncation_mult=4.0):
106 dmap_paths = sorted(glob(os.path.join(input_dir, "*.dmap")))
107
108 # Estimate GSD if voxel size is not provided
109 if voxel_size == 0.0:
110 voxel_size = estimate_gsd_from_depth_maps(dmap_paths) * 3.0
111 print(f"Estimated voxel size: {voxel_size}")
112
113 # Reconstruct mesh
114 mesh = create_mesh_from_depth_maps(dmap_paths, voxel_size, truncation_mult)
115 print(f"Reconstructed mesh with {len(mesh.vertices)} vertices and {len(mesh.triangles)} triangles")
116
117 # Save the mesh
118 o3d.io.write_triangle_mesh(output_file, mesh)
119 print(f"Mesh saved to {output_file}")
120
121
122if __name__ == "__main__":

Callers 1

MvsDMAP2TSDF.pyFile · 0.85

Calls 3

printFunction · 0.85

Tested by

no test coverage detected