refine_peak_newton — 3D refine op

• Data kinds: score × position → position

• Call: import fullseye as fs; fs.ledger.refine_peak_newton(score, idx, device='cpu', max_iter=12, tol=0.0001) (implementation को सीधे call करना हो तो import match3d; match3d.refine_peak_newton(score, idx, device='cpu', max_iter=12, tol=0.0001), registry से लेना हो तो ops3d.get("refine_peak_newton"))

• Ledger के ज़रिए return value: fullseye.ledger.refine_peak_newton(...) केवल घोषित out type position का value लौटाता है (मूल function सहायक जानकारी भी लौटाता है)। जो हिस्सा छोड़ दिया गया है उसकी ज़रूरत हो तो fullseye.ledger.refine_peak_newton.raw(...) का उपयोग करें, या match3d.refine_peak_newton को सीधे call करें।

• GPU: इस op का GPU path है (device="cuda")

उपयोग

score/correlation volume के integer peak को 3D Newton से sub-voxel स्तर तक refine करता है (iterative optimisation)।

coarse match (integer NCC / Fourier-Mellin ±3° / Hough ±0.5voxel) से लौटे integer peak idx को, local quadratic (2 घात) model f(x)≈f0+gᵀΔ+½ΔᵀHΔ के stationary point Δ=-H⁻¹g की ओर बार-बार update करके continuous coordinate तक converge कराता है। प्रति-axis parabolic sub-pixel के विपरीत यह पूरा 3x3 Hessian (cross curvature fzy,fzx,fyx सहित) उपयोग करता है, इसलिए घुमाए गए (cross curvature वाले) anisotropic peak में भी coordinate axis के बीच का coupling bias हटा सकता है।

हर iteration: वर्तमान position के आसपास के 27 neighbour trilinear से लें → central difference से gradient g और 6-component Hessian H बनाएँ, Δ=solve(H,-g)। हर component को ±1 voxel पर clip करें (trust region), position update करें, |Δ|<tol पर converge। Gaussian peak पर central-difference gradient का zero सही peak से मेल खाता है, इसलिए यह stationary point पर converge करता है (एक step में 2nd-order model की error बचती है और ±0.05voxel से नीचे नहीं जा पाती, पर iteration से ~0.02voxel तक converge होता है)। जहाँ H negative definite नहीं (= maximum नहीं) ऐसी real correlation surface पर यह ऊपर की दिशा में हटता है (gradient ascent step) ताकि divergence न हो।

Parameters

score : array_like या torch.Tensor

3D score/correlation volume (D,H,W)। बड़ा मान peak है।

idx : tuple[int,int,int]

integer peak coordinate (z,y,x) (आमतौर पर argmax का unravel परिणाम)।

device : str

"cpu" / "cuda"। torch operation का device।

max_iter : int

अधिकतम iteration (default 12)।

tol : float

convergence मानदंड (update का L2 norm, default 1e-4)।

Returns

numpy.ndarray

[score_peak, z, y, x] (refine के बाद)। score_peak refine की गई position पर trilinear interpolate किया गया score है।

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• refinement — py -3.11 examples_3d/refinement.py

वे अगले ops जिनसे type जुड़ता है (position को input के रूप में लेते हैं)

refine_translation_lk · refine_lm · fuse_to_voxel

इसी category के (refine)

refine_translation_lk · refine_lm · refine_rotation_z · icp_point2point_3d · icp_point2plane


*Provenance: match3d.py — 3D operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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