Replies: 1 comment
-
+1. This could be really useful for applications like 3D reconstruction from medical image slices, where surface only reconstruction leads to artifacts where different slices intersect like in the example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I got a point cloud and I want to create a voxel grid from it. The straightforward functions that open3d provides, e.g.
create_from_point_cloud()
works fine, but it just creates voxels from the surface of the objects ( see http://www.open3d.org/docs/latest/tutorial/Advanced/voxelization.html#Voxel-carving ).So my idea was to first compute the occupied voxel indices from the point cloud:
occupied_voxels = np.unique(((points - np.min(points, axis=0))).astype(int), axis=0)
and store them in a set, so I can efficiently use them later for checking:
occupied_voxel_idx = set(map(lambda x: tuple(x), occupied_voxels))
Then, I create a dense voxel grid, according to the bounding box of the point cloud (the widht, height and depth are from the bounding box of the point cloud)
Lastly, I create an empty voxel grid:
new_voxel_grid = o3d.geometry.VoxelGrid()
and iterate over the dense voxel grid and adjust the color, if one of the voxels is occupied:
Normally, the color would be from a color map according to the label , but I exlcuded that part for simplicty. The issue is, that when I draw this new grid, I just get a white screen:
o3d.visualization.draw_geometries([new_voxel_grid])
So my approach does not seem to work. Any idea how I can achieve my goal or why my solution does not work?
Beta Was this translation helpful? Give feedback.
All reactions