update normal strategy

This commit is contained in:
hofee
2024-10-23 02:58:58 -05:00
parent 7e68259f6d
commit 64891ef189
8 changed files with 185 additions and 57 deletions

View File

@@ -5,7 +5,7 @@ import torch
class PtsUtil:
@staticmethod
def voxel_downsample_point_cloud(point_cloud, voxel_size=0.005):
def voxel_downsample_point_cloud(point_cloud, voxel_size=0.005, require_idx=False):
voxel_indices = np.floor(point_cloud / voxel_size).astype(np.int32)
unique_voxels = np.unique(voxel_indices, axis=0, return_inverse=True)
return unique_voxels[0]*voxel_size