refine op• 資料種類:score × position → position
• 呼叫: import fullseye as fs; fs.ledger.refine_peak_newton(score, idx, device='cpu', max_iter=12, tol=0.0001)(要直接呼叫實作,import match3d; match3d.refine_peak_newton(score, idx, device='cpu', max_iter=12, tol=0.0001);從台帳取用則 ops3d.get("refine_peak_newton"))
• 經台帳呼叫的回傳值: fullseye.ledger.refine_peak_newton(...) 只回傳宣告的 out 型別 position 的值(底層函式還會回傳輔助資訊)。需要被捨棄的部分時,請用 fullseye.ledger.refine_peak_newton.raw(...),或直接呼叫 match3d.refine_peak_newton。
• GPU:該運算子有 GPU 路徑(device="cuda")
用 3D Newton 把 score/相關體的整數峰精化到次體素(迭代最佳化)。
將粗匹配(整數 NCC / Fourier-Mellin ±3° / Hough ±0.5voxel)回傳的整數峰值 idx,向局部 2 次模型 f(x)≈f0+gᵀΔ+½ΔᵀHΔ 的駐點 Δ=-H⁻¹g 迭代更新,使其收斂到連續座標。與逐軸的拋物線次像素不同,它使用 完整的 3x3 Hessian(含交叉曲率 fzy,fzx,fyx),因此即使是旋轉後的(有交叉曲率的)異向性峰值,也能消除座標軸之間的耦合偏差。
每次迭代:以 trilinear 取目前位置周圍的 27 鄰域 → 以中心差分構造梯度 g 與 6 分量 Hessian H, Δ=solve(H,-g)。各分量截斷到 ±1 voxel(信賴域)後更新位置,|Δ|<tol 時收斂。在高斯峰上,中心差分梯度的零點與真實峰值一致,因此收斂到駐點(單步會殘留 2 次模型誤差,無法低於 ±0.05voxel,但迭代可收斂到 ~0.02voxel)。在 H 非負定(=不是極大)的 real 相關面上,退回到上升方向(梯度上升步)以防發散。
score : array_like 或 torch.Tensor
3D 分數/相關 volume (D,H,W)。值越大越是峰值。
idx : tuple[int,int,int]
整數峰值座標 (z,y,x)(通常為 argmax 的 unravel 結果)。
device : str
"cpu" / "cuda"。torch 運算的 device。
max_iter : int
最大迭代次數(預設 12)。
tol : float
收斂判定(更新量 L2 範數,預設 1e-4)。
numpy.ndarray
[score_peak, z, y, x] (精細化後)。score_peak 為精細化位置處的 trilinear 內插分數。
• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。
• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。
• refinement — py -3.11 examples_3d/refinement.py
position 作為輸入)refine_translation_lk · refine_lm · fuse_to_voxel
refine)refine_translation_lk · refine_lm · refine_rotation_z · icp_point2point_3d · icp_point2plane
*Provenance: match3d.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.