Issuu on Google+

International Journal of Computer Science Engineering and Information Technology Research (IJCSEITR) ISSN 2249-6831 Vol. 3, Issue 3, Aug 2013, 141-150 © TJPRC Pvt. Ltd.


Research Scholar, Department of Computer Science, Avinashilingam Institute for Women, Coimbatore, Tamil Nadu, India 2

Professor, Department of Computer Science, Avinashilingam Institute for Women, Coimbatore, Tamil Nadu, India

ABSTRACT The food-borne Mycotoxins which are primarily known for affecting the human health are Aflatoxin and Fumonisins. The chili pepper is affected by Aflatoxin during harvest, production and storage periods. X-ray is a very popular non-destructive testing method. In this proposed work, X-ray images of chili pepper samples were processed using image processing methods. This research analysis is carried out with the technique of weighted 4-connected median filter. Weighted 4-connected median filter is being selected as a main tool for noise removal, based on the comparisons of performance measures of various preprocessing techniques. This weighted 4-connected median filter is an advance of the 4-Connected Median Filter. Noise level in the chili pepper X-ray images is reduced while using the Weighted 4-Connected Median Filter. The obtained MAE value is 0.18 and RMSE error value is 5.35.

KEYWORDS: Aflatoxin, Chili Pepper, X-Ray Imaging, Weights, Median Filter INTRODUCTION The objective of noise removal is to improve the quality of the image and make it ready for further processing by removing the irrelevant noise and unwanted parts in the background of the image. Digital images often contain individual pixels which vary abruptly in intensity from their neighboring pixels, which do not reflect the scene they represent. These pixels are referred to as random noise [18]. Chili pepper x-ray images usually contain high random noise. To remove this noise, various filters are applied to the image. The following literature reviews various preprocessing methods used for xray images. Catalin (2001) proposed a work to detect bones from chicken meat using competitive Hopfield neural network and fuzzy filtering. In their approach, they used the histogram information of the chicken meat images, to be processed in the next level [4]. S. Kim (2001) developed a system to detect pinholes in almonds using x–ray imaging. In that the image of a single raw almond was filtered using a 3x3 mask to remove spot noise. This spot noise is formed due to dust or artifacts during scanning which appeared as a bright spot in the image. Since the insect–damaged region appeared darker than normal, the center pixel was replaced with a median value of nine pixels within a 3x3 window, this is done only if the value of the center pixel was greater than the median value plus a preset value. Spot noise can also be removed using mathematical and morphological processing called opening. The filtered image was then brought to an average again using a 3x3 mask containing nine elements of equal amplitudes (1/9) to remove small noise associated images through the x–ray imaging system [21]. Fernando Mendoza (2010) developed a system to find Multi fractal properties of pore-size distribution in an apple tissue. He used an image pre-processing to render stacks of 2-D square images of apple tissue and multi fractal analysis were performed using the Image Processing Toolbox of MATLAB v7. 0 in this experiment [10]. Domingo Mery (2011) proposed an automated fish bone detection using X-ray imaging. The original X-ray image is linearly enhanced


M. Rajalakshmi & P. Subashini

