An Adaptive Filter for Image Noise Removal Using Chi-Square Goodness-of-Fit to Uniform Distribution

Noise is any undesired information that contaminates an image. The ideal situation (no noise) never occurs in practice, so there is a little point in ignoring it. Hence, one of the primary concerns of digital image processing is to increase image quality through the moderation of the degradations introduced by the noise which contaminate the image


INTRODUCTION
ll image-acquisition processes are subjected to noise of some type, so there is little point in ignoring it, the ideal situation -no noise-never occurs in practice.Noise cannot be predicted accurately because of its random nature, and is characterized only statistically, it cannot even be measured accurately from noisy image, since the contribution to the gray levels of the noise cannot be distinguished from the pixel data [6].
Noise occurs due to a great many factors such as light intensity, type of camera and lens, motion, temperature, atmospheric effects, dust, and others.It is very unlikely that two pixels that correspond to precisely the same gray level in the scene will have the same level in the image [6].
Digital images are corrupted by noise either during image acquisition or during image transmission.The image acquisition noise is photo electronic noise ( for photo electronic sensors ) or film-grain ( in the case of photography ) , in both cases the noise is signal dependence, in which the level of the noise value at each point in the image is a function of the gray level value.Signal-independence noise is a random set of grey levels, statistically independent of the image data, that is added to the pixels in the image to give the resulting noisy image.This kind of noise occurs when an image is transmitted electronically from one place to another [7].

RELATED WORKS
The following is a review of the works that employ Adaptive Filter for Image noise removal purposes.Jayaraj V.
[3] presented a non-linear adaptive statistics estimation filter to remove high density Salt and Pepper noise.The algorithm detects the pixels corrupted by Salt an Pepper noise and replace them with a value estimated using proposed algorithm.The algorithm detects the corrupted pixel at the initial stage itself.Kalavathy S. [4] presented a new filter called Switching Weighted Adaptive Median (SWAM) filter which used to incorporate the Recursive Weighted Median (RWM) filter and the Switching Adaptive Median (SAM) filter.The adaptive window size is selected using RWN and the output image produced by this filter with least mean square error is considered as input image to SAM filter where impulse detection mechanism is adopted.Smolka B. [8] presented a noise detection algorithm based on the concept of aggregated distance assigned to the pixels belonging to the filtering window.The value of difference between the accumulated distance assigned to the central sample and the pixel with the lowest rank, serves as an indicator of the presence of impulses injected into the image by the noise process.The output of the proposed filter is a weighted mean of the central pixel of the filtering window and the vector median of its sample.Thota S. [9] presented an effective way to remove impulsive noise from digital images in two stages.The first stage is to detect the impulse noise in the image.In this stage, based on only the intensity values, the pixels are roughly divided into two classes, which are " noise-free pixels" and " noise pixels".Then, the second stage is to eliminate the impulse noise from the image, in this stage only the "noise-A PDF created with pdfFactory Pro trial version www.pdffactory.compixels" are processed.The " noise-free pixels" are copied directly to the output image.The second stage is to remove the noise.In this stage only "noise pixels" are filtered and other pixels, which are considered as "noise-free pixels" are left untouched.
Vijay kumar V. R. [11] presented a filter which gives the smallest weight for the impulse.However, for many weight functions, including the exponential one, this weight is non-zero.Thus the impulse has an effect on the output and the magnitude of the impulse is reduced.The window size of the RWMF is adaptive based on the presence of noise density.

THE GOODNESS-OF-FIT TEST
The goodness-of-fit test is the test of the agreement (or conformity , consistency ) between a hypothetical and sample distribution , which can be stated as : where o i : is the observed frequency e i : is the expected frequency H o says that there is no fundamental difference between the observed frequency and the expected frequency .In other words :- The Goodness-of-Fit Test determines the likelihood that the frequencies observed for a categorical variable could have been drawn from a hypothesized population [5].
As is seen , this χ 2 may be considered as a measure of discrepancy between o i and e i .If there is no discrepancy , then χ 2 =0 .As the discrepancy becomes larger χ 2 becomes larger .These χ 2 values are evaluated by the χ 2 distribution after determining the level of significance α and the number of degree of freedom ; i.e. ; if the observed and expected frequencies are quite close, the resulting χ 2 will be small, and that means there is no significant difference between the two distributions .If large differences exist among the observed and expected frequencies , then the resulting χ 2 will be large and that means there is a significant difference between the two distributions .
The acceptance of the null hypothesis with level of significant α shows how much we allow the observed frequency to be far from the expected frequency [5].

