Skip to main content
Sandbox Physics

Optics 070 · Diffraction, Fourier optics, and computational imaging

Computational Deblurring Lab

Restore the actual noisy camera record with truncated inverse, Wiener-type ridge and RL. Expose wrong-kernel ghosts and irrecoverable frequencies.

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. Its acquisition is Di=Pi+ϵiD_i=P_i+\epsilon_i. Turning noise off records expectations, not integer detections. Read noise can produce negative electronic samples without negative photons.

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
No algorithm gets an answer key. At an optical null, H(ν)=0 ⟹ lost modeH(\nu)=0\ \Longrightarrow\ \text{lost mode}. Priors may select an answer, not establish a measurement of missing detail. Try the beyond-cutoff target.

Core mathematical model

Count light, then read electronics

μ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}

Independent shot noise and electronic read noise; expectation mode records the mean instead. Negative electronic samples are retained for spectral filters and scoring, not called negative photons.

A physical intensity kernel

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}

Sampled circular pupil and scalar diffraction. Defocus or astigmatism changes phase, not aperture transmission. Motion convolves a shutter-time path; seeing convolves a Gaussian surrogate. All convolution is periodic on the declared grid.

Sensor travel matches defocus

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

First-order paraxial defocus magnitude. Positive control moves the sensor behind nominal focus; negative before it. Pure defocus intensity is invariant under sign reversal. No claim of an exact large-displacement spherical-wave calculation.

Truncated inverse

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}

Data are normalized by the known electron budget. The assumed transfer can differ from the true one. The threshold avoids division by numerical zeros but still permits severe noise gain.

Constant-ratio Wiener-type ridge

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

A user-assumed constant spectral ratio, equivalent here to identity-penalty ridge. Not a calibrated frequency-dependent optimal Wiener filter; Poisson noise is signal-dependent. Raw signed estimates are scored without display clipping.

RL updates only the acquired record

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)

A positive uniform start and the normalized-kernel adjoint. Poisson-only likelihood, maximum eighty steps; early stopping is an implicit prior. With Gaussian read noise, negative data are clipped for this approximate update and a warning is shown. No automatic truth-based tuning.

Common difficulties

Sharper means more correct?

Typical misconceptionA sharp reconstruction with a small fit residual proves fine detail has returned.

Better mental modelInverse filtering can amplify noise; regularization adds bias; RL can fit noise after too many steps. Compare the held-out synthetic truth score and the transfer band, not sharpness alone.

Run the experiment

  1. 01

    Scene 1: Defocus · a recoverable band

    Start with defocus and inspect the sensor front. Compare acquired and restored images using their common scale.

    What to observe: Defocus moves the actual camera but does not change the clear pupil. The normalized kernel conserves the declared photoelectron budget.
  2. 02

    Scene 2: Motion with read noise

    Keep one record fixed and switch restoration algorithms. Add noise, increase RL steps, or deliberately perturb the supplied PSF.

    What to observe: The same raw record is used by all algorithms. Changing the assumed kernel alters processing, not acquisition.
  3. 03

    Scene 3: Poisson stars · RL iteration

    Drag the answer-key probe for a shared cross-section. Select beyond-cutoff stripes to see information absent from the acquisition.

    What to observe: Noise gain, bias, wrong-kernel ghosts and null bands remain visible. A better fit need not 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