Open Access

A Laplacian based image filtering using switching noise detector

  • Ali Ranjbaran1Email author,
  • Anwar Hasni Abu Hassan1,
  • Mahboobe Jafarpour1 and
  • Bahar Ranjbaran1

Received: 23 December 2014

Accepted: 22 January 2015

Published: 8 March 2015


This paper presents a Laplacian-based image filtering method. Using a local noise estimator function in an energy functional minimizing scheme we show that Laplacian that has been known as an edge detection function can be used for noise removal applications. The algorithm can be implemented on a 3x3 window and easily tuned by number of iterations. Image denoising is simplified to the reduction of the pixels value with their related Laplacian value weighted by local noise estimator. The only parameter which controls smoothness is the number of iterations. Noise reduction quality of the introduced method is evaluated and compared with some classic algorithms like Wiener and Total Variation based filters for Gaussian noise. And also the method compared with the state-of-the-art method BM3D for some images. The algorithm appears to be easy, fast and comparable with many classic denoising algorithms for Gaussian noise.


Local noise estimator Denoising Total variation Energy functional Laplacian


Denoising is one of the most important issues in image processing. The most popular noise removal methods are Adaptive Median Filtering (AMF), Total Variation (TV) based algorithms, Kernel based methods, Bilateral and Guided filtering and recently BM3D state-of-the-art in natural image denoising. In this work, we introduce a noise removal approach using a local noise estimator. We use the noise estimator in a minimization energy functional scheme. We obtain an iterative image denoising process using Laplacian. Denoising can be seen as adding values of pixels with their relative Laplacian weighted by local noise estimator.

Section 2 is related work. Section 3 represents our idea for denoising. We show how we can define a noise estimator using the sign of change in intensity of pixels in a 3x3 window. Using local noise estimator modified by Gaussian weight, we define an energy functional, drive the final equation and use it in an iterative denoising process. We show that although Laplacian is known as edge detector, it can be used for noise removal purposes. The algorithm is implemented in section 4. In section 5, results are shown and described. Moreover, figures of the denoising method are shown in comparison with Wiener, ROF and BM3D filters based on TV value and visual performance.

Related work

A Total Variation based noise removal method (ROF) (Rudin et al. 1992) defines an energy functional that preserves edges of the image and smoothes Gaussian noisy area, based on the total variation norm minimizer. The TV regularization technique is a suitable method that can be extended to different noisy conditions such as Laplace and Poisson (Chan and Esedo Lu 2005; Li et al. 1994). The Split Bregman method (Goldstein and Osher 2008) is fast, reliable and extendable to different models of noise distribution. Split Bregman is a basic and effective tool in solving many functional-based problems such as Compressed Sensing (CS) (Candès et al. 2006). In recent years, the usage of kernel-based techniques in image denoising has developed the quality of noise removal results. The image used in kernel functioning is called the guidance image. One of the most popular approaches using the guidance image is bilateral filter (Petschnigg et al. 2004). Other important kernel-based methods are Data-adaptive kernel regression (Takeda et al. 2007), Non-Local Means (Buades et al. 2005) and Optimal Spatial Adaptation (Kervrann et al. 2006). Another novel state of the art method was recently introduced as guided filter (He et al. 2010). The US patent 6229578 “Edge Detection Based Noise Removal Algorithm” (Acharya et al. 2001) is a denoising method based on using edge detector. This method removes noise by distinguishing between edge and non-edge pixels and applying a first noise removal technique to pixels classified as non-edge and a second noise removal technique to pixels classified as edge pixels. BM3D is a well-engineered algorithm which represents the current state-of-the-art method for denoising images corrupted by Additive White Gaussian Noise (AWGN) (Dabov et al. 2007; Dabov et al. 2006; Dabov et al. 2008; Dabov et al. 2009; Chen and Wu 2010). In another strategy, denoised image is considered as a linear combination of the original image and its average when the coefficients are determined by an edge detector (Ranjbaran et al. 2013).


Our methodology is based on using a local noise estimator in an energy functional minimizing scheme. Here we start with explaining our idea to define a local noise estimator. Consider Figure 1 where u(x, y) is pixel intensity. A noise in x direction is estimated when the sign of the change of the image intensity for two adjacent pixels is in opposite direction. Taking two x direction gradient components g x and g x + Δx we write:
Figure 1

Two ideal noisy pixels.

