pnp_ransac — 3D pose_estimation op

Data kinds: points × keypointspose

Call: import fullseye as fs; fs.ledger.pnp_ransac(points_3d, points_2d, K, thresh=2.0, iters=300, seed=0) (to call the implementation directly, import pnp3d; pnp3d.pnp_ransac(points_3d, points_2d, K, thresh=2.0, iters=300, seed=0); from the registry, ops3d.get("pnp_ransac"))

Usage

Outlier-robust PnP (RANSAC plus a final DLT refit). → (R, t, inlier_mask, info).

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

6 点の最小サンプルで DLT(精密化なし)→ 再投影誤差 < thresh の inlier 最大化 →

inlier 全体で :func:pnp_pose(精密化あり)リフィット。

Raises ValueError: points_2d が (N,2) でない / points_3d が (N,3) でない /

点数不一致 / 6 点未満 / 非有限。

引数:

• `thresh`: 再投影誤差のしきい値 [px] (ユークリッド距離、既定 2.0)。これ未満を inlier とする。

• `iters`: 反復数(既定 300)。早期終了はせず必ずこの回数回す。各反復は 6 点を非復元抽出し初期姿勢だけを解く(縮退した標本は捨てて次へ)。

• `seed: numpy.random.default_rng(seed)` に渡す。同じ入力と seed なら結果は再現する。

返り値: `R (3,3)、t (3,)(規約 Xc = R X + t)、inlier_mask bool (N,)、info` dict。

`info のキーは n_inliers / inlier_ratio / iters / rms`(最終姿勢の再投影 RMS [px]、inlier 集合上)。

• 最良標本の inlier が 6 未満のときは全点で解き直す fallback に入り、`info["fallback"] = True が付く。このとき inlier_mask は fallback 姿勢で数え直した実測値なので、inlier_ratio が小さいまま返ることがある(合意を捏造しない)。fallback も失敗すれば ValueError`。

• inlier 数の比較は「より多い」だけを更新するので、同数なら先に見つかった標本が残る。

• 最終姿勢は inlier 全体でのリフィット(LM 精密化あり)。

• Raises `ValueError: 形状不正 / 6 点未満 / 点数不一致 / 非有限(dlt_pose` と同じ入口検査)。

• 評価は `reprojection_error、GT 比較は pose_error`。

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)

pnp_pose_outlierspy -3.11 examples_3d/pnp_pose_outliers.py

pose_estimationpy -3.11 examples_3d/pose_estimation.py

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

fuse_to_voxel · pose_error · bundle_adjust · mean_reprojection_error · optimize_pose_graph · relative_pose · mean_edge_error · rotation_translation_error

Same category (pose_estimation)

dlt_pose · reprojection_error


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