# Color Image Denoising Based on Guided Filter and Adaptive Wavelet Threshold

Authors: Xin Sun; Ning He; Yu-Qing Zhang; Xue-Yan Zhen; Ke Lu; Xiu-Ling Zhou
Journal: Applied Computational Intelligence and Soft Computing
 (2017)

---

## Abstract

In the process of denoising color images, it is very important to enhance the edge and texture information of the images. Image quality can usually be improved by eliminating noise and enhancing contrast. Based on the adaptive wavelet threshold shrinkage algorithm and considering structural characteristics on the basis of color image denoising, this paper describes a method that further enhances the edge and texture details of the image using guided filtering. The use of guided filtering allows edge details that cannot be discriminated in grayscale images to be preserved. The noisy image is decomposed into low-frequency and high-frequency subbands using discrete wavelets, and the contraction function of threshold shrinkage is selected according to the energy in the vicinity of the wavelet coefficients. Finally, the edge and texture information of the denoised color image are enhanced by guided filtering. When the guiding image is the original noiseless image itself, the guided filter can be used as a smoothing operator for preserving edges, resulting in a better effect than bilateral filtering. The proposed method is compared with the adaptive wavelet threshold shrinkage denoising algorithm and the bilateral filtering algorithm. Experimental results show that the proposed method achieves superior color image denoising compared to these conventional techniques.


---

## Body

## 1. Introduction

During their acquisition and transmission, images are adversely affected by noise. Color images contain better visual effects than gray image in terms of visual perception, and the edge information of color images is more abundant than in gray images. Ideally, when removing the additive noise from an image, as many of the important features as possible should be retained. The denoising of color images often results in the loss of some edge and texture information, making the image blurred and creating a poor visual effect.Denoising methods of color image commonly, Wiener filter and Gaussian filter denoising, have edge blurred situation. Bilateral filtering [1] is the most intuitive nonlinear smoothing filter, although it suffers from the gradient inversion effect, which uses a histogram-based approximation to calculate the weight, and it is computationally complex. Recently, Zhang et al. [2] develop an improved bilateral filter based framework which is capable of effectively removing universal noise. Bilateral filter takes spatial information and grayscale similarity into account and achieves both denoising and edge-preserving. Bilateral filter preserves too much high-frequency information but, however, does not denoise the high-frequency noise in color images. Thus, bilateral filter has better denoising effect for low-frequency noise merely. Sometimes, bilateral filter suffers from gradient reverse. The reason is that when an edge pixel has few similar pixels around it, the Gaussian weighted average is unstable. In this paper, proposed method based on local linear model has good edge-preserving smoothing properties like bilateral filter, but it does not suffer from the gradient reverse.Wavelet threshold denoising [3–8] is a simple and effective denoising method. This technique effectively involves the decomposition of a signal into a set of independent, spatially oriented frequency channels. The discrete wavelet threshold [9] can be used to decompose the original image into a sequence of images of different spatial resolutions. Dong and Ding [10] proposed a method that can always achieve better performance with lower computation cost and fewer decomposition scales than a high-frequency denoising method. Elyasi and Zermchi [11] proposed several adaptive wavelet denoising methods: Bayes Shrink, Modified Bayes Shrink, and Normal Shrink.In recent years, many algorithms have improved and studied the wavelet threshold denoising. Like, Bhandari et al. [12] developed an optimized adaptive thresholding function which selects the appropriate threshold values to separate noise from the actual image and preserve edge details. In this paper, a new adaptive wavelet shrink denoising algorithm is proposed. Compared with other threshold algorithms, the proposed approach improves the denoising performance and has lower complexity than existing adjacent pixels methods [13, 14].In the process of color image denoising, we compared the proposed method with the algorithms mentioned above (bilateral filter, Wiener filter, Gaussian filter, and wavelet threshold methods). Proposed method achieves superior color image denoising to these conventional algorithms. The reason is that classic algorithms could suppress the Gaussian noise effectively, but, at the same time, these methods fail to maintain the quality of denoised color images (like, texture) and may blur edges in the image. To address these short comings, this paper proposes a method based on image structure using adaptive wavelet threshold and guided filter to maintain edges when denoising. It makes edges continuous and the color of image more brightly. Because guided filter using a local linear model to enhance the image, the edge details remain. In particular, the details in color image, like texture, are more abundant and saturation is more greater.On this basis, this paper presents a new color image denoising method based on the adaptive wavelet threshold shrinkage algorithm combined with image structure-based guided filtering [15]. The method uses the discrete wavelet transform to calculate the energy near the wavelet coefficients and then uses the adaptive threshold shrinkage function to denoise the image. The threshold function depends on the energy of adjacent pixels. Further using guided filter enhances the image after denoising. Experiments show that the proposed technique enables better preservation of edge information during the denoising process.The rest of the paper is organized as follows. Section2 reviews the related work. Algorithm analysis and the structure of proposed method are presented in Section 3. Then experimental results and analysis are shown in Section 4. Section 5 concludes the paper.


## 2. Related Work

Numerous works have been proposed for image denoising. In this part, we review previous and related work about wavelet threshold algorithms and guided filter.


### 2.1. Wavelet Threshold Shrinkage Algorithm

