[ieee 8th international multitopic conference, 2004. proceedings of inmic 2004. - lahore, pakistan...

5
Empowering Spatial Domain Filters of Digital Image Processing with IFE Tool Fahim Arif' and Muhammad Akbar2 'Conipzifer Sciei?ce Departnrent,2Chicj Instrt~ctar (Eizginsering Divison) Milircuy CO llege oj'Signa is, Nut io nu 1 University of Scien ce and Tech of ogy, Rnwa fpindi {U h iiizcrr-if@ ho mail. coni, mirliDui~-n?c.r~nl~st. eh .pk Abstract 1. 111 trod u c ti on History of digital image processing and analysis can not be older than the inveiition of first electronic computer way back in 1946. However, the concept of digital iinage could be found in literature as early as in 1920 with transmission of images through the Bartlane cable pictcx transmission system. Potentials oi' image processing techniques came into focus with the advanceinent of iarge-scale digital computer and with thc journey to the moon. Images captured with photoelectric or pliotoclicunical methods have noise duc to cainera inisfocus or distortiori during photography. The process of image acquisition frequently leads to image degradation. Quality of the digitized image is inferior to the original Goal of enhancement is to produce the visually most pleasing image and the goal of restoration is to producc the best possible estimate of th? original image [I ,2]. The measure of success in restoration is usually an error measure between the original and the estimate. No mathematical error function is known that corresponds to human perceptual assessment of error. An infinite number of filters, both linear and non-linear, are possible for image processing [3,4j. Most of the classical linear digital iinage filters defined in spatial domain, such as averaging, ininiinuin and maximuin filters have IOW pass characteristics and they tend to blur edges and to destroy lines, edges and other fine details [5,6]. Oiic solution to this problem is the use of the non-linear filters such as median filter, which is the most popular order statistics filter [7] in the nonlinear filter class. The filter has been recogiiized as a useful filter due to its edge preserving characteristics and its simplicity in implementation 1x1. However, median filter with 3 larger window size removes tine image details due to its ordering process. Applicalion of median filter with a larger window rcquires caution because bigger mask tends to remove image details such as thin lines and corners while reducing noise [9]. A' variety of softwares are available to implement linear and nonlinear spatial domain filters. Some of the coinmercialized products, such as matlab and paint shop pro are very popular. However most of the spatial domain filters are not available in these. A iiccd was tlierefore felt to deveIop a software which can easily and readily process digital images with different kinds of noises utilizing a large variety of' filters. because of mechanical problems, out-of-focus blur, motion and inappropriate illuminatioii etc. 2. Types of image noises 0-7803-8680-9/04/$20.00 02004 TEEE. INMlC 2004

Upload: muhammad-akbar

Post on 25-Mar-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [IEEE 8th International Multitopic Conference, 2004. Proceedings of INMIC 2004. - Lahore, Pakistan (Dec. 24-26, 2004)] 8th International Multitopic Conference, 2004. Proceedings of

Empowering Spatial Domain Filters of Digital Image Processing with IFE Tool

Fahim Arif' and Muhammad Akbar2 'Conipzi fer Sciei?ce Departnrent,2Chicj Instrt~ctar (Eizginsering Divison)

Milircuy CO llege oj'Signa is, Nut io nu 1 University of Scien ce and T e c h of ogy, Rnwa fpindi {U h iiizcrr-if@ ho mail. coni, mirliDui~-n?c.r~nl~st. e h .pk

Abstract

1 . 111 trod u c ti on

History of digital image processing and analysis can not be older than the inveiition of first electronic computer way back in 1946. However, the concept of digital iinage could be found in literature as early as in 1920 with transmission of images through the Bartlane cable pictcx transmission system. Potentials oi' image processing techniques came into focus with the advanceinent of iarge-scale digital computer and with thc journey to the moon. Images captured with photoelectric or pliotoclicunical methods have noise duc to cainera inisfocus or distortiori during photography. The process o f image acquisition frequently leads to image degradation. Quality of the digitized image is inferior to the original

Goal of enhancement is to produce the visually most pleasing image and the goal of restoration is to producc the best possible estimate of th? original image [ I ,2]. The measure of success in restoration is usually an error measure between the original and the estimate. No mathematical error function is known that corresponds to human perceptual assessment of error. An infinite number of filters, both linear and non-linear, are possible for image processing [3,4j.

Most of the classical linear digital iinage filters defined in spatial domain, such as averaging, ininiinuin and maximuin filters have IOW pass characteristics and they tend to blur edges and to destroy lines, edges and other fine details [5,6]. Oiic solution to this problem is the use of the non-linear filters such as median filter, which is the most popular order statistics filter [7] in the nonlinear filter class. The filter has been recogiiized as a useful filter due to its edge preserving characteristics and its simplicity in implementation 1x1. However, median filter with 3

larger window size removes tine image details due to its ordering process. Applicalion of median filter with a larger window rcquires caution because bigger mask tends to remove image details such as thin lines and corners while reducing noise [9 ] .

A' variety of softwares are available to implement linear and nonlinear spatial domain filters. Some of the coinmercialized products, such as matlab and paint shop pro are very popular. However most of the spatial domain filters are not available i n these. A iiccd was tlierefore felt to deveIop a software which can easily and readily process digital images with different kinds of noises utilizing a large variety of' filters.

because of mechanical problems, out-of-focus blur, motion and inappropriate illuminatioii etc. 2. Types of image noises

0-7803-8680-9/04/$20.00 02004 TEEE. INMlC 2004

Page 2: [IEEE 8th International Multitopic Conference, 2004. Proceedings of INMIC 2004. - Lahore, Pakistan (Dec. 24-26, 2004)] 8th International Multitopic Conference, 2004. Proceedings of

The mean and variance of the density are given by [!I]

/ I =; t'l i JXb 1 it Cominon types of noises found in images

2 b ( 4 - x ) r-

( 7 =

during forindon and rccording are:

2.1. Uniform (white) noise > 4

Whitc noise i s uiiiforinly distributcd in thc finite interval of pixel values, PDF of uniform noise is given by:

2.2. Impulse noise

It is also known as shot and spike noise or salt and pepper noise. I t appears as black and wliitr spots in the gray Ievel. Its PDF is given as:

2.3. Gaussian or normal noise

Gaussian noise models are frequently used because of their matliematical tractability in both spatial and fi-equeiicy damailis, The PDF of a Gaussian random . . variable, z, is given by:

where z represents gray level, p is the ineati and 2 is the variance of z.

2.4. Rayleigh noise

3. IFE tool

linage Filtering and Enhanccinent (TFE) Tool is a software designed for the restoration and enhancement of digital images. The software was developed using Visual C++ MDI approach. A large variety of spatial domain filters are designed in this software for restoration of noisy digital images like ordered filters i.e, maxiinum, minimum and mid-point filters and mean filters like mean, median and alpha trimmed filters. The eiihanceinent of dark and light recorded images is achieved with the help of histogram equalization technique designed in the software using VC++. Some extra features of image processing like flip, rotatc, clear and negative are plugged to provide flexibility to the user. The tool can upload a wide range of standard image f i les including BMP, P E G , GIF, TIF, TGA, PNG etc. The enhanced images cart also be saved in a variety of image formats. The refined image is displayed in a separate window, can again be used as input for another filter operation.

4. Spatial domain filters available in IFE tool

Spatial domain filters opcrate oil pixel values of the image. They can remove noise from the image in an effective way. The filters can be categorized into order and mean filters. Order filters arrange the pixel values within the mask and perform the desired action like maxiinuin, ininiiiium or mid-point filters. Mean filters' are essentially averaging filters. They operate on a local group of pixels called neighborhoods and replace the centcr pixel with an average of the pixels in the neighborhood. Various spatial filters are briefly describcd in this section.

The density of this noise fiinction is 4.1. Maximum filter skewed to the right. Its PDF is given as follows: I " 1 - Maximum filter is an Order filter which

I S used for elrmination o f Pepper noise. It selects the largest value within an ordered window of pixel values. The filter works best for pepper type (low valued) noise. Pepper noise IS basically black

I ^ R dots that appear on an image

37

Page 3: [IEEE 8th International Multitopic Conference, 2004. Proceedings of INMIC 2004. - Lahore, Pakistan (Dec. 24-26, 2004)] 8th International Multitopic Conference, 2004. Proceedings of

4.2. Minimum filter

Minimum filter is also an Order filter which is used for elimination of salt noise. It selects the smallcst value within an ordered window ofpixcl values. This filter works best for salt (high valued) noise. Salt noise is basically white dots that appear on an image.

4.3. Mid-point filter

Mid-point filter is the average of the inaxiinuin and ininirnu~n values within a window. The inid-point filter is most useful for Gaussian and uniform noise.

4,4. Median filter

Median filter is very useful for removing salt and pepper noises from images. The filter, firs! arranges pixel values in the mask window in an increasing or decreasing order and then picks up thc middte value. Generally, the window size is chosen in such a way that middle value is odd. IC window size is even, then the median is taken as the average of the two values in the middle.

4.5, Alpha filter

Alpha-trimmed mean filter takes the average o f pixel values within the window, but with some of the endpoint-ranked values are excluded. This fitter is useful for images containing multiple types of noises, such as Gaussian and salt-and-pepper noise.

5. Results of IPE tool

Spatial filters operate on small neighborhoods, 3 x 3 to 11 x 11 mask, (some can be implemented as convolution masks). A user friendly GUI is part of the software. The user loads a noisy image and applies the desired filtcr. The processed image i s displayed in a separate window which can be used as an input image for another filter. Results of applying various IFE tool filters to noisy'images are shown in this section.

Maximum filter selects the largest value within an ordered window of pixcl values, whereas the minimum filter selects the smallest value. Minimum filter works better for salt type (high valued) noise, and maximum filter works best for pepper type (low valued) noise. Figure 1

and 2 show the results of reduction of these noises with the hetp of TFE Tool.

.I

Figure 1: linage with salt noise (probability of salt 5.04) and result of min filter mask si7e =

3x3

Figure 2: Image with pepper noise (probability of pepper = .04) and result of max fiItering

mask size +r 3x3

Mid-point filter is both order and a meail filter because it orders the pixel values, and then calculates the average of minimum and maximum values. The mid-point filter is most useful for Gaussian and uniform noise. Figure 3 shows the image filtered with mid-point filter.

Figure 3: Image with gaussian noise; (Variance = 300; Mean = 0) and result of mid-point filter;

mask size = 3

Mean filters are essentially averaging filters. They operate on local groups of pixels called neighborhoods and replace the center pixcl with an average of the pixels in this neighborhood. Figure 4 shows the application ofmean filter,

38

Page 4: [IEEE 8th International Multitopic Conference, 2004. Proceedings of INMIC 2004. - Lahore, Pakistan (Dec. 24-26, 2004)] 8th International Multitopic Conference, 2004. Proceedings of

Figure 4: Original image and mean filtered image, 3 x 3 kernel

Median filter i s a nonlinear filter. In this case resuli cannot be found by a weighted sum of the neighborhood pixels, as is done for a convolution mask. However, median tilter operatcs on a local neighborhood. Central pixel of the neighborhood is rcplaccd with the median or ccnter valuc present ainong its neighbors, rather than by tlicir average. Figure 5 shows the result of applying median filter to an image containing salt and pepper noise.

Figure 5: Original image with added impulse noise and Median-filtered image using a 3 x 3

kernel

Alpha-trimmed filter is both an order and ii mean filter. It first orders rhe pixel values, and then calculates the average of pixel values within the window, but dropping sonie o f the endpoint values. This filter is useful for images containing tnultiple types of noises, such as Gaussian and salt-and-pepper noise. Result of applying this filter to an image corrupted with such noises is shown in figure 6.

Figure 6: Image with salt-and-pcppcr and Gaussian noise and result of alpha-trimmed

mean filter; mask size = 3, trim size = 1

7. Comparison with paint shop pro v3.11

Paint shop pro filters are divided into three main types, the Edge Filters which can detect the edges of different objects in an image, Normal Filters for blurring, . softening or sharpening an image and Spccial Filters which perform some specific image operation like dilation, crosion, despecklc and mosaic etc. The only spatial domain filter available in paint shop pro is median filter and its performance can be compared with IFE Tool median filter. Figure 7 shows images de-noised with median filters of both the softwares. Image obtained with TFE Tool is better than the one obtained with paint shop pro.

Figure 7: Filtered image using paint shop pro v3.11 and IFE Tool

6. Comparison with matlab

Although a wide range of filters such as FIR filters, Frequency Domain filters, Linear and Adaptive filters are defined i n matIab but only two spatial domain filters, that is, median and avcrage filters are available. These can be used with the functions like imtilter, medfilt2 and ordfilt2. Other spatial filters are not readily available but can be devcfoped using matlab tools. Results o f applying Matlab and IFE tool filters are shown in figure 8. Results obtained with IFE tool are much better than the results obtained with matlab. Thick black line seen ill the filtered image of IFE tool is due to padding applied to pixels on thc boundary during the masking operation.

8. Summary

Main aim of this research work was to develop a software which can load images of different formats, filter out noises and enhance the processed images.

A number of spatial domain filters like maximum, minimum, mid-point and alpha have been developed in IFE tool. Histogram

39

Page 5: [IEEE 8th International Multitopic Conference, 2004. Proceedings of INMIC 2004. - Lahore, Pakistan (Dec. 24-26, 2004)] 8th International Multitopic Conference, 2004. Proceedings of

Figure 8 (a) Original irnagc (b) Image added with salt and pepper noise (c) Matlab median filtcrcd image (d) Matlab mid-point filtered image ( e ) WE tool mcdian filtered image (0

IFE tool mid-point filtered image

equalizatioii technique has been provided for the enhancement of images.

Not only the variety of available filters in F E tool is much more than matlab and paint shop pro but the performance of these filters is also observed to be better than these commercially availablc softwares.

. .

9. References

[ l ] Biemond, J. , Rieske, J . and Garhands, J . J . , “A fast kalman filter for imagcs dcgradcd by both blur and noise”, ZEEE Truns. un Acucrstics Speech and Signa( Proc. ASSP-31, 1983, pp. 1248-1256.

121 Burch, S.F., Gull, S.F. and Skilling, J . , “ltnagc restoratimi by a powerful maximum entropy mctliod”, IEEE Trans. on Computer Graphics and Signol Proc. ASSP-23, 1983, pp.113-128, 1983.

data compression”, J. Inst. Electronics und Telecamm. Engrs., 1989, pp.120-135.

E. Abrcu, “Signal-dcpcndciit rank-ordcrcd inenn filters,” Nunlineur Itnrige Processing. G. L. Sicuranza (Eds.), Academic Press, 2000.

Hunt, B.R., “Haycs nicthod iii [ioii-liiicai. digital iinage restoration”, IEEE Ti-~7.7. O I I

compiter. C-26, 1977, pp.216-2 19.

L. Yin, R. Yang, M. Gabbotij, and Y . Ncuvo, “Weighted median filters: A tutorial,” IEEE Trans. Circuits and Syst. I1 : Analog and Digital Signal Processing, vol. 43, Mar. 1996, pp. 157-192.

R. C. Hardic and K. E. Barner, “Rank- conditioncd rank sclection filtcrs for signal restoration, ” IEEE Trans. Inluge Pr-ocessing, vol. 2, no. 2, Mar. 1994, pp. 192-206.

Slcpian, D., “Rcstoration of photographs bluned by image motion”, Bell S ~ W J ~ Z S Tech. J. , 46, 1967, pp.2353-2362

T. Chen and H. R. Wu, “Adaptive impulse detection using center-weighted median filter,” IEEE Signul Processing Leiteis. vol. 8. no I , Jan 2001

T. Chen, K.-K. Ma. and L. -H. Chen, “Trt-state median filter for image denoising,” [EEL Trms. finage Processing, vol. 8, Dcc. 1999, pp 1834-1838.

http://w\r?v.digilalimagcprocessIngbook.coin/ content/noise-reduction.htm

[3] Dutta Majumder, D., Chanda, B. and Mali, P.C., “Mathematical tools for image restoration and

40