At the forefront of Artificial Intelligence
  Home Articles Reviews Interviews JDK Glossary Features Discussion Search
Home » Articles » Machine Vision » Beginner

An Introduction to Noise Processing

This article will discuss a phenomenon found in every digital image: noise. Whether your images are taken with a mobile phone, high-end digital camera or scanned, they will contain noise. Noise in images can be the result of small discrepancies in the hardware we use to digitize our analog world, such as thermal excitation of CCD sensors during long exposures, or simply dirt and scratches on the lenses.

Test Image

Looking at the image above, it is hard to see where the noise actually is. Decent modern-day cameras and scanning equipment will minimize noise, but it is still possible to see artifacts if you zoom the image. Therefore, for the purposes of this article, we will artificially add various types of noise. The simplest type of noise is impulse noise (sometimes called salt-and-pepper noise):

Impulse Image

So how might we remove such noise from an image? An obvious method would be to average surrounding pixels.

Mean Filtering

Mean filtering simply takes an area surrounding a central pixel, calculates the average of the area and uses it as the new value for the pixel. This has the effect of spreading any noise across a neighbourhood. So, how does mean filtering work on our image? Below is an example of mean filtering, taking a small 3x3 around each pixel and averaging it:

Mean Image

The noise is less pronounced, but it is still fairly evident. Obviously, to blur the noise further, we could increase our window size. Here are the results from a 9x9 mean filter:

Mean 9x9 Image

Sure enough, the noise is much less pronounced. Unfortunately, so is the rest of the image. Evidently, we need a better way to process this noise.

Median Filtering

As the name suggests, median filtering works similarly to the mean filter, except the neighbourhood median is used as the new pixel value. For example, given this 3x3 neighbourhood of pixels:

223 210 198
210 0   188  -> 223 210 198 210 0 188 198 188 175
198 188 175

We sort the pixels:

0 175 188 188 198 198 210 210 223

And select the middle element, 198, as our median value. So what effect does this have on our noisy image?

Median Image

You can see this has excellent results at removing the impulse noise from the image. This is because impulse noise often generates localized discrepancies, which the median filter can happily ignore. For consistency, let us look at what a 9x9 median filter will do to our input image:

Median 9x9 Image

You can see that more localized data is removed, such as the wingtip, but although the body shape is deformed, the edges remain (as opposed to the blurriness equated with the mean filter).

Conclusion

This article introduced you to the basics of noise and noise removal: specifically the effects and differences between mean and median filtering. As always, all these concepts can be explored further using the Generation5 JDK Java classes.

Additionally, if you are thinking about implementing your own mean/median filter, take a look at the Convolution and Correlation article.

Submitted: 27/12/2004

Article content copyright © James Matthews, 2004.
 Article Toolbar
Print
BibTeX entry

Search

Latest News
- Generation5 10-year Anniversary (03/09/2008)
- New Generation5 Design! (09/04/2007)
- Happy New Year 2007 (02/01/2007)
- Where has Generation5 Gone?! (04/11/2005)
- NeuroEvolving Robotic Operatives (NERO) (25/06/2005)

What's New?
- Back-propagation using the Generation5 JDK (07/04/2008)
- Hough Transforms (02/01/2008)
- Kohonen-based Image Analysis using the Generation5 JDK (11/12/2007)
- Modelling Bacterium using the JDK (19/03/2007)
- Modelling Bacterium using the JDK (19/03/2007)


All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -