Keywords

1 Introduction

We often find images with various noises like Salt and Pepper, Speckle, Gaussian, and Poisson. Various filtering methods are required to denoise images containing each of these different noises. In this paper, we show a comparative study of different types of filters and compare their performances using them to denoise images containing different types of noises. Section 1 of this paper gives an introduction to the paper and elucidates the different references that have been taken. Section 2 describes the different types of noises while Sect. 3 describes the different types of filters that have been used. Section 4 gives an insight into the experimentation and results obtained while Sect. 5 discusses the observations. Finally, Sect. 6 gives a conclusion by mapping different noises to the filters that can be used in denoising images containing them.

Any grayscale image of \(m \times n\) dimension can be represented in the form of a matrix of dimension \(m \times n\) such that each element of the matrix contains the grayscale intensity of each pixel of the image. The grayscale intensity values range from 0 to 255, where 0 represents black and 255 represents white. The pixel values closer to 0 have a darker shade while the pixel values closer to 255 have a lighter shade.

In Ref. [1], an overview of different types of noises like Gaussian, Salt and Pepper, and the Speckle has been given. Various Linear and Non-linear filtering techniques are explained.

The application of the Wiener filter for digital image restoration in 2D has been shown in Ref. [2]. The Wiener filter and its use as a linear filter have been demonstrated. Reference [3] provides an optimal parameter selection for a Bilateral filter and an extension to the Bilateral filter, namely the Multiresolution Bilateral filter.

Reference [4] proposes a new weighted mean filtering method specifically for the Salt and Pepper noise. In Ref. [5], a new Median filtering method, which stands superior to the Standard Median filter, the Center-Weighted Median Filter, and the Tri-State Median filter, has been put forth. The use of the Total Variance Denoising method in detecting the R-peaks in ECG signals has been illustrated in [6]. Reference [7] discusses the application of \(l\) 1 trend filter as an image denoising technique for 3D color images. In Ref. [8], ECG signals have been denoised using Wiener filter as well as Kalman Filter.

In Ref. [9], a comparison between Least Square-based denoising and Total Variation denoising has been done while in Ref. [10] Weighted Regularized Least Square denoising method has been introduced. Reference [11] illustrates the use of Partial Differential Equations, like Heat Equation and Perona-Malik Equation, in image restoration. Reference [12] gives a vivid account of the use of the Weighted Regularization Least Square method in aerial and satellite image denoising. Reference [13] illustrates the denoising of medical images using a bilateral filter and their classification using CNN.

2 Different Types of Noises

2.1 Gaussian Noise

Gaussian noise is a type of statistical noise. It is a noise that is uniformly distributed throughout the image signal. Gaussian noise gets its name as the noise probability distribution function follows the Gaussian distribution. An image with Gaussian noise is obtained by replacing the pixels of the original image with the sum of their original pixel intensities and the noise value.

2.2 Poisson’s Noise

The Poisson noise is also a type of statistical noise. It is also known as quantum noise. It is often present in photon images. The Poisson noise is dependent on image signals and is also known as additive noise because it is added to images through the addition of the noise signal with the original image signal.

2.3 Salt and Pepper Noise

Salt and pepper noise is also known as impulse noise. It adds white and black pixels to images at random positions thereby making them noisy. Salt and Pepper noise often occurs due to some disturbances that may occur in image signals when it is being shared. This noise gets its name because it randomly adds white pixels which resemble salt and black pixels which resemble pepper to the image. Salt and Pepper noise is added by changing the intensity of random pixels of an image to either 0 or 255.

2.4 Speckle Noise

Speckle noise is also known as granular or grain noise. It adds pixels with random grayscale intensities ranging from 0 to 255 to images. Speckle noise is also referred to as multiplicative noise as it is added to images by multiplying the original image signal with the noise signal. Speckle noise is often detected in medical ultrasound and Synthetic Aperture Radar (SAR) images. This is due to the phenomenon of constructive and destructive interference that results in bright and dark spots on images.

3 Different Types of Filters

3.1 Mean Filter

The mean filter is a type of filter which is also known as an average filter. There is a sliding matrix, and the center value of the sliding matrix is replaced with the average of all the pixel intensity values in the sliding matrix. The preferred order of the sliding matrix is of odd order. In this project, we have considered a sliding matrix of order 3 × 3. This method was developed from the fact that every pixel in an image should have a grayscale intensity value similar to that of its neighbors. This filter achieves that by reducing the difference between grayscale intensities of neighboring pixels. This filter results in the smoothening of images.

3.2 Multiple Mean Filter

Multiple Mean Filter is the name given to the filter which contains iterative Mean filters. The output image of the first Mean filter is given as the input to the second Mean filter and the pattern moves on. In this project, we have considered repeating the use mean filter five times.

