denoise {EBImage} | R Documentation

## Noise removal, blurring and smoothing or images

### Description

This set of functions allows for the removal of noise, blurring and smoothing of images. The functions operate of images in any image mode. The functions and the corresponding help descriptions are ported from ImageMagick, see the reference below.

### Usage

      # Noise removal:
      ## S4 method for signature 'Image':
      denoise(x, r=0, ...)
      ## S4 method for signature 'Image':
      mediansmooth(x, r=2, ...)
      ## S4 method for signature 'Image':
      despeckle(x, ...)

      # Sharpening images:
      ## S4 method for signature 'Image':
      sharpen(x, r=0, s=0.5, ...)
      ## S4 method for signature 'Image':
      umask(x, r=0, s=0.5, amount=5, t=2, ...)

      # Blurring images:
      ## S4 method for signature 'Image':
      blur(x, r=0, s=0.5, ...)
      ## S4 method for signature 'Image':
      gblur(x, r=0, s=0.5, ...)

      # Adding noise to images:
      ## S4 method for signature 'Image':
      noise(x, type="G", ...)

### Arguments

`x` | An object of `Image`.
`r` | A numeric value for the radius of the pixel neighbourhood. Passing 0 enables automatic radius selection, default.
`s` | A numeric value for the standard deviation of the Laplacian (`sharpen`) or Gaussian (`umask, blur, gblur`), in pixels. For reasonable results, in most functions `r` must be larger than `s`.
`amount` | A numeric value for the percentage difference between the original and the blurred image that is added back into the original in the un-sharp mask algorithm.
`t` | A numeric value for the threshold in pixels needed to apply the `amount` in the un-sharp mask algorithm.
`type` | The type of noise to add. Supported noise types are: `Uniform, Gaussian` (default), `Multi, Impulse, Laplace` and `Poisson`. The value can be specified by one letter. Case insensitive.
`...` | Reserved.

### Details

`despeckle` reduces the speckle-type, single-pixel, noise.

`mediansmooth` smooths the noisy image by replacing each pixel by a median of pixel values in taken over the neighbouring as defined by radius.

`blur, gblur` produce a blurred image. The `blur` method differs from the Gaussian blur, `gblur`, in that it uses a separable kernel which is faster but mathematically equivalent to the non-separable kernel.

`sharpen, umask` sharpen an image. `umask` uses the un-sharp mask algorithm, in which the image is convolved with a Gaussian operator of the given radius and standard deviation, `s`.

### Value

A transformed image in an object of `Image`.

### Author(s)

Oleg Sklyar, osklyar@ebi.ac.uk, 2005-2007

### References

ImageMagick: http://www.imagemagick.org.

### See Also

`Image, normalize`

### Examples

      w <- 120
      a <- Image((0:(w^2))/w^2, c(w,w))
      if ( interactive() ) display(a)
      b <- normalize(noise(a) * 0.1)
      if ( interactive() ) display(b)
      dn <- despeckle(b)
      if ( interactive() ) display(dn)
      bl <- blur(dn, 4, 2)
      if ( interactive() ) display(bl)

[Package EBImage version 2.4.0 Index]