graycode_decode — 3D structured_light op

資料種類:imagesimage2d

呼叫: import fullseye as fs; fs.ledger.graycode_decode(bit_images, thresh=0.5) -> 'np.ndarray'(要直接呼叫實作,import fringe; fringe.graycode_decode(bit_images, thresh=0.5) -> 'np.ndarray';從台帳取用則 ops3d.get("graycode_decode"))

用法

Gray code 位元影像序列 → 整數條紋級次圖(絕對級次)。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

bit_images: 長さ K のシーケンス(各 2D 画像、明=1 / 暗=0)。MSB first(bit_images[0] が

最上位ビット)。thresh で二値化する。

thresh: 二値化しきい値(画素値 >= thresh を 1)。

処理: 各ビット面を二値化 → MSB first で Gray 値を組み立て → Gray→binary 変換

(binary = gray ^ (gray>>1) ^ ... ^ (gray>>(K-1)))で絶対次数(整数)を返す。

返り値: dtype int64 の 2D 次数マップ(値域 0..2**K-1)。

検証(`ValueError): None / (K, H, W) に変換できない / K < 1` /

`K > 62(int64 に収まらない) / NaN・Inf を含む。thresh` は検査しない

(画素値と同じスケールで与える。`[0, 1]` 画像なら 0.5 が既定)。

二値化は固定閾値 `>= thresh` のみ — 反転パターン(ネガ画像)との比較や

局所閾値は行わない。影・低反射で暗く出た画素は 0 ビットとして復号され、

エラーにならず誤った次数になるので、`modulation` などで作った信頼マスクを

呼び手が別に持つこと。

次数の意味: Gray 符号は隣接コードが 1 ビットしか違わないので、境界画素の

二値化誤りは次数を ±1 しかずらさない(binary 符号なら大きく飛ぶ)。返る整数を

投影機コラム番号や縞の絶対次数として、`absolute_phasecoarse`

(`2π * 次数 を位相に換算)や triangulate_columncolumn` に使う。

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

depth_sensors — 深度センサの知識 — 測距原理・実機の値・欠測の出方

參考(範例資料・文獻)

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

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

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

graycode_structured_lightpy -3.11 examples_3d/graycode_structured_light.py

structured_light_scanpy -3.11 examples_3d/structured_light_scan.py

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

fuse_to_voxel · fit_poly_surface · eval_poly_surface · surface_form_error · background_flatten · polar_unwrap · fit_zernike · matcap_shade

同類別(structured_light)

wrapped_phase · unwrap_phase_2d · decode_fringe · synthesize_fringes · absolute_phase · triangulate_column


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

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