Next: Median Filter
Up: Smoothing
Previous: Smoothing
The isolated pixels with gray values much different from its neighbors
can be considered as impulses corresponding to high spatial frequencies.
One way to get rid of this kind of noise is to use the average of a small
local region in the image so that the out-of-range gray levels can be
suppressed. Equivalently, this averaging operation in spatial domain
corresponds to low-pass filtering in the spatial frequency domain.
The averaging operation is a weighted sum of the pixels in a small
neighborhood and can be implemented by a common convolution with a kernel
of certain shapes and values:
where
is a symmetric kernel of a limited size (typically
3x3, 5x5, 7x7, etc.). Some common kernels:
These convolution kernels can be considered as the approximations of some
continuous 2D functions such as a rectangular function
and a Gaussian function
Convolution with such functions in spatial domain
is equivalent
to the filtering in spatial frequency domain
with the Fourier
transforms of the kernel functions:
and
In general the Gaussian function is a preferred method for the following
reasons:
- Rotational symmetric with no bias on any particular direction;
- Closer neighbors contribute more (larger weights) than those farther
away;
- The width of the function can be easily controlled;
- Fourier transform of Gaussian is also Gaussian so that the filtering
in frequency domain is smooth.
Weymouth-Overton's algorithm
- Define weights for each pixel
in the neighborhood W of the pixel
under consideration. The distance weight is defined as:
and the value weight is defined as:
where
is a user specified parameter. The overall weight for pixel
is defined as
Pixels close to
in both distance and value will have larger weights.
- Replace
by
Next: Median Filter
Up: Smoothing
Previous: Smoothing
Ruye Wang
2013-09-10