Wavelet threshold denoising is done by Donoho in 1994, which is based on thresholding the discrete wavelet transform (DWT) of the signal. Hard threshold and soft threshold are traditional threshold algorithm. Donoho [5] proposed wavelet soft threshold denoising and the threshold VisuShrink algorithm. This method for image denoising obtains a series of wavelet coefficients from the wavelet transform and applies a threshold to determine the smaller coefficients (which correspond to noise). Denoising and an inverse wavelet transformation yield the reconstructed image with reduced noise. Hard and soft threshold functions are defined as follows.The hard threshold function is expressed in(1)Y=X,X≥λ0,X<λ.The soft threshold function on the other hand is expressed in(2)Y=sgnXX-λ,X≥λ0,X<λ,where λ is a threshold value, X is wavelet coefficients value after the DWT of images, and Y is output value using wavelet threshold shrinkage function.Normally, hard threshold function can preserve the wavelet coefficients well generated by the useful information from images, but it is discontinuous atX=λ after reconstruction. An alternative approach to hard threshold is the soft threshold, which has advantages of continuity. Soft threshold function is smooth and continuous relatively at the threshold. But sometimes, there are defects that decreased the wavelet coefficients generated by the effective signal.An appropriate thresholdλ is the most important role of discrete wavelet denoising. In the process of denoising, if the threshold λ is too small, the wavelet coefficients contain too many noise components and cannot denoise effectively. Otherwise, the threshold λ is particularly large resulting in the loss of useful components that causes distortion. Thus, new methods are proposed and some of them have been delivered to real applications.Adaptive wavelet threshold method first assigns zeroes when the wavelet coefficients are smaller than the given threshold. As the threshold increases, the number of coefficients below the threshold will increase rapidly. When the number of nonzero coefficients reaches a certain value, the threshold is further enlarged and the number of nonzero values slowly decreases; this method can remove most of the noise and improve the compression efficiency. Nasri and Nezamabadi-pour [16] proposed a new thresholding function to be further used in a new subband-adaptive thresholding neural network to improve the efficiency of the denoising procedure. Liu et al. [17] found that a wavelet denoising using neighbor coefficients and level dependency was proposed to separate spikes from background noise.


### 2.2. Guided Filter

The guided filter is based on a dual integral image architecture VLSI [18] (Very Large Scale Integration). The filtering method computes the output image based on the input guiding image, which preserves the edges of the image well; this is an accurate and fast edge-preserving filtering algorithm. He et al. [15] proposed a new explicit local linear guided filtering model, which is a fast and nonapproximate linear time algorithm. Their model senses the edges and enhances the texture detail. Gadge and Agrawal [19] used guided filtering to color images.Guided filter of image is a linear transformable filtering process, where the guidance imageI needs to be preset according to the specific application and I could be identical to the input image p. The output value at pixel i is calculated as follows:(3)qi=∑jWijIpj,where i and j are pixel indexes. Wij is filter kernel function, which defined in [15] expressed by (4)WijI=1ω2∑k:i,j∈ωk1+Ii-μkIj-μkσk2+ε,where ωk is the local window that center of k, ω is count of pixels in the local window, μk and σk2 are mean and variance of guidance image I in the window, and, finally, ε is a smoothing factor.A local linear model (3) is used in guided filter. This linear relationship ensures that output qi has the same edge information with guidance image I. Thus, guided filter has a better edge-preserving smoothing and avoids the gradient reverse. In addition, its algorithm computed efficiently and nonapproximately.


## 2.1. Wavelet Threshold Shrinkage Algorithm

Wavelet threshold denoising is done by Donoho in 1994, which is based on thresholding the discrete wavelet transform (DWT) of the signal. Hard threshold and soft threshold are traditional threshold algorithm. Donoho [5] proposed wavelet soft threshold denoising and the threshold VisuShrink algorithm. This method for image denoising obtains a series of wavelet coefficients from the wavelet transform and applies a threshold to determine the smaller coefficients (which correspond to noise). Denoising and an inverse wavelet transformation yield the reconstructed image with reduced noise. Hard and soft threshold functions are defined as follows.The hard threshold function is expressed in(1)Y=X,X≥λ0,X<λ.The soft threshold function on the other hand is expressed in(2)Y=sgnXX-λ,X≥λ0,X<λ,where λ is a threshold value, X is wavelet coefficients value after the DWT of images, and Y is output value using wavelet threshold shrinkage function.Normally, hard threshold function can preserve the wavelet coefficients well generated by the useful information from images, but it is discontinuous atX=λ after reconstruction. An alternative approach to hard threshold is the soft threshold, which has advantages of continuity. Soft threshold function is smooth and continuous relatively at the threshold. But sometimes, there are defects that decreased the wavelet coefficients generated by the effective signal.An appropriate thresholdλ is the most important role of discrete wavelet denoising. In the process of denoising, if the threshold λ is too small, the wavelet coefficients contain too many noise components and cannot denoise effectively. Otherwise, the threshold λ is particularly large resulting in the loss of useful components that causes distortion. Thus, new methods are proposed and some of them have been delivered to real applications.Adaptive wavelet threshold method first assigns zeroes when the wavelet coefficients are smaller than the given threshold. As the threshold increases, the number of coefficients below the threshold will increase rapidly. When the number of nonzero coefficients reaches a certain value, the threshold is further enlarged and the number of nonzero values slowly decreases; this method can remove most of the noise and improve the compression efficiency. Nasri and Nezamabadi-pour [16] proposed a new thresholding function to be further used in a new subband-adaptive thresholding neural network to improve the efficiency of the denoising procedure. Liu et al. [17] found that a wavelet denoising using neighbor coefficients and level dependency was proposed to separate spikes from background noise.


## 2.2. Guided Filter

