ISSN ONLINE(2278-8875) PRINT (2320-3765)

All submissions of the EM system will be redirected to Online Manuscript Submission System. Authors are requested to submit articles directly to Online Manuscript Submission System of respective journal.

Hybrid Median Filter for Impulse Noise Removal of an Image in Image Restoration

Rakesh M.R1, Ajeya B2, Mohan A.R2
  1. M.Tech student, Dept of ECE, Canara Engineering College, Mangalore, Karnataka, India
  2. Assistant professor, Dept. of ECE, Canara Engineering College, Mangalore, Karnataka, India
Related article at Pubmed, Scholar Google

Visit for more related articles at International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering

Abstract

Images capture by the camera and processed and stored in memory. During this process the images are corrupted due to impulse noises. The image pixels are getting damaged due to these noises. The noise occurs due to transmission errors, malfunctioning pixel elements in the camera sensors, faulty memory locations, and timing errors in analog-to-digital conversion. Then our goal is to remove that type of noise in maximum amount by preserving the main image features. Image processing consists of many filters in order to remove the impulse noises. One of the filter is Hybrid median filter which is somewhat improved version of median filter, which removes the noise better than median filter.

Keywords

Linear Filter, Non-Linear Filter, Median Filter, Hybrid Median Filter.

INTRODUCTION

Images are often corrupted by impulse noise due to transmission errors, malfunctioning pixel elements in the camera sensors, faulty memory locations, and timing errors in analog-to-digital conversion. In most applications, denoising the image is fundamental to subsequent image processing operations. The goal of noise removal is to suppress the noise while preserving image details. A variety of techniques have been proposed to remove impulse noise. Noise is perturbations of the pixel values. Noise arises in the sensor or the imaging process. Noise may degrade the visual interpretation. Noise may be removed by filtering. Of course, noise cannot be perfectly removed. Noise removal, reconstructs the correct pixel values. Generic filters such as the mean filters, order statistics filters are used to remove the noise in an image.
Image filters produce a new image from an original by operating on the pixel values. Filters are used to suppress noise, enhance contrast, find edges, and locate features. If we want to enhance the quality of images, we can use various filtering techniques which are available in image processing. There are various filters which can remove the noise from images and preserve image details and enhance the quality of image. The common noise which contains the image is impulse noise. The impulse noise is salt and pepper noise (image having the random black and white dots). Mean filter not perfect for remove impulse noise. Impulse noise can be removed by order statistics filter. The median filter is the filter removes most of the noise in image. But there is advanced filter called hybrid median filter which preserves corner with removal of impulse noise.
There is any type of noise which is added to the input image and image gets degraded. The image degradation should not be there in image processing. For that we have to remove noise in an image as much as possible.Inorder to remove that we use various types of filters. Impulse noises are classified into two major types:
•Salt and pepper noise (equal height impulses) impulse values are represented as 0 and 255. Typical noise sources include flecks of dust inside the camera and overheated or faulty CCD elements
•Random-valued impulse noise (unequal height impulses) impulse values are between 0 and 255.
The impulse removal can be very much good in hybrid median filter. So by that hybrid median filter the almost impulse noise is removed from image.
image

LINEAR AND NON-LINEAR FILTERS

