integrate_normals — 3D photometric op

Data kinds: normalmapimage2d

Call: import fullseye as fs; fs.ledger.integrate_normals(normals, mask=None) (to call the implementation directly, import photometric; photometric.integrate_normals(normals, mask=None); from the registry, ops3d.get("integrate_normals"))

Usage

Normal field → height field z by Frankot-Chellappa integration. → z, HxW (a constant offset is free; referenced to zero mean).

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

手順: 法線 `(H,W,3) を勾配 p = -nx/nzq = -ny/nz に直し(|nz| < 1e-6` の

画素は nz を ±1e-6 に置き換えて零割を避ける)、FFT 領域で最小二乗解

`Z(wx,wy) = (-j·wx·P - j·wy·Q) / (wx² + wy²)` を求め(直流成分は 0)、逆変換して

平均を 0 に引く。`mask` (bool HxW) を与えると mask 外の勾配を 0 にしてから積分する

(その領域は平坦として扱われる)。返り値は float64 の `(H,W)`。

注意点:

• 周期境界を仮定するため、画像の上下・左右がつながるように端が歪む。

• 絶対高さは決まらない(平均 0)。格子間隔 1 画素で積分するので `z` も画素単位の

高さになり、実寸には画素ピッチを掛ける。

• `nz ≈ 0`(輪郭付近・視線に平行な面)は勾配が発散し、波打ちを周囲へ広げる。

`mask` で除くか法線を事前に平滑する。

入力検証は無い(`(H,W,3) 以外は内部の添字で失敗)。surface_normals` が逆変換で、

`photometric_stereo` の法線をここへ渡すと形状(高さ場)が得られる。

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.

Runnable examples (verified samples that actually call this op)

photometric_stereopy -3.11 examples_3d/photometric_stereo.py

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

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

Same category (photometric)

photometric_stereo · surface_normals · render_lambertian


*Provenance: photometric.py — 3D 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.