In this experiment you learn about filtering signals from noise in 2D.
You will do so by operating on noisy images. We shall consider two types
of noise, binary noise
and Gaussian noise.
In the binary case, the user specifies a percentage value (a number between
0 and 100). This value indicates the percentage of pixels in the image
that will have their values completely lost and arbitrarily set equal to
the maximum gray level value (corresponding to a white pixel).
In the Gaussian case, the value of the pixel x(k,l) is altered
by additive white gaussian noise x(k,l)+n, with the noise n~N(0,v) being normally distributed
and with variance v specified by the user (a number between
0 and 2 in this exercise).
In the case of binary noise, the image is the same, except for a
set of positions where the pixels of the image are set to white. In the
case of Gaussian noise, the noisy image looks blurred.
Original Image
Image with binary noise
Image with Gaussian noise
Image enhancement refers to the process of noise reduction or to the sharpening of images in order to enhance the quality of the image. Although the technique of image enhancement is well developed, we limit ourselves here to two techniques that are based on the idea of filtering of the original image in order to get a restored or enhanced image. The filters we employ can perform linear or nonlinear operations.
In median filtering, a pixel is replaced by the median of the pixels contained in a window around it. That is,
where W is a suitably chosen window around the pixel. The algorithm
for median filtering requires arranging the pixel values in the window
in increasing or decreasing order and picking the middle value. Generally,
the window is chosen to be square with an odd square size.
In the case of spatial averaging, each pixel is replaced by an average of its neighboring pixels. That is,
where W is a suitably chosen window around the pixel and Nw is the number of pixels in the window. In practice, the size of the window W is limited due to the fact that spatial averaging introduces a distortion in the form of blurring.
In this experiment, you will be asked to add some noise to an image and to recover the image by using the above enhancement techniques. You will see that the ideal image enhancement technique depends on both the type of noise and on the amount or intensity of noise contained in an image.