The simplest approach is neighbourhood averaging, where each pixel is replaced by the average value of the pixels contained in some neighbourhood about it.
The simplest case is probably to consider the group of pixels
centred on the given pixel, and to replace the central pixel value by the unweighted
average of these nine pixels. For example, the central pixel in
Fig. 18 is replaced by the value 13 (the nearest integer to the
Fig. 18 Neighbourhood averaging
If any one of the pixels in the neighbourhood has a faulty value due to noise, this fault will now be smeared over nine pixels as the image is smoothed.
This tends to blur the image.
A better approach is to use a median filter.
A neighbourhood around the pixel under consideration is used, but this time the pixel value is replaced by the median pixel value in the neighbourhood.
Thus, if we have a neighbourhood, we write the 9 pixel values in sorted order, and replace the central pixel by the fifth highest value. For example, again taking the data shown in Fig. 18, the central pixel is replaced by the value 12.
This approach has two advantages.
When the neighbourhood covers the left hand nine pixels, the median value is 10; when it covers the right hand ones, the median value is 20, and the edge is preserved.
If there are large amounts of noise in an image, more than one pass of median filtering may be useful to further reduce the noise.
A rather different real space technique for smoothing is to average multiple copies of the image.
The idea is that over several images, the noise will tend to cancel itself out if it is independent from one image to the next.
Statistically, we expect the effects of noise to be reduced by a factor if we use n images.
One particular situation where this technique is of use is in low lighting conditions.