---
title: "Computational Deblurring Lab Interactive Lab | Sandbox Physics"
description: "When does deconvolution recover detail, and when does it only amplify noise or model error?"
canonical_url: "https://sandboxphysics.com/labs/computational-deblurring-lab/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/computational-deblurring-lab/"
last_modified: "2026-10-27"
---

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 simulation: open this page in a web browser to change the parameters and run the model.

The test scene is synthetic, incoherent and periodic, and the PSF is either known or deliberately perturbed. No real camera data are used, and the restoration is not blind. Gaussian seeing is an approximation. With read noise present, RL does not use the exact Poisson–Gaussian likelihood.

Physics tutorial

## Audit the physics of Computational Deblurring Lab

**Background** The camera first blurs an incoherent intensity target, then counts photoelectrons. The recorded value is $D_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 matters** When 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(\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

$$
\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

$$
\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

$$
\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

$$
\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

$$
\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)}\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 misconception** A sharp reconstruction with a small fit residual proves the fine detail has come back.

**Better mental model** Inverse 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.

Physical conclusion

You restore a recording, not an illustration. Keep missing bands, noise, calibration error and priors in view.

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
