gicp — 3D gicp op

• 資料種類:points × points → pose

• 呼叫: import fullseye as fs; fs.ledger.gicp(source, target, max_iter: 'int' = 30, k: 'int' = 20, epsilon: 'float' = 0.001, tol: 'float' = 1e-08, init=None, reproducible: 'bool' = False) -> 'dict'(要直接呼叫實作,import gicp; gicp.gicp(source, target, max_iter: 'int' = 30, k: 'int' = 20, epsilon: 'float' = 0.001, tol: 'float' = 1e-08, init=None, reproducible: 'bool' = False) -> 'dict';從台帳取用則 ops3d.get("gicp"))

• 經台帳呼叫的回傳值: fullseye.ledger.gicp(...) 只回傳宣告的 out 型別 pose 的值(底層函式還會回傳輔助資訊)。需要被捨棄的部分時,請用 fullseye.ledger.gicp.raw(...),或直接呼叫 gicp.gicp。

用法

用 Generalized-ICP(共變異數加權馬氏 ICP)估計剛體變換 (R,t)。

每次迭代建立 source→target 的最近鄰對應,對以權重 W_i = (C_target[q_i] + R·C_source[s_i]·Rᵀ)⁻¹ 衡量殘差 d_i = R·s_i + t - q_i 的馬氏代價 Σ d_iᵀ W_i d_i,以小角度線性化 R ← (I+[ω]×)R 的 Gauss-Newton 進行最小化。由各對應的雅可比矩陣 J_i = [-[R·s_i+t]× | I](3×6) 求解正規方程式 (Σ J_iᵀ W_i J_i) x = -(Σ J_iᵀ W_i d_i)(6×6)得到增量 x=[ω|τ],以 Rodrigues 轉回旋轉並累積。

共變異數為 plane-to-plane(estimate_covariances)。point-to-plane 將殘差投影到 target 的法線方向(rank-1),而 GICP 使用合成了 source、target 雙方 full 3×3 共變異數的權重,因此對平面狀、含雜訊的點雲穩健。

ICP 是局部最佳化,因此以接近的初始化為前提(傳入粗匹配或 init)。

參數:

source (N,3): 被移動一側的點雲。

target (M,3): 參考側(固定)的點雲。

max_iter: 最大迭代次數。

k: 共變異數估計的鄰域點數。

epsilon: plane-to-plane 中法線方向的小變異數(0<ε<1)。

tol: 收斂閾值。增量平移 ‖τ‖ 小於 tol×(target 的 RMS 半徑) 且

增量旋轉 ‖ω‖(rad)小於 tol 時終止(相對於尺度)。

init: (R0(3,3), t0(3,)) 的初始位姿元組,或 None(單位)。

reproducible: 為 True 時,N 點之和 Σ J_iᵀ W_i J_i、Σ J_iᵀ W_i d_i 以 ozakimm(Ozaki 方案)歸約,

位姿的套用改為逐元素運算,RMSE 用 math.fsum。與 source 點的順序、BLAS 執行緒數無關,

R、t、rmse 逐位元相同(若共變異數的鄰域中有距離恰好相同的點,鄰域的選取方式可能改變)。

預設 False 與以往相同。

回傳值:

dict:

"R" (3,3) ndarray — 滿足 target ≈ R·source + t 的旋轉。

"t" (3,) ndarray — 平移。

"rmse" float — 最終對應上的歐氏 RMSE(採用的點)。

"iterations" int — 實際迭代次數。

例外:

ValueError: 輸入形狀不正確 / 點數不足 / 數值發散(非有限)= fail-closed(失敗即拒絕)。

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• gicp_register — py -3.11 examples_3d/gicp_register.py

型別可銜接的下一個運算子(可接受 pose 作為輸入)

fuse_to_voxel · pose_error · bundle_adjust · mean_reprojection_error · optimize_pose_graph · relative_pose · mean_edge_error · rotation_translation_error

同類別(gicp)

estimate_covariances


*Provenance: gicp.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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