motion_segment op• 資料種類:points × points → labels
• 呼叫: import fullseye as fs; fs.ledger.segment_rigid_motions(pts0, pts1, thresh, max_bodies: 'int' = 5, min_inliers=None, n_iter: 'int' = 100, k_sample: 'int' = 6, seed: 'int' = 0) -> 'dict'(要直接呼叫實作,import motion_seg3d; motion_seg3d.segment_rigid_motions(pts0, pts1, thresh, max_bodies: 'int' = 5, min_inliers=None, n_iter: 'int' = 100, k_sample: 'int' = 6, seed: 'int' = 0) -> 'dict';從台帳取用則 ops3d.get("segment_rigid_motions"))
• 經台帳呼叫的回傳值: fullseye.ledger.segment_rigid_motions(...) 只回傳**宣告的 out 型別 labels 的值**(底層函式還會回傳輔助資訊)。需要被捨棄的部分時,請用 fullseye.ledger.segment_rigid_motions.raw(...),或直接呼叫 motion_seg3d.segment_rigid_motions。
• 底層回傳: {"labels", "motions"} → labels
把兩個點群按運動一致的剛體分割(迭代 RANSAC 的 multi-body 分割)。
> 以下的詳細說明為原文 —— 摘要與標題已翻譯。
まず :func:estimate_flow で観測フロー(各 pts0 点 -> pts1 最近傍)を取り、
`target = pts0 + flow` を対応先として固定する。以後、残り点集合に対して:
1. 空間的に近い `k_sample` 点(seed + その最近傍)を種に Kabsch で剛体仮説を立て、
2. フロー整合 `|| (R·s + t) - target(s) || < thresh` を満たす inlier を数え、
3. `n_iter` 試行で 有意性ゲートを満たす 最良仮説を選び(inlier 残差中央値が
`thresh` の一定割合未満 = 真の剛体らしく残差が 0 近傍に集中。無相関/ノイズの
偶然適合は許容球を満たし残差 ≈ 0.6*thresh なので弾かれる)、その inlier で Kabsch
再フィット(refine)、
4. inlier 数が `min_inliers` 以上 かつ refine 後も有意性を保つならそれを 1 剛体
として確定・除去。満たさなければ body を作らず残余は -1 のまま終了(偽の剛体を捏造
しない)。
を `max_bodies` 個または残り点が閾値を下回るまで繰り返す。どの剛体にも属さない残り点は
`labels = -1`(outlier / 未対応、詐称しない)。近傍種サンプリングは空間的に連続な物体を
まとめて掴むための locality prior で、閾値ではなく相対順位だけを使うためスケール不変。
Args:
pts0: (N, 3) 時刻 0 の点群。
pts1: (M, 3) 時刻 1 の点群(N と一致不要)。
thresh: フロー整合の inlier 距離しきい値。座標スケール相対で与えること
(絶対 epsilon をモジュール内に持たないため、呼び手が座標系に合わせる)。
max_bodies: 抽出する剛体数の上限(>= 1)。
min_inliers: 1 剛体と認める最小 inlier 数。None なら `max(3, round(0.1*N))`。
outlier の塊を偽の剛体にしないための下限。
n_iter: 剛体 1 個あたりの RANSAC 試行回数。
k_sample: 1 仮説を作る種サンプルの点数(seed + 最近傍、>= 3)。
seed: RANSAC 乱数シード(再現性)。
Returns:
dict: ``{"labels": (N,) int(各点の剛体 id、0..K-1 / outlier=-1),
"motions": [(R, t), ...] (id 順の剛体変換、K 個)}``。
Raises:
ValueError: 形状不正 / 非有限 / pts1 空 / thresh <= 0 / max_bodies < 1 /
k_sample < 3。
• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。
• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。
• motion_seg — py -3.11 examples_3d/motion_seg.py
labels 作為輸入)fuse_to_voxel · vol_region_props
motion_segment)*Provenance: motion_seg3d.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.