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 分割)。
首先以 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.