refine opvoxel × voxel × position → positionimport fullseye as fs; fs.ledger.refine_translation_lk(scene, template, init_pos, device='cpu', iters=30, tol=0.0001) (実装を直接呼ぶなら import match3d; match3d.refine_translation_lk(scene, template, init_pos, device='cpu', iters=30, tol=0.0001)、台帳から引くなら ops3d.get("refine_translation_lk"))device="cuda")Gauss-Newton 逆合成 Lucas-Kanade による 3D 並進サブボクセル精緻化。
粗マッチ(整数 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 だけ異なる点に注意)。
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‖ がこの値を下回ったら収束打ち切り。
pos : (3,) np.ndarray(float64) 精緻化されたサブボクセル位置 (dz,dy,dx)。
grad_scale=32 は分離 sobel3d(導関数[-1,0,1]×平滑[1,2,1]²)の固定スケール
(線形ランプで実測 32.0)。真の勾配へ正規化して Δp のスケールを正す。py -3.11 examples_3d/refinement.pyposition を入力に取れる)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. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.