finish PoseDiff and NBVDataset
This commit is contained in:
@@ -129,11 +129,11 @@ class DataLoadUtil:
|
||||
target_points_camera_aug = np.concatenate([target_points_camera, np.ones((target_points_camera.shape[0], 1))], axis=-1)
|
||||
|
||||
target_points_world = np.dot(cam_extrinsic, target_points_camera_aug.T).T[:, :3]
|
||||
|
||||
return {
|
||||
"points_world": target_points_world,
|
||||
"points_camera": target_points_camera
|
||||
}
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_point_cloud_world_from_path(path):
|
||||
|
@@ -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]
|
Reference in New Issue
Block a user