3.3 Median Filter

The median filter is a type of filter which is similar to the mean filter. The only difference between the median filter and the mean filter is that the center value of the sliding matrix is replaced with the median of all the pixel intensity values in the sliding matrix. The preferred order of the sliding matrix is of odd order. In this project, we have considered a sliding matrix of order 3 × 3. The Median filter is better than the Mean filter as the mean filter is more sensitive to outliers than the median filter.

3.4 Median-Mean Filter

As the name suggests, the Median-Mean filter is a combination of both the Median filter and the Mean filter. The noisy image is first filtered using the Median filter, and the output image obtained from the Median filter is given as input to a Mean filter. The output of the Mean filter is the final output image. A point to be noted is that the sequence of these filters is not to be changed.

3.5 Wiener Filter

The Wiener filter is an extension of the Inverse filter. The inverse filter works by minimizing the mean square of the noise as the noise value has to be negligible for the Inverse filter to work. The Wiener filter also minimizes the noise mean square error like the Inverse filter. However, the Wiener filter can be used to filter images containing noise in them by smoothening the noise.

3.6 Bilateral Filter

The Bilateral filter is an extension of the Gaussian filter. The Gaussian filter utilizes the spatial distances of the pixels to multiply the weights. The Bilateral filter makes use of the photometric distance of the pixels to obtain the weights. A matrix with the weights of each pixel in the surrounding region is considered and is multiplied with parts of the image matrix and the average of the obtained sum replaces the value of the pixel.

4 Experiments, Results, and Analysis

In this paper, we have considered an image of a bird to observe the changes over it by adding different noises and in turn filtering the noisy images using various types of filters. Figure 1 shows the color image of the bird that we considered in this paper while Fig. 2 shows the image after conversion into grayscale. All the work that has been carried out in this paper is with the grayscale image in Fig. 2.

Fig. 1
figure 1

Image that has been considered

Fig. 2
figure 2

Grayscale image of the bird

We considered different noise values for each type of noise and added noise to the images. These noisy images are filtered using the various types of filters mentioned above. The structural similarity index is used to compare the filtered image with the original image.

Table 1 gives the noise values that have been considered for Salt and Pepper, Speckle, and Gaussian noise.

Table 1 Noise intensity values considered

Figure 3 gives a flowchart describing the process that we followed for adding noise and denoising the input bird image.

Fig. 3
figure 3

Flowchart for image denoising

When we use the Mean filter to filter images containing different types of noises, it is observed that the Mean filter is best in filtering images containing Speckle noise. As the noise value increases, the structural similarity index of the filtered output image of the original grayscale image decreases. Images with Poisson’s noise filtered using a mean filter also show good results, but this is not the best application as the Poisson noise value is very less by default.

Figure 4 represents the image after adding Salt and Pepper noise of value 0.2 and the filtered output image obtained using the Mean filter alongside the original image.

Fig. 4
figure 4

Mean filter output for salt and pepper noise (0.2)

Figure 5 represents the image after adding Gaussian noise of value 0.2 and the filtered output image obtained using the Mean filter alongside the original image.

Fig. 5
figure 5

Mean filter output for Gaussian noise (0, 0.04)

Figure 6 represents the image after adding Speckle noise of value 0.2 and the filtered output image obtained using the Mean filter alongside the original image.

Fig. 6
figure 6

Mean filter output for Speckle noise (0.2)

Surprisingly when we repeatedly use Mean filters, we get better results than those observed using Mean filters. We observe that as the number of Mean filters applied increases, the structural similarity index of the filtered output image and the original grayscale image increases. In this paper, we have considered only five iterative mean filters as it was observed that even when the number of iterations is more than five, the structural similarity index of the filtered output image and the original grayscale image remains constant. But there is one exception when Poisson’s noise is considered. In the case of images with Poisson’s noise, the structural similarity index of the filtered output image and the original grayscale image increases only until two iterations and then decreases from two iterations. And it is also observed that the Multiple Mean filter is best in filtering images containing both Speckle and Gaussian noises.

The time taken for the execution of the first Mean filter is 1.800386 seconds while the simulation time for the execution for all the five Mean filter loops is 8.867266 seconds. The simulation for the calculation of elapsed time has been done on MATLAB in a system with 16 GB RAM.

When we use the Median filter to filter images containing different types of noises, it is observed that the Median filter is best in filtering images containing Salt and Pepper noise and least suitable for filtering images containing Gaussian noise.

Figure 7 represents the image after adding Salt and Pepper noise of value 0.2 and the filtered output image obtained using the Median filter alongside the original image.

Fig. 7
figure 7

Median filter output for salt and pepper noise (0.2)

Figure 8 represents the original image, the image after adding Gaussian noise of value 0.04, and the filtered output image obtained using the Median filter.

