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.