The guided filter is based on a dual integral image architecture VLSI [18] (Very Large Scale Integration). The filtering method computes the output image based on the input guiding image, which preserves the edges of the image well; this is an accurate and fast edge-preserving filtering algorithm. He et al. [15] proposed a new explicit local linear guided filtering model, which is a fast and nonapproximate linear time algorithm. Their model senses the edges and enhances the texture detail. Gadge and Agrawal [19] used guided filtering to color images.Guided filter of image is a linear transformable filtering process, where the guidance imageI needs to be preset according to the specific application and I could be identical to the input image p. The output value at pixel i is calculated as follows:(3)qi=∑jWijIpj,where i and j are pixel indexes. Wij is filter kernel function, which defined in [15] expressed by (4)WijI=1ω2∑k:i,j∈ωk1+Ii-μkIj-μkσk2+ε,where ωk is the local window that center of k, ω is count of pixels in the local window, μk and σk2 are mean and variance of guidance image I in the window, and, finally, ε is a smoothing factor.A local linear model (3) is used in guided filter. This linear relationship ensures that output qi has the same edge information with guidance image I. Thus, guided filter has a better edge-preserving smoothing and avoids the gradient reverse. In addition, its algorithm computed efficiently and nonapproximately.


## 3. Proposed Algorithm

In this paper, we describe an adaptive wavelet transform method to remove noise from a color image and use the inverse discrete wavelet transform to obtain the denoised image. The guided filter is then applied for edge and texture recovery and enhancement, producing a better color image effect.


### 3.1. Overview of Method Structure

The framework of proposed method contains two main stages (Figure1). The first step is to obtain preliminary denoised image p using adaptive wavelet threshold shrinkage algorithm, which is based on image structure feature to shrinkage wavelet coefficients. The wavelet coefficients are decomposed by two-level discrete wavelet transform (DWT). The second step is further denoising and enhancing by using guided filter to the previous result p. In guided filter, the guidance image I should be preset. Setting I and p is identical and can perverse edge and texture of image.Figure 1
Illustration of the proposed method. It contains two main parts. Left part is denoising by adaptive wavelet threshold algorithm to obtain denoise imagep. Right part is using guided filter to enhance edges of image p.In the ideal case, the wavelet threshold shrinkage algorithm subtracts Gaussian noise from the image, and its denoising effect is obvious. Natural image denoising using the wavelet threshold is very effective because it can capture the energy of the converted images.Proposed denoising algorithm has the following steps in detail:(1)
Transform the noisy image into the frequency domain using DWT.(2)
Apply the adaptive wavelet threshold shrinkage algorithm to the local window on each subband and then use inverse DWT to obtain preliminary denoising imagep.(3)
Apply guided filter on imagep to obtain further denoise image q.(4)
Enhanceq and output image.


### 3.2. Adaptive Wavelet Threshold Algorithm

The discrete wavelet transform (DWT) applied to image processing has two main components: decomposition and reconstruction. We use DWT to decompose the noisy image into a sequence of images of different spatial resolutions. Two-dimensional images can be decomposed in two-degree directions, resulting in different frequency bands: LL (Low-Frequency), LH (Horizontal High-Frequency), HL (Vertical High-Frequency), and HH (Diagonal High-Frequency).In Figure2, using DWT to decompose the noisy image into a sequence of images of different frequency bands. Low-Frequency (LL) is decomposed using DWT. And decomposing it produces four different frequency subbands (LL2, HL2, LH2, and HH2) using two-level wavelet decomposition function. On the basis of these frequency subbands, the different wavelet threshold shrinkage algorithm can be used to denoise from the image.Figure 2
Two-level decomposition of the image. Obtaining Low-Frequency image (LL) from the noise image and decomposing it resulting in subbands LL2, HL2, LH2, and HH2. The adaptive wavelet shrink algorithm is applied to each subband to denoise the image.After the two-level wavelet decomposition of the image (Figure2), an adaptive wavelet transform is used to extract the structure information in the multiresolution image, and the corresponding shrinkage function is applied to the structure features of the image. In fact, the natural image structure of the wavelet coefficients in the resolution scale exhibits a certain similarity, so there is a certain degree of redundancy in the wavelet decomposition scale. For example, the wavelet coefficients of the edge region are usually concentrated together, indicating that there is a certain degree of dependency in the adjacent wavelet coefficients corresponding to the edge region.The structure information of the image can be obtained by calculating the energy of the local area in the wavelet domain. The smoother the image, the lower the energy. A threshold range is determined based on the local energy calculated by the wavelet decomposition, and a different function is used within the corresponding threshold. The specific algorithm takes the average of the square of each pixel value in the local window to calculate the energy of the center pixel of the window. The appropriate shrinkage factorα,β is then selected according to the corresponding shrink function (6).In practice, we select the local windowR∗R (i.e., R=5) using (5) to calculate the local window center pixel energy value Sj,k2 and then use (6) to calculate the local shrinkage function:(5)Sj,k2=1R2∑m=-Rm=R∑n=-Rn=Rdm,n2,(6)d^j,k=dj,k1-α∗λ2Sj,k2,ifSj,k2≥β∗λ20else,(7)σ2=MedianYi,j0.6745Yi,j=subbandHH,where λ2=(4σ2log⁡R). Equation (7) gives the noise variance σ2, and dj,k is the central pixel of the local window. If dj,k is at the boundary of the second wavelet coefficients, a boundary condition is required. In the experiments, we set α=0.1,β=0.3. Finally, the reconstructed image is denoised.This denoising algorithm uses the DWT to calculate the energy near the wavelet coefficients and then applies the adaptive wavelet threshold shrink function to denoise the image. In the experiments, we added Gaussian noise with variances ofσ2=0.01 and σ2=0.03 to the images. Adaptive wavelet threshold shrink function denoising noise and getting denoised image p. From the experimental results, it can be seen that when the noise variance is large, the image p is not very clear after denoising; in particular, the effect of texture is not obvious. Therefore, we need to enhance the image p after this processing step. Thus, the proposed technique uses the guided filter to enhance the image after denoising.


