deflectometry_render — SPECULAR deflectometry op

• Data kinds: image2d → images

• Call: import fullseye as fs; fs.ledger.deflectometry_render(height, rig=None, period_mm=10.0, n_steps=4, direction='x', kind='fringe', slope_x=None, slope_y=None, diffuse_fraction=0.0, scatter_rad=0.0, back_thickness_mm=None, refractive_index=1.52, focus='surface', aperture_samples=None, noise_sigma=0.0, bits=None, seed=0) (to call the implementation directly, import deflectometry; deflectometry.deflectometry_render(height, rig=None, period_mm=10.0, n_steps=4, direction='x', kind='fringe', slope_x=None, slope_y=None, diffuse_fraction=0.0, scatter_rad=0.0, back_thickness_mm=None, refractive_index=1.52, focus='surface', aperture_samples=None, noise_sigma=0.0, bits=None, seed=0); from the registry, opsspecular.get("deflectometry_render"))

Usage

Height field → the camera's image of the screen's mirror reflection (forward simulation). → list of images (each (H, W), [0, 1]).

> The detailed description below is the original text — the summary and the headings are translated.

height (H, W) [mm] は rig の視野(一辺 field_mm、格子間隔 field / (W − 1))に張った面の高さ。カメラの画像も (H, W) で、視野の四隅が収まる焦点距離を選ぶ(画素と面の格子は斜めから見るので 1 対 1 ではない —— deflectometry_phase_to_slope が投影して読み直す)。各画素の視線を面に当て(z = h の交点を反復で)、法線で鏡面反射して(match3d.reflect)画面に当て、画面の輝度(deflectometry_screen_pattern と同じ式)を読む。kind="fringe" なら n_steps 枚、それ以外は 1 枚。

傾きは slope_x = ∂h/∂x、slope_y = ∂h/∂y を渡せば解析値を使い(真値を厳密にするため)、省略すると height の中心差分。

物理の効果(どれも既定は「理想の鏡」):

• diffuse_fraction = k_d ∈ [0, 1): 面の拡散成分。I = (1 − k_d)·鏡面 + k_d·画面の平均輝度。縞の振幅が (1 − k_d) 倍に落ち、位相の雑音は 1 / (1 − k_d) 倍になる(ざらついた塗装)。

• scatter_rad: 鏡面ローブの広がり(面の法線の標準偏差 [rad])。反射光は 2 倍広がり、画面上で σ = 2·scatter·(面から画面の距離)のガウスで縞がぼける → 振幅 exp(−2π²σ²/周期²)。

• back_thickness_mm / refractive_index: 透明板(カバーガラス)の裏面反射(屈折率は数か材料表の名前 —— 名前なら d 線 587.56 nm の n)。表で屈折(glassmirror.refract_rays)→ 平らな裏面で反射 → 表から出る光が、ずれた画面の点を映す。重みは Fresnel(glassmirror.fresnel_dielectric)。カメラの露出は表と裏の和で正規化する。

• focus: "surface"(面にピント)/ "screen"(画面の虚像 = 主光線に沿って L + d にピント)/ 0〜1 の数(その間の比 D_f = L + α d)。開口 rig["aperture_mm"] = A の薄レンズで、距離 D の物体の錯乱円の直径は A·|D − D_f| / D_f。面にピント(α = 0)で開口積分を指定しないときは、面の 1 点から出た光が画面上で直径 A·d/L の円板に広がるだけなので、縞に一様円板の MTF 2 J1(πc/p) / (πc/p) を掛ける(閉形式、負なら位相が反転)。それ以外は開口積分: 開口上の aperture_samples 点(既定 16、Vogel の螺旋)から、主光線上のピントの点へ向かう光線を 1 本ずつ面に当てて反射させ、画面の輝度を平均する —— 画面側のぼけ(縞の振幅)と面側のぼけ(面の傾きの平均 = 凹みがぼける)が同時に出る。

★2026-10-15: 初版は面側のぼけを「画像を円板で畳み込む」近似にしていて、画面にピントを合わせても

縞の振幅が 0.59 倍に落ちた(縞そのものまでぼかしていた)。画面に合っていれば縞はくっきりで、ぼける

のは縞を曲げる面の傾きのほう —— 開口積分に直した。

• noise_sigma(画素の加法ガウス雑音、[0, 1] の単位)と bits(量子化、例 8)。seed で再現。

画面の外に当たる画素は 0(黒)。fringe.modulation で低い変調の画素を除くこと。

Raises: ValueError —— height が 2-D の有限な配列でない(2 × 2 未満も)、傾きの形が違う・有限でない、周期が正でない、N < 3、方向・kind・focus が不正、k_d が [0, 1) の外、散乱が負、板厚が正でない、屈折率が 1 以下、雑音が負、bits が 1〜16 の整数でない、aperture_samples が 1〜256 の整数でも None でもない、rig が不正。

Detailed usage guide

• specular_photometric family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_phase_measuring_deflectometry — py -3.11 examples/poc_phase_measuring_deflectometry.py

Ops the type connects to (they accept images as input)

photometric_stereo_robust · photometric_residual

Same category (deflectometry)

deflectometry_rig · deflectometry_screen_pattern · deflectometry_phase_to_slope · slope_to_curvature · deflectometry_sensitivity


*Provenance: deflectometry.py — SPECULAR operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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