TYPE OF NOISE
In typical images the noise can be modeled with either a Gaussian (Normal ), uniform, or salt-and-pepper (impulse) distribution.The shape of the distribution of these noise types as a function of grey levels can be modeled as a histogram and can be seen in With the uniform distribution, the grey level values of the noise are evenly distributed across a specific range, which may be the entire range ( 0 to 255 for 8bits ), or a smaller portion of the entire range.
In the salt-and-pepper model there are only two possible values , a and b , and the probability of each is typically less than 0.1 -with a number greater than this the noise will dominate the image.For a 8-bit image, the typical value for pepper noise is 0 and for salt-noise, 255.
The Gaussian model is most often used to model natural noise processes, such as those occurring from electronic noise in the image acquisition system.The saltand-pepper type noise is typically caused by malfunctioning pixel elements in the camera sensors, faulty memory locations, or timing errors in the digitization process.Uniform noise is useful because it can be used to generate any other type of noise distribution.Visually, the Gaussian and uniform noisy images appear similar, but the image with added salt-and-pepper is very distinctive [10].

THE PROPOSED FILTER
The typical criteria used to determine the filter behavior are the local image characteristic, usually measured by the local gray level statistics.
The proposed filter is an adaptive filter of the type decision-directed filter, ( the decision is taken depending on the edge information) , the Chi-square goodness of fit for uniform distribution test will be performed on a sliding window of size (3×3), and depending on the calculated value and the theoretical value of χ 2 three types of areas in the image under consideration can be distinguished .Finally, the suitable decision can be made depending on each area type, as shown below: 1.If the calculated χ 2 value = 0 , it means the tested area is a perfect uniform PDF created with pdfFactory Pro trial version www.pdffactory.com(Fairly constant), and thus it cannot have any edge pixels nor any noise pixels, hence the center value of the sliding window remains unchanged.
2. If the value of calculated χ 2 < theoretical χ 2 it means the tested area is uniform and it does not have any edge pixels, but it may have a noise pixel, because the value of the calculated χ 2 ≠ 0, and hence the tested area is not a perfect uniform area (not fairly constant).Thus, in such situation the center value of the sliding window must be replaced by the average of that window; that is because the average removes the noise perfectly but it also causes a blurring to the edge, and since there is no edge in this area, there is no fear from substituting the centre value by the average value.
3. If the value of χ 2 (calculated) > χ 2 (theoretical) this mean that the tested area is not uniform and it does have an edge pixel.In this case if the center value is replaced by the average of the window this causes a blurring to that edge, thus the center value must be replaced by the median of the sliding window, so the edge will be preserved because the median filter is much edge preserving than the average filter.

The Characteristics of this Filter
1.All the conventional spatial filters (e.g.mean or median …) will replace all the image pixels value by the value of the mean or median of the 3×3 window, and they are don't take into consideration if this area is a low-variation or highvariation area (does it represent an edge or an background?), while this proposed filter takes the high variation areas (edges) in consideration.
2. The adaptive filters (MMSE filter) replace the homogeneous local area with the average of that local area ( average of window ), while it leave the heterogeneous local areas ( which are expected to contains edges ) unchanged, thus the adaptive MMSE filter preserve edge , but it does not filter out noise form edge regions; while the proposed filter does, by replacing the center of the heterogeneous window with the median of that window, so that it could preserve edges, as well as removing noise from edge areas.
3. All classical Decision Directed Filters (DDF) replace the center pixel of windows that does not contain an edge pixels by the average of that window, while they replace the center value by the median of the window in those windows which contains an edge, so they could remove the noise and at the same time they could preserve the edge pixels, but, they do not take in consideration the "fairly constant areas" i.e. areas that does not contaminated by noise; while this proposed filter does.
4. It use the level of significant α to control the filter accuracy (power of the test ).
Relating to point (3) above a sample containing a number of randomly selected images is taken, and it has been discovered that more than 50 percent of the images pixels are perfectly uniform "fairly constant" with their 8 neighbors , so they will be left unchanged , this makes this filter speed about twice the speeds of other filters .
Algorithm 1:An adaptive filters using chi-square goodness of fit to uniform distribution Input : image corrupted by any type of noise.
Output : image clear from noise.
Step 1: -Create an output image g, of dimensions M× N -Determine α ( the level of significant ) by the user .
Step 2: -For all pixel coordinate i and j do -Select a 3×3 window of the current pixel and it's 8-neighbor.
-Assume that the pixels grey level in this windows represent the observed frequency o i .
Step 3: -Calculate the expected frequency e i which is equal to the average of the pixel gray of that window . -Calculate -Obtain χ 2 (theoretical) from χ 2 table with degree of freedom = n-1= 8 and with level of significant = α .The smaller the value of the error metric, the better the reconstructed image represents the original image.
2. The SNR metrics consider the reconstructed image I ˆ(r,c) to be the signal and the error to be "noise", the root_SNR is defined as: Where L is the number of gray levels.In this measure a larger number implies a better result.

