Sunteți pe pagina 1din 4

Objective: To study and implement the filters to remove noisy images.

Theory: Histogram: Histogram of a digital image with gray levels in the range [0, L-1] is a discrete function h(rk)=nk where rk is the kth gray level & nk is the number of pixels in the image having gray levels rk. Application of Histograms: 1) Histograms are used for various techniques such as image enhancement. 2) Information from the histogram is quite useful in other image processing applications such as image compression and segmentation. Histogram is basically plotted along x, y axis. The horizontal axis of histogram has the gray levels r k. The vertical axis corresponds to values h(rk)=nk. Histograms are plots of h(rk)=nk versus rk Histograms can give important information about the image: 1) Histogram of the dark image is concentrated on the low side of the gray scale. 2) Histogram of the bright image is concentrated on the high side of the gray scale. 3) Histogram of the low contrast image is centered toward the middle of the gray scale. 4) Histogram of the high contrast image covers wide range of the gray scale. Various types of processing can be done on histograms such as Histogram equalization, Modification, Specification. Filters: Image filtering is useful for many applications, including smoothing, sharpening, removing noise, and edge detection. A filter is defined by a kernel, which is a small array applied to each pixel and its neighbors within an image. Various types of filters are high pass filter, mean filter, median filter, Gaussian filter, laplacian.

High Pass Filter: Image contains both high and low frequency components. The low frequency component is bright part of the image. The high frequency component is dark part of the image. It is used to pass the high frequency component of the image. The kernel or mask of the high pass filter is designed to increase the brightness of the center pixel relative to neighboring pixels. The kernel array usually contains a single positive value at its center, which is completely surrounded by negative values. The following array is an example of a 3 by 3 kernel for a high pass filter:

To perform high pass filtering we have to convolve the image and the mask with each other. The factor 1/9 is used to bring the output pixels within the range of input image. It is used to sharpen the blurred images. Mean Filter: The mean filter is a simple sliding-window spatial filter that replaces the center value in the window with the average (mean) of all the pixel values in the window. The window, or kernel, is usually square but can be any shape. An example of mean filtering of a single 3x3 window of values is shown below: Unfiltered values 5 2 8 3 1 4 6 9 7

The pixels are added and then the average is taken of all the pixels. The average value is placed in the center pixel. 5 + 3 + 6 + 2 + 1 + 9 + 8 + 4 + 7 = 45 45 / 9 = 5

Mean Filtered * * * * 5 * * * *

Median filter: The median filter is also a sliding-window spatial filter, but it replaces the center value in the window with the median of all the pixel values in the window. As for the mean filter, the kernel is usually square but can be any shape. An example of median filtering of a single 3x3 window of values is shown below. Unfiltered values
6 3 19 2 97 3 0 4 10

In Order: 0, 2, 3, 3, 4, 6, 10, 15, 97 Median filtered


* * * * 4 * * * *

Center value (previously 97) is replaced by the median of all nine values (4). The median filter has the ability to remove 'impulse' noise (outlying values, either high or low). The median filter is also widely used for 'edge-preserving'. In the presence of noise it can blur edges in images slightly.

Laplacian Filter: The Laplacian filter is used for detection of edges in an image. It highlights areas in which intensity changes rapidly producing a picture of all the edges in an image. The 3x3 kernel used in Laplacian filter is:

Three commonly used discrete approximations to the Laplacian filter are

Gaussian Filter: The Gaussian filter is used to smooth the image. Gaussian smoothing is commonly used with edge detection. Using a Gaussian Blur filter before edge detection aims to reduce the level of noise in the image, which improves the result of the edgedetection algorithm.

S-ar putea să vă placă și