### 3.3. Guided Filter to Further Processing

Guided filtering is a spatial enhancement technique for the spatial domain, and the filtered output is a linear transformation of the localized image. The filtering algorithm uses a guiding image to process the edges of the noisy image. The guiding image can be the image itself. At this time, their structures are the same; that is, the edges of the original image are the same as the edges of the guiding image. The output pixel values take into account the statistics of the local spatial neighborhood in the guided image. Hence, using guided filtering, the output image is more structured. This can be used for image dehazing and so on. The guided filter adopts an exact linear algorithm. The algorithm is efficient and fast and is considered to be one of the fastest edge-preserving filters.For both grayscale and color images, the guided filtering algorithm haso(N) time complexity, regardless of the local window radius (r).


#### 3.3.1. Algorithm of Guided Filter

Guided Filter. The guide image can be a separate image or the original input image; when the guiding image is the original input image, the guided filter retains the edges for image reconstruction.Assume that the input image isp, the output image is q, and the guiding image is I. q and I have a local linear relationship in the window ωk centered on pixel k: (8)qi=akIi+bk,∀i∈ωk,where ak,bk are linear (constant) coefficients in the local window, and the window radius is r. Equation (8) calculates the guidance of the guiding image to be ∇q=a∇I. Therefore, the linear equation is only guaranteed if I is in the presence of an edge, and the output image q will contain edges. To determine the coefficients, we require constraints from the input image p. The output q is the input p with a number of noise components ni subtracted, that is,(9)qi=pi-ni.To minimize the difference between the output q and the input p and ensure the linearity of (8), the function E(ak,bk) is minimized in the window ωk, where ε is the regularization parameter:(10)Eak,bk=∑i∈ωkakIi+bk-pi2+εak2.In order to minimize the value of the model E(ak,bk), we can derive ak and bk, respectively, and (10) can be solved using linear regression:(11)ak=1/ω∑i∈ωkIipi-μkp¯kσk2+ε,bk=p-k-akμk,where μk and σk2 represent the mean and variance in the local window ωk, respectively; ω is the number of pixels in the window; and p-k represents the mean value in the window ωk of p. After obtaining ak and bk, in Figure 3, the output qi is(12)qi=1ω∑k∣i∈ωkakIi+bk=a-iIi+b-i,where a-i=1/ω∑k∈ωiak, b-i=1/ω∑k∈ωkbk. Convert ak and bk into weights forms, which is the general form of filtering.Figure 3
Illustration of (12). When the window ω is sliding in the image, a pixel is involved in many windows that covers pixel. For instance, windows ω1 and ω2 are different local windows that cover the same pixel i. Therefore, the output qi should average all the values of pixel i in different windows.Therefore, the guide filter algorithm proceeds as follows. Traverse the entire image via each local window, implementing the following calculation, wheref is the mean filter with local window radius r; input image is p; guidance image is I; corr is the correlation coefficient; var is the variance; ε is smoothing factor; and cov is the covariance:(13)meanI=fmeanI,rmeanp=fmeanp,rcorrI=fmeanI.∗I,rcorrIp=fmeanI.∗p,rvarI=corrI-meanI.∗meanIcovIp=covIp-meanI.∗meanpa=covIp.varI+εb=meanp-a.∗meanImeana=fmeana,rmeanb=fmeanb,rq=meana.∗I+meanb.


#### 3.3.2. Edge Preservation

WhenI=p, the guided filter becomes an edge-preserving filter. At this point, we have(14)ak=σk2σk2+ε,bk=1-akμk.Therefore, when the local window variance is large, the center pixel value remains unchanged. In smoother areas, the average value of the neighboring pixels is used as the center pixel value.


#### 3.3.3. Guided Filter for Color Image

When the guided filter is applied independently to the three color channels of the color image, (8) can be rewritten as(15)qi=akTIi+bk,∀i∈ωk,where Ii is a 3 × 1 color vector, ak is a 3 × 1 coefficient vector, and qi, bk are scalars. Thus, the color image of the guided filter is(16)ak=∑k+εU-11ω∑i∈ωkIipi-μkp-k,bk=p-k-akTμk,qi=a-iTIi+b-i, where ∑k is the 3 × 3 covariance matrix of I in ωk and U is the 3 × 3 identity matrix.Because the local linear model is more effective in the color space, the edges of gray images cannot be identified but through the color image of the guided filter it can be well-preserved. Thus, the image edges have a significant effect.


### 3.4. Image Enhancement

For images with more texture (i.e., Image 5), the above denoising method may cause some regions to appear too smooth. Therefore, it is necessary to further enhance the image texture detail. Using (17), the denoised image q is subtracted from the original noiseless image to yield the details of the loss in q. Positive number c is to control and balance the degree of its stacking:(17)q_enhanced=I-q∗c+q.The proposed algorithm uses the characteristics of the image structure. In the wavelet domain, threshold shrinkage is used to denoise the image, and then the guided filter enhances the edges of the denoised image to better reflect the texture details of the image.


