match_chamfer_3d — 3D match_localize op

Data kinds: voxel × voxelposition

Call: import fullseye as fs; fs.ledger.match_chamfer_3d(scene, template, device='cpu', thr=0.3, edt='scipy') (to call the implementation directly, import match3d; match3d.match_chamfer_3d(scene, template, device='cpu', thr=0.3, edt='scipy'); from the registry, ops3d.get("match_chamfer_3d"))

Return value through the ledger: fullseye.ledger.match_chamfer_3d(...) returns **only the declared out type position** (the underlying function also returns auxiliary values). When you need what was dropped, use fullseye.ledger.match_chamfer_3d.raw(...) or call match3d.match_chamfer_3d directly.

GPU: this op has a GPU path (device="cuda")

Usage

Chamfer / distance-field matching (robust to partial views and occlusion). The voxel × chamfer column.

> The detailed description below is the original text — the summary and the headings are translated.

シーンのエッジの EDT(各 voxel から最近エッジまでの距離)に、テンプレのエッジ点を載せて

距離和を最小化。score(pos)=Σ_{template edge} DT_scene(pos+edge)/n。低いほど良い一致

エッジ点の一部が欠けても効く(NCC より遮蔽に強い)。相関(conv3d)は常に GPU。距離場は

edt="scipy"(CPU、既定)か edt="jfa"(edt_jfa、全 GPU で CPU 往復なし。scipy と厳密一致)。

返り値 [chamfer 距離, d, h, w]。

手順: 両 volume で `|∇| > thr·max|∇| の voxel をエッジにする(thr` は各 volume の最大

勾配に対する 相対比、勾配は `sobel3d`)。scene エッジの距離変換 DT を作り、テンプレの

エッジ 2 値 volume をカーネルに conv3d した値をエッジ数 `n` で割る。

返り値 `[距離, z, y, x]` の距離は「テンプレのエッジ 1 voxel あたり、最寄り scene エッジまでの

平均距離(voxel 単位)」で 0 が完全一致。位置は テンプレ中心 (T//2) の scene 座標で

整数(subvoxel 精緻化は無い。要るなら `refine_translation_lk` へ。corner 規約なので

T//2 を引く)。テンプレが完全に収まらない位置は最大値+1 で埋めて除外する。

テンプレにエッジが無い(`thr` が高すぎる等)と score が全 0 になり index (0,0,0) が返る。

scene にエッジが無い場合の距離場は意味を持たない(`thr` を下げる)。

`edt="jfa"edt_jfa を使い device` 上で完結、それ以外は scipy(CPU)。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

matching_localizepy -3.11 examples_3d/matching_localize.py

Ops the type connects to (they accept position as input)

refine_peak_newton · refine_translation_lk · refine_lm · fuse_to_voxel

Same category (match_localize)

match_shape_3d · match_curvature_3d · match_hough_3d · match_mip_2d · match_points_ncc


*Provenance: match3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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