anscombe_inverse — PHOTON transform op

数据种类:image2dimage2d

调用: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).

详细使用指南

photon_timeresolved 族使用指南

参考(示例数据・文献)

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

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

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

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

photon_timeresolvedpy -3.11 examples/photon_timeresolved.py

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

photon_sample · photon_statistics · photon_uncertainty · anscombe_transform

同类别(transform)

anscombe_transform


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

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