## 3.1. Overview of Method Structure

The framework of proposed method contains two main stages (Figure1). The first step is to obtain preliminary denoised image p using adaptive wavelet threshold shrinkage algorithm, which is based on image structure feature to shrinkage wavelet coefficients. The wavelet coefficients are decomposed by two-level discrete wavelet transform (DWT). The second step is further denoising and enhancing by using guided filter to the previous result p. In guided filter, the guidance image I should be preset. Setting I and p is identical and can perverse edge and texture of image.Figure 1
Illustration of the proposed method. It contains two main parts. Left part is denoising by adaptive wavelet threshold algorithm to obtain denoise imagep. Right part is using guided filter to enhance edges of image p.In the ideal case, the wavelet threshold shrinkage algorithm subtracts Gaussian noise from the image, and its denoising effect is obvious. Natural image denoising using the wavelet threshold is very effective because it can capture the energy of the converted images.Proposed denoising algorithm has the following steps in detail:(1)
Transform the noisy image into the frequency domain using DWT.(2)
Apply the adaptive wavelet threshold shrinkage algorithm to the local window on each subband and then use inverse DWT to obtain preliminary denoising imagep.(3)
Apply guided filter on imagep to obtain further denoise image q.(4)
Enhanceq and output image.


## 3.2. Adaptive Wavelet Threshold Algorithm

The discrete wavelet transform (DWT) applied to image processing has two main components: decomposition and reconstruction. We use DWT to decompose the noisy image into a sequence of images of different spatial resolutions. Two-dimensional images can be decomposed in two-degree directions, resulting in different frequency bands: LL (Low-Frequency), LH (Horizontal High-Frequency), HL (Vertical High-Frequency), and HH (Diagonal High-Frequency).In Figure2, using DWT to decompose the noisy image into a sequence of images of different frequency bands. Low-Frequency (LL) is decomposed using DWT. And decomposing it produces four different frequency subbands (LL2, HL2, LH2, and HH2) using two-level wavelet decomposition function. On the basis of these frequency subbands, the different wavelet threshold shrinkage algorithm can be used to denoise from the image.Figure 2
Two-level decomposition of the image. Obtaining Low-Frequency image (LL) from the noise image and decomposing it resulting in subbands LL2, HL2, LH2, and HH2. The adaptive wavelet shrink algorithm is applied to each subband to denoise the image.After the two-level wavelet decomposition of the image (Figure2), an adaptive wavelet transform is used to extract the structure information in the multiresolution image, and the corresponding shrinkage function is applied to the structure features of the image. In fact, the natural image structure of the wavelet coefficients in the resolution scale exhibits a certain similarity, so there is a certain degree of redundancy in the wavelet decomposition scale. For example, the wavelet coefficients of the edge region are usually concentrated together, indicating that there is a certain degree of dependency in the adjacent wavelet coefficients corresponding to the edge region.The structure information of the image can be obtained by calculating the energy of the local area in the wavelet domain. The smoother the image, the lower the energy. A threshold range is determined based on the local energy calculated by the wavelet decomposition, and a different function is used within the corresponding threshold. The specific algorithm takes the average of the square of each pixel value in the local window to calculate the energy of the center pixel of the window. The appropriate shrinkage factorα,β is then selected according to the corresponding shrink function (6).In practice, we select the local windowR∗R (i.e., R=5) using (5) to calculate the local window center pixel energy value Sj,k2 and then use (6) to calculate the local shrinkage function:(5)Sj,k2=1R2∑m=-Rm=R∑n=-Rn=Rdm,n2,(6)d^j,k=dj,k1-α∗λ2Sj,k2,ifSj,k2≥β∗λ20else,(7)σ2=MedianYi,j0.6745Yi,j=subbandHH,where λ2=(4σ2log⁡R). Equation (7) gives the noise variance σ2, and dj,k is the central pixel of the local window. If dj,k is at the boundary of the second wavelet coefficients, a boundary condition is required. In the experiments, we set α=0.1,β=0.3. Finally, the reconstructed image is denoised.This denoising algorithm uses the DWT to calculate the energy near the wavelet coefficients and then applies the adaptive wavelet threshold shrink function to denoise the image. In the experiments, we added Gaussian noise with variances ofσ2=0.01 and σ2=0.03 to the images. Adaptive wavelet threshold shrink function denoising noise and getting denoised image p. From the experimental results, it can be seen that when the noise variance is large, the image p is not very clear after denoising; in particular, the effect of texture is not obvious. Therefore, we need to enhance the image p after this processing step. Thus, the proposed technique uses the guided filter to enhance the image after denoising.


## 3.3. Guided Filter to Further Processing

Guided filtering is a spatial enhancement technique for the spatial domain, and the filtered output is a linear transformation of the localized image. The filtering algorithm uses a guiding image to process the edges of the noisy image. The guiding image can be the image itself. At this time, their structures are the same; that is, the edges of the original image are the same as the edges of the guiding image. The output pixel values take into account the statistics of the local spatial neighborhood in the guided image. Hence, using guided filtering, the output image is more structured. This can be used for image dehazing and so on. The guided filter adopts an exact linear algorithm. The algorithm is efficient and fast and is considered to be one of the fastest edge-preserving filters.For both grayscale and color images, the guided filtering algorithm haso(N) time complexity, regardless of the local window radius (r).


### 3.3.1. Algorithm of Guided Filter

