---
title: "ImageDeconvolve"
language: "en"
type: "Symbol"
summary: "ImageDeconvolve[image, ker] gives a deconvolution of image using kernel ker."
keywords: 
- deconvolve
- Wiener
- Tikhonov
- damped LS
- Lucy
- Richardson
- deblurring
- restoration
- psf
- point spread function
- deconvblind
- TV
- total variation
- steepest descent
- TSVD
- truncated SVD
- Bregman
- deconvwnr
- deconvreg
- deconvlucy
canonical_url: "https://reference.wolfram.com/language/ref/ImageDeconvolve.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Image Filtering & Neighborhood Processing"
    link: "https://reference.wolfram.com/language/guide/ImageFilteringAndNeighborhoodProcessing.en.md"
  - 
    title: "Image Computation for Microscopy"
    link: "https://reference.wolfram.com/language/guide/ImageComputationForMicroscopy.en.md"
  - 
    title: "Image Restoration"
    link: "https://reference.wolfram.com/language/guide/ImageRestoration.en.md"
  - 
    title: "Image Processing & Analysis"
    link: "https://reference.wolfram.com/language/guide/ImageProcessing.en.md"
  - 
    title: "3D Images"
    link: "https://reference.wolfram.com/language/guide/3DImages.en.md"
  - 
    title: "Computational Photography"
    link: "https://reference.wolfram.com/language/guide/ComputationalPhotography.en.md"
related_functions: 
  - 
    title: "ImageConvolve"
    link: "https://reference.wolfram.com/language/ref/ImageConvolve.en.md"
  - 
    title: "ListConvolve"
    link: "https://reference.wolfram.com/language/ref/ListConvolve.en.md"
  - 
    title: "ListDeconvolve"
    link: "https://reference.wolfram.com/language/ref/ListDeconvolve.en.md"
  - 
    title: "ImageCorrelate"
    link: "https://reference.wolfram.com/language/ref/ImageCorrelate.en.md"
  - 
    title: "Sharpen"
    link: "https://reference.wolfram.com/language/ref/Sharpen.en.md"
---
# ImageDeconvolve

ImageDeconvolve[image, ker] gives a deconvolution of image using kernel ker.

## Details and Options

* The deconvolution kernel is given as a numerical matrix or as an image and cannot be larger than ``image`` in any dimension.

* The kernel represents the point spread function, which is assumed to model the blur present in the image.

* ``ImageDeconvolve[image, ker]`` always gives an image of a real type of the same dimensions as ``image``.

* ``ImageDeconvolve`` operates separately on each channel in image.

* The deconvolution kernel must have a single channel or the same number of color channels as the ``image``.

* The following options can be specified:

|                |            |                                      |
| -------------- | ---------- | ------------------------------------ |
| MaxIterations  | 10         | maximum number of iterations to use  |
| Method         | "DampedLS" | method to use                        |
| Padding        | "Reversed" | padding method                       |

* Possible settings specifying spectral deconvolution methods are:

|            |                                                            |
| ---------- | ---------------------------------------------------------- |
| "DampedLS" | damped least squares, generalized Tikhonov regularization  |
| "Tikhonov" | Tikhonov regularization method                             |
| "TSVD"     | truncated singular value decomposition                     |
| "Wiener"   | Wiener deconvolution                                       |

* For spectral deconvolution methods, a regularization parameter ``p`` can be given with a setting ``Method -> {"method", p}``. For non-negative deconvolution kernels in which the sum of all elements is equal to 1, the regularization parameter is typically in the range from 0 to 1.

* With a setting ``Method -> {"method", {p1, p2, …}}``, separate regularization parameters can be given for each color channel.

* The following settings for the ``Method`` option specify iterative deconvolution methods:

|                   |                                                       |
| ----------------- | ----------------------------------------------------- |
| "Hybrid"          | Tikhonov–Golub–Kahan bidiagonalization regularization |
| "RichardsonLucy"  | Richardson–Lucy iterative deconvolution               |
| "SteepestDescent" | modified residual norm steepest descent               |

* The ``"SteepestDescent"`` and ``"RichardsonLucy"`` methods always return non-negative pixel values.

* Iterative deconvolution methods typically provide better results than spectral methods but are computationally more expensive. By default, preconditioned versions of the iterative methods are used. Preconditioning can be disabled by setting ``Method -> {"method", "Preconditioned" -> False}``, resulting in slower convergence.

* The classical Richardson–Lucy deconvolution method does not use preconditioning.

* ``ImageDeconvolve`` also supports an iterative ``"TotalVariation"`` method that effectively implements an iterative total variation regularization algorithm.

* The following suboptions can be specified with a setting ``Method -> {"TotalVariation", subopt}`` :

|                  |            |                          |
| ---------------- | ---------- | ------------------------ |
| "NoiseModel"     | "Gaussian" | noise model              |
| "Regularization" | Automatic  | regularization parameter |

* Possible settings for ``"NoiseModel"`` are ``"Gaussian"``, ``"Laplacian"``, or ``"Poisson"``.

* Note that ``ImageDeconvolve`` and ``ImageConvolve`` use different default settings for ``Padding``.

* ``ImageDeconvolve`` works with ``Image3D`` objects.

## Background & Context

``ImageDeconvolve`` performs deconvolution, which is typically used to enhance local details and edges in an image. Deconvolution is the converse operation to convolution, but unlike convolution, it is nonlinear, ill-posed, and non-unique.

Images may be blurred due to camera motion, object motion, lens defects, or—in the case of astronomical images—atmospheric turbulence. Deconvolution can sometimes be used to partially reverse the effects of these and other undesirable convolution-type processes in an image.

A kernel used for deconvolution is often referred to as a "point spread function" (commonly abbreviated "psf") and is assumed to model the blur whose removal from an image is being attempted. If the point spread function does not match the blur actually present in an image, deconvolution will fail to recover details and may even add spurious artifacts. Furthermore, even if a representative point spread function is chosen, deconvolution may still not recover all details in the original image.

The converse operation to ``ImageDeconvolve`` is performed by ``ImageConvolve``. Sharpen is another simple way of enhancing edges.

---

## Examples (24)

### Basic Examples (1)

Restore a blurred image:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[10]]

Out[1]= [image]
```

### Scope (5)

#### Data (3)

Remove blur from a grayscale image:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[4]]

Out[1]= [image]
```

---

Remove Gaussian blur:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[4]]

Out[1]= [image]
```

---

Deconvolve a 3D image:

```wl
In[1]:= ImageDeconvolve[[image], DiskMatrix[2, {4, 4, 4}] / 56, Method -> "TotalVariation"]

Out[1]= [image]
```

#### Parameters (2)

The point spread function can be given as an image:

```wl
In[1]:= ImageDeconvolve[[image], [image]]

Out[1]= [image]
```

---

### Options (7)

#### Method (6)

Deblur a Snellen chart:

```wl
In[1]:= ImageDeconvolve[[image], BoxMatrix[3] / 49, Method -> "TotalVariation"]

Out[1]= [image]
```

---

Comparison of spectral deconvolution methods:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[5], Method -> #]& /@ {"DampedLS", "Tikhonov", "TSVD", "Wiener"}

Out[1]= [image]
```

---

Comparison of iterative deconvolution methods:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[5], Method -> {#, "Preconditioned" -> False}, MaxIterations -> 100]& /@ {"Hybrid", "SteepestDescent", "RichardsonLucy"}

Out[1]= [image]
```

---

Iterative methods with preconditioning:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[5], Method -> {#, "Preconditioned" -> True}]& /@ {"Hybrid", "SteepestDescent", "RichardsonLucy"}

Out[1]= [image]
```

---

Total variation method with explicit regularization parameter:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[4], Method -> {"TotalVariation", "Regularization" -> 10 ^ -5}, Padding -> "Fixed"]

Out[1]= [image]
```

---

Total variation method with a specified noise model:

```wl
In[1]:= ImageDeconvolve[[image], [image], Method -> {"TotalVariation", "NoiseModel" -> "Poisson"}]

Out[1]= [image]
```

#### MaxIterations (1)

By default iterative methods run 10 iterations:

```wl
In[1]:= img = [image];ker = GaussianMatrix[5];

In[2]:= ImageDeconvolve[img, ker, Method -> {"SteepestDescent", "Preconditioned" -> False}, MaxIterations -> 10]

Out[2]= [image]
```

Specify maximum number of iterations:

```wl
In[3]:= ImageDeconvolve[img, ker, Method -> {"SteepestDescent", "Preconditioned" -> False}, MaxIterations -> 50]

Out[3]= [image]
```

### Applications (3)

Remove out-of-focus blur:

```wl
In[1]:= ImageDeconvolve[[image], DiskMatrix[7] / 177, Method -> "SteepestDescent"]

