triangulate_column — 3D structured_light op

• 資料種類:image2d → depth

• 呼叫: import fullseye as fs; fs.ledger.triangulate_column(column, k_cam, k_proj, rot, trans) -> 'np.ndarray'(要直接呼叫實作,import fringe; fringe.triangulate_column(column, k_cam, k_proj, rot, trans) -> 'np.ndarray';從台帳取用則 ops3d.get("triangulate_column"))

用法

由每個相機像素的「投影機行號」三角測量出深度 Z(結構光的最後一段)。

結構光掃描器的幾何本身:相機像素 (u,v) 張成 1 條視線,投影機的行號 u_p 張成 1 個平面(包含投影機中心與該行的平面)。視線與平面的交點就是表面的 3D 點,其相機座標系下的 Z 即深度。這是閉式解,既不需要迭代也不需要最佳化。

column:(H, W) 的投影機行號(次像素實數)。由相位得到的值可直接

傳入。NaN = 未確定像素(輸出也為 NaN)。

k_cam: 相機內參矩陣 3x3(fx, fy, cx, cy[, skew])。像素中心位於整數座標

(與 render3d.render_mesh / camera.depth_to_points 相同的約定)。

k_proj:投影機內參矩陣 3x3。只使用第 0 列(行方向)和第 2 列。

rot: 3x3 旋轉。相機座標系 → 投影機座標系(X_proj = rot·X_cam + trans)。

trans: 長度為 3 的平移(同上,單位與場景相同)。禁止零向量

(基線 0 = 相機與投影機在同一點。平面與視線不相交,深度無法定義)。

回傳值:(H, W) float64 的深度圖(相機前方的 Z,與 render_mesh 的 depth 為同一量)。

交點在後方(Z<=0)或視線與平面平行的像素為 NaN。

推導:X_cam = Z·d(d = K_cam⁻¹[u,v,1])。投影機端的行條件為(K_proj[0] − u_p·K_proj[2])·X_proj = 0。代入 X_proj = rot·X_cam + trans, 對 Z 求解得 Z = −(a·trans) / (a·(rot·d)),a = K_proj[0] − u_p·K_proj[2]。

Raises:形狀、矩陣不正確,基線為零,相機矩陣奇異時拋出 ValueError。

來源(公開文獻):基於光線與平面交點的結構光三角測量 — Hartley & Zisserman, *Multiple View Geometry* 2nd ed. §12(射影幾何中的相交)/ Salvi et al., *Pattern Recognition* 43 2010(結構光圖案的分類與解碼)。

背景知識指南(該運算子背後的物理與規範)

• depth_sensors — 深度感測器知識 —— 測距原理、實機數值、缺測的表現

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• structured_light_scan — py -3.11 examples_3d/structured_light_scan.py

型別可銜接的下一個運算子(可接受 depth 作為輸入)

depth_to_points · tsdf_from_depth · to_points · fuse_to_voxel · depth_to_organized_points · normals_from_depth · occlusion_edges · bearing_angle_image

同類別(structured_light)

wrapped_phase · unwrap_phase_2d · graycode_decode · decode_fringe · synthesize_fringes · absolute_phase


*Provenance: fringe.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.