by modifying the original histogram in order to increase contrast [9]. S. A. Patil (2012) proposed a system to extract the features of TB x-ray images. In this system, Median filter is used to remove the noise or irrelevant information from the images [19]. It is found that Median filter is chosen as the best method for deducting the noise in the grayscale images because it preserves the edge details of the image so that the output images can be visualized with high originality. One of the disadvantages of other filters, such as the Average filter, when used to denoise the data, is that they not only smooth the noise, but also smooth the sudden and sharp transitions that were present in the original data, such as edges in images. Moreover, they are not as efficient as the median filters in removing certain types of noise, such as impulsive noise . Although median filters do not blur the edges as much as the other filters do, because they still possess smoothing characteristics, as the size of the filter increases, there may be a significant image blurring [17] . The rest of the paper is organized as follows: In section 2, all the noise removal methods are explained in detail. In Section 3, the results obtained in several noise removal methods on chili x-ray images are shown. Finally, in Section 4 some concluding remarks are given. Data Set For the proposed research work, 25 chilies were collected from the village near Salem district, Tamilnadu state, India. The collected chilies were kept in a plastic container to maintain the humidity level up to 60 days. After 40 days, some fungus was formed on the surface of most of the chilies. The surface, color and thickness of these chilies were also affected while the remaining chilies are not affected by the fungus. Fungus formation indicates that most of the chilies inherently contain toxin. So it is noted that the maximum period of formation of fungus in the chili pepper is from 40 to 60 days and it is formed only in the chilies that contain toxin within it. In addition we note that the fungus does not affect the chilies that crossed the 40-60 days, which is the maximum period limit for the fungus formation in a chili since they do not contain toxin within them. In the proposed research work the Vidisco digital X-ray system was used to take the x-ray images of chili pepper. By using this system, 25 images of chili pepper were taken for noise removal purpose. The X-ray images of the fungus formed chilies were very noisy, while, other chili images were good and less noisy [14].

METHODOLOGY Filters can be applied in the spatial or the frequency domain. In the spatial domain, the value lies in the pixels of the resulting image that depend directly upon their original values and the values of their original neighboring pixels. In the frequency domain, the resulting pixel values depend on the horizontal and vertical frequency components in the original image and not directly on the individual pixel values. In the proposed research, spatial domain processing was adopted to depend upon the original pixel values [19]. Median filter is found to be the best method for deducting the noise in x-ray images. After performing median filtering, the result of the chili image was analyzed. The analysis shows that it still contained noise. To improve the quality of chili pepper X-ray images more better another new method called 4-connected median filter is being adopted. In that work, the background of the image is removed by the application of thresholding methods. In that several pre-processing methods such as Average filter, Median filter, Adaptive filter, Gamma intensity correction, Contrast-limited adaptive histogram equalization (CLAHE) along with the new method i.e., 4-connected median filter were applied [14]. It is noted that the quality of the chili X-ray image was not up to the expected level.

Removal of Noise in the Chili Pepper Images Using Weighted 4-Connected Median Filter


For this reason, in this work the 4-connected median filter is added with weights to yield a better result when compared to the other preprocess methods that were used earlier. After introducing the weights in the 4-connected median filter the error value was deduced to the expected level. Performance measures of the images were evaluated at the end. Average Filtering Average filtering is the default filter type, used to remove the noise in an image. The output pixel value is calculated by simply taking the average of the cells in the filter window. The average filter allows few of the higher frequency features with changes, and allows low frequency features to be unchanged [14]. The averages of the cells are calculated by using the following formula. (1) where M is the total number of pixels in the neighborhood N and i,j are the pixel position of the filtered image and k,l are the pixel position of the original image. Median Filtering Some images contain brighter or darker cell values, which is represented as noise and they are removed from further processing. Noise reduction processing introduces several approaches in removing the noise displayed in an image. The median filter orders input pixel values from the current filter window and assigns the middle value to the output pixel value [22]. The median value is not affected by the original value of the noise cells, an the Median filter is especially good at removing both the isolated and random noise found in the images.Median filtering can be calculated by using the following equation [11]. f(x,y)=


where (x,y) is the total number of pixels in the neighborhood (s,t). Median filtering produces better results than the average filter by preserving the edges and other features [14]. Adaptive Filtering The adaptive filter is more selective than the other linear filters by preserving edges and other high frequency parts of an image. In addition, there are no design tasks for filtering, the wiener filter performs all preliminary calculations, and implements the filter to an input thresholding image [5] . Wiener filter works best when the noise is Gaussian noise. The goal of the Wiener filter is to filter out noise that has corrupted the original image. Where the variance is large, Wiener performs little smoothing. Where the variance is small, Wiener performs more smoothing [14] . The local mean and variance in the neighborhood around each pixel can be calculated by using the following equations.

