Restoration for blurred noisy images based on guided filtering and inverse filter

Received Feb 28, 2020 Revised Aug 19, 2020 Accepted Oct 10, 2020 The development of complex life leads into a need using images in several fields, because these images degraded during capturing the image from mobiles, cameras and persons who do not have sufficient experience in capturing images. It was important using techniques differently to improve images and human perception as image enhancement and image restoration etc. In this paper, restoration noisy blurred images by guided filter and inverse filtering can be used for enhancing images from different types of degradation was proposed. In the color images denoising process, it was very significant for improving the edge and texture information. Eliminating noise can be enhanced by the image quality. In this article, at first, The color images were taken. Then, random noise and blur were added to the images. Then, the noisy blurred image passed to the guided filtering to get on denoised image. Finally, an inverse filter applied to the blurred image by convolution an image with a mask and getting on the enhanced image. The results of this research illustrated good outcomes compared with other methods for removing noise and blur based on PSNR measure. Also, it enhanced the image and retained the edge details in the denoising process. PSNR and SSIM measures were more sensitive to Gaussian noise than blur.


INTRODUCTION
Image processing is played in the latest days important part in many of the research, especially for enhancing and restoring the images for improvement of human perception. An image is degraded by blurring from Camera motion, object motion, an optical system that is outside of concentrate, etc., or it is corrupted by noise as the imaging process, the errors that produce through the measurement process, and electronic sources. Image restoration is the process of removing different types of distortion from the image to go back to the original image [1][2][3].
Image restoration is a process reconstructing an image that has been corrupted by the corruption phenomenon. The objective of it is to make the image after restoration like the original image. The image restoration process needs the inverse technique that is used to restore the original image [4,5]. There are several types of denoising techniques in image processing are denoising by thresholding in the frequency domain and filters in the spatial domain. This paper aims to present a guided filtering technique for removing noise from images that originates under spatial domain approaches of image processing. The guided filter can also be utilized in an edge-preserving and smoothing filter. This article presents a method to restore the image from noise and blur using guided filtering and inverse filter. Also, the purpose of this paper is to keep on the edge of the output image as is shown in Figure 1 [5][6][7][8]. Figure 1. Illustration of guided filtering technique [8] Image processing in the past two decades has become an important part of every side of technological society. There are different of the necessary steps involved in digital image processing such as image enhancement, preprocessing of images, image segmentation, image restoration, and image reconstruction, etc. Image restoration is a process for restoring the degraded image from noise and blur to the original image. There are several methods of image restoration in the field image processing such as Median filter, guided filter, Wiener filtering, inverse filtering, Harmonic mean filter, Arithmetic mean filter, and Max filter, etc [7][8][9][10].
Inverse filtering and guided filter methods are methods simplest and have advantages to overcome the restoration problems. Tahir [9] proposed the restoration of noisy blurred images using the MFPIA and DWT method. She used Gaussian blur, motion blur, Gaussian noise, and salt and pepper noise. She performed MFPIA to reduce the blur and wavelet denoising to remove the noise.
Reconstruction of noisy blurred images using blur kernel by Ellappan and Chopra [10] are used Lucy Richardson algorithm which is also named a non-blind algorithm for making the image less noisy. Sun, et al., [11] presented color image denoising based on the guided filter and wavelet threshold. They used image denoising based on the adaptive wavelet threshold and guided filtering. They showed the proposed method eliminates Gaussian noise and enhances the image.
A comprehensive analysis of image filtering techniques by Babu and Kumari. They implemented a guiding filter to remove noise and preserve the edge smoothing of the image. They showed the proposed work gave effective and efficient than bilateral filter [12]. Farooque, et al., [13] presented a survey of various noises and techniques for denoising the color image. They showed the wavelet method is effective to eliminate the noise from color images as salt and pepper noise and Gaussian noise, etc.
Gadge and Agrawal by guided filtering of the color image. They presented guided filter to smooth and enhance the image in addition to give a high quality of image [1]. Mehwish, et al., [6] proposed Guiding image filtering using data mining and decomposition. They presented a guided filter to perform as an edgepreserving smoothing of the image. They saw the guided filter made a smooth image and improve the quality of the image. Rahman, et al., proposed digital image restoration by using inverse and wiener Filtering. They used the motion blur with the color image. They showed both motion and noisy motion blurred images are restored by Inverse filtering and Wiener filtering [14].

