Wednesday, September 16, 2009

Act 18: Noise models and basic image restoration

In this activity, we make use of a grayscale image, apply noise to it, and using knowledge of the noise present in the image, try to recover its quality.

We make use of the image similar to the one provided in the Activity 18 manual and its pdf (above), as well as an image downloaded from the internet and its pdf (below):



Source: (http://www.stevennoble.com/closer_look/SLS_Corporate_Logo_th.jpg)

We apply different kinds of noise to it.
Gaussian:



Rayleigh:



Erlang or gamma:



Exponential:




Uniform:



Impulse or "salt and pepper":


Since the noises in the images were applied onto an original image, we try to reconstruct the images using four kinds of filters which are suited for additive noises. These are arithmetic mean filter, geometric mean filter, harmonic mean filter, and contraharmonic mean filter. Applying these filters for each image will yield the following (note that the images are sequenced in the with respect to the sequence of the filters mentioned above):

For the Gaussian noise:
Arithmetic

Geometric

Harmonic

Contraharmonic


(For the next sets of images, the order of the filter used follows suit.)
For the Rayleigh noise:





For the Erlang noise:





For the exponential noise:





For the uniform noise:





For the impulse noise:





It can be seen from the resulting images that the filters yielded somewhat similar reconstructions, save for the contraharmonic filter (where Q=2) which yielded images that had inverted colors. The harmonic and geometric filters had similar reconstructions. It is interesting to note that both images reconstructed using these two filters had black dots scattered at some parts of the image. Also, a subtle difference between the two is that the harmonic image is a bit darker. The arithmetic filter seems suitable for most applications in general; the images yielded by this filter looks fine in most cases.

We now investigate the effects of varying the order of the filter Q in the salt-and-pepper noise.
For Q=2 and Q=-2:

For Q=1 and Q=-1:

For Q=0.1 and Q=-0.1:

For Q=0.01 and Q=-0.01:

It can be seen that the contraharmonic filter attempts to mask the "pepper" noise by applying white patches on it when Q is positive, while the reverse happens for when Q is positive. Long blog is long. These patches become larger when the absolute value of Q is increased, but is barely noticeable when set too low. Based on my observation, it is better to eliminate "pepper" noise, since black on a grayscale image is more discernible.

I will give myself a grade of 10/10 for this activity since I have completely done all the steps. I would like to thank Earl for his help with the filters and Gilbert for providing me with the modnum toolbox necessary to generate Rayleigh noise.