Guided Filter. The guide image can be a separate image or the original input image; when the guiding image is the original input image, the guided filter retains the edges for image reconstruction.Assume that the input image isp, the output image is q, and the guiding image is I. q and I have a local linear relationship in the window ωk centered on pixel k: (8)qi=akIi+bk,∀i∈ωk,where ak,bk are linear (constant) coefficients in the local window, and the window radius is r. Equation (8) calculates the guidance of the guiding image to be ∇q=a∇I. Therefore, the linear equation is only guaranteed if I is in the presence of an edge, and the output image q will contain edges. To determine the coefficients, we require constraints from the input image p. The output q is the input p with a number of noise components ni subtracted, that is,(9)qi=pi-ni.To minimize the difference between the output q and the input p and ensure the linearity of (8), the function E(ak,bk) is minimized in the window ωk, where ε is the regularization parameter:(10)Eak,bk=∑i∈ωkakIi+bk-pi2+εak2.In order to minimize the value of the model E(ak,bk), we can derive ak and bk, respectively, and (10) can be solved using linear regression:(11)ak=1/ω∑i∈ωkIipi-μkp¯kσk2+ε,bk=p-k-akμk,where μk and σk2 represent the mean and variance in the local window ωk, respectively; ω is the number of pixels in the window; and p-k represents the mean value in the window ωk of p. After obtaining ak and bk, in Figure 3, the output qi is(12)qi=1ω∑k∣i∈ωkakIi+bk=a-iIi+b-i,where a-i=1/ω∑k∈ωiak, b-i=1/ω∑k∈ωkbk. Convert ak and bk into weights forms, which is the general form of filtering.Figure 3
Illustration of (12). When the window ω is sliding in the image, a pixel is involved in many windows that covers pixel. For instance, windows ω1 and ω2 are different local windows that cover the same pixel i. Therefore, the output qi should average all the values of pixel i in different windows.Therefore, the guide filter algorithm proceeds as follows. Traverse the entire image via each local window, implementing the following calculation, wheref is the mean filter with local window radius r; input image is p; guidance image is I; corr is the correlation coefficient; var is the variance; ε is smoothing factor; and cov is the covariance:(13)meanI=fmeanI,rmeanp=fmeanp,rcorrI=fmeanI.∗I,rcorrIp=fmeanI.∗p,rvarI=corrI-meanI.∗meanIcovIp=covIp-meanI.∗meanpa=covIp.varI+εb=meanp-a.∗meanImeana=fmeana,rmeanb=fmeanb,rq=meana.∗I+meanb.


### 3.3.2. Edge Preservation

WhenI=p, the guided filter becomes an edge-preserving filter. At this point, we have(14)ak=σk2σk2+ε,bk=1-akμk.Therefore, when the local window variance is large, the center pixel value remains unchanged. In smoother areas, the average value of the neighboring pixels is used as the center pixel value.


### 3.3.3. Guided Filter for Color Image

When the guided filter is applied independently to the three color channels of the color image, (8) can be rewritten as(15)qi=akTIi+bk,∀i∈ωk,where Ii is a 3 × 1 color vector, ak is a 3 × 1 coefficient vector, and qi, bk are scalars. Thus, the color image of the guided filter is(16)ak=∑k+εU-11ω∑i∈ωkIipi-μkp-k,bk=p-k-akTμk,qi=a-iTIi+b-i, where ∑k is the 3 × 3 covariance matrix of I in ωk and U is the 3 × 3 identity matrix.Because the local linear model is more effective in the color space, the edges of gray images cannot be identified but through the color image of the guided filter it can be well-preserved. Thus, the image edges have a significant effect.


## 3.3.1. Algorithm of Guided Filter

Guided Filter. The guide image can be a separate image or the original input image; when the guiding image is the original input image, the guided filter retains the edges for image reconstruction.Assume that the input image isp, the output image is q, and the guiding image is I. q and I have a local linear relationship in the window ωk centered on pixel k: (8)qi=akIi+bk,∀i∈ωk,where ak,bk are linear (constant) coefficients in the local window, and the window radius is r. Equation (8) calculates the guidance of the guiding image to be ∇q=a∇I. Therefore, the linear equation is only guaranteed if I is in the presence of an edge, and the output image q will contain edges. To determine the coefficients, we require constraints from the input image p. The output q is the input p with a number of noise components ni subtracted, that is,(9)qi=pi-ni.To minimize the difference between the output q and the input p and ensure the linearity of (8), the function E(ak,bk) is minimized in the window ωk, where ε is the regularization parameter:(10)Eak,bk=∑i∈ωkakIi+bk-pi2+εak2.In order to minimize the value of the model E(ak,bk), we can derive ak and bk, respectively, and (10) can be solved using linear regression:(11)ak=1/ω∑i∈ωkIipi-μkp¯kσk2+ε,bk=p-k-akμk,where μk and σk2 represent the mean and variance in the local window ωk, respectively; ω is the number of pixels in the window; and p-k represents the mean value in the window ωk of p. After obtaining ak and bk, in Figure 3, the output qi is(12)qi=1ω∑k∣i∈ωkakIi+bk=a-iIi+b-i,where a-i=1/ω∑k∈ωiak, b-i=1/ω∑k∈ωkbk. Convert ak and bk into weights forms, which is the general form of filtering.Figure 3
Illustration of (12). When the window ω is sliding in the image, a pixel is involved in many windows that covers pixel. For instance, windows ω1 and ω2 are different local windows that cover the same pixel i. Therefore, the output qi should average all the values of pixel i in different windows.Therefore, the guide filter algorithm proceeds as follows. Traverse the entire image via each local window, implementing the following calculation, wheref is the mean filter with local window radius r; input image is p; guidance image is I; corr is the correlation coefficient; var is the variance; ε is smoothing factor; and cov is the covariance:(13)meanI=fmeanI,rmeanp=fmeanp,rcorrI=fmeanI.∗I,rcorrIp=fmeanI.∗p,rvarI=corrI-meanI.∗meanIcovIp=covIp-meanI.∗meanpa=covIp.varI+εb=meanp-a.∗meanImeana=fmeana,rmeanb=fmeanb,rq=meana.∗I+meanb.