TYPES OF NOISE
The noise is unwanted information that corrupts the image used in the distorting part of image information. An image is contaminated with noise through its transmission or acquisition. It creates unwanted effects such as artifacts, impractical edges, invisible lines, corners, distorted objects and disturbs background scenes. To reduce these undesirable effects, prior learning of noise models is essential for further processing. Noise elimination is a significant process in image processing is called image denoising process [15,16]. There are various models of noise like additive and multiplicative in digital images are Gaussian noise, salt, pepper noise, Poisson noise, and speckle noise. In sensors, the temperature can cause an effect on the amount of noise created by an image sensor. Digital sensor cameras produce more noise during summer than winter [15][16][17][18].

Amplifier noise (gaussian noise)
The Gaussian noise follows additive noise, this type of noise is independently at each pixel. This type of noise has a Gaussian distribution property, which has a probability distribution function. In color cameras, the blue color is more amplifier than red and green channels, because the blue channel provides more noise from other channels. The noise caused by poor illumination, high temperature, and transmission. Gaussian noise in image processing can be decreased by spatial filtering techniques for noise removal as a mean filter, median filter, and Gaussian smoothing [19].

Impulsive noise
It is called salt and pepper noise. This type of noise contains white and black pixels. A white pixel is the brightest part while the black pixel is the dark part. Salt and pepper noise has only two values, a and b. The probability of each value is typically 0 or 1. The value of salt noise is 255 and for pepper, noise is 0. This type of noise caused by malfunctioning of the pixel value in the camera devices, faulty memory location, and errors in the process of digitization [20].

Poisson noise
It is called shot noise that is considered as one of a kind of electronic noise. It occurs when molecules transport power as electrons in an electronic circuit and photons in an optical system. Poisson noise can cause when the number of photons recognized by the sensor is not sufficient for providing statistical information. This type of noise owns the root mean square value relative to the square root amount of the image. Various pixels will suffer from free noise values [21].

Speckle noise
This type follows multiplicative noise. It differs from the Gaussian and salt pepper noise because they are following additive noise. It is more popular in radar, laser, and SAR images. This type of noise leads to get worse the quality of radar and synthetic aperture radar (SAR) images. Speckle noise is produced for the reason that of coherent processing of scattered signals from several spread points. The source of this type refers to random intervention between the coherent outputs [22,23].

TYPES OF BLUR
Blur can be defined as an unsharp image region that happens through camera motion, object motion, out-of-focus of the camera, and through image acquisition. There are three several types of blur in the images are average blur, Gaussian blur, and motion blur [24].

Average blur
Average blur is one of the tools that is used to remove noise from the images, each pixel in the output image has a value equal to the average value of its neighboring pixels in the original image. It is distributed in vertical and horizontal directions. The average filter removes this type of blur. It is useful when noise is covering the whole image [11,25].

Gaussian blur
Gaussian blur is also defined as the Gaussian image smoothening technique in image processing. This blur utilized to acquire a blurred image and also used for removing the details of the image and adding the noise into the image. So its result would be a blurred image. This type of blur is a candidate that blends a certain number of pixels. This type incenses in the center and the edge of the image. Gaussian blur can be used in computer vision algorithms as a preprocessing stage to improve image structures at various scales [17].

