match_chamfer_3d — 3D match_localize op

• Data kinds: voxel × voxel → position

• 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: none (CPU reference implementation only)

Usage

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

Place the edge point of the template on the EDT of the edge of the scene (distance from each voxel to the nearest edge). Minimize the sum of distances. score(pos)=Σ_{template edge} DT_scene(pos+edge)/n. Lower is better match. It works even if some of the edge points are missing (more resistant to occlusion than NCC). Correlation (conv3d) is always GPU. The distance field is edt="scipy" (CPU, default) or edt="jfa" (edt_jfa, all GPUs, no CPU round trips, exactly matches scipy). Return value [chamfer distance, d, h, w].

Steps: Edge voxels with |∇| > thr·max|∇| in both volumes (thr is the maximum relative ratio to the slope, where the slope is sobel3d). Create a distance transformation DT for the scene edge and use the template Conv3d the edge binary value volume to the kernel and divide it by the number of edges n. dist of the return value [dist, z, y, x] is per voxel edge of the template, up to the nearest scene edge. "Average distance (in voxel units)" and 0 is a perfect match. The position is the scene coordinates of template center (T//2) Integer(subvoxel There is no refinement. If necessary, go to refine_translation_lk. Since it is a corner convention subtract T//2). Positions where the template does not fit completely are filled with the maximum value +1 and excluded. If the template has no edges (thr is too high, etc.), the score will be all 0 and index (0,0,0) will be returned. If there are no edges in the scene, the distance field has no meaning (lower thr). edt="jfa" uses edt_jfa and is completed on device, otherwise scipy (CPU). If there are no edges in the template, the score will be all 0, and the beginning of the valid range (pd, ph, pw) will be returned.

Empty input (scene with 0 elements) results in a ValueError.

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_localize — py -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.