match_hough_3d — 3D match_localize op

• 資料種類:voxel × voxel → position

• 呼叫: import fullseye as fs; fs.ledger.match_hough_3d(scene, template, device='cpu', ndir=26, mc=0.05, topk=1, nms=3, subvoxel=True)(要直接呼叫實作,import match3d; match3d.match_hough_3d(scene, template, device='cpu', ndir=26, mc=0.05, topk=1, nms=3, subvoxel=True);從台帳取用則 ops3d.get("match_hough_3d"))

• 經台帳呼叫的回傳值: fullseye.ledger.match_hough_3d(...) 只回傳宣告的 out 型別 position 的值(底層函式還會回傳輔助資訊)。需要被捨棄的部分時,請用 fullseye.ledger.match_hough_3d.raw(...),或直接呼叫 match3d.match_hough_3d。

• GPU:該運算子有 GPU 路徑(device="cuda")

用法

generalized Hough 3D(Ballard R-table 投票)。voxel × Hough 列。

把 GHT 以 GPU 原生方式表述為 各方向 bin 相關之和:

accumulator A(t) = Σ_bin ( scene_bin ⋆ template_bin )。每條邊緣依其梯度方向投票, 缺失的邊緣只會降低峰值(對遮蔽、雜波強健)。與 shape-based(連續內積的單一解) 不同,其差異化在於 回傳投票 accumulator,可用 NMS 取多個峰值 = 多個實例。回傳值為 (topk,4) 的 [votes, d, h, w] (votes 降冪)。

步驟:把兩個 volume 的單位梯度(mc 是對 sobel3d 原始輸出的閾值)量化到 ndir 個參考方向中最接近的一個,對每個方向 bin 用 conv3d 累加「scene 中該 bin 的 2 值場 ⋆ 模板中該 bin 的 2 值場」。除以模板的有效邊緣數,因此 votes 在 [0, 1] 內,1 表示全部邊緣一致。

• ndir:26 以下取 26 鄰域方向清單的前 ndir 個(少於 26 時方向有偏),27 以上

在 fibonacci 球上均勻分布。方向越粗對旋轉越寬容,但偽峰也越多。

• 回傳值 (topk, 4) 的每一列為 [votes, z, y, x],votes 降冪。座標是 模板中心 (T//2)

的 scene 座標,subvoxel=True 時為 ±2 鄰域質心。

• nms:每取一個峰值,就把 ±nms voxel 的立方體設為 −1,再找下一個。相鄰的

多個實例需把 nms 調小。

• 模板沒有邊緣時為全 0 的 (topk,4)。模板不能完全容納的位置為 0。

後續:用 refine_translation_lk / refine_peak_newton 細化各峰值。

參考(範例資料、文獻)

• 範例資料目錄(下載 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_shape_3d · match_chamfer_3d · match_curvature_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.