Motion blur
This type of blur makes an image in moving by appending a blur in a certain part. Motion blur happens due to relative motion between the scene and the camera. The effects of motion blur can be simulated in an image with a motion filter in a particular part. The power of motion is implemented by an angle (0 to 360 degrees), (-90 to +90). The certain number of pixels to be removed and the angle of shifting (θ) can change [26,27].

GUIDED FILTERING AND INVERSE FILTER
Guided filtering is one of the enhanced techniques of the spatial domain. Figure 2 shows the guided image filtering process. It performs very well in a variety of applications, such as joint up sampling, image 1268 enhancement, detail image smoothing, dehazing, noise reduction, detail enhancement, and compression. It is one of the easiest algorithms to implement, edge-preserving, efficiency, and quality. guided image filter keeps on the edge-preserving smoothing in an image, by the content of the second image, the guidance image. If the guidance image is the same as the original image to be filtered, an edge of the original image and the guidance image are the same as is shown in Figure 2(b). The guided filter can be performed better on the pixels near the edge. When the input image is different from the guidance image, the guided filter will extract structured information from the guidance image and combine it into the input image as is shown in Figure  2(c). Inverse filtering is one of the deblurring techniques used to restore the image to the original image as is shown in Figure 3. It is one of the methods applied in the spatial domain for image restoration [28][29][30]. Inverse filter without noise present in the spatial domain as the following formula: where : ( , ) is a degraded image by blurring. ( , ) is the original image. ℎ( , ) is blur mask (degradation function). while the noisy presence the formula can be represented as follows: ( , ) = ( , ) * ℎ( , ) + ( , ) is the additive noise [13]. The reconstructed image from blur I^(x, y) can be achieved by inverse DFT according to the following formula: where: ( , ) is a degraded image by blurring.
is the inverse of the blur mask [29]. In Figure 4, the original image is convolved with the blur mask to get the blurred image according to (1). Then we apply the inverse of blur filter that removes blur from the image and it convolved with a blurred image to get the deblurred image according to (3).

RESEARCH METHOD
This paper presented a good method for image restoration by using guided filtering and inverse filtering. Figure 5 shows a set of steps that clarify the proposed method. At first, The color image is taken. Then the original image is degraded by different types of noise and blur based on (2) to get on the noisy blurred image. The guided filter is implemented on the noisy blurred image.

Figure 5. The proposed method
The original noisy image I am set for the guidance image G. Radius value rd=5 and regularization parameter ϵ=0.01. A lower value of the parameter will make the image less smoothing and more preservation of edge and vice versa. After that, mean, correlation, variance and covariance are computed for both input image I and guided image G. The effect of blur can be measured by a and b coefficient according to (5).
In the denoising technique, we implemented the guided filtering for smoothing the input image I and guidance image G. The image smoothing is making the noisy image smoothing which that means removing the noise from the image. We use G as the guidance image and I as the filtering input image to recover some details of edges and reduce noise according to an algorithm. The guided filter decreases the noise effect, according to the algorithm of the guided filtering method. The properties of guided filter are reducing the noise and maintain on edge details of an image and also improves the quality of the image. The guided filter will filter the original image by a linear transformation. The output image O can be considered as the linear transformation of guiding image G according to (4).
where (ak, bk) are linear coefficients can be obtained by linear equation where µ and are the mean and variance of the guided image respectively, ̂ is the mean of an input image. At last, the inverse filtering is performed on the output image by using the (3) to get the deblurred image. Inverse filtering of a blurred image is a high pass filter. It is a method that removes blur from an image and getting on the enhanced image that is similar to the input image.

