hdr op• Data kinds: images → image2d
• Call: import fullseye as fs; fs.ledger.hdr_merge(images, exposures, response=None, weight='hat', saturation_margin=1, dark_level=None) (to call the implementation directly, import hdrfusion; hdrfusion.hdr_merge(images, exposures, response=None, weight='hat', saturation_margin=1, dark_level=None); from the registry, opsoptics.get("hdr_merge"))
• GPU: none (CPU reference implementation only)
Merge an exposure series into a relative radiance map (image2d).
> The detailed description below is the original text — the summary and the headings are translated.
各露出の段 Z を逆応答 X(Z) で露光量に戻し、X / t を重みつきで合成する:
• weight="hat" / "gaussian": Debevec の対数の重み平均 ln E = Σ w(Z)(ln X(Z) − ln t) / Σ w(Z)(X ≤ 0 の段は重み 0)。
• weight="hat_time": 三角の重みに露出時間 t を掛ける。散弾雑音が支配するとき Var(ln X_j) ≈ 1/(η L t_j) なので、t に比例する重みが対数の推定の逆分散の重み(短い露出の暗い段の雑音を持ち込まない。暗部の傷の CNR が 4 倍、PoC で実測)。
• weight="linear": 光子数の和 E = Σ X / Σ t(飽和と Z ≥ L−1−margin を除く全露出、暗部の負の値も含む)。線形のセンサでは散弾雑音の最尤で、暗部も偏らない。
どの露出でも有効でない画素(全部で飽和 / 全部で真っ暗)は、最短(飽和)/ 最長(真っ暗)の露出 1 枚の値で埋める(下限 / 上限の推定 —— NaN を返さない約束。hdr_dynamic_range はここで測れる上限を数える)。response=None は「段 = 露光量」の線形(オフセット 0)。そのときの段数 L は float と uint8 で 256、それ以外の整数 dtype(uint16 に入った 12 bit のセンサ値など、満の値が dtype から決まらないもの)は系列の最大値 + 1 ―― つまり系列で最も明るい段を飽和とみなす。満の値が分かっているなら camera_response_* の応答表(levels)を渡すこと。三角の重みは [dark_level, L−1] に張る(既定 = 逆応答が初めて正になる段。暗いときのオフセットを持つセンサで、オフセットのすぐ上の雑音だらけの段に重みを与えないため)。
Returns radiance in inverse-units per exposure-time unit (relative: Debevec/Robertson fix only the scale g(mid) = 0). ★Assumes a static scene and registered frames.
Every optics op validates its input before computing (nothing slips through silently):
• Units are baked into the argument name — _mm / _um / _deg / _mrad. Confusing mm with µm does not crash; it yields a plausible-looking wrong answer, so the name prevents it. Nothing here guesses the unit from the magnitude.
• Strings raise ValueError — float('50') succeeds, so an unparsed configuration value would slip through as a length (measured: thin_lens('50', '200') returned a plausible 66.667 mm). bool is refused too, as the implicit promotion True == 1.
• complex / masked arrays raise ValueError (real-valued slots only; silently dropping the imaginary part or peeling off the mask is refused). NaN/Inf raises ValueError on every input.
• Division by zero and its relatives are refused by name: focal length 0, radius of curvature 0, refractive index <= 0, a fully opaque aperture (all zeros, so the normalisation is 0/0), a PSF whose sum is <= 0, a Stokes vector with S0 = 0, and an object sitting at the front focal point (the image is at infinity).
• Only two ops return a non-finite value, and both state it as a contract: depth_of_field returns far_mm = inf beyond the hyperfocal distance (that is what the hyperfocal distance means), and gaussian_beam returns wavefront_radius_mm = inf at the waist (the radius of curvature of a plane wavefront). Both also return a finite companion (far_is_infinite / curvature_per_mm). Any other silent NaN/Inf is detected internally and raises ValueError — "float64 overflowed" and "the answer is infinite" are different claims, so the first is never returned wearing the face of the second.
• Size caps: generated grids are capped by optics.MAX_GRID (4096); supplied fields/PSFs/apertures by optics.MAX_FIELD_ELEMENTS (2^24); ABCD element chains by optics.MAX_SYSTEM_ELEMENTS (1024); Zernike by MAX_ZERNIKE_TERMS (512) / MAX_ZERNIKE_ORDER (40) / MAX_ZERNIKE_BASIS (2^25). This closes, fail-closed, the paths where a small argument triggers a huge internal allocation (measured: n_max=40 × 4096² needs 108 GB).
• Physically impossible states are refused too: a Stokes vector with degree of polarisation > 1, negative transmittance, negative intensity, and invalid Zernike indices such as n-|m| odd.
• 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.
• poc_hdr_glossy_metal_inspection — py -3.11 examples/poc_hdr_glossy_metal_inspection.py
image2d as input)fraunhofer_pattern · pupil_psf · pupil_blur · psf_to_mtf · encircled_energy · ensquared_energy · energy_radii · mtf_tangential_sagittal
hdr)camera_response_debevec · camera_response_robertson · camera_response_linear · exposure_fusion_mertens · hdr_exposure_series_simulate · hdr_radiance_error · hdr_dynamic_range
*Provenance: hdrfusion.py — OPTICS 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.