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.