match_localize op• 数据种类:voxel × voxel → position
• 调用: import fullseye as fs; fs.ledger.match_shape_3d(vol, template, device='cpu', mc=0.05, subvoxel=True)(要直接调用实现,import match3d; match3d.match_shape_3d(vol, template, device='cpu', mc=0.05, subvoxel=True);从台账取用则 ops3d.get("match_shape_3d"))
• 经台账调用的返回值: fullseye.ledger.match_shape_3d(...) 只返回声明的 out 类型 position 的值(底层函数还会返回辅助信息)。需要被丢弃的部分时,使用 fullseye.ledger.match_shape_3d.raw(...),或直接调用 match3d.match_shape_3d。
• GPU:该算子有 GPU 路径(device="cuda")
3D 形状(梯度方向)匹配 = 2D shapematch_gpu 的 voxel 版(「轮廓匹配」)。
模板与场景的 单位梯度向量内积之和(Steger 式)。对强度/对比度不变, 以边缘/形状衡量匹配。score(pos)=Σ<û_scene(pos+dt), û_model(dt)>/n,用 3 个分量的 conv3d 计算。
步骤:对两个 volume 做 sobel3d → 只把大小超过 mc 的 voxel 单位向量化(其余为 0)。以模板单位梯度的 3 个分量为核,与场景单位梯度逐分量做 conv3d 并求和, 再除以模板的有效 voxel 数 n。score 在 [−1, 1] 内,1 为完全匹配(梯度方向全部一致),对比度反转时为 −1。
• mc:针对 sobel3d 的 原始输出(真实梯度的 32 倍) 的阈值。越小,平坦区域的
噪声梯度越多地参与投票。
• 位置:返回值 [score, z, y, x](float64 数组)的坐标是 模板中心 voxel(index T//2)
落在 scene 的何处。模板不能完全容纳的位置都置为 0,因此模板比 scene 大时全部保持为 0,返回 index (0,0,0)(不抛出异常)。
• subvoxel=True 时细化到 argmax 的 ±2 邻域内正分数的质心(accel_match._subvoxel_com)。
后续:refine_translation_lk(corner 约定,因此减去 T//2)/ refine_lm。对旋转不具不变性(先用 match_logpolar_z 对齐旋转)。
• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。
• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。
• matching_localize — py -3.11 examples_3d/matching_localize.py
position 作为输入)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 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.