Wiener filters formulation, without blur is as follows: (3) Where M is the total number of pixels in the neighborhood N , nv is the standard deviation of noise, Ďƒ2 is the variance of noisy image and Îź is the mean value of the noisy image .


M. Rajalakshmi & P. Subashini

Gamma Intensity Correction Gamma intensity correction produces an accurate image display on a computer screen. Gamma correction method corrects the overall brightness of a given noisy image. Noisy images which are not properly corrected by gamma intensity correction can look like an image that is bleached out, or too dark. To reproduce colors accurately, it requires knowledge of gamma correction. Gamma values lesser than 1, improves light areas and values greater than 1, improves dark areas of the original image after the conversion is performed. Gamma intensity correction procedure modifies the pixel value based on the following equation [14] : I= c IÎł


Where I and IÎł are the original and enhanced images and c is a scaling factor [1]. Contrast-limited Adaptive Histogram Equalization (CLAHE) CLAHE was originally developed for medical imaging and has proven to be successful for enhancement of lowcontrast images such as x-ray images and portal films. The CLAHE algorithm partitions the images into contextual regions and applies the histogram equalization to each one. This will evenly spread out the distribution of used gray values and thus make hidden features of the image more visible. Contrast Limited Adaptive Histogram Equalization, CLAHE, is an improved version of Adaptive Histogram Equalization (AHE). Both overcome the limitations of standard histogram equalization. CLAHE pixel values are calculated by using the following equation [14] . -


where gmin is the minimum pixel value, P (f) is the Cumulative probability Distribution Function (CDF) [25]. 4-Connected Median Filter In this 4-connected median filter the basic approach is taken from the Median filter. In a set of values, the class has been taken from the set of values less than m, half (m) and greater than m. Here the m is referred as mid pixel. Median filter for the whole image taken by calculating the mid value of the square windows like 3x3, 5x5, and 7x7 were taken for preprocessing. In this proposed research four connected values are taken in the square windows instead of the full set of values. In the four connected median filter mid pixel value found by horizontal, vertical neighbors of pixel p i.e., N4 (p), Diagonal neighbors of a pixel of p i.e., ND (p) and the original value of that pixel. N4P has four horizontal and vertical neighbors, whose coordinates are given by (x-1, y), (x, y-1), (x, y+1), (x+1, y). N4P is illustrated in figure 1.


1 1 1


Figure 1: 4-Neighbors of Pixel p i.e., N4 (p) The four diagonal neighbors of p i.e. ND (p) have coordinates (x-1, y-1), (x-1, y+1), (x+1, y-1), (x+1, y+1). ND (p) is illustrated in figure 2.

Removal of Noise in the Chili Pepper Images Using Weighted 4-Connected Median Filter



1 1



Figure 2: 4-Diagonal Neighbors of Pixel p i.e., ND (p) The greater value of three numbers viz. The median of N4 (p), ND (p), and the original value of that pixel p has taken to replace the pixel value of that point p.

Pixel p =


By using the equation (6), the 4-connected median filter was carried over. By calculating new pixel value for each pixel, the process was repeated in the entire chili x-ray image [17]. Weighted 4-Connected Median Filter In Weighted 4-connected median filter mid pixel value is calculated by taking horizontal, vertical neighbors of pixel p i.e., N4P and Diagonal neighbors of a pixel of p i.e., NDP added to pre-established weights. This is used for the purpose of reducing the error rate. For the set of input values X = [X1, X2, . . . , XN], with the integrated weights such as W = [W1, W2, . . . , WN] will produce the output Y as Y = MED [W1◊X1, W2◊X2, . . . , WN◊XN] where MED denotes the median operation and ◊ denotes duplication, i.e. k times. For example, K ◊ X = X, . . . , X for k times The Filtering Procedure is Stated as Follows 

