European Journal of Scientific Research ISSN 1450-216X Vol.27 No.2 (2009), pp.167-173 EuroJournals Publishing, Inc. 2009 http://www.eurojournals.com/ejsr.htm Gray Image Reconstruction Waheeb Abu Ulbeh Computer Science Department, Al al-bayt University, Mafraq, Jordan P.O.BOX 922283, 11192 Akram Moustafa Computer Science Department, Al al-bayt University, Mafraq, Jordan P.O.BOX 922283, 11192 Ziad A. Alqadi Faculty of Engineering, Al-Balqa Applied University, Amman-Jordan Abstract Noise elimination from the gray images some time causes loosing some information from the original image thus it is important to find a way to eliminate the noise and reconstruct the image. This paper proposed a methodology of eliminating the noise from the gray image and reconstructing the image in order to get the image without loosing any piece of information from it. The methodology was implemented and tested and the experimental results shows that the proposed methodology is efficient comparing with the results obtained by applying standard methods used to eliminate noises such as Gaussian, Sobel, prewitt, laplacian, log, average, unsharp methods which are used as a special filters to eliminate the noise from the gray image. Keywords: Morphological Operations, Dilation, Erosion, Opening, Closing, Noise, Filter. 1. Theoretical Background 1.1. Noise Reduction Digital images are prone to a variety of types of noise. There are several ways that noise can be introduced into an image, deping on how the image is created. For example: If the image is scanned from a photograph made on film, the film grain is a source of noise. Noise can also be the result of damage to the film, or be introduced by the scanner itself. If the image is acquired directly in a digital format, the mechanism for gathering the data (such as a CCD detector) can introduce noise. Electronic transmission of image data can introduce noise. [1-4]. Image noise elimination (reduction) [5] is the process of removing noise from the image. Noise reduction techniques are conceptually very similar regardless of the signal being processed, however a priori knowledge of the characteristics of an expected signal can mean the implementations of these techniques vary greatly deping on the type of signal. In practice a lot of methods are used to eliminate the noise from the image and a lot of filters are used. Table1 shows a summery of some filters which are used to eliminate the noise and the results of using these filters was compared with the proposed methodology in this paper:
Gray Image Reconstruction 168 Table 1: Standard Filters Value gaussian sobel prewitt laplacian log average unsharp Description Gaussian lowpass filter Sobel horizontal edge-emphasizing filter Prewitt horizontal edge-emphasizing filter Filter approximating the two-dimensional laplacian operator Laplacian of Gaussian filter Averaging filter Unsharp contrast enhancement filter If we apply each of these filters to eliminate the noise from the image we can use some or a lot of information from the image and this leads to some defection in the image and the following example shows this fact. Example: This example was implemented using mat lab. Read the original image a=imread('eight.tif'); Figure 1: Imshow(a), title 'Original';- Add noise to the original image b = imnoise(a,'salt & pepper',0.02); Figure 2: Imshow(b), title 'Noisy image';
169 Waheeb abu ulbeh, Akram Moustafa and Ziad A. Alqadi Applying the filter to reduce the noise, we applied the above mentioned filters and got the following results (which are shown in table 2): Table 2: Results of applying the standard filters Used filter Correlation between the original image and the filtered noisy image Gaussian 0.9601 Sobel -0.1985 Prewitt -0.1608 Laplacian -0.2791 Log -0.3803 Average 0.9636 Unsharp 0.8720 The results in table2 shows that applying each of the standard filters to reduce (eliminate) the noise from the gray image causes a defection in the image, thus loosing some information (features) from the image. 1.2. Morphological Operations Morphology is a technique of image processing based on shapes. The value of each pixel in the output image is based on a comparison of the corresponding pixel in the input image with its neighbors. By choosing the size and shape of the neighborhood, we can construct a morphological operation that is sensitive to specific shapes in the input image. [6] Dilation and erosion are two fundamental morphological operations. Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries. The number of pixels added or removed from the objects in an image deps on the size and shape of the structuring element used to process the image. Dilation and erosion are often used in combination to implement image processing operations. For example, the definition of a morphological opening of an image is erosion followed by dilation, using the same structuring element for both operations. The related operation, morphological closing of an image, is the reverse: it consists of dilation followed by erosion with the same structuring element. [6] Morphological operations has been widely used to process binary and grayscale images, with morphological techniques being applied to noise reduction, image enhancement, and feature detection.[7]. We propose a new methodology based on the set of morphological operators to eliminate the noise from the gray image and reconstruct the image in order to obtain a clear image without loosing any feature from the processed image. Erosion The fundamental operation of mathematical morphology is erosion. All mathematical morphology deps on this notion. [8]The erosion of an input image A by a structuring element B is defined as follows: AΘ B = { x : B + x A} This means that in order to perform the erosion of A by B we translate B by x so that this lies inside A. The set of all points x satisfying this condition constitutes AΘ B. The erosion of an image can also be found by intersecting all translates of the input image by the reflection of the structuring element: AΘB = I { A + b : b B} The erosion of a gray scale image f by a structuring element g at a point x is defined as follows:
Gray Image Reconstruction 170 ( fθg )( x) = min z D[ f ] D[ g { f ( z) g ( z) } x x ], x : D[ g x ] D[ f ] This means that we translate spatially g by x (so that its origin is located at point x) and then we find the minimum of all differences of values of f with the corresponding values of the translated g, z D[ f ] D[ g x ] Dilation The dual operation to erosion is dilation. Dilation of an input image A by a structuring element B is defined as follows: A B = U { B + a : a A} This means that in order to perform the dilation of A by B we first translate B by all points of A.The union of these translations constitutes A B. The dilation of a gray scale image f by a structuring element g at a point x is defined as follows: ( f g)( x) = max{ f ( z) + g x ( z) } z D[ f ] D[ g x ( z)] This means that we translate spatially the reflection of g, g (-z), so that its origin is located at point x and then we find the maximum of all sums of values of f with the corresponding values of the translated reflection of g, z D[ f ] D[ g x ( z )] Opening A secondary operation of great importance in mathematical morphology is the opening operation. Opening of an input image A by a structuring element B is defined as follows: A o B = (AΘB) B An equivalent definition for opening is: A o B = U{ B + x : B + x A} This means that in order to open A by B we first translate B by x so that this lies inside A. The union of these translations constitutes A o B. For instance, the opening of a triangle A by a disk B (the origin coincides with the centre of the disk) is the triangle A with rounded corners. In general, opening by a disk rounds or eliminates all peaks exting into the image background. Closing The other important secondary operation is closing. Closing of an input image A by a structuring element B is defined as follows: A B = (A B) ΘB For instance, closing a triangle A by a disk B (the origin is on the centre of the disk) yields the same triangle A. In this case A B = A and we say that A is B-close. In general, closing by a disk rounds or eliminates all cavities exting into the image foreground.[10-17] 2. The Proposed Methodology (Filter) of Noise Reduction and Image Reconstruction 2.1. Proposed Filter Description The following steps summarize the sequence of operations needed to implement the proposed methodology: 1. Read the original noisy image.
171 Waheeb abu ulbeh, Akram Moustafa and Ziad A. Alqadi 2. Perform morphological opening using the original image and a specified structuring element. 3. Save the resulting image. 4. Close the resulting image. 5. Let the resulting image equal the intersection of the resulting image and the original one. 6. Compare the results with the reconstructed (non-noisy) original image. 7. If the resulting images not equal the reconstructed image go to step 3. 8. Else stop. 2.2. Filter Implementation The proposed filter was implemented using different noisy images and different structuring element. The following figure shows the noisy image and the reconstructed image after applying the proposed filter: The following code shows a mat lab code for just one implementation: I = imread('eight.tif'); J = imnoise(i,'salt & pepper',0.02); k = strel('diamond',3); m = imopen(j,k); t = m; while t ~= m t = m; m = imdilate(m,k); for i = 0: 255 for j = 0: 255 if ((m(i,j) == 1) & (J(i,j) == 1)) m(i,j) = 1;
Gray Image Reconstruction 172 The above code was implemented using different images and different structuring elements which were applied for each image. The following structuring element gives the best results: Neighbourhood One(3) Ones(3,3) Diamond(3) Disk 4 Diamond(4) Table 3 contains the worst results obtained by implementing the proposed methodology. Table 3: Results of applying the proposed filter Used structuring element Correlation between the original image and the filtered noisy image Neighbourhood 0.9732 One(3) 0.963 Ones(3,3) 0.9385 Diamond(3) 0.9278 Disk 4 0.923 Diamond(4) 0.9103 2.3. Results Discussion Comparing the experimental results shown in table 3 with the practical results of applying different standard filters (results in table 2) we can conclude that the proposed methodology can be categorized as a filter and applying it to a Gray scale image leads to some enhancement in the process of noise reduction and image reconstruction, thus it leads to the minimum loose of information from the image after elimination the noise.
173 Waheeb abu ulbeh, Akram Moustafa and Ziad A. Alqadi References [1] Filtering Multiplicative Noise in Images Using Adaptive Region Based Statistics, JEI(7), No. 1, January 1998, pp. 222-230. 9807 BibRef. [2] Multi resolution Adaptive Filtering of Signal-Depent Noise Based on a Generalized Laplacian Pyramid, ICIP97(I: 381-384). IEEE DOI Reference BibRef. [3] Jostschulte, K., Amer, A., Schu, M., Schroder, H., Perception Adaptive Temporal TV-Noise Reduction Using Contour Preserving Prefilter Techniques, Consumer(44), No. 3, August 1998, pp. 1091-1096. 9810 BibRef,Boutalis, Y., Kollias, S., Carayannis, G., [4] A fast adaptive approach to the restoration of images degraded by noise, SP(19), No. 2, 1990, pp. 151-162. BibRef 9000,Chan, T.F., Osher, S.J., Shen, J., [5] http://en.wikipedia.org/wiki/noise_reduction. [6] Morphological operations (Image processing Toolbox user's guide). [7] AA(Siemens Information and Communications Networks) AB(Univ. Central Florida) J. Electronic Imaging 10(02), 548-559, Jan P. Allebach; Ed. 04/2001. [8] http://homepages.inf.ed.ac.uk/rbf/cvonline/local_copies/gasteratos/soft/2.htm. [9] R. C. Gonzalez and R. E. Woods (1992): Digital Image Processing, Addison-Wesley, New York.. [10] R. M. Haralick and L. G. Shapiro (1992): Computer and Robot Vision, Addison-Wesley, New York. [11] I. Pitas and A. N. Venetsanopoulos (1990): Nonlinear Digital Filters: Principles and Applications, Kluwer Academic Publishers, Boston, Massachusetts, U.S.A. [12] J. Serra, ed., (1989): Image Analysis and Mathematical Morphology: Theoretical Advances, Academic Press, London. [13] J. Serra and P. Soille, eds., (1994): Mathematical Morphology and its Applications to Image Processing, Kluwer Academic Publishers, Dordrecht-Boston-London. [14] P. Maragos, R. W. Schafer and M. A. Butt, eds., (1996): Mathematical Morphology and its Applications to Image and Signal Processing, Kluwer Academic Publishers, Dordrecht-Boston- London. [15] H. J. A. M. Heijmans and J. B. T. M. Roerdink, eds., (1998): Mathematical Morphology and its Applications to Image and Signal Processing, Kluwer Academic Publishers, Dordrecht-Boston- London. [16] H. J. A. M. Heijmans (1994): Morphological Image Operators, Academic Press, New York. [17] L. Koskinen, J. Astola and Y. Neuvo (1991) "Soft Morphological Filters", Proceedings of SPIE Symposium on Image Algebra and Morphological Image Processing, 262-270.