orient_normals — 3D normals_orient op

• 数据种类:points × normals → normals

• 调用: import fullseye as fs; fs.ledger.orient_normals(points, normals, k: 'int' = 20, seed_dir=None) -> 'np.ndarray'(要直接调用实现,import normals_orient; normals_orient.orient_normals(points, normals, k: 'int' = 20, seed_dir=None) -> 'np.ndarray';从台账取用则 ops3d.get("orient_normals"))

用法

用 Hoppe 法把法线定向为全局一致(MST 传播)。→ (N,3)。

在 kNN 图上以权重 1 - |n_i·n_j|(切平面越一致代价越低)建立最小生成树, 从种子点开始对树做 BFS,翻转与父节点符号相反的子节点,使分量内部一致。种子点在指定 seed_dir 时为沿该方向最突出的点,未指定时为最外点(离质心最远)。若图不连通,则对每个连通分量独立选取种子点并传播(分量之间的相对朝向不保证)。

传入 seed_dir 时,在通过传播使分量内部一致后,汇总分量所有点的投影,使全局符号与 seed_dir 一致(不依赖单个种子点的 |cos|,因此即使种子点的法线与 seed_dir 近乎正交,符号也能可靠确定 — finding [5])。seed_dir 与分量的全部法线(几乎)正交、无法决定符号的真正退化情况为 fail-closed(失败即拒绝)(ValueError)。在闭曲面(球等)上 seed_dir 平均而言与法线正交时,全局符号不唯一, 因此保留以最突出点(= 朝外)为基准的定向。未指定 seed_dir 时从质心朝外。

Args:

points: (N,3) 的点云。

normals: (N,3) 朝向未定的法线(内部单位化)。

k: kNN 图的邻域点数。

seed_dir: 全局参考朝向 (3,)。为 None 时以从质心朝外为基准。

Returns:

符号全局一致的 (N,3) 单位法线。

Raises:

ValueError: seed_dir 为零,或(在某个连通分量中)与全部法线正交而

无法控制全局符号时(fail-closed(失败即拒绝))。

背景知识指南(该算子背后的物理与约定)

• blender_interop — 与 Blender 配合使用 —— 在 Blender 中建形、用 fullseye 测量(坐标轴、单位、真值数据的陷阱)

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

可运行的示例(实际调用该算子并已验证的样例)

• oriented_normals — py -3.11 examples_3d/oriented_normals.py

类型可衔接的下一个算子(可接受 normals 作为输入)

icp_point2plane · compute_fpfh · shot_descriptor · fuse_to_voxel · reflect · refract · normal_consistency · ransac_cylinder

同类别(normals_orient)

estimate_oriented_normals


*Provenance: normals_orient.py — 3D 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.