## 3.3.2. Edge Preservation

WhenI=p, the guided filter becomes an edge-preserving filter. At this point, we have(14)ak=σk2σk2+ε,bk=1-akμk.Therefore, when the local window variance is large, the center pixel value remains unchanged. In smoother areas, the average value of the neighboring pixels is used as the center pixel value.


## 3.3.3. Guided Filter for Color Image

When the guided filter is applied independently to the three color channels of the color image, (8) can be rewritten as(15)qi=akTIi+bk,∀i∈ωk,where Ii is a 3 × 1 color vector, ak is a 3 × 1 coefficient vector, and qi, bk are scalars. Thus, the color image of the guided filter is(16)ak=∑k+εU-11ω∑i∈ωkIipi-μkp-k,bk=p-k-akTμk,qi=a-iTIi+b-i, where ∑k is the 3 × 3 covariance matrix of I in ωk and U is the 3 × 3 identity matrix.Because the local linear model is more effective in the color space, the edges of gray images cannot be identified but through the color image of the guided filter it can be well-preserved. Thus, the image edges have a significant effect.


## 3.4. Image Enhancement

For images with more texture (i.e., Image 5), the above denoising method may cause some regions to appear too smooth. Therefore, it is necessary to further enhance the image texture detail. Using (17), the denoised image q is subtracted from the original noiseless image to yield the details of the loss in q. Positive number c is to control and balance the degree of its stacking:(17)q_enhanced=I-q∗c+q.The proposed algorithm uses the characteristics of the image structure. In the wavelet domain, threshold shrinkage is used to denoise the image, and then the guided filter enhances the edges of the denoised image to better reflect the texture details of the image.


## 4. Experimental Results and Analysis

