Skip to content
AI360Xpert
Beta

Image Deblurring

Image deblurring reverses camera shake and defocus by estimating the blur kernel, then deconvolving it to restore edges the shake smeared away.

Deblurring estimates the shake kernel that smeared the image, then inverts it to restore crisp edges
Deblurring estimates the shake kernel that smeared the image, then inverts it to restore crisp edges

Why Does This Exist?

Hands shake and lenses miss focus. The resulting blur is not missing information but mixed information: each pixel holds a weighted blend of its neighbourhood along the shake path. Naive sharpening amplifies the mix into halos and ringing without unmixing anything.

Deblurring estimates the mixing kernel, then inverts the blend. Classical Wiener deconvolution does this analytically given the kernel; blind methods estimate kernel and image together; modern networks learn the inversion directly from shaken-sharp pairs. The task map is image-to-image tasks, and the noise-side sibling is image denoising.

Think of It Like This

Unmixing paint streaks by retracing the brush

A wet painting gets dragged sideways, streaking every colour into its neighbour. An observer who measures the drag direction and length can push each streak back along its path, roughly restoring the original dabs. Without the drag measurement, pushing blindly smears further.

The kernel is the drag measurement. Blind deblurring is guessing the drag from the streaks themselves, possible because sharp edges leave recognisable signatures under smearing. It fails when the drag varied across the canvas, spatially varying shake no single kernel describes.

How It Actually Works

Model blur as convolution with kernel kk plus noise: y=k∗x+ny = k * x + n. A uniform 5×55 \times 5 shake kernel spreads each pixel evenly, entries 0.040.04 summing to 1.01.0. Non-blind deconvolution inverts a known kk with regularisation against noise blowup; blind methods alternate between estimating kk from strong edges and xx given kk; end-to-end networks regress sharp images directly, often multi-scale, coarse-to-fine:

y=k∗x+n,∑k=1.0y = k * x + n, \qquad \sum k = 1.0

Kernel normalisation matters: entries must sum to one so brightness is preserved through the blur model. Multi-scale networks deblur thumbnails first where kernels look small, then refine upward.

Worked example

Uniform 5×55 \times 5 kernel: 2525 entries of 0.040.04 sum to 1.001.00, preserving brightness exactly. A headlight pixel of value 0.90.9 on black background spreads to 2525 pixels of 0.0360.036 each. Deblurring collects those 2525 contributions back: 25×0.036=0.925 \times 0.036 = 0.9 restored, minus noise the regulariser leaves behind. Misestimate the kernel size as 7×77 \times 7 and the inversion rings, collecting neighbours that belong to other sources.

Code

Uniform kernel check plus the unmixing sum, the two invariants of blur modelling.

import numpy as np

def uniform_kernel(size: int = 5) -> np.ndarray:    """Normalized box blur kernel preserving brightness."""    return np.full((size, size), 1.0 / (size * size))

k = uniform_kernel(5)print(round(float(k.sum()), 2))  # -> 1.0 brightness preservedprint(round(float(25 * 0.036), 2))  # -> 0.9 headlight gathered back

Watch Out For

Ringing from kernel size errors

Wrong kernel size turns every edge into ripples: energy collected from too wide an area oscillates around high-contrast boundaries. Ringing is the visual signature of kernel mismatch, not of weak networks.

Estimate size from calibration or edge profiles before deconvolving. When unsure, multi-scale blind methods degrade more gracefully than fixed-kernel inverses.

Spatially varying shake under one global kernel

Real handshake rotates, varying blur across the frame. A single kernel fits the centre and smears the corners, or vice versa, and no global setting fixes both.

Use patch-wise or dense kernel fields for real shake. Global kernels suit defocus and uniform motion only.

The Quick Version

  • Blur mixes neighbourhoods through a kernel; deblurring estimates and inverts the mix.
  • A uniform 5×55 \times 5 kernel holds 0.040.04 per entry, summing to 1.01.0.
  • Our headlight spreads to 2525 pixels of 0.0360.036 and gathers back to 0.90.9.
  • Blind methods alternate kernel and image estimates; networks learn the inversion directly.
  • Kernel size errors ring, and rotating shake needs spatially varying kernels.