1

我正在计算 Open3D 中点云的法线

使用:

points = np.random.uniform(-1, 1, (10000, 6))

pointcloud = o3d.geometry.PointCloud()
pointcloud.points = o3d.utility.Vector3dVector(points[:, [0, 1, 2]])
pointcloud.colors = o3d.utility.Vector3dVector(points[:, [3, 4, 5]])
pointcloud = o3d.geometry.voxel_down_sample(pointcloud, voxel_size=0.1)

print("Recompute the normal of the downsampled point cloud ...")
# Why are all the normals in the x direction positive?
o3d.geometry.estimate_normals(
    pointcloud,
    #search_param=o3d.geometry.KDTreeSearchParamKNN(knn=250),
    search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=1.0, max_nn=30)

)

print(np.round(np.asarray(pointcloud.normals).min(axis=0), 3))
print(np.round(np.asarray(pointcloud.normals).max(axis=0), 3))

结果是:

[ 0. -1. -1.]
[1. 1. 1.]

为什么法线的所有 x 分量都是正的?

4

1 回答 1

1

一些法线低于表面,解决方案是:

o3d.geometry.orient_normals_to_align_with_direction( pointcloud, orientation_reference=np.array([0., 0., 1.]) )

于 2019-08-31T00:27:08.543 回答