photometric_residual — SPECULAR photometric op

• 数据种类:images → image2d

• 调用: import fullseye as fs; fs.ledger.photometric_residual(images, lights, normals=None, albedo=None, normalize=True)(要直接调用实现,import specularity; specularity.photometric_residual(images, lights, normals=None, albedo=None, normalize=True);从台账取用则 opsspecular.get("photometric_residual"))

用法

Lambert 模型逐像素的失配程度。→ (H, W) 的 RMS 残差。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

sqrt(mean_n (albedo * (n.L_n) - I_n)^2) — the root-mean-square disagreement between the linear model and the measurements, in the units of the input radiance. On a synthetic Lambertian surface with the true float64 normals and albedo supplied it measures 1.4e-16 at worst; with them omitted the floor rises to 4.5e-08, because photometric.photometric_stereo returns float32 and that is its precision, not a modelling error (supplying the *same* truth cast to float32 reproduces 4.5e-08 exactly). It is large where the assumption actually broke: 0.50 at worst on the same scene with 3 of 8 lights blocked by a cast shadow — fifteen orders of magnitude above the clean floor. All four numbers measured in tests/test_specularity.py.

This is the diagnostic that tells you *whether* you need photometric_stereo_robust before you reach for it, and it is the map an inspection routine thresholds to find glossy defects.

With *normals* and *albedo* omitted it solves them first with photometric.photometric_stereo and reports the residual of that fit — the honest self-assessment of the plain estimator. Pass them to score an estimate that came from somewhere else (a robust fit, a CAD model, a previous frame).

Note the residual uses n.L without the max(., 0) clamp, because that is the linear system the solver actually inverted; a pixel in attached shadow therefore shows a residual, which is the intended signal rather than an artefact.

Raises ValueError: *images* / *lights* problems as in photometric_stereo_robust; *normals* is not (H, W, 3) matching the images; *albedo* is not (H, W); exactly one of *normals* / *albedo* is given (the pair is meaningless apart — the model is albedo * n).

详细使用指南

• specular_photometric 族使用指南

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• specular_photometric — py -3.11 examples/specular_photometric.py

类型可衔接的下一个算子(可接受 image2d 作为输入)

polarization_render

同类别(photometric)

photometric_stereo_robust


*Provenance: specularity.py — SPECULAR 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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