我正在为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分量都是正的?
最佳答案
一些法线在表面以下,解决方案是:o3d.geometry.orient_normals_to_align_with_direction( pointcloud, orientation_reference=np.array([0., 0., 1.]))
关于python - 为什么Open3D法线在x方向上不正确?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57734044/