In the field of image processing, modern trend moves towards handling images effectively with more clarity and high performance. This image enhancement can be done either in spatial domain or in frequency domain. Low pass, high pass, band pass and notch filters are designed to remove the noise from the image or to enhance the quality of the image (Chen et al., 2013). If the filter or kernel size is small, filtering can be done more effectively in the spatial domain (Islam et al., 2010). If the kernel or convolution mask size becomes large, this would be tedious in the spatial domain. In such a case, the filtering could be done more effectively in the frequency domain. Since the convolution becomes multiplication here, the processing would be done more effectively even with large kernel size (Elamaran et al., 2013; Malik and Baharudin, 2012).
In some applications, there is a necessity to detect the shape and structure of the image or a pattern within an image. Morphological algorithms are more pertinent for this kind of image analysis (Li et al., 2013). A particular shape can be extracted and analyzed with the help of dilation and erosion processes. A particular pattern size can be enlarged by dilation and minimized by erosion. By combining both dilation and erosion, morphological filtering would be achieved. Input image can be smoothened along with the removal of noise by opening and closing. Edge detection, feature detection, image segmentation, counting objects is the other applications of morphological algorithms. These operations are not linear like spatial filtering using convolution masks (Elamaran et al., 2012; Dougherty, 2009).
In some applications, there is a requirement to detect internal and external boundaries of a pattern within an image. Erosion output is subtracted from the image to get an internal boundary and input image is subtracted from the dilation output to get an external boundary (Qidwai and Chen, 2009). Set theory is the most fundamental concept applied to morphological algorithms. Boolean logic operations like exclusive OR and NOT are performed to process the image. Union operator is equivalent to the OR and intersection operator is equivalent to the AND logic operation (Elamaran et al., 2012).
A main objective of this study is to implement morphological filtering to reduce the impulsive noise content from the given input image. Applying dilation once or twice followed by erosion and applying dilation once or twice followed by erosion are the key techniques for the task of filtering. A detailed analysis is done to use the best structuring element to remove the impulse noise from a binary image using the proposed algorithm. More appropriate Structuring Elements (SE) are chosen such a way that the noise would be reduced further.
Morphological image filtering: Morphological image processing is the best tool used for extracting or modifying information on the shape or structure of the objects within an image. Very often this would be applied to binary images and also this can be extended to gray scale images too. This is the different one from filtering in which the noise is filtered with the help of filter and the output image is obtained. But here, a kind of image analysis is performed to the given input image (Priya and Pugazhenthi, 2014).
For example, a classifier is used to convey the category of the objects in an image. In this study, morphological operations are performed to remove a salt and pepper noise from an image. So, morphological filtering task is implemented and the results are analyzed with the PSNR performance metric (Gopi, 2007). Apart from this hit or miss, thickening, thinning and skeletonization are also can be used for the purpose of image segmentation and classification. Overall, the morphological algorithms are very successful in the field of digital image processing (Tan and Jiang, 2013).
Basic morphology operations like dilation and erosion can be applied to the basic shapes png image, which is shown in Fig. 1. A salt and pepper noise is added with the original one and is used for the filtering purpose by dilation, erosion, opening and closing morphological processes with different structuring elements. A noisy image is shown by Fig. 2.
Dilation and erosion: Dilation is a process in which the structuring element is placed on the input image and if at least one pixel match with the structuring element, then the center pixel is replaced with 1. If the dilation is required in all directions or horizontally and/or vertically, the structuring elements are chosen appropriately. The size and the design of the structuring element play a vital role in the dilation process. Actually the original pattern size will be enlarged. Even to detect a boundary line of an object, this dilation could be useful. This is accomplished by dilating all directions and by subtracting the original image from the result (Russ and Russ, 2007).
Erosion is a process in which the structuring element is placed on the input image and if every pixel in a structuring element matches every pixel in the image region, the center pixel is replaced with 1. The size of the pattern is shrinking while the implementation of erosion process. If this process is repeated twice or thrice, the region of interesting pattern size will be minimized further (Marques, 2011).
|Fig. 1:||Input binary image|
|Fig. 2:||Input binary image with added impulse noise|
Opening and closing: The results of the dilation and dilation followed by first erosion are shown in Fig. 3 and 4, respectively. The dilation result shows that the noise involved within the object is removed completely. But the noise within the background is enlarged and this can be reduced by applying erosion.
Since the noise size is more, erosion can be applied again and again. Implementing this from hardware point of view, this algorithm make use of more resources and time consuming. But the final result would be with better quality. The equation describe these algorithmic steps applied to the input impulse noisy image A with structuring element B:
Dilation followed by erosion is being referred as closing.
|Fig. 3:||Dilation applied to the noisy image|
|Fig. 4:||Closing applied to the noisy image|
The methodology implemented in this study is summarized as below:
||Get an input binary image of size N×N
||Add impulse noise to the original input binary image
||Apply dilation to the noisy image
||Apply erosion the resultant image
||Apply erosion first time after closing
||Apply erosion two times after closing
||Apply erosion three times after closing and obtain the noise free image
||Repeat step 2-7 by adding different impulse noise intensities
|Fig. 5:||Closing with first erosion using SE1|
|Fig. 6:||Closing with second erosion using SE1
Figure 3 shows the multiple erosions followed by closing with the help of structuring element. The structuring element, SE1 used here is described as in Eq. 2. After multiple erosions, the noise content in the original image is almost removed at the cost of complexity in algorithm. First erosion, second erosion and third erosion after closing results are shown in Fig. 5-7, respectively.
The amount of dilation and/or erosion can be done with a suitable structuring element. These operations are performed with depends upon 1s and 0s in a structuring element. For example, a 3×3 structuring element with all 1s indicate the dilation is performed in all the directions. This one is expressed in the Eq. 3 as structuring element 3 (SE3). In dilation, at least one pixel match with the structuring element, then the center pixel is replaced with 1. But with the erosion process, if all the pixels in the pattern of the image match with the structuring element, then the center pixel is replaced with 1:
|Fig. 7:||Multiple erosions after closing using SE1|
Equation 3 shows the different structuring elements used for the same algorithm to remove noise and increase the PSNR value:
Structuring element decides dilation and erosion process. If all the elements are 1, then the dilation takes place in all directions as in SE3. If the dilation should take place both in horizontal and vertical directions, SE2 can be used. Similarly, if the dilation is needed in only diagonal directions, the SE4 would be used. Depends on the shape of the structuring element, both closing and opening results are varied. The SE2 may does the dilation in the horizontal and vertical directions and SE4 may do the dilation diagonally. This is verified with the arrangements of 1s in those corresponding structuring elements. In spatial domain filtering, averaging filters are used to blur the image and to remove the high frequency noise contents in the image. But these filters are not good in the filtering of salt and pepper noise (Esakkirajan et al., 2011). A non-linear filter like median filter would be used to remove this kind of impulsive noise from the image. In spatial domain filtering to remove the salt and pepper noise with median filter, the larger size kernels are not appropriate since the median value deviates from the desired pixel. Morphological operations are not linear and are useful to remove the salt and pepper noise (Toh and Isa, 2010).
Figure 8 shows the dilation result using the structuring element SE2 and Fig. 9 indicates the final erosion using the same structuring element. Similar results are obtained using the structuring element SE3 and SE4 and the corresponding results are shown in Fig. 10-13, respectively.
|Fig. 8:||Dilation using SE2|
|Fig. 9:||Closing with multiple erosions using SE2
RESULTS AND DISCUSSION
Image enhancement algorithms are effectively implemented even using average low pass filtering, which reduce the noise content from the image but the blurring effect occurs at the resulting image. Blurring effect depends on the size of the filter; more blurring occurs with a bigger kernel size. Morphological algorithms are effectively used to remove noise too apart from the boundary detection, pattern segmentation, classification etc.
|Fig. 10:||Dilation using SE3|
|Fig. 11:||Closing with multiple erosions using SE3|
Performance metrics: Let orig (x,y) be the original noise-free image with size M×N, f (x,y) be the impulse noise added image and the f (x,y) be the restored image with the same size:
|Fig. 12:||Dilation using SE4|
|Fig. 13:||Closing with multiple erosions using SE4|
where, μf(x,y) and μf(x,y) are the mean value of the input and output images.
All the above algorithms presented here are implemented using MATLAB software tool and the performance metric results have been compared and depicted below (Melange et al., 2011; Hsieh et al., 2013). The performance metrics like PSNR, MAE, NCC and IEF are obtained using four structuring elements with 50% impulse noise intensity as shown in Table 1. It is apparent that the SE2 provides higher PSNR, smaller MAE, higher NCC and higher IEF among the other three structuring elements.
Detailed comparison analysis
PSNR: Simulation results show that the structuring element SE2 is good (high in the Fig. 14a) for PSNR metric compared with others.
||Results of (a) PSNR, (b) MAE, (c) NCC and (d) IEF with various impulse noise intensities using four structuring elements
|Table 1:||Results of PSNR, MAE, NCC and IEF with SE1 with 50% impulse noise intensity|
The structuring element SE3 is poor (low in the Fig. 14a) for 70, 80 and 90% impulse noise intensities. The structuring element SE4 is poor (low in the Fig. 14a) for 20, 30, 40, 50 and 60% impulse noise intensities.
MAE: Simulation results show that the structuring element SE2 is good (down in the Fig. 14b) for MAE metric compared with others. The structuring element SE3 is poor (high in the Fig. 14b) for 70, 80 and 90% impulse noise intensities. The structuring element SE4 is poor (high in the Fig. 14b) for 20, 30, 40, 50 and 60% impulse noise intensities.
NCC: Simulation results show that the structuring element SE2 is good (high in the Fig. 14c) for PSNR metric compared with others. The structuring element SE4 is poor (low in the Fig. 14c) for overall impulse noise intensities.
IEF: Simulation results show that the structuring element SE2 is good (high in the Fig. 14d) for IER metric compared with others. The structuring element SE3 is poor (low in the Fig. 14d) for 70, 80 and 90% impulse noise intensities. The structuring element SE4 is poor (low in the Fig. 14d) for 20, 30, 40, 50 and 60% impulse noise intensities.
Morphological algorithms are easily implemented for the impulsive noise reduction with dilation, erosion, opening and closing processes. Image enhancement, image classification, image segmentation internal and external boundary detection are the very important applications out of morphological operations. Non-linear filters like median filters are the key to remove salt and pepper noise from the input image. But this median algorithm is more complex compared to simple moving averaging filter. Set theory is the most fundamental concept for morphological operations with the image. Erosion and dilation are the most popular techniques to identify the image, classify the image, detect the line or boundary from the image, detect the shape of the object etc. This study removes the salt and pepper noise from the input image with the dilation followed by erosion twice or thrice even. The results are better at the cost complexity in the algorithm. This work can be further extended to remove the other kind of noises like white noise, flicker noise and shot noise, etc.