finish PoseDiff and NBVDataset

This commit is contained in:
2024-08-30 19:21:18 +08:00
parent be5a2d57fa
commit f58360c0c0
5 changed files with 57 additions and 33 deletions

View File

@@ -2,7 +2,7 @@ import numpy as np
import open3d as o3d
class PtsUtil:
@staticmethod
def voxel_downsample_point_cloud(point_cloud, voxel_size=0.005):
o3d_pc = o3d.geometry.PointCloud()
@@ -14,4 +14,9 @@ class PtsUtil:
def transform_point_cloud(points, pose_mat):
points_h = np.concatenate([points, np.ones((points.shape[0], 1))], axis=1)
points_h = np.dot(pose_mat, points_h.T).T
return points_h[:, :3]
return points_h[:, :3]
@staticmethod
def random_downsample_point_cloud(point_cloud, num_points):
idx = np.random.choice(len(point_cloud), num_points, replace=False)
return point_cloud[idx]