refine op• Data kinds: voxel × voxel × position → position
• Call: import fullseye as fs; fs.ledger.refine_translation_lk(scene, template, init_pos, device='cpu', iters=30, tol=0.0001) (to call the implementation directly, import match3d; match3d.refine_translation_lk(scene, template, init_pos, device='cpu', iters=30, tol=0.0001); from the registry, ops3d.get("refine_translation_lk"))
• GPU: this op has a GPU path (device="cuda")
Sub-voxel refinement of the 3-D translation by inverse-compositional Lucas-Kanade with Gauss-Newton.
> The detailed description below is the original text — the summary and the headings are translated.
粗マッチ(整数 NCC / Fourier-Mellin / Hough)が与えた整数初期位置 `init_pos` を
出発点に、SSD `Σ|I(x+p) − T(x)|² を最小化してサブボクセル並進 p` へ収束させる。
逆合成(inverse-compositional, Baker–Matthews)方式のため steepest-descent 画像
`SD = ∇T と Hessian H = Σ SDᵀSD` を 反復前に一度だけ前計算し、各反復は
「scene の trilinear ワープ + 残差 + 3×3 線形解 `Δp = H⁻¹ Σ SDᵀ(I(x+p)−T)`」のみ。
並進の合成は `p ← p − Δp`。純並進ワープでは ∂W/∂p=I なので SD=∇T がそのまま使える。
座標系: `init_pos` と戻り値はいずれも テンプレート原点(corner, index 0,0,0) が
scene のどの (dz,dy,dx) に載るか。`sobel3d / grid_sample` の corner 規約に一致
(NCC(ncc_locate_3d)の中心規約とは T//2 だけ異なる点に注意)。
Parameters
----------
scene : (D,H,W) array_like
探索対象ボリューム。
template : (Td,Th,Tw) array_like
位置合わせするテンプレート(scene より小)。
init_pos : (3,) sequence
整数初期位置 (dz,dy,dx) = テンプレート原点の scene 座標。
device : str
"cpu" / "cuda" 等。device 非依存。
iters : int
最大反復数。
tol : float
‖Δp‖ がこの値を下回ったら収束打ち切り。
Returns
-------
pos : (3,) np.ndarray(float64)
精緻化されたサブボクセル位置 (dz,dy,dx)。
Notes
-----
• 滑らか(帯域制限)な密度場を仮定。整数初期値が真値の ±0.5〜1 voxel 内であれば
通常 5〜8 反復で ‖err‖ < 0.05 voxel(低ノイズ時)。実測(独立 cubic-spline GT):
ノイズ無し mean 0.008 / max 0.013 voxel(≈6 反復, ≈1.2ms/回)、NCC サブボクセル
baseline(mean 0.56 voxel)を約60×改善。
• `grad_scale=32` は分離 sobel3d(導関数[-1,0,1]×平滑[1,2,1]²)の固定スケール
(線形ランプで実測 32.0)。真の勾配へ正規化して Δp のスケールを正す。
• H には微小 Levenberg 正則化を加え、勾配の乏しい平坦テンプレートでの数値破綻を防ぐ。
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• refinement — py -3.11 examples_3d/refinement.py
position as input)refine_peak_newton · refine_lm · fuse_to_voxel
refine)refine_peak_newton · refine_lm · refine_rotation_z · icp_point2point_3d · icp_point2plane
*Provenance: match3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.