denoise {SpatialPack}R Documentation

Remove noise from an image

Description

This function removes noise from an input image.

Usage

denoise(img, type = "Lee", looks = 1, damping = 1)

Arguments

img

input grayscale image matrix.

type

character string, specifying the type of filter: "median", "Lee" and "enhanced" (enhanced Lee filter).

looks

parameter of gamma multiplicative noise. The default value is looks = 1.

damping

specifies the extent of exponential damping effect on filtering, by default damping = 1.

Details

The median filter, in which each pixel is replaced by the median of nearby values is suitable to remove additive noise from an image.

The Lee filter reduces the speckle noise by applying a spatial filter to each pixel in an image, which filters the data based on local statistics calculated within a square window. The value of the center pixel is replaced by a value calculated using the neighboring pixels. Use the Lee filter to smooth speckled data that has a multiplicative component.

The Enhanced Lee filter is a refined version of the Lee filter, reducing the speckle noise effectively by preserving image sharpness and detail. Use the Enhanced Lee filter to reduce speckle while preserving texture information.

The size of the pixel window used to each filter is 3-by-3.

Value

Filtered image, returned as a numeric matrix. It allows a better image interpretation. The denoise function clips output pixel values to the range [0,1] after removing the noise.

References

Lee, J.S. (1980). Digital image enhancement and noise filtering by use of local statistics. IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-2, 165-168.

Examples

  data(texmos2)
  x <- imnoise(texmos2, type = "saltnpepper", epsilon = 0.10)
  plot(as.raster(x))

  y <- denoise(x, type = "median")
  plot(as.raster(y))

  x <- imnoise(texmos2, type = "speckle")
  plot(as.raster(x))

  y <- denoise(x, type = "Lee")
  plot(as.raster(y))

[Package SpatialPack version 0.3-81 Index]