Duplicate each pixel input X to the number of times of corresponding weight W

Sort the pixel values in the filter window,

Choose the median value from the new set of pixel values. For filtering the filter window is selected from the 4-connected median filter. The possible window length is 5. In

the standard weighted median filters the standard weights for the filter window length 5 are [1,1,1,1,1], [3,2,2,1,1], [2,2,1,1,1], and [3,1,1,1,1]. Among the four weights this research is carried over in the last set [3, 1, 1, 1, 1] as a weighted median filter. Remaining three sets were producing more error rate than the last set [3, 1, 1, 1, 1]. The greater value of two numbers viz. The weighted median of N4 (p) and weighted median of ND (p), has been taken to replace the pixel value of that point p. Pixel P = max


By using the equation (7), the new pixel value for each pixel is calculated in weighted 4-connected median filter. This process was repeated for each and every pixel in the chili x-ray image. Finally the resultant image is evaluated under the performance measure [13].


M. Rajalakshmi & P. Subashini

EXPERIMENTAL RESULTS AND DISCUSSIONS Some of the sample images, which are processed using noise removal methods, are shown in the below table 1. After preprocessing, the processed images were less noisy when compared with the quality of the original image. Some of the chili‟s images still have a noisy background. So to select the best noise removal method, performance evaluation was carried as follows. Table 1: Results of Noise Removal Methods on Chili Images

Peak-Signal-to-Noise-Ratio (PSNR) Peak Signal-to-Noise Ratio is the ratio between the image in threshold image and the filtered image, given in decibels. The higher the PSNR, the closer the filtered image is to the thresholding image [14]. It is found that the rate of the PSNR defines the quality of the image i.e., if higher the PSNR it indicates that it is a higher quality image, but tests have shown that this is not true for all images. However, PSNR is a popular quality metric because it is easy and fast to calculate while still giving better results [25]. -


where r(x, y) represents the original (reference) image and t(x,y) represents the distorted (modified) image and x and y are the pixel position of the nx×ny image. The PSNR of the image lies between 20 dB and 40 dB which indicates that the images are of „good‟ acceptable quality [22]. Signal-to-Noise-Ratio (SNR) The SNR measures the roughness or the granularity of an image, and this is independent of the relation between the original signal and the background [14] . (9)


Removal of Noise in the Chili Pepper Images Using Weighted 4-Connected Median Filter

where r(x, y) represent the original (reference) image and t(x, y) represent the distorted (modified) image and x and y are the pixel position of the nx×ny image. Root Mean Squared Error (RMSE) Mean Squared Error is the average squared difference between the thresholding image and the filtered image. It is calculated pixel-by-pixel by adding up the squared differences of all the pixels and dividing by the total pixel count [25]. The mean-squared-error (MSE) is the simplest, and the most widely used, full-reference image quality measurement. This metric is frequently used in signal processing and is defined as follows [14] . (10) where r(x, y) represents the original (reference) image and t(x, y) represents the distorted modified) image and x and y are the pixel position of the nx×ny image. MSE is zero when r (x, y) =t (x, y) [7]. Mean Absolute Error (MAE) Mean Absolute Error between two nx x ny digital images „r‟ and „t‟ measures the absolute closeness of these images to each other [29]. It is a linear score which means that all the individual differences are weighted equally in the average and it is calculated by using the following formula as: (11) Where r(x, y) represent the original (reference) image and t(x, y) represent the distorted modified) image and x and y are the pixel position of the nx×ny image [14]. The performance measures taken for 25 chili images were tabulated in the following table 2. Table 2: Comparison of Quality Assessment Parameters Method/Measure Average Filter Median filter Adaptive filter Gamma intensity correction CLAHE 4-connected Median Filter Weighted 4-connected Median Filter [1,1,1,1,1] Weighted 4-connected Median Filter [3,2,2,1,1] Weighted 4-connected Median Filter [2,2,1,1,1] Weighted 4-connected Median Filter [3,1,1,1,1]

