transform op• 데이터 종류: image2d → image2d
• 호출: import photoncount; photoncount.anscombe_inverse(values, gain=1.0, read_sigma=0.0, offset=0.0, mode='algebraic')(또는 opsphoton.get("anscombe_inverse"))
:func:anscombe_transform 을 역변환 —— 대수적으로, 또는 편향 없이.
> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.
`mode="algebraic"` is the exact algebraic inverse of
:func:anscombe_transform::
x = ((g*A/2)^2 - (3/8)*g^2 - sigma_r^2)/g + offset
so `anscombe_inverse(anscombe_transform(x)) == x` to machine precision
(measured over 100001 values of `x spanning [0, 1e4]`: max absolute
error 2.7e-12, max relative error 3.7e-16 for `x > 1`). It is, however,
biased: `E[A(X)] != A(E[X])`, so applying it to a *denoised* (i.e.
averaged) Anscombe image underestimates the intensity.
`mode="unbiased"` is the closed-form exact unbiased inverse of Makitalo &
Foi (IEEE TIP 2011)::
x = D^2/4 + (1/4)*sqrt(3/2)/D - (11/8)/D^2 + (5/8)*sqrt(3/2)/D^3 - 1/8
which is defined for the classical transform only (`gain=1`,
`read_sigma=0, offset=0`) — passing generalised parameters with this
mode raises rather than returning a formula that does not apply.
Measured bias — apply the inverse to the *ideal denoised* value
`D = E[A(X)], X ~ Poisson(lambda), and compare with lambda`. Both
computed exactly from the Poisson pmf (no sampling):
======== ================== ==================
lambda algebraic bias unbiased bias
======== ================== ==================
1 -0.179361 -0.003668
2 -0.231074 -0.006374
4 -0.249688 +0.003779
10 -0.250227 +0.016904
30 -0.250019 +0.017041
100 -0.250002 +0.011960
======== ================== ==================
The algebraic inverse converges to a constant -1/4 photon offset, which
at 1 photon/pixel is a 18% error; the closed form keeps the worst case to
0.017 photons (a 49x reduction at `lambda = 1`, 15x at its own worst point
near `lambda = 10-30`). It is a closed-form *approximation* of the exact
unbiased inverse, so it is not bias-free — those +0.017 are the honest
residual, not round-off.
The result is clipped at 0 — stated here rather than done quietly — but the
clip essentially never fires: the closed form's positive root is
exactly `A(0) = 2*sqrt(3/8) = 1.2247448714` (measured: the root and
`A(0)` agree to 0.0), which is also the smallest value
:func:anscombe_transform can produce, so over the whole valid domain the
formula is non-negative to round-off (measured minimum -1.11e-16 over
`D in [A(0), 6] on 500001 samples). Below A(0)` it does go
genuinely negative (-0.0217 at `D = 1.20`), which is why values there are
refused outright rather than clipped.
Returns a float64 array of the same shape as *values*.
Raises `ValueError`: non-finite *values*, an unknown *mode*, a
non-positive *gain*, a negative *read_sigma*, `mode="unbiased"` combined
with any non-default generalised parameter, and — instead of dividing by
zero — `mode="unbiased" with any value <= 0 (the 1/D^3` term).
• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.
• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.
• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.
• photon_timeresolved — py -3.11 examples/photon_timeresolved.py
image2d 를 입력으로 받는 것)photon_sample · photon_statistics · photon_uncertainty · anscombe_transform
transform)*Provenance: photoncount.py — PHOTON 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.