register_nonrigid — 3D deform op

• 数据种类:points × points → points

• 调用: import fullseye as fs; fs.ledger.register_nonrigid(src, dst, iters=20, lam=1.0, k_smooth=None)(要直接调用实现,import deform3d; deform3d.register_nonrigid(src, dst, iters=20, lam=1.0, k_smooth=None);从台账取用则 ops3d.get("register_nonrigid"))

• 经台账调用的返回值: fullseye.ledger.register_nonrigid(...) 只返回声明的 out 类型 points 的值(底层函数还会返回辅助信息)。需要被丢弃的部分时,使用 fullseye.ledger.register_nonrigid.raw(...),或直接调用 deform3d.register_nonrigid。

• 底层返回: (warped, info, info)

用法

用非刚体 ICP 把 src 靠向 dst。

每次迭代都从"当前变形后的 src"向 dst 重新建立最近邻对应,把这些对应作为控制点对应(控制中心 = 原始 src),带正则化地重新拟合 TPS,并对 src 进行变形。即使对应关系未知,也能恢复平滑的非线性变形。

实现要点(鲁棒性):

• 尺度不变: λ 被视为相对于 dst 绕质心的 RMS 半径的相对值(内部为 λ_eff = λ·scale)。即使坐标放大 100 倍,同一个 λ 也给出相同的行为。

• 发散保护: 对应关系含糊时,简单的 NN 迭代可能因正反馈而发散。监视每次迭代的对应 RMS,返回最佳迭代(RMS 最小)的变形和模型。因此即使 λ 选得不好,也不会返回"比初始更差"的结果。

• λ 越大越刚性(变形越小)。默认 λ=1.0 偏保守(几乎刚性),因此想恢复较大的非线性变形时,应把 λ 调小(例如 0.01~0.05)。

参数:

src: (N,3) 移动侧点云。

dst: (M,3) 固定侧(参考)点云。

iters: 最大迭代次数。

lam: TPS 正则化 λ(相对尺度)。越大变形越平滑(对错误对应鲁棒,

拟合较松)。越小贴合越紧(能恢复细小变形)。

k_smooth: 为 None 时以最近的 1 个点为目标(硬对应)。给定整数时,

以 dst 侧 k 个近邻的平均为目标,使对应平滑化(对噪声鲁棒)。

返回值:

warped_src: (N,3) 最佳迭代时变形后的 src。

model: 对应的 TPS 模型(控制中心 = 原始 src,可在原坐标系中直接

传给 tps_warp)。如果 1 次拟合都没有成功则为 None。

info: dict。"rms"(最佳对应 RMS)、"rms_init"(初始=恒等时的对应 RMS)、

"rms_history"(list)、"iters"(实际迭代次数)、"best_iter"、"converged"(bool)。

异常:

ValueError: 形状非法、点数不足、k_smooth 非法。

参考(示例数据、文献)

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

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

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

• nonrigid_deform — py -3.11 examples_3d/nonrigid_deform.py

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

points_to_voxel · gaussians_to_voxel · estimate_point_normals · to_points · match_points_ncc · match_pca · moment_axes · icp_point2point_3d

同类别(deform)

tps_fit · tps_warp · register_cpd_rigid


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

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