Skip to main content
Sandbox Physics

Optics 070 · Diffraction, Fourier optics, and computational imaging

Computational Deblurring Lab

When does deconvolution recover detail, and when does it only amplify noise or model error? It recovers detail at frequencies the blur weakened but still let through. Where the optical transfer function is zero, that detail never reached the sensor. Dividing by a near-zero response there only blows up the noise and any error in the assumed blur. A prior can pick a plausible answer for those frequencies, but it does not measure them.

Restore the same noisy camera record with a truncated inverse filter, a Wiener-type ridge filter and Richardson–Lucy (RL) deconvolution. See the ghosts a wrong blur kernel creates and the frequencies no method can recover.

Interactive modelComputational Deblurring Lab
Simulation-only blur / restoration error εblur,εrestore\varepsilon_{\rm blur},\varepsilon_{\rm restore}0.500.50
Data fit / small-transfer area εD,m\varepsilon_D,m50%50\%
Image-side NA / actual sensor distance NA,dsensor{\rm NA},d_{\rm sensor}0.00π0.00\pi
Model regimevalid model regime\text{valid model regime}

Physics tutorial

Audit the physics of Computational Deblurring Lab

BackgroundThe camera first blurs an incoherent intensity target, then counts photoelectrons. The recorded value is Di=Pi+ϵiD_i=P_i+\epsilon_i. With noise off, the camera records expected values, which need not be whole numbers. Read noise can make an electronic sample negative, even though a photon count never is.

Why it mattersWhen does deconvolution recover detail, and when does it only amplify noise or model error?

Start with the essentials

Focus question
When does deconvolution recover detail, and when does it only amplify noise or model error?
One-sentence intuition
None of the algorithms can see the true image. Where the optics transmit nothing, H(ν)=0 ⟹ lost modeH(\nu)=0\ \Longrightarrow\ \text{lost mode}. A prior can pick one answer, but it cannot turn missing detail into a measurement. Try the beyond-cutoff target.

Core mathematical model

Photon counting, then electronic readout

μi=E(h∗f)iPi∼Poisson⁡(μi)Di=Pi+ϵiϵi∼N(0,σr2)\begin{aligned}\mu_i&=E(h*f)_i\\P_i&\sim\operatorname{Poisson}(\mu_i)\\D_i&=P_i+\epsilon_i\\\epsilon_i&\sim\mathcal N(0,\sigma_r^2)\end{aligned}

Shot noise and electronic read noise are independent. In expectation mode the record holds the mean instead. Negative electronic samples are kept for the spectral filters and the scoring; they are not negative photons.

The blur kernel from pupil diffraction

P=1ρ≤1eiϕ,ρ2=u2+v2ϕ2π=−wdρ2+wa(u2−v2)h=∣F−1P∣2∑∣F−1P∣2\begin{aligned}P&=\mathbf1_{\rho\le1}e^{i\phi},\quad \rho^2=u^2+v^2\\\frac{\phi}{2\pi}&=-w_d\rho^2+w_a(u^2-v^2)\\h&=\frac{|\mathcal F^{-1}P|^2}{\sum|\mathcal F^{-1}P|^2}\end{aligned}

The kernel comes from a sampled circular pupil with scalar diffraction. Defocus and astigmatism change the phase, not the transmission of the aperture. Motion adds a convolution with the path traced during the shutter time; seeing adds a convolution with a Gaussian stand-in. Every convolution is periodic on the stated grid.

Sensor position for a given defocus

Δz=2λwdNA2,dsensor=f+Δz\Delta z=\frac{2\lambda w_d}{{\rm NA}^2},\quad d_{\rm sensor}=f+\Delta z

This is the first-order paraxial size of the defocus. A positive setting moves the sensor behind the nominal focus, a negative one in front of it. With pure defocus, flipping the sign leaves the intensity unchanged. This is not an exact spherical-wave calculation for large displacements.

Truncated inverse filter

F^inv(ν)={G(ν)/H~(ν),∣H~∣≥10−30,otherwise\widehat F_{\rm inv}(\nu)=\begin{cases}G(\nu)/\widetilde H(\nu),&|\widetilde H|\ge10^{-3}\\0,&\text{otherwise}\end{cases}

The data are divided by the known total electron count. The assumed transfer function can differ from the true one. The threshold avoids dividing by numerical zeros, but noise can still be amplified severely.

Wiener-type filter with a constant ratio

F^K=H~∗∣H~∣2+K G\widehat F_K=\frac{\widetilde H^*}{|\widetilde H|^2+K}\,G

The user sets a constant spectral ratio, which here is the same as ridge regression with an identity penalty. It is not a calibrated optimal Wiener filter that varies with frequency, and Poisson noise depends on the signal. The raw estimates, negative values included, are scored without display clipping.

RL iteration uses only the recorded data

f(k+1)=f(k)⊙H~T ⁣(D/EH~f(k))f^{(k+1)}=f^{(k)}\odot\widetilde H^T\!\left(\frac{D/E}{\widetilde H f^{(k)}}\right)

The iteration starts from a positive uniform image and uses the adjoint of the normalized kernel. Its likelihood assumes Poisson noise only, and it runs at most eighty steps; stopping early acts as an implicit prior. When Gaussian read noise is present, negative data are clipped for this approximate update and a warning appears. Nothing is tuned automatically from the true image.

Common difficulties

Is sharper always more correct?

Typical misconceptionA sharp reconstruction with a small fit residual proves the fine detail has come back.

Better mental modelInverse filtering can amplify noise, regularization adds bias, and too many RL steps start fitting the noise. Check the score against the held-out simulated truth and the band the optics transmit, not the sharpness alone.

Run the experiment

  1. 01

    Scene 1: Defocus · a recoverable band

    Start with defocus and look at the front of the sensor. Compare the acquired and restored images on their shared scale.

    What to observe: Defocus moves the camera itself but leaves the clear pupil unchanged. The kernel is normalized, so the stated total number of photoelectrons is conserved.
  2. 02

    Scene 2: Motion with read noise

    Keep one record and switch between restoration algorithms. Add noise, increase the RL steps or deliberately perturb the PSF given to the algorithm.

    What to observe: All algorithms use the same raw record. Changing the assumed kernel changes the processing, not the recording.
  3. 03

    Scene 3: Poisson stars · RL iteration

    Drag the answer-key probe to set a cross-section that all images share. Select the beyond-cutoff stripes to see information that is missing from the recording.

    What to observe: Amplified noise, bias, ghosts from a wrong kernel and bands with zero transfer all stay visible. A better fit does not necessarily mean a more faithful reconstruction.
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy