match_localize op• Data kinds: voxel × voxel → position
• Call: import fullseye as fs; fs.ledger.match_shape_3d(vol, template, device='cpu', mc=0.05, subvoxel=True) (implementation को सीधे call करना हो तो import match3d; match3d.match_shape_3d(vol, template, device='cpu', mc=0.05, subvoxel=True), registry से लेना हो तो ops3d.get("match_shape_3d"))
• Ledger के ज़रिए return value: fullseye.ledger.match_shape_3d(...) केवल घोषित out type position का value लौटाता है (मूल function सहायक जानकारी भी लौटाता है)। जो हिस्सा छोड़ दिया गया है उसकी ज़रूरत हो तो fullseye.ledger.match_shape_3d.raw(...) का उपयोग करें, या match3d.match_shape_3d को सीधे call करें।
• GPU: इस op का GPU path है (device="cuda")
3D shape-based (gradient direction) matching = 2D shapematch_gpu का voxel संस्करण ("contour matching")।
Template और scene के unit gradient vectors के dot products का योग (Steger शैली)। intensity/contrast से invariant है, और edge/shape के आधार पर match मापता है। score(pos)=Σ<û_scene(pos+dt), û_model(dt)>/n, 3 components के conv3d से।
प्रक्रिया: दोनों volume पर sobel3d → केवल वे voxel unit vector बनते हैं जिनका magnitude mc से अधिक है (बाकी 0)। Template के unit gradient के 3 components को kernel बनाकर, scene के unit gradient के साथ हर component पर conv3d करके योग लिया जाता है, और template के valid voxel की संख्या n से भाग दिया जाता है। score [−1, 1] में है: 1 पर पूरा match (सभी gradient दिशाएँ एक जैसी), contrast उलटने पर −1।
• mc: sobel3d के raw output (असली gradient का 32 गुना) पर threshold। जितना छोटा, उतने अधिक flat क्षेत्रों के
noise gradients vote में आते हैं।
• Position: return value [score, z, y, x] (float64 array) के coordinates बताते हैं कि template center voxel (index T//2)
scene में कहाँ पड़ता है। जहाँ template पूरा नहीं समाता वे positions 0 कर दी जाती हैं, इसलिए template अगर scene से बड़ा हो तो सब 0 ही रहता है और index (0,0,0) लौटता है (कोई exception नहीं)।
• subvoxel=True पर argmax के ±2 neighbourhood के धनात्मक scores के centroid तक refine होता है (accel_match._subvoxel_com)।
आगे: refine_translation_lk (corner convention, इसलिए T//2 घटाएँ) / refine_lm। rotation से invariant नहीं है (पहले match_logpolar_z से rotation मिलाएँ)।
• 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 के स्रोत।
• matching_localize — py -3.11 examples_3d/matching_localize.py
position को input के रूप में लेते हैं)refine_peak_newton · refine_translation_lk · refine_lm · fuse_to_voxel
match_localize)match_chamfer_3d · match_curvature_3d · match_hough_3d · match_mip_2d · match_points_ncc
*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.