THE RESULTS
The results are applied to the color images that are degraded by different types of noise and blur. The types of degradation are used in this paper are salt and pepper noise, speckle noise, motion blur, and Gaussian blur. The key idea of this paper reduces noise and blur using guided filtering and inverse filtering techniques and getting the enhanced image. The radius value and regularization parameters were set to rd=5 and ϵ=0.01 respectively.
First, a noise variance of 0.01 salt and pepper noise was added to the color original images (256*256). Then Gaussian blur was added to the noisy image. This generated a noisy blurred image. After that, the guided filter algorithm was applied to the resulted image from the previous step to get a denoised image and enhance the edge. The guided filter performs better at the pixels near the edges because the properties of the guided algorithm are preserved on the edge and reducing the noise effect. Finally, an inverse filter is implemented by using (3) to remove blur and getting on the output image as is shown in Figure 6.
In Figure 7 more level noise is added to the original image. Salt and pepper noise are added to the original images (256*256) with level noise 0.03. Then a Gaussian blur is added to a noisy image according to (2). A guided filter is performed according to the algorithm on a resulted image from the previous step to get the denoised image. Guided filter algorithm will make the image smoothly, and preserve the edge. An edge in input image I is the same as in the guidance image G. Finally, an inverse filter is implemented to remove blur and getting on the output enhanced image. The results show the output image of the level noise 0.01 is better than 0.03 based on PSNR value because when the noise level is increased, the denoising effect is decreased. In Figure 8 a different type of noise is used with variation in the size of the image. Speckle noise is added to the original images (512*512) with 0.01 level noise in addition to a Gaussian blur to the noisy image according to (2). Then, a guided filtering method is applied to the resulted image to get on the denoised image according to the algorithm. The guided filter improves the edges and details of the denoised image. The Guided filter makes the image better effect of the edge after denoising. At last, the inverse filtering is applied to the blurred image for getting on the enhanced image. The results show inverse filtering performs well in the absence of noise for image restoration. In Figure 9, the here higher noise level was used than before, where speckle noise is added to the original images with 0.03 level noise according to (2). Then, Gaussian blur is added to the noisy image according to (1). After that guided filter is implemented on noisy blurred images to remove noise & blur and get on the denoised image. The guided filter retains on the edge and details of an image after denoising image. Finally, the inverse filter is applied to remove blur and getting on the output image. It shows the smaller size of the image will give the largest value-based on metrics. In Figure 10, the first step was to add another type of blur that is motion blur according to (1). Then salt and pepper noise is added to the blurred image with 0.01 level noise based on (2). Then, guided filtering is performed on the resulted image from the previous step to get the denoised image. After guided filtering is performed, the edge of the image is kept of a guiding image. At last, the inverse filter is performed on the resulted image according to the (3) to remove blur and getting on the enhanced image.
The first step was to add salt and pepper noise into the original images with 0.03 level noise instead of (0.01) level noise, in addition to motion blur by (2). After that, the guided filter is applied to the resulted image from the previous step to remove noise. At last, the inverse filter is implemented to remove blur and getting on the output image. The output image is represented in Figure 11. In the previous figures, the proposed method makes the edge of the output image smooth and coherent.
The higher value of the PSNR is, the stronger the denoising algorithm ability is. The structural similarity index measurement (SSIM) measure uses to measure the similarity between the input image and the output image. The value of SSIM is as big as better. Table 1

CONCLUSION
In this paper, we have utilized a method for image denoising named guided filtering, which is most appropriate in computer graphics and vision processing. This paper presented a good method to improve the degraded image by noise and blur based on guided and inverse filtering. The proposed method removes noise in the spatial domain using a guided filter and then uses inverse filtering to remove the blur that made to enhance the image and keep on edges. Inverse filtering works well in the absence of noise in restoring the input image from its degraded. The results show guiding filter performs better at the pixels near for edges. guided filtering is performed for edge-preserving smoothing of the image. This method presented better results of PSNR and SSIM metrics that is indicated this method has a visual quality. The work has shown that the PSNR measure is more sensitive to Gaussian noise than SSIM, in addition to PSNR and SSIM are more sensitive to Gaussian noise than Gaussian blur. The results show PSNR value is inversely proportional to the size of the image, the PSNR value of the small size of the image is better than the larger size of the image, and vice versa.