We conducted a series of experiments using MATLAB R2015b and images in Figure4. Images in Figure 4, Image 9, Image 10, Image 11, and Image 12, are rich in texture. First, variance of 0.01 and 0.03 Gaussian noise was added to the color images in Figure 4. This produced the noisy images shown in Figures 5(a), 6(a), 7(a), 8(a), 9(a), 10(a), 11(a), and 12(a). The proposed method based on image characteristics and the adaptive wavelet threshold shrinkage algorithm was then applied to obtain the denoised images p shown in Figures 5(c), 6(c), 7(c), 8(c), 9(c), 10(c), 11(c), and 12(c). We used the “sym4” two-level wavelet decomposition function to decompose the noisy images, with a local window R=5∗5, β=0.3, and α=0.1 to control the degree of shrinkage in the wavelet coefficients.Figure 4
Test image: Images 1–12 (from left to right, top to bottom).Figure 5
Image 1: comparison of various experimental results under noise varianceσ2=0.01.
(a)
σ
2
=
0.01
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 6
Image 1: comparison of various experimental results under noise varianceσ2=0.03.
(a)
σ
2
=
0.03
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 7
Image 5: comparison of various experimental results under noise varianceσ2=0.01.
(a)
σ
2
=
0.01
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 8
Image 5: comparison of various experimental results under noise varianceσ2=0.03.
(a)
σ
2
=
0.03
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 9
Image 9: comparison of various experimental results under noise varianceσ2=0.01.
(a)
σ
2
=
0.01
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 10
Image 9: comparison of various experimental results under noise varianceσ2=0.03.
(a)
σ
2
=
0.03
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 11
Image 10: comparison of various experimental results under noise varianceσ2=0.01.
(a)
σ
2
=
0.01
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 12
Image 10: comparison of various experimental results under noise varianceσ2=0.03.
(a)
σ
2
=
0.03
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodThe guided filter was used to denoise the imagep with the guiding image I set to the original image without noise. This was intended to give the image a better edge effect after denoising. The local window radius was set to r=8 and ε=0.022. The image p was denoised after the adaptive wavelet threshold algorithm. In image p, the r,g,b channels were individually subjected to the guide filter. The texture and edge information of the images were enhanced and we obtained the output q. The parameter c in (17) was found to give better texture effects and undistorted images when c=1.5. The final results q_enhanced images are presented in Figures 5(f), 6(f), 7(f), 8(f), 9(f), 10(f), 11(f), and 12(f). From Figures 9(f), 10(f), 11(f), and 12(f), it can be concluded that the texture and the edge of images had a good performance in proposed method.The peak signal-to-noise ratio(PSNR) of the proposed method is presented in Table 1. These PSNRs indicate that the method proposed in this paper is superior to bilateral filtering, the adaptive wavelet threshold algorithm, nonlocal means [20] algorithm, and BM3D [21] method. When the noise level increases, the denoising effect of all five methods decreases, but the proposed method gives better performance than the other four.Table 1
PSNR of the proposed method, bilateral filtering, and adaptive wavelet.
Noise variance
0.01
0.03
0.01
0.03
0.01
0.03
Image 1 (256∗256)
Image 2 (512∗512)
Image 3 (256∗256)
Adaptive wavelet
26.7048
25.4507
28.0801
26.4821
27.7967
26.1699
Bilateral filtering
22.5751
22.0167
23.1551
22.6118
22.7560
22.1802
Nonlocal means
29.9765
27.4871
30.1415
27.6777
30.1910
27.6823
BM3D
28.9235
26.9276
30.4215
27.8901
30.9457
28.0957
Proposed method
39.5634
35.3129
41.5647
36.0267
40.8101
35.5930
Image 4 (256∗256)
Image 5 (256∗256)
Image 6 (512∗512)
Adaptive wavelet
25.2375
24.2724
23.4663
22.7332
25.6576
24.5766
Bilateral filtering
22.6074
21.9415
22.1076
21.5494
22.3016
21.7254
Nonlocal means
26.6512
25.3287
25.3588
24.3120
27.8813
26.2105
BM3D
25.5157
24.4968
24.0394
23.2556
28.0621
26.3334
Proposed method
37.0265
34.1344
33.8535
32.1364
36.8294
33.9588
Image 7 (512∗512)
Image 8 (512∗512)
Image 9 (200∗150)
Adaptive wavelet
27.5706
25.9130
29.0039
26.9908
21.4746
20.8466
Bilateral filtering
23.2116
22.4080
23.1373
22.4268
21.4834
21.0023
Nonlocal means
29.4155
27.0736
31.3181
28.2534
23.7273
23.0137
BM3D
29.1443
26.9120
32.0590
28.6197
21.7645
21.2712
Proposed method
39.1414
34.8926
41.2256
35.7943
31.4041
30.0693
Image 10 (200∗150)
Image 11 (187∗171)
Image 12 (187∗171)
Adaptive wavelet
29.4247
27.5268
26.7443
25.4201
15.9075
16.9781
Bilateral filtering
23.6728
23.0581
22.2984
21.7973
22.7751
22.6673
Nonlocal means
30.3106
27.9794
28.7439
26.6227
17.4105
17.2673
BM3D
30.8146
28.3780
31.8744
28.4922
31.0366
30.1990
Proposed method
40.2191
35.9371
38.7096
35.0295
24.4256
25.7756ThePSNR is calculated as follows:(18)PSNR=10∗log102552MSE,MSE=13mser+mseg+mseb,msek=1m∗n∑i=1m∑j=1nIi,j-qi,j2,k=r,g,b,where the input image is I and the output image is q_enhanced. The mean square error(MSE) is the average mean square error of the three channels (r,g,b) in the color image.Wells [22] proposed a quality factor to evaluate the edges of an image after denoising. This quality factor (Pratt’s figure of merit) takes into account three kinds of error: the loss of the effective edge, the edge of the positioning error, and noise misjudged as the edge. Pratt’s figure of merit provides a quantitative evaluation of image edges and can be used to compare the edges in the denoised image and the original image. From Figures 13 and 14, it is obvious that there are differences between the texture parts. Pratt’s figure of merit was measured in four images. The results in Figure 15 confirm that the edge quality factor (red curve) of the proposed method is higher than that of the other four methods for different degrees of noise variance. Thus, our method achieves better edge effects.Figure 13
Image 1: edge comparison of various experimental results under noise varianceσ2=0.03.
(a)
Image 1 edge
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 14
Image 5: edge comparison of various experimental results under noise varianceσ2=0.01.
(a)
Image 5 edge
(b)
Bilateral filtering
(c)
Adaptive wavelet
(d)
Nonlocal means
(e)
BM3D
(f)
Proposed methodFigure 15
Pratt’s figure of merit.From a subjective point of view, we find that not only can the proposed method preserve edge better, it also reduces noise well when compared with the other four methods. From Figures5–12, the result images (f) using proposed method look clearer than the others because we use a guided filter to filter the image and eliminate noise. Moreover, in Figures 13 and 14, the edge of the result image that uses the proposed method is smooth and coherent, which greatly helps to enhance edge.To objectively evaluate the results, we use the Pratt’s figure of merit and PSNR for image quality evaluation. Pratt’s figure of merit results are listed in Figure15. y-axis is the Pratt factor results and x-axis is noise variance. The curves showed that Pratt factor decreases when the noise variance increases, but proposed method (red curves) is much higher than others. Curves results suggested that edge of image using proposed method is effective and abundant. Table 1 is result of PSNR. The proposed method is superior to the other four methods with respect to image processing.From the data in Table1 and the quality factor curves in Figure 15, we can conclude that the proposed method is superior to bilateral filtering, the adaptive wavelet threshold denoising algorithm, nonlocal means algorithm, and BM3D algorithm on color image denoising. From a visual point of view, the proposed method not only gives a good denoising effect but also achieves better edge retention.


## 5. Conclusion

In this paper, a new denoising method based on the adaptive wavelet threshold denoising algorithm and edge-guided filtering has been proposed. The image denoising is performed according to the local structure of the image. In comparative experiments against bilateral filtering, the adaptive wavelet denoising method, nonlocal means algorithm, and BM3D algorithm, the proposed method exhibited the best denoising and edge preservation performance. The proposed approach removes Gaussian noise in the frequency domain and then uses linear guided filtering to further enhance the image recovery, resulting in better denoising and edge effects. As color images display more detailed textures, this filtering overcomes the gradient inversion effect in the edge regions. As the linear model (see (8)) is a block-unsupervised learning method, it can be combined with other models to obtain new denoising techniques. This will be the focus of future research and exploration on color image denoising.



---

*Source: 5835020-2017-11-06.xml*