chamfer_distance — 3D metrics op

Data kinds: points × pointsmeasurement

Call: import fullseye as fs; fs.ledger.chamfer_distance(a, b, squared=False) (to call the implementation directly, import metrics3d; metrics3d.chamfer_distance(a, b, squared=False); from the registry, ops3d.get("chamfer_distance"))

Usage

The symmetric Chamfer distance = 0.5*(mean_a min_b + mean_b min_a). → scalar. Smaller is a closer match.

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

Raises ValueError: どちらかが空 or (N,3) でない場合(空の平均 = 無言 NaN)。

計算: `scipy.spatial.cKDTreea の各点から b への最近傍距離 d_ab`

(`(Na,))と b から a への d_ba を取り、0.5 * (mean(d_ab) + mean(d_ba))`。

`squared=True` なら各距離を 2 乗してから平均する(単位が距離^2 になる。

勾配ベースの最適化で使う形)。既定は生の距離(単位 = 座標の単位)。

入力: `a, b(N, 3) / (M, 3)` の点群(点数は違ってよい、対応は

不要)。float に変換する。座標系・スケールは両者で揃えておくこと(登録前の

2 雲を比べると単に姿勢の差を測ることになる)。

返り値: Python `float。同一点群なら 0。値域は [0, inf)` で正規化はしない

(雲の大きさに比例するので、比較するときは bbox 対角などで割る)。

注意: 平均なので外れ値の影響は Hausdorff より小さいが、点密度の偏りには敏感

(密な側の平均が支配的)。密度を揃えるには `pc_poisson_disk` /

`voxel_grid_downsample を先に掛ける。閾値ベースの評価は fscore`、最悪値は

`hausdorff_distance、対応既知なら rmse_correspondence`。

Background guides (the physics and conventions behind this op)

blender_interop — Blender との併用 — 形を作って fullseye で測る(軸・単位・正解データの罠)

measurement_uncertainty — 計測の不確かさと校正の知識 — 「測れている」を主張するために

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)

itokawa_pose_canonicalpy -3.11 examples_3d/itokawa_pose_canonical.py

itokawa_shape_matchpy -3.11 examples_3d/itokawa_shape_match.py

mesh_lod_downloadpy -3.11 examples_3d/mesh_lod_download.py

metrics_evalpy -3.11 examples_3d/metrics_eval.py

poisson_surface_reconpy -3.11 examples_3d/poisson_surface_recon.py

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

vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle

Same category (metrics)

hausdorff_distance · m3c2_distance · fscore · rmse_correspondence · normal_consistency · voxel_iou · pose_error


*Provenance: metrics3d.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.