RESULTS
The proposed method for noise removal has been tested over a number of images contaminated by different type of noise.The left hand side of Figure (3) shows an image corrupted by uniform, Gaussian, and impulse noise respectively, while the right hand side of the figure shows the same images after applying then proposed noise removal technique.
Tables (1) and (2) show that the time required to removing noise from the test images using the proposed method is about half than that of the traditional methods.For example , to remove the noise of type uniform from a test image of size ( 600 × 600 ) it required 32.898 second, while the required time for the mean, median, and α-Trimmed Filter are 63.343 , 58.992 , 68.342 seconds respectively.
Tables (2) , (3), and (4) show a number of fidelity criterion which are MSE, SNR, and PSNR applied on the test images in Figure (3) , and the value of those criterion clearly shows that the proposed method gives a superior results comparing to the traditional methods.

CONCLUSIONS
From the current research work, the following conclusions are derived.
1. 2. The proposed statistical filters for noise removal also leaves the non-noisy areas ( fairly constant areas) untouched and that speed up the processing times, ( i. e. make it Faster than the classical noise removal filters) 3. According to the fidelity criteria the proposed filter gives More accurate results than the classical noise removal filters).
Figure(1).Figure (1-a) presents the bell-shaped curve of the Gaussian noise distribution, it can be analytically described by [10]: PDF created with pdfFactory Pro trial version www.pdffactory.comEng.& Tech.Journal, Vol.31, No. 2, 2013 An Adaptive Filter for Image Noise Average of the pixels grey level of the current window.Else If χ 2 (calculated) > χ 2 (theoretical ) then // it represent an edge pixel Out-image [ i ][ j ] = Median of the pixels grey level of the current window.End forEVALUATION CRITERIAIn this work, three evaluation criteria are used.These criteria can be used to measure the amount of error in the reconstructed (manipulated) image.The three evaluation measures are:-1.The Root_Mean_Square_Error is computed by taking the square root of the squared error divided by the total number of pixels in the image.
r,c)=the original image I ˆ(r,c)= the reconstructed image PDF created with pdfFactory Pro trial version www.pdffactory.com to noise ratio (SNR) metrics, a larger number implies a better result.3. The peak _SNR is defined as:

Figure ( 3 )
Figure (3) Left side: Images corrupted by Uniform noise, Gaussian noise, σ = 20, implus noiseRight side : Images after performing the proposed Adaptive Filters Using Chi-square Goodness-of-Fit to Uniform Distribution.
PDF created with pdfFactory Pro trial version www.pdffactory.com

& Tech. Journal, Vol.31, No. 2, 2013 An Adaptive Filter for Image Noise Removal Usin Chi-Square Goodness-of-Fit to Uniform Distribution 246
The proposed statistical filters for noise removal have more edge preservation and less blurring effects ( this is obvious from the images of Figure (2) ), besides they removes noise from edge areas as well as non-edges areas PDF created with pdfFactory Pro trial version www.pdffactory.comEng.

& Tech. Journal, Vol.31, No. 2, 2013 An Adaptive Filter for Image Noise Removal Usin Chi-Square Goodness-of-Fit to Uniform Distribution
PDF created with pdfFactory Pro trial version www.pdffactory.comEng.