PSNR (dB) 34.84 43.97 29.21 Inf 34.00 22.49

SNR 13.98 13.97 15.66 25.42 14.66 22.30

RMSE 32.99 36.23 19.10 0.92 21.25 22.95

MAE 12.80 8.37 13.28 0.27 21.25 3.67

















DISCUSSIONS In this proposed work, different X-ray images of chili pepper were taken for reducing noises. In this research work various preprocess techniques were compared such as Median filtering, Adaptive filtering, Average filtering, Gamma Intensity Correction, Contrast Limited Adaptive Histogram Equalization (CLAHE), 4-connected median filter along with the proposed weighted 4-connected Median filter. To evaluate the result, performance measures such as Peak signal to noise ratio (PSNR), Signal to noise ratio (SNR), Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE) were


M. Rajalakshmi & P. Subashini

calculated between the original image and the result of the filtered image. From the above table it is inferred that Weighted 4-connected median filter with weight set [3,1,1,1,1] is found producing better results than the other methods. In weighted 4-connected median filter the MAE error value is comparatively lower than the other techniques used i.e., value is 0.18 and the SNR value is greater than all the other methods i.e., value is 34.35. The previous researches have proved that when the SNR and PSNR value is greater than 25, then the output image is good and suitable. Accordingly the output of the chili image is also considered as suitable. It is noted that the RMSE error also have been considerably lower in this proposed work. So, it is concluded that the Weighted 4- connected median filter is suitable for removing noise in chili pepper images with set [3, 1,1,1,1].

CONCLUSIONS Earlier in Four connected median filter the PSNR and SNR values have been considerably increased and the RMSE and MAE values have been decreased to a minimum level while comparing to another method of preprocess. The RMSE value in 4-connected median filter is considerably lower than the Average filter and the Median filter. The same RMSE value is variably higher than the other methods. Further Weighted 4-connected median Filter is used to perform noise removal to obtain the best result. The weighted 4-connected median filter yield PSNR and SNR values as increased and RMSE and MAE values as decreased while comparing to the 4-connected median filter and all the other preprocessing methods. Thus Weighted 4-connected median Filter technique is used for the noise removal purpose in chili X-ray images.


Alexey Guilarte Noa and Edel B. García Reyes, “Image Processing Methods for X-Ray Luggage Images: A Survey”, October 2011, CENATAV.


A. Sim, B. Parvin and P. Keagy, “Invariant representation and hierarchical network for inspection of

nuts from

x-ray images” , 1998. 3.

Catalin G. Amza, Mark Graves, Jeffrey Knight, Peter R. Innocent, “Flexible Neural Network Classifier for the Automated Detection of Bones in Chicken Breast Meat”, 2001.


Catalin G. Amza, and Peter R. Innocent, “Bones detection from chicken breast meat using a competitive Hopfield neural network and fuzzy filtering”, 2001.


Bhausaheb Shinde, Dnyandeo Mhaske, Machindra Patare, A.R. Dani,” Apply Different Filtering Techniques To Remove

The Speckle Noise Using Medical Images”, International Journal of Engineering Research and

Applications (IJERA), Vol. 2, Issue 1, Jan-Feb 2012, pp. 1071-1079. 6.

Bogdan Smolka, “Modified central weighted vector median filter”, Journal of Medical

Informatics and

Technologies, Vol 3, 2002, ISSN 1642-6037, pp. 40 - 50. 7.

C.Sasivarnan, A.Jagan, Jaspreet Kaur, Divya Jyoti, Dr.D.S.Rao,” Image Quality Assessment Techniques on Spatial Domain”, International journal of Computer science and technology(IJCST),Vol.2,Issue 3, Sep 2011, pp.177-184.


