【问题标题】:Why are Open3D normals incorrect in x-direction?为什么 Open3D 法线在 x 方向上不正确?
【发布时间】:2019-08-30 23:15:56
【问题描述】:

我正在为 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 分量都是正数?

【问题讨论】:

  • 为什么不呢?
  • @Marcin 屋顶指向天空是正 z 方向。因此,屋顶的面朝东北,朝南和朝西。 sl 一些法线应该有一个负的 x 分量
  • @Marcin 如果我的积分是points = np.random.uniform(-1, 1, (1000, 6)),我会得到相同的结果,这让我觉得我错过了什么?为什么会有一个带有负 x 分量的法线?
  • 我找到了原因,法线朝向屋顶下方。

标签: python normals open3d


【解决方案1】:

一些法线在表面之下,解决办法是:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-07
    • 1970-01-01
    • 1970-01-01
    • 2017-03-27
    • 1970-01-01
    • 2012-01-17
    • 2011-08-01
    相关资源
    最近更新 更多