Out[1]= [image]
```

---

Recover license plate numbers from blurred images:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[20], Method -> {"DampedLS", 0.02}]

Out[1]= [image]
```

---

Guess an appropriate PSF for removing motion blur:

```wl
In[1]:=
psfMotion[dim_ ? NumberQ, theta_ ? NumberQ] := 
	Module[{PSF}, 
		PSF = ConstantArray[0.0, {dim, dim}];
		PSF[[Ceiling[dim / 2.0], All]] = 1.0 / dim;
		Return[ImageRotate[Image[PSF], theta  Degree]];
	];
psf = psfMotion[14, 0];
ImageDeconvolve[[image], psf, Method -> "RichardsonLucy", MaxIterations -> 15]

Out[1]= [image]
```

### Properties & Relations (3)

``ListDeconvolve`` can be used to perform deconvolution on the result of ``ImageData`` :

```wl
In[1]:= Image[ListDeconvolve[GaussianMatrix[4], ImageData[[image]]]]

Out[1]= [image]
```

---

``Sharpen`` does not require a PSF, but it can only restore a small Gaussian blur:

```wl
In[1]:= Sharpen[[image], 5]

Out[1]= [image]
```

---

``ImageDeconvolve`` is an approximate inverse of ``ImageConvolve`` :

```wl
In[1]:= blur = ImageConvolve[[image], GaussianMatrix[10], Padding -> "Reversed"]

Out[1]= [image]

In[2]:= ImageDeconvolve[blur, GaussianMatrix[10]]

Out[2]= [image]
```

### Possible Issues (5)

The PSF should always be normalized so that the total of the weights is 1:

```wl
In[1]:= i = [image];shape = [image];

In[2]:= ImageDeconvolve[i, shape]

Out[2]= [image]
```

Use a normalized PSF:

```wl
In[3]:= ImageDeconvolve[i, ImageMultiply[shape, 1 / ImageMeasurements[shape, "Total"]]]

Out[3]= [image]
```

---

If the PSF does not match the blur, deconvolution fails to enhance details and it may add artifacts:

```wl
In[1]:= ImageDeconvolve[[image], GaussianMatrix[3], Method -> "TotalVariation"]

Out[1]= [image]
```

---

Preconditioned methods may introduce more artifacts than non-preconditioned:

```wl
In[1]:= ImageDeconvolve[[image], ConstantArray[1 / 20, {1, 20}], Method -> {"Hybrid", "Preconditioned" -> #}]& /@ {True, False}

Out[1]= [image]
```

---

Preconditioned methods are sensitive to boundary conditions:

```wl
In[1]:= ImageDeconvolve[[image], [image], Method -> {"SteepestDescent", "Preconditioned" -> True}, Padding -> #]& /@ {"Reflected", "Periodic", 0}

Out[1]= [image]
```

---

Even a small amount of noise in a blurred image can reduce the quality of reconstruction:

```wl
In[1]:= ImageDeconvolve[ImageEffect[[image], {"GaussianNoise", 0.01}], GaussianMatrix[4]]

Out[1]= [image]
```

## See Also

* [`ImageConvolve`](https://reference.wolfram.com/language/ref/ImageConvolve.en.md)
* [`ListConvolve`](https://reference.wolfram.com/language/ref/ListConvolve.en.md)
* [`ListDeconvolve`](https://reference.wolfram.com/language/ref/ListDeconvolve.en.md)
* [`ImageCorrelate`](https://reference.wolfram.com/language/ref/ImageCorrelate.en.md)
* [`Sharpen`](https://reference.wolfram.com/language/ref/Sharpen.en.md)

## Related Guides

* [Image Filtering & Neighborhood Processing](https://reference.wolfram.com/language/guide/ImageFilteringAndNeighborhoodProcessing.en.md)
* [Image Computation for Microscopy](https://reference.wolfram.com/language/guide/ImageComputationForMicroscopy.en.md)
* [Image Restoration](https://reference.wolfram.com/language/guide/ImageRestoration.en.md)
* [Image Processing & Analysis](https://reference.wolfram.com/language/guide/ImageProcessing.en.md)
* [3D Images](https://reference.wolfram.com/language/guide/3DImages.en.md)
* [Computational Photography](https://reference.wolfram.com/language/guide/ComputationalPhotography.en.md)

## History

* [Introduced in 2010 (8.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn80.en.md) \| [Updated in 2012 (9.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn90.en.md)