简体   繁体   English

Open3D的体素总数?

[英]Open3D total number of voxels?

Hi all I'm have managed to reconstruct a shape using the carve from silhouette voxel carving function in open3D.大家好,我已经设法使用 open3D 中的轮廓体素雕刻 function 的雕刻来重建形状。

How do I count the total number of voxels contained in the grid that makes up the carved 3D model?如何计算构成雕刻 3D model 的网格中包含的体素总数?

You can find the total number of voxels in a VoxelGrid with len(voxel_grid.get_voxels()) .您可以使用len(voxel_grid.get_voxels())找到VoxelGrid中的体素总数。 Here is a complete example这是一个完整的例子

>>> import open3d as o3d
>>> import numpy as np
>>> 
>>> N = 2000
>>> armadillo_data = o3d.data.ArmadilloMesh()
>>> pcd = o3d.io.read_triangle_mesh(armadillo_data.path).sample_points_poisson_disk(N)
>>> pcd.scale(1 / np.max(pcd.get_max_bound() - pcd.get_min_bound()), center=pcd.get_center())
PointCloud with 2000 points.
>>> voxel_grid = o3d.geometry.VoxelGrid.create_from_point_cloud(pcd, voxel_size=0.05)
>>> 
>>> len(voxel_grid.get_voxels())
737

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM