match_shape_3d — 3D match_localize op

資料種類:voxel × voxelposition

呼叫: 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_localizepy -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.