$$ {g}_x=\frac{u\left(x,y\right)-u\left(x-\varDelta x,y\right)}{\varDelta x}\kern3.5em {g}_{x+\Delta x}=\frac{u\left(x+\Delta x,y\right)-u\left(x,y\right)}{\varDelta x} $$
A noise is detected when g x  < 0, g x + Δx  > 0 or g x  > 0, g x + Δx  < 0. Generally we have:
$$ -{g}_x\ {g}_{x+\Delta x}>0 $$
Using Heaviside function H the noise detector in x direction can be defined as:
$$ SW{N}_x=H\left(-{g}_x\ {g}_{x+\Delta x}\right) $$
Noise appears in two conditions in an image, first as ideal noise, shown in Figure 1 and second as correlated noise (Figure 2). To distinguish these two cases we need to assign a weight to the detected location. Because SWN x acts as a switch its value is between zero and one. For ideal noisy pixels in the image plane, independent of the noise intensity, the value of weight should be one.
Figure 2

Pixels include noise and edge.

For the cases where noise is added to an edge as shown in Figure 2 the weight should be lower than one. To find a measure of the weight we consider that for ideal case |u(x + Δx, y) − u(x − Δx, y)| = 0 independent of noise intensity, but for non-ideal noise this difference is not zero. Then we can use a Gaussian weighting for the detected noise as the following equation:
$$ W{N}_x={e}^{-{\left({g}_x+{g}_{x+\Delta x}\right)}^2} $$
$$ {g}_x+{g}_{x+\Delta x}=\frac{u\left(x+\varDelta x,y\right)-u\left(x-\varDelta x,y\right)}{\varDelta x} $$
As noise is added to the image in two directions we should drive the similar equations for y components. By using similar notations we find the final switching noise estimator as:
$$ SWN=H\left(-{g}_x\ {g}_{x+\Delta x}\right)H\left(-{g}_y\ {g}_{y+\Delta y}\right){e}^{-{\left({g}_x+{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y+{g}_{y+\Delta y}\right)}^2} $$
To find a denoising way using SWN we define a measure of noise intensity in the image plane. Since SWN ≥ 0 the intensity of the noise in the noisy image can be defined as:
$$ {\displaystyle {\displaystyle \iint }H\left(-{g}_x\ {g}_{x+\Delta x}\right)H\left(-{g}_y\ {g}_{y+\Delta y}\right){e}^{-{\left({g}_x+{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y+{g}_{y+\Delta y}\right)}^2}} $$
To reduce noise, we define the following energy functional and try to minimize it:
$$ J={\displaystyle \iint }{\left(u-{u}_0\right)}^2+\lambda {\displaystyle \iint }H\left(-{g}_x\ {g}_{x+\Delta x}\right)H\left(-{g}_y\ {g}_{y+\Delta y}\right){e}^{-{\left({g}_x+{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y+{g}_{y+\Delta y}\right)}^2} $$
where u and u 0 are denoised and noisy images respectively and the first part is regularization term. The energy functional is minimized in Appendix A. Although there are some techniques for computing u by Equ. 47, this way is a bit sophisticated and difficult to implement. To find a more simple equation we add λ f(u 0) to the two sides of the equation and write:
$$ {u}_0+\lambda\ f\left({u}_0\right)=u+\lambda \left(f\left({u}_0\right)-f(u)\right) $$
Based on SWN operation and iteratively computing f(u 0) and f(u) in the locations classified as noise, we approximate f(u 0) = f(u). Then the final equation we used in our implementation is:
$$ u={u}_0+\lambda\ f\left({u}_0\right) $$
This relation can be interpreted as follows: Because u is disturbed by f(u) and creates noisy image u 0 (Equ. 47), a similar process can restore u from u 0 (Equ. 9). By decreasing noise after some cycles of iteration f(u 0) goes to a small value. Equ. 47 presents a noise cancellation method based on using Laplacian value. The algorithm decreases the noise by adding the pixels value with Laplacian that weighted by SWN. Laplacian has been known as a common second-order edge detector but it has considerable value in noisy condition. Block diagram of the method is demonstrated in Figure 3.
Figure 3

Block diagram of the denoising method.

Adding the intensity of pixels with the relative Laplacian is an averaging process. In an iterative process we can generally consider the evolution equation as:
$$ u\left(t+\Delta t\right)=u(t)+\left(\lambda\ SWN\kern0.5em {\nabla}^2u\ \right)\Delta t $$
where Δt is the evolution timing step. For the cases that SWN = 1 the evolution equation is:
$$ u\left(t+\Delta t\right)=\left(1-\lambda \right)u(t) + \lambda\ \left(\frac{u\left(\mathrm{t}-\Delta t\right)+u\left(\mathrm{t}+\Delta t\right)}{2}\ \right)\kern0.5em \Delta t $$
Then we have the following first order differential equation:
$$ \dot{u}+\lambda u(t) = \lambda\ \overline{u} $$
When \( \overline{u}=\frac{u\left(\mathrm{t}-\Delta t\right)+u\left(\mathrm{t}+\Delta t\right)}{2} \) is the average value of u. The timing response is:
$$ u(t) = \overline{u}+\left({u}_0-\overline{u}\right)\ {e}^{-\lambda t}\kern2.75em t\ge 0 $$
where λ is the time constant. For λ ≥ 0 the denoised image u exponentially approaches to it steady state value ū in the locations where SWN is high. To find the constraints on λ we note that because 0 ≤ u ≤ 1 and − 1 ≤ f(u 0) ≤ 1, we have two constrains on λ as:
$$ -{u}_0\le \lambda \le 1-{u}_{0\kern0.75em }\kern3.25em -\left(1-{u}_0\right)\le \lambda \le {u}_0 $$
As 0 ≤ λ ≤ 1 − u 0 and we choose ≥ 0, maximum value for λ is:
$$ {\lambda}_{max}=1 $$

It is predictable that in implementing the algorithm by large number of iterations λ must be a positive small value. In real condition SWN is not constant and reduced during the evolution.


We have implemented our method in Matlab for Gaussian noise and evaluated it on different images. For implementation the Heaviside function is approximated by inverse tangent function:
$$ H\left(-{g}_x\ {g}_{x+\Delta x}\right)H\left(-{g}_y\ {g}_{y+\Delta y}\right)\approx \frac{\frac{\pi }{2}+ta{n}^{-1}\left(-C{g}_x{g}_{x+\Delta x}\right)}{\pi}\kern0.5em \frac{\frac{\pi }{2}+ta{n}^{-1}\left(-C{g}_y{g}_{y+\Delta y}\right)}{\pi } $$
According to Equ.12 λ controls timing response and the value is between 0 and 1. So choosing the middle value can be suitable. Based on experimental results C = 3 is found as an appropriate value for noisy cases. We use a 3x3 window for simplicity and fast computing. The method is implemented by 10 numbers of iteration. The algorithm of implementation can be shown as the following steps:
  1. 1.

    Setting parameters : window size 3×3, λ = 0.5

  2. 2.

    Reading image u 0

  3. 3.

    Adding zero mean Gaussian Noise (imnoise code)

  4. 4.
    Computing SWN for current pixel
    $$ SWN=\frac{\frac{\pi }{2}+ta{n}^{-1}\left(-3{g}_x{g}_{x+\Delta x}\right)}{\pi}\kern0.5em \frac{\frac{\pi }{2}+ta{n}^{-1}\left(-3{g}_y{g}_{y+\Delta y}\right)}{\pi }\ {e}^{-{\left({g}_x+{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y+{g}_{y+\Delta y}\right)}^2} $$
  5. 5.
    Computing Laplacian for current pixel
    $$ {\nabla}^2u = \frac{u\left(x+\Delta x,y\right)+u\left(x-\Delta x,y\right)-2u\left(x,y\right)\kern0.5em }{4}+\frac{u\left(x,y+\Delta y\right)+u\left(x,y-\Delta y\right)-2u\left(x,y\right)\kern0.5em }{4} $$
  6. 6.

    Updating u = u 0 + λ SWN2 u 0 for the current pixel

  7. 7.

    Going to step 4 and continuing

  8. 8.

    Finishing when the whole of the image is scanned for ten times.


Results and discussions

We implemented our method in two noisy conditions (0.005 and 0.1 noise variance using imnoise matlab code for Gaussian noise) and compared it with ROF model using evolve2D code with 10 iterations and Wiener filter using wiener2 (‘image’, [3 3]) matlab code. f(u 0) can be interpreted as a noise intensity pattern in the image plane. Similar to ROF model in which \( \left\Vert div\left(\frac{\nabla {u}_0}{\left|\nabla {u}_0\right|}\right)\right\Vert \) can be used as a measure of noise variance (Dabov et al. 2007), ‖f(u 0)‖ is related to noise intensity. An example is shown in Figure 4. The results including noisy and denoised images are demonstrated in Figure 5 for Boat, Figure 6 for Man and Figure 7 for House. Figures 8, 9 and 10 show the results for Cameraman, Lena and Barbara respectively. TV for noisy and denoised images is shown in Tables 1 and 2. TV of the denoised image is totally comparable with ROF model. The computation time of our model is equal to ROF method with 10 iterations. f(u 0) has a decreasing behavior during the filtring time. At start, f(u 0) is high in noisy pixels identified by SWN. Because image intensity is reduced by Laplacian value, f(u 0) tends to zero after some iteration. An example of such response is shown if Figure 11. Number of iterations is the only parameter that controls smoothness and running time. Large number of iteration makes the image blurry. Since f(u 0) goes to zero after some iteration, we can implement the algorithm adaptively until f(u 0) reaches a small value. This value should be estimated experimentally to make the algorithm applicable for every noisy condition. We also compared our method with BM3D technique for Boat, House and Cameraman in two SNR 25 and 75. The results are shown in Figures 12, 13, 14, 15, 16, 17. The denoising technique used in this work can be generalized to other applications for reducing any feature of the image (F(u)) in other image processing tasks such as deblurring. A proposing framework can be written as the following energy functional:
Figure 4

f ( u 0 ) for Cameraman with 0.1 noise variance.

Figure 5

Results of ROF, wiener filter and our denoising method for Boat.

Figure 6

Results of ROF, wiener filter and our denoising method for Man.

Figure 7

Results of ROF, wiener filter and our denoising method for House.

Figure 8

Results of ROF, wiener filter and our denoising method for Cameraman.

Figure 9

Results of ROF, wiener filter and our denoising method for Lena.

Figure 10

Results of ROF, wiener filter and our denoising method for Barbara.

Table 1

TV for 6 noisy and denoised images with noise variance 0.005

Noise variance (0.005)

TV (original mage)

TV (noisy image)

TV (ROF model)

TV (Wiener filter)

TV (our method)





































Table 2

TV for 6 noisy and denoised images with noise variance 0.1

Noise variance (0.1)

TV (original image)

TV(noisy image)

TV (ROF model)

TV (Wiener filter)

TV (our method)





































Figure 11

Decreasing behavior of f ( u 0 ) during the denoising process.

Figure 12

Results of our method (up) and BM3D technique (down) with SNR = 25 for Boat.

Figure 13

Results of our method (up) and BM3D technique (down) with SNR = 75 for Boat.

Figure 14

Results of our method (up) and BM3D technique (down) with SNR = 25 for House.

Figure 15

Results of our method (up) and BM3D technique (down) with SNR = 75 for House.

Figure 16

Results of our method (up) and BM3D technique (down) with SNR = 25 for Cameraman.

Figure 17

Results of our method (up) and BM3D technique (down) with SNR = 75 for Cameraman.

$$ J={\displaystyle \iint }{\left(u-{u}_0\right)}^2+\lambda {\displaystyle \iint } Detector\left(F(u)\right) Wiegth\left(F(u)\right) $$
Such that:
$$ \left| Detector(F)\right|\le 1\kern0.75em and\kern1em \left| Wiegth(F)\right|\le 1 $$
and λ is a control parameter determined experimentally. Minimizing the energy functional results the final relation for implementation.
$$ \frac{\partial J}{\partial u}={\displaystyle \iint }2\left(u-u0\right)+{\displaystyle \iint}\lambda \kern0.5em \frac{\partial (F)}{\partial (u)}\kern0.5em \left[\frac{\partial (Detector)}{\partial (F)} Wiegth(F)+\frac{\partial (Wiegth)}{\partial (F)} Detector(F)\right]=0 $$
As an example, for deblurring, Detector(F) and Wiegth(F) can be suggested as:
$$ Detector(F)=H\left({g}_x\ {g}_{x+\Delta x}\right)H\left({g}_y\ {g}_{y+\Delta y}\right) $$
$$ Wiegth(F)={e}^{-{\left({g}_x-{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y-{g}_{y+\Delta y}\right)}^2} $$
where the blurring locations identified when the sign of change in intensity of two adjacent pixels is equal (g x  g x + Δx  > 0 , g y  g y + Δy  > 0), and weighted by difference in their gradient components for x and y directions. Computing \( \frac{\partial J}{\partial u}=0 \) the final relation is:
$$ u={u}_0+\lambda \left({u}_{0 xxxx}+{u}_{0 yyyy}\right)H\left({g}_x\ {g}_{x+\Delta x}\right)H\left({g}_y\ {g}_{y+\Delta y}\right){e}^{-{\left({g}_x-{g}_{x+\Delta x}\right)}^2}{e}^{-{\left({g}_y-{g}_{y+\Delta y}\right)}^2} $$

This relation shows that in the blurred locations, identified by the blurring detector, u is restored by the forth order of differentiation in the blurred areas.


We presented a noise removal method using a local switching noise estimator in an energy functional minimizing process. We showed that in addition to using Laplacian in edge detection tasks, it can be used for noise removal applications. Smoothness can be easily controlled just by the number of iterations. We compared the method with some classic methods like ROF and Wiener filters based on TV value and also with the state-of-the-art BM3D. The result of denoising is totally comparable with ROF model. The computation time is equal to ROF model with 10 iterations. Based on experimental results we concluded that in relation to classic filters like ROF the method appears to be easy, fast and applicable for many noisy images. We analyzed that the technique can be applied for other image processing applications like deblurring by defining the appropriate detector and weight functions. The main disadvantage of the method is its filtering action on the area of the image including low intensity edges. The method can be improved to represent better response by defining better noise detectors.


Authors’ Affiliations

School of Electrical and Electronic Engineering, Universiti Sains Malaysia, Engineering Campus


  1. Acharya T, Tsai PS (2001) Edge-Detection Based Noise Removal Algorithm, US Patent 6,229,578Google Scholar
  2. Buades A, Coll B, Morel JM (2005) A review of image denoising algorithms, with a new one. Multiscale Model Simul 4(2):490–530View ArticleGoogle Scholar
  3. Candès EJ, Romberg J, Tao T (2006) Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information, Information Theory. IEEE Trans Image Process 52:489–509Google Scholar
  4. Chan TF, Esedo Lu S (2005) Aspects of total variation regularized L1 function approximation. SIAM J Appl Math 65(5):1817–1837View ArticleGoogle Scholar
  5. Chen Q, Wu D (2010) Image denoising by bounded block matching and 3D filtering. Signal Process 90(9):2778–2783View ArticleGoogle Scholar
  6. Dabov K, Foi A, Katkovnik V, & Egiazarian K (2006). Image denoising with block-matching and 3D filtering. In Electronic Imaging 2006. International Society for Optics and Photonics.Google Scholar
  7. Dabov K, Foi A, Katkovnik V, Egiazarian K (2007) Image denoising by sparse 3-D transform-domain collaborative filtering. IEEE Trans Image Process 16(8):2080–2095View ArticleGoogle Scholar
  8. Dabov K, Foi A, Katkovnik V, Egiazarian K (2008) A Nonlocal and Shape-Adaptive Transform-Domain Collaborative Filtering. In: Proc. Int. Workshop on Local and Non-Local Approx. in Image Process., LNLAGoogle Scholar
  9. Dabov K, Foi A, Katkovnik V, Egiazarian K (2009) BM3D Image Denoising With Shape-Adaptive Principal Component Analysis. In: SPARS’09-Signal Processing with Adaptive Sparse Structured RepresentationsGoogle Scholar
  10. Goldstein T, Osher S (2008) “The split Bregman Method for L1 Regularized Problems,” UCLA CAM Report, vol. 2., p 4Google Scholar
  11. He K, Sun J, Tang X (2010) “Guided Image Filtering,” The 11th European Conference on Computer Vision, Part I., pp 1–14Google Scholar
  12. Kervrann C, Bourlanger J, Bourlanger J (2006) Optimal spatial adaptation for patchbased image denoising. IEEE Trans Image Process 15:10View ArticleGoogle Scholar
  13. Li Y, Santosa F, Center CT (1994) “An Affine Scaling Algorithm For Minimizing Total Variation In Image Enhancement” Vol. 201:CiteseerGoogle Scholar
  14. Petschnigg G, Agrawala M, Hoppe H, Szeliski R, Cohen M, Toyama MK (2004) Digital photography with flash and no-flash image pairs. ACM Trans Graph 23:664–672View ArticleGoogle Scholar
  15. Ranjbaran A, Hassan AHA, Kheng ES, Ranjbaran B (2013) An edge detection based noise removal algorithm. Espec Issue Image Video Process 40:769–784Google Scholar
  16. Rudin LI, Osher S, Fatemi E (1992) “Nonlinear Total Variation Based Noise Removal Algorithms,” Physica D: Nonlinear Phenomena, vol. 60., pp 259–268Google Scholar
  17. Takeda H, Farsiu S, Milanfar P (2007) Kernel regression for image processing and reconstruction, IEEE Trans Image Process 16(2):349–366View ArticleGoogle Scholar


© Ranjbaran et al.; licensee Springer. 2015

This is an Open Access article distributed under the terms of the Creative Commons Attribution License (, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.