Image Processing Toolbox User's Guide |
Syntax
Description
J = imnoise(I,type)
adds noise of a given type to the intensity image I
. type
is a string that can have one of these values.
Depending on which type of noise you specify, imnoise
accepts additional parameters. If you omit these arguments, imnoise
uses default values for the parameters. All numerical parameters are normalized; they correspond to operations with images with intensities ranging from 0 to 1.
adds Gaussian white noise of mean J = imnoise(I,'gaussian',m,v)
m
and variance v
to the image I
. The default is zero mean noise with 0.01 variance.
adds zero-mean, Gaussian white noise of local variance J = imnoise(I,'localvar',V)
V
to the image I
. V
is an array of the same size as I
.
adds zero-mean, Gaussian noise to an image J = imnoise(I,'localvar',image_intensity,var)
I
, where the local variance of the noise, var
, is a function of the image intensity values in I
. The image_intensity
and var
arguments are vectors of the same size, and plot(image_intensity,var)
plots the functional relationship between noise variance and image intensity. The image_intensity
vector must contain normalized intensity values ranging from 0 to 1.
generates Poisson noise from the data instead of adding artificial noise to the data. In order to respect Poisson statistics, the intensities of J = imnoise(I,'poisson')
unit8
and uint16
images must correspond to the number of photons (or any other quanta of information). Double-precision images are used when the number of photons per pixel can be much larger than 65535 (but less than 10^12); the intensity values vary between 0 and 1 and correspond to the number of photons divided by 10^12.
adds salt and pepper noise to the image I, where J = imnoise(I,'salt & pepper',d)
d
is the noise density. This affects approximately d*prod(size(I))
pixels. The default is 0.05 noise density.
adds multiplicative noise to the image J = imnoise(I,'speckle',v)
I
, using the equation J = I+n*I
, where n
is uniformly distributed random noise with mean 0 and variance v
. The default for v
is 0.04.
Class Support
I
can be of class uint8
, uint16
, int16
, single
, or double
. The output image J
is of the same class as I
. If I
has more than two dimensions it is treated as a multidimensional intensity image and not as an RGB image.
Example
See Also
rand
, randn
in the MATLAB Function Reference
immultiply | imopen |
© 1994-2005 The MathWorks, Inc.