image = | despeckleFilter2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY,inFactor) |
Smoothes the input image replacing aberrant values by the neighbourhood's mean intensity.
This algorithm is inspired from the sigma filter proposed by Lee in 1983 [1]. The sigma filter is based on the idea that impulse noise intensity differs from the local intensity according to a given standard deviation. Hence, it smooths the image impulse noise by averaging only the pixels in the current neighbourhood having their intensities within a fixed range.
The DespeckleFilter2dImg algorithm uses the same hypothesis that a noisy pixel will differ from the neighbourhood mean intensity, according to a range given by the local standard deviation. It suppresses the impulse noise in the input image replacing aberrant values by the mean intensity of the neighourhood defined by and
(the central pixel is not taken into account).
For each pixel , the local mean
and the local standard deviation
are calculated. The filtered resulting image is then given by:
Where is a weight factor on the distance between the current pixel and the local mean. A high value of
yields to a strong blur whereas a too low value of
will not suppress all noisy pixels. Moreover, calculating the local mean on a too large neighbourhood will take into account more noisy pixels, degrading the quality of the smoothed image.
Here is an example of an image with salt and pepper noise and the result of the despeckle filter algorithm. In this example, ,
and
were set to 1:
[1] "Digital image smoothing and the sigma filter", J.-S. Lee, Computer Vision, Graphics, and Image Processing, Vol. 24, pp. 255 - 269, 1983.