fit_line_3d — 3D geometry op

数据种类:pointsprimitive

调用: import fullseye as fs; fs.ledger.fit_line_3d(points)(要直接调用实现,import match3d; match3d.fit_line_3d(points);从台账取用则 ops3d.get("fit_line_3d"))

用法

点群 → 最小二乘直线(过重心,方向=最大主轴)。返回 (point, direction)。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

`(N,3) の点群(数値・列数 3 でなければ ValueError、2 点未満も ValueError)の重心 c` と

散布行列 `(P−c)ᵀ(P−c)` の最大固有値の固有ベクトルを返す(直交距離の二乗和を最小化する直線。

z=f(x) 型の回帰ではない)。`direction は単位ベクトルで **符号は任意**(eigh` 次第。向きを

揃えるなら `(P[-1] − P[0]) @ direction` の符号で反転)。

2 点だけなら 2 点を通る直線。点が平面状に広がっていると最大軸は「最も長い方向」になるだけで

直線とは限らない(残差は返さないので `distance_point_line` で確かめる)。外れ値に弱い

(ロバストには `ransac_line`)。3-D 専用(2-D 点は ValueError)。

参考(示例数据・文献)

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

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

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

geometry_metrologypy -3.11 examples_3d/geometry_metrology.py

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

fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment

同类别(geometry)

line_from_2points · plane_from_3points · angle_3points · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line


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

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