Fig. 8
figure 8

Median filter output for Gaussian noise (0, 0.04)

Figure 9 represents the image after adding Speckle noise of value 0.2 and the filtered output image obtained using the Median filter on the original image.

Fig. 9
figure 9

Median filter output for Speckle noise (0.2)

Interestingly, it has been observed that the Median-Mean filter gives the best results compared to the above-mentioned filters. It is more suitable for filtering images containing Salt and Pepper and Speckle noises. It is observed that the Median-Mean filter gives a better structural similarity index when compared with the Median filter only when the noise is above a certain minimum value. The value is approximately 0.00324 in the case of Speckle noise and 0.17027895 for Salt and Pepper noise.

Figure 10 represents the image with a Salt and Pepper noise value of 0.2 and the filtered output image obtained using the Median as well as Median-Mean filter.

Fig. 10
figure 10

Median filter and Median-Mean filter output for salt and pepper noise (0.2)

Figure 11 shows the image after adding Gaussian noise of value 0.04 and the filtered output image obtained using the Median as well as Median-Mean filter.

Fig. 11
figure 11

Median filter and Median-Mean filter output for Gaussian noise (0, 0.04)

Figure 12 shows the image after adding Speckle noise of value 0.2 and the filtered output image obtained using the Median as well as Median-Mean filter.

Fig. 12
figure 12

Median filter and Median-Mean filter output for Speckle noise (0.2)

The Wiener filter is best in filtering images containing Speckle and Gaussian noises. The Wiener filter is least suitable for filtering images containing Salt and Pepper noise as the structural similarity indices are the least.

Figure 13 represents the image after adding Salt and Pepper noise of value 0.2 and the filtered output image obtained using the Wiener filter alongside the original image.

Fig. 13
figure 13

Wiener filter output for Salt and Pepper noise (0.2)

Figure 14 represents the image after adding Gaussian noise of value 0.04 and the filtered output image obtained using the Wiener filter alongside the original image.

Fig. 14
figure 14

Wiener filter output for Gaussian noise (0, 0.04)

Figure 15 represents the image after adding Speckle noise of value 0.2 and the filtered output image obtained using the Wiener filter alongside the original image.

Fig. 15
figure 15

Wiener filter output for Speckle noise (0.2)

The Bilateral filter is suitable for filtering images containing Speckle noise. It is not suitable for filtering images containing Salt and Pepper and Gaussian noises. In general, the structural similarity indices are the least for the Bilateral filter.

Figure 16 represents the image after adding Salt and Pepper noise of value 0.2 and the filtered output image obtained using the Bilateral filter alongside the original image.

Fig. 16
figure 16

Bilateral filter output for Salt and Pepper noise (0.2)

Figure 17 represents the image after adding Gaussian noise of value 0.04 and the filtered output image obtained using the Bilateral filter alongside the original image.

Fig. 17
figure 17

Bilateral filter output for Gaussian noise (0, 0.04)

Figure 18 represents the image after adding Speckle noise of value 0.2 and the filtered output image obtained using the Bilateral filter along with the original image.

Fig. 18
figure 18

Bilateral filter output for Speckle noise (0.2)

Table 2 gives us structural similarity indices of the filtered output image and original grayscale image for images containing Speckle, Gaussian, and Salt and Pepper noises, with different noise values, using various filters.

Table 2 Noise value and SSIM value observation table

5 Discussions

The highest structural similarity value for the images with Salt and Pepper noise is 0.9680 which is obtained using the Median filter on the given input image. Images containing Gaussian noise show the highest structural similarity index, 0.9015, for images filtered using the Wiener filter. Similarly, images filtered using the Wiener filter give the highest structural similarity index, 0.9356, in the case of images containing Speckle noise.

6 Conclusions

From the observations made, we can conclude that the structural similarity index of the original grayscale image and filtered output image decreases as the noise value increases. From the structural similarity indices, it is understood that the Median filter is better than the Mean filter in the case of Salt and Pepper noise, and the Mean filter is better than the Median filter when we consider images containing Gaussian and Speckle noise. The Median-Mean filter is far better than the Median filter in the case of all the different types of noises. We observe that the Median-Mean filter is best for filtering images that contain Salt and Pepper noise. Images containing Speckle noise and Gaussian noise can be filtered using the Wiener filter. Poisson’s noise is very less in quantity as it is assigned a default value. Hence, images with this noise can easily be filtered using the Multiple Mean filter. In the case of the Multiple Mean filter, it is observed that the time complexity of execution increases at a relatively lesser rate as the number of Mean filters applied increases. As it gives a higher structural similarity index and takes a moderate amount of time when compared to the Mean filter, the Multiple Mean filter stands better in denoising images containing Poisson’s noise.