点云的一致法线计算 [英] Consistent normal calculation of a point cloud

查看:469
本文介绍了点云的一致法线计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在python或c ++中的库,该库能够以一致的方式估计点云的法线? 以一致的方式,我的意思是法线的方向在表面上是全局保留的.

Is there a library in python or c++ that is capable of estimating normals of point clouds in a consistent way? In a consistent way I mean that the orientation of the normals is globally preserved over the surface.

例如,当我使用python open3d软件包时:

For example, when I use python open3d package:

downpcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(
    radius=4, max_nn=300))

结果不一致,其中一些法线指向内部,其余法线指向外部.

I get an inconsistent results, where some of the normals point inside while the rest point outside.

非常感谢

推荐答案

就像马克说的那样,如果您的点云来自多个深度图像,则可以在将它们连接在一起之前调用open3d.geometry.orient_normals_towards_camera_location(pcd, camera_loc)(假设您使用的是python版本) Open3D )

Like Mark said, if your point cloud comes from multiple depth images, then you can call open3d.geometry.orient_normals_towards_camera_location(pcd, camera_loc) before concatenating them together (assuming you're using python version of Open3D).

但是,如果您没有该信息,则可以使用以下算法:

However, if you don't have that information, you can use the following algorithm:

  1. 为您的点云构建knn图.
    图节点是点.如果一个点是另一个点的k最近邻点,则将两个点连接起来.
  2. 将权重分配给图形的边缘.
    与边缘(i,j)相关的权重计算为 1-| n i n j |
  3. 生成结果图的最小生成树.
  4. 将树植在初始节点上, 以深度优先的顺序遍历树,为每个节点分配一个 方向与其父方向一致.
  1. Build knn-graph for your point cloud.
    The graph nodes are the points. Two points are connected if one is the other's k-nearest-neighbor.
  2. Assign weights to the edges in the graph.
    The weight associated with edge (i, j) is computed as 1 - |ninj|
  3. Generate the minimal spanning tree of the resulting graph.
  4. Rooting the tree at an initial node, traverse the tree in depth-first order, assigning each node an orientation that is consistent with that of its parent.

实际上,上述算法来自 Hoppe 1992年的第3.3节 SIGGRAPH论文从无组织点重建表面.该算法也是开源.

Actually the above algorithm comes from Section 3.3 of Hoppe's 1992 SIGGRAPH paper Surface Reconstruction from Unorganized Points. The algorithm is also open sourced.

AFAIK算法不能保证完美的方向,但是应该足够好.

AFAIK the algorithm does not guarantee a perfect orientation, but it should be good enough.

这篇关于点云的一致法线计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