fullseye

sfp_height — OPTICS shape_from_polarization op

使い方

Integrate a normal map to a height map with Frankot-Chellappa on a mirror-extended domain, so the periodic boundary of the FFT does not bend the result.

Gradients p = -nx/nz, q = -ny/nz are formed inside mask (zero outside — the object stands on a flat background); slopes steeper than max_zenith_deg (the occluding rim, where nz -> 0 and the gradient diverges) are clamped to that zenith with the azimuth kept. The field is then reflected into a 2H x 2W even-symmetric domain (p changes sign under the mirror in x, q under the mirror in y) and handed to :func:photometric.integrate_gradients — the same Frankot-Chellappa solver, without its wrap-around. Measured on a 64 x 80 tilted plane (slopes 0.3 and -0.2): largest height error 0.06 px here against 18 px with the periodic solver, which cannot represent a ramp at all (the residual 0.06 px is the kink of the half-sample mirror at the seam).

Returns (H, W) float64 heights in pixel units (multiply by the pixel pitch), with the background (outside mask) at mean 0, or the whole image at mean 0 when there is no mask.

Compared with :func:photometric.integrate_normals (registered in ops3d): that operator integrates as is (periodic, no validation, no rim clamp); this one validates the field (unit, finite, facing the camera) and fixes the boundary.

Raises ValueError: normals not a finite (H, W, 3) field of unit normals with nz >= 0; mask not boolean of shape (H, W) or empty; max_zenith_deg outside (0, 90).

ファミリ共通の入力契約(fail-closed)

optics の全 op は入力を検証してから計算する(黙って通さない):

詳しい使い方ガイド

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(image2d を入力に取れる)

fraunhofer_pattern · pupil_psf · pupil_blur · psf_to_mtf · edge_spread · veiling_glare_index · emva_pair_statistics · emva_defect_pixels

同カテゴリ(shape_from_polarization)

sfp_dolp_model · dolp_to_zenith · aolp_to_azimuth · sfp_render · sfp_normals · sfp_disambiguate · sfp_estimate_index


Provenance: sfpolar.py — OPTICS operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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