Chun-Te Chen and Liang-Gee Chen, “A Self-Adjusting Weighted Median Filter for removing Impulse Noise in Images”, IEEE Transactions, 1996, pp.419-422.


Domingo Mery, Ivan Lillo, Hans Loebel, Vladimir Riffo, Alvaro Soto, Aldo Cipriano, Jose Miguel Aguilera, “Automated fish bone detection using X-ray imaging”, Journal of Food Engineering, Mar 2011.

Removal of Noise in the Chili Pepper Images Using Weighted 4-Connected Median Filter


10. Fernando Mendoza, Pieter Verboven, Quang TriHo, Greet Kerckhofs, Martin Wevers and Bart Nicolai, “Multifractal properties of pore-size distribution in apple tissue using X-ray imaging”, Journal of Food Engineering, Feb 2010, pp. 206–215. 11. Gajanand Gupta,” Algorithm For Image Processing Using Improved Median Filter And Comparison Of Mean, Median And Improved Median Filter”, International Journal of Soft Computing and Engineering (IJSCE), ISSN: 2231-2307, Volume-1, Issue-5, November 2011, pp. 304-311. 12. Kai Oistiimo, Qin Liu, Mika Grundstrom, and Yrjo Neuvo, “Weighted Vector Median Operation For Filtering Multispectral Data”, IEEE Transactions, 1992, pp. 16-19. 13. Lin Yin, Ruikang Yang, Moncef Gabbouj and Yrjo Neuvo, “Weighted Median Filters: A Tutorial”, IEEE Transactions On Circuits And Systems-11: Analog And Digital Signal Processing, Vol. 43, No. 3, March 1996, Pp. 157-192. 14. M. Rajalakshmi, Dr. P. Subashini ,” Noise Removal Methods of Chili Pepper Images for Detecting Toxin Using Neural Networks”, International Journal of Emerging Technologies in Computational and Applied Sciences, 3 (2), Dec.12-Feb.13, pp. 155-162. 15. Mark Willcox and George Downes, “A Brief Description of NDT Techniques”, pp. 1-22 16. Madhuri Gundam,” Implementation of Directional Median Filtering using Field Programmable Gate Arrays”, Ph.D thesis, 2010. 17. Rafael C. Gonzalez, Richard E. Woods, “Digital Image Processing”, Pearson Education, 2001. 18. Ranjeet Kaur, P.S.Maan, “Non-linear Filter for Digital Image De-noising”, International Journal of Computer Technology and Applications (IJCTA), Volume 2 (6), Nov-Dec 2011, pp. 1761-1767. 19. Richards, John A. Remote Sensing and Digital Image Analysis: an introduction. New York: Springer-Verlag, 1986. 20. S. A. Patil, “Texture analysis of TB X-Ray Images using Image Processing Techniques”, Journal of Biomedical and Bioengineering, Volume 3, Issue 1, 2012, pp. 53-56. 21. S. Kim, T. Schatzki, “Detection of Pinholes in Almonds through X–Ray Imaging”, American Society of Agricultural Engineers, Vol. 44 (4), 2001. 22. Sarah B. Aziz and Maytham A. Shahed,” Impulsive and Poisson Noises Removal Using Takagi Neuro-Fuzzy Network”, Scientific Journal of King Faisal University (Basic and Applied Sciences), Vol.11

No.1, 2010, pp.

117-141. 23. Sumathi Poobal, G. Ravindran,” The Performance of Fractal Image Compression on Different Imaging Modalities Using Objective Quality Measures”, International journal of Engineering science and technology (IJEST), Vol3. No.1 Jan 2011, pp. 525-530. 24. Suresh Kumar, Papendra Kumar, Manoj Gupta, Ashok Kumar Nagawat,” Performance Comparison of Median and Wiener Filter in Image De-noising”, International Journal of Computer Applications (0975 – 8887) Volume 12– No.4, November 2010, pp. 27-31.

18 removal of noise full