The filter which removes unwanted things. In order to that image noises we can use the filter such as
•Linear Image Smoothing Filters: - One method to remove noise is by convolving the original image with a mask that represents a low-pass filter or smoothing operation. For example, the Gaussian mask comprises elements determined by a Gaussian function. This convolution brings the value of each pixel into closer harmony with the values of its neighbours. In general, a smoothing filter sets each pixel to the average value, or a weighted average, of itself and its nearby neighbours; the Gaussian filter is just one possible set of weights.
•Nonlinear Image Filters: - A median filter is an example of a non-linear filter and, if properly designed, is very good at preserving image detail. To run a median filter: 1. consider each pixel in the image, 2. sort the neighbouring pixels into order based upon their intensities, 3. replace the original value of the pixel with the median value from the list.
A. Linear filtering
Linear filtering is filtering in which the value of an output pixel is a linear combination of the values of the pixels in the input pixel's neighbourhood.
image
However, in several cases one cannot find an acceptable linear filter, either because the noise is non-additive or non-Gaussian. For example, linear filters can remove additive high frequency noise if the signal and the noise do not overlap in the frequency domain. Still, in two-dimensional signal processing the signal may have important and structured high frequency components, like edges and small details in image processing. In this case a linear low pass filter would blur sharp edges and yield bad results. Nonlinear filters should be used instead.
B. Non linear filtering
Nonlinear filters locate and remove data that is recognised as noise. The algorithm is 'nonlinear' because it looks at each data point and decides if that data is noise or valid signal. If the point is noise, it is simply removed and replaced by an estimate based on surrounding data points, and parts of the data that are not considered noise are not modified at all. Linear filters, such as those used in band pass, high pass, and low pass, lack such a decision capability and therefore modify all data. Nonlinear filters are sometimes used also for removing very short wavelength, but high amplitude features from data. Such a filter can be thought of as a noise spike-rejection filter, but it can also be effective for removing short wavelength geological features. Image restoration is the operation of taking a corrupted/noisy image and estimating the clean original image. Corruption may come in many forms such as motion blurs noise.
C. Median filtering
Median filtering is a non-linear filtering technique that is well known for the ability to remove impulsive-type noise, while preserving sharp edges. The median filter is a order statistics filter. Also Mean filter is used to remove the impulse noise. Mean filter replaces the mean of the pixels values but it does not preserve image details. Some details are removes with the mean filter. But in the median filter, we do not replace the pixel value with the mean of neighbouring pixel values, we replaces with the median of those values. The median is calculated by first sorting all the pixel values from the surrounding neighbourhood into numerical order and then replacing the pixel being considered with the middle pixel value.
In median filter, the pixel value of a point p is replaced by the median of pixel value of 8-neighbourhood of a point ‘p’. The operation of this filter can be expressed as:
image
Fig illustrates an example calculation.
image
Neighbourhood values : 115,119,120,123,124,125,126,127,150.
Median values: 124.
The median filter gives best result when the impulse noise percentage is less than 0.1%. When the quantity of impulse noise is increased the median filter not gives best result. Since edges are minimally degraded, median filters can be applied repeatedly, if necessary. The median filter tends to preserve brightness differences across signal steps, resulting in minimal blurring of regional boundaries. The median filter also tends to preserve the positions of boundaries in an image, making this method useful for both visual examination and measurement. In addition, application of a median filter may be repeated until there are no further changes in the filtered image. Multiple applications of the median filter (with smaller neighbourhood masks) can improve noise suppression at the expense of a loss in image detail. With repeated applications of the filter, pasteurization can occur.
Normally median filters have not been used for spatial grain-suppression because grain noise is not impulsive. But have found wide application in the suppression of impulsive noise. Median filtering is also used in television applications, for example in the generation of an image sequence with progressive scanning from an interlaced original. Unlike filtering by convolution (linear filtering), non-linear filtering uses neighbouring pixels according to a non-linear law. The median filter (specific case of rank filtering), which is used in this exercise, is a classical example of these filters. Just like the linear filters, a non-linear filter is performed by using a neighbourhood.
To create a noisy image:-
Load the image BOATS.BMP. Update the path browser.
The aim is to compare the effects of a linear and a non-linear filtering used to reduce the noise in an original image. The Matlab function in noise allows you to add different classical noises to an image. Use this function for computing the noisy image of BOATS (use a “salt-and-pepper” noise).
Application of a linear filtering:-
We want to reduce the noise in the image. Let us consider a (3 * 3) averaging filter for reducing the noise. Its convolution kernel is:
image
image
The ‘salt-and-pepper’ noise consists of random pixels being set to black or white (the extremes of the gray level range). This kind of impulse noise can be generated by image digitalization or during image transmission.
II. : Here are the commands to perform the 3-by-3 averaging filter:
% Averaging filter
N = ones (3)/9; % convolution kernel
If1 = imfilter (IB, N);
figure (2)
image (If1)
title ('Noisy image filtered by a 3-by-3 averaging filter’)
v=0:1/255:1; colormap ([v' v' v']); % LUT for displaying in gray levels
Here is the image displayed:
image
The “salt-and-pepper” noise is not significantly reduced. We can still easily distinguish the noisy pixels. Each output pixel value is the mean value of all the values of its neighbouring pixels, therefore when a noisy pixel is included in the neighbourhood; its extreme value (0 and 255) is used to compute the mean value:
image
All the pixels of this image are set to the luminance value 8 except one noisy pixel which has the luminance value 255. The output value of the surrounded pixel (and of all pixels whose neighbourhood contains the value 255) is equal to: (8*8+255)/9 =35. The output value of this pixel is thus not representative of its neighbourhood, the noise is not enough reduced. This linear filtering is not appropriate for reducing the impulse noise
III. : Here are the commands to perform the median filtering:
% Median filtering
If2 = medfilt2 (IB, [3 3]); % 3-by-3 median filtering
figure (3)
image (If2)
title ('Noisy Image filtered by a 3-by-3 median filter’)
v=0:1/255:1; colormap ([v' v' v']); % LUT for displaying in gray levels
Here is the image visualized:
image
The “salt-and-pepper” noise is significantly reduced. This median filtering does a better job of removing noise, with less blurring of edges. The filter sorts the neighbouring values of a pixel; the output value is then the median value of all these sorted values (non-linear operator):
image
Let us consider the previous example: the pixel values are sorted by increasing order: 0, 8, 8, 8, 8, 8, 8, 8, and 255. The median value is 8. The extreme luminance values 0 and 255 have no effect on the output value by using this non-linear filtering. The median filtering is efficient for reducing the impulse noise.
D. Hybrid median filter
This is another type of the non filter and advanced version of the median filter. The impulse noise removing is greatly improved by hybrid median filter. Here the median value of X, + shaped neighbours can be calculated and median value of that these are added to original median value.

HYBRID MEDIAN FILTER

Hybrid median filter is windowed filter of nonlinear class that easily removes impulse noise while preserving edges. In comparison with basic version of the median filter hybrid one has better corner preserving characteristics. The basic idea behind filter is for any elements of the signal (image) apply median technique several times varying window shape and then take the median of the got median values. The hybrid median filter takes two medians: in an “X” and in a “+” centered on the pixel. The output is the median of these two medians and the original pixel value.
Motivation: preserves corners
B = hmf (A, n) performs hybrid median filtering of the matrix A using an n x n box. Hybrid median filter preserves edges better than a square kernel (neighbour pixels) median filter because it is a three-step ranking operation: data from different spatial directions are ranked separately. Three median values are calculated: MR is the median of horizontal and vertical R pixels, and MD is the median of diagonal D pixels. The filtered value is the median of the two median values and the central pixel C: median ([MR, MD, C]).
As an example, for n = 5:
image
Y = median {MR, MD, C}
Hybrid median filter algorithm:
1. Place a cross-window over element;
2. Pick up elements;
3. Order elements;
4. Take the middle element;
5. Place a +-window over element;
6. Pick up elements;
7. Order elements;
8. Take the middle element;
9. Pick up result in point 4, 8 and element itself;
10. Order elements;
11. Take the middle element.
For all window filters there is some problem. That is edge treating. If you place window over an element at the edge, some part of the window will be empty. To fill the gap, signal should be extended. For hybrid median filter there is good idea to extend image symmetrically. In other words we are adding lines at the top and at the bottom of the image and add columns to the left and to the right of it. A hybrid median filter has the advantage of preserving corners and other features that are eliminated by the 3 x 3 and 5 x 5 median filters. With repeated application, the hybrid median filter does not excessively smooth image details (as do the conventional median filters), and typically provides superior visual quality in the filtered image. One advantage of the hybrid median filter is due to its adaptive nature, which allows the filter to perform better than the standard median filter on fast-moving picture information of small spatial extent.

SIMULATION EXAMPLE

The example shows that if there is any noise is added to the original rice image. Then what happens to the image. And how that image is filtered?. The linear filter (averaging filter) filters the image but smooth’s the image. The median filter is a non linear filter gives good noise removing characteristics. The hybrid median filter gives better characteristics’ than median filter
image

CONCLUSION

In this paper the main aim is to remove the impulse noise from the image by using the hybrid median filter. The impulse noise can be removed efficiently and smooth the all noise other than impulse noise. The hybrid median filters have some of the advantages in image processing. For repeated application the hybrid median filter does not excessively smooth image details, Edge treating is possible, Hybrid median filter preserves edges better than a median filter, Preserves brightness difference., Simple to understand The HMF has some disadvantages also in IP. It is only helpful to remove only impulse noise; it is non linear filter, High computation cost. So in order to